Compare commits
314 Commits
feat/descr
...
master
Author | SHA1 | Date | |
---|---|---|---|
a8b9db109e | |||
|
d643a4f495 | ||
|
ecf46d7ffc | ||
|
bdd3ed09e0 | ||
|
8eb94b1ed8 | ||
b198e9b1fe | |||
7bde75ea15 | |||
765f485556 | |||
320e17ea93 | |||
490cc9ae4a | |||
9e6a87881d | |||
|
c1c0b865dc | ||
|
e8e36098e4 | ||
e5f69c915c | |||
42d8f26af5 | |||
c5fd96fbf0 | |||
b5a74de4d9 | |||
|
21e43c2d35 | ||
|
53ab45c536 | ||
|
17767ac3c0 | ||
|
f47c8533a9 | ||
|
70ffe63766 | ||
|
a30e8c646f | ||
|
46f35cb918 | ||
|
afd7ae13c9 | ||
7f64ffe221 | |||
657af1c40d | |||
c9174fd9b7 | |||
28822b45d8 | |||
012aaacb66 | |||
ec3938a2cf | |||
e44fa64760 | |||
91ba49d94c | |||
bfc2dd7930 | |||
2a7ea08e02 | |||
90b18d2624 | |||
|
ba96f96f58 | ||
5e370b0af3 | |||
ce6a719bc2 | |||
|
a501656907 | ||
ed4918c6a2 | |||
|
121ebb5007 | ||
27958367ff | |||
|
79a2b74a16 | ||
12e5046f53 | |||
782a0f021d | |||
03433e3108 | |||
|
08ea724555 | ||
dc98cd8ad4 | |||
d7a29f51b7 | |||
5f15108949 | |||
|
b75aaaf22e | ||
89ca980f9e | |||
|
5c5115471d | ||
066428c8b6 | |||
|
b0a2dc1bd2 | ||
1ff779c1de | |||
|
5a2c358fe8 | ||
074766b7fa | |||
|
bb5db6d967 | ||
fcf7f08fe4 | |||
3af900f998 | |||
|
2798253fb9 | ||
e56a19e4fa | |||
357a4c677a | |||
a129d39168 | |||
|
e5b176c148 | ||
15536f32c8 | |||
|
05064d9473 | ||
4fb101b7e3 | |||
|
17fa6f6990 | ||
98439dc5e8 | |||
|
006dc0ceeb | ||
c4489fb0a8 | |||
|
a2afc51ad8 | ||
3d8959891e | |||
|
5e483436b0 | ||
f5ff6e760f | |||
|
079df27f4b | ||
|
fe789b5479 | ||
|
08a14b3ae0 | ||
|
8acf8242ea | ||
|
92bcaace2b | ||
|
b104d383e8 | ||
|
5bab7caa8c | ||
085b790121 | |||
|
28ba34894d | ||
da8a0be612 | |||
|
aa1930e1b7 | ||
638ccf5d8d | |||
|
e1d7ab2621 | ||
5a1e41a7a3 | |||
|
b64abd7164 | ||
d0607af936 | |||
|
efb5acaf0a | ||
8d45ba6481 | |||
|
2ada801a32 | ||
|
c3573d9efb | ||
46e6d0b4d0 | |||
|
8e6b1fc8f2 | ||
54a680c0ff | |||
|
6a75d0412a | ||
0718d8c4d1 | |||
|
ed22f8bcf9 | ||
6f4797694f | |||
|
375d5983f4 | ||
c65756bbb2 | |||
3666fc4ed1 | |||
|
05f99f7359 | ||
3bd50deeb3 | |||
|
60ef9e88ee | ||
b930efa40d | |||
|
0cfdaa4851 | ||
f9c5dccb73 | |||
f778ec1b72 | |||
dd6ff1d2be | |||
23706fabf9 | |||
|
e8ddd60daa | ||
da3c1714c5 | |||
2e753a7259 | |||
|
e90dcce641 | ||
d02a2b2015 | |||
e3e3c05ae0 | |||
|
d95fe37e43 | ||
570f183382 | |||
|
1f6c7ccb18 | ||
b2dbace653 | |||
|
3b9d13d9b9 | ||
8215fa5e4f | |||
|
f09b77e689 | ||
a65d6e062d | |||
fe321d1c3b | |||
b3a18efa8f | |||
8dc81e1743 | |||
|
6b7dc33bce | ||
5fe34f8b87 | |||
f766136844 | |||
2310cac125 | |||
|
eb72f16e3a | ||
|
1f6d3cd5d7 | ||
37c34eb785 | |||
|
511471e5c5 | ||
d80cab2407 | |||
59f0924c66 | |||
0f0644495a | |||
457fa88dcc | |||
3083ef7865 | |||
5f806dadba | |||
|
72db5f1273 | ||
|
64d38943f7 | ||
066cd46614 | |||
b4d001475a | |||
defd87dfc7 | |||
|
6eb14f8eef | ||
f9fd6389c4 | |||
|
9f49dfe9b4 | ||
|
93bc21a29a | ||
|
faf0a5682e | ||
5f2873c152 | |||
3f92df816c | |||
|
0144f5cc33 | ||
|
a4ff47ea1a | ||
|
68e7ac2642 | ||
|
8486837339 | ||
|
9ed531d9da | ||
|
ac9e098c0c | ||
|
15a46122e8 | ||
1e1ac401e5 | |||
a47aa0c431 | |||
9d4eab8c9e | |||
207e734e73 | |||
|
7f0fe45ca9 | ||
|
efc2fdad9b | ||
aea6e2ec4c | |||
|
57af643093 | ||
|
7b09934be8 | ||
|
38fb02e322 | ||
c9abef2676 | |||
|
b6b61b6c54 | ||
|
1f3286e67d | ||
|
b915d80dea | ||
67e59fffe8 | |||
|
1f16e68272 | ||
|
786f1b280a | ||
da80151c37 | |||
681a2009b3 | |||
|
a087d53d3f | ||
|
ee93e674b0 | ||
|
65dfa30de1 | ||
|
2ed69cc1f2 | ||
|
94ca0181ec | ||
|
aa36147bf5 | ||
26ba0f7922 | |||
|
8d1d7bfa1c | ||
|
b14cb22285 | ||
|
91315d4a9f | ||
|
8b5bbea837 | ||
|
c4fe25f89b | ||
|
641ae6e7e1 | ||
|
8b99b57dfa | ||
|
9c96671e4e | ||
|
b2e5941eb9 | ||
|
868ede50eb | ||
|
efee26019a | ||
|
63ba67b779 | ||
|
240fd2730f | ||
|
e4a73f5ec1 | ||
|
f6c2290738 | ||
|
ecd528c71a | ||
|
fc681c510c | ||
|
90b1d8df18 | ||
|
89fbf3e416 | ||
|
718d348d91 | ||
|
feb2ef7db1 | ||
|
93f0670ded | ||
|
e25180d3ee | ||
|
a3aefaf499 | ||
|
f2cc70c785 | ||
|
5ff6f9a8f0 | ||
|
c2516e7141 | ||
|
e722bb90a8 | ||
03d7b8dcbf | |||
c1c90fc76f | |||
|
334f3a30e5 | ||
|
60f913c5a5 | ||
|
4230353aea | ||
baab5ce1a0 | |||
ed78f749e8 | |||
6465abf12a | |||
388d52eaf7 | |||
a762756bfc | |||
431b43b8f1 | |||
8866db8058 | |||
d6fab922a9 | |||
|
8df51b18e9 | ||
|
28771b0bd2 | ||
|
8366383350 | ||
|
794d9cb805 | ||
|
911ae99e27 | ||
|
37794c50f3 | ||
ddc9ea1cb5 | |||
8b2902f7fa | |||
39a11cbed3 | |||
0ea53caade | |||
c47d4ff80b | |||
35497d39ad | |||
b433d5f182 | |||
c4088792e8 | |||
|
8eb6ad5fd7 | ||
18d44be102 | |||
|
619cbffa1c | ||
4bbfce77c0 | |||
ea867cd1ac | |||
|
e59b290559 | ||
|
0a7a210322 | ||
|
95bd78f3b1 | ||
|
0d2a8a232d | ||
|
6f65746373 | ||
843df14b69 | |||
|
d370fed819 | ||
|
b2df3e3a7c | ||
|
caf7869f15 | ||
f9ce7156b4 | |||
51b793019d | |||
c0ede44b4d | |||
|
eddd4c7afb | ||
|
d36518078d | ||
|
4fb21f0236 | ||
|
72ba7bcc83 | ||
|
7aa51db9b2 | ||
7a264f4e47 | |||
8daa0a5fbe | |||
42513c21cf | |||
bc5a281a50 | |||
|
679ff254bf | ||
|
204b050233 | ||
|
b42be0d8b1 | ||
88a1fb0715 | |||
a0ba07963d | |||
|
f5af44bcb7 | ||
|
ea77da711f | ||
|
b5faa55ada | ||
|
59ce1a5218 | ||
57f54b7164 | |||
|
572876c585 | ||
|
4436f47cd7 | ||
|
ab5f5f5791 | ||
|
762f480f81 | ||
|
8c9346e627 | ||
|
59913abe7b | ||
|
c8e4057ed6 | ||
|
838e8bfa39 | ||
|
b67b89a4ce | ||
|
c3041a7d9e | ||
|
d064da49a4 | ||
|
35b99a3270 | ||
|
690fcd9e20 | ||
|
c5e262a384 | ||
|
1633eb9c99 | ||
|
cd4bf82223 | ||
|
ea98dde102 | ||
|
e590ab308c | ||
|
cab10522c8 | ||
d78b44f12f | |||
|
00a503e983 | ||
|
9366c8f33a | ||
|
390dd6ca88 | ||
|
2c58e8f76f | ||
|
5a97990cc8 | ||
|
a4b96011bb | ||
|
ee9abf3ead | ||
|
c4a14f3ca4 | ||
|
34af6f9c5e | ||
|
d8dab224ca |
@ -6,13 +6,17 @@
|
|||||||
max-width: none;
|
max-width: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#root .dumi-default-header-content {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
#root .dumi-default-header {
|
#root .dumi-default-header {
|
||||||
box-shadow: 2px 1px 16px #dfdfdf;
|
box-shadow: 2px 1px 16px #dfdfdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
#root .dumi-default-sidebar {
|
#root .dumi-default-sidebar {
|
||||||
width: 188px;
|
width: 188px;
|
||||||
overflow-y: hidden;
|
overflow-y: scroll;
|
||||||
/* stylelint-disable-next-line rule-empty-line-before */
|
/* stylelint-disable-next-line rule-empty-line-before */
|
||||||
&:hover {
|
&:hover {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: none; display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
|
||||||
<defs>
|
|
||||||
<path id="path" d="M50 15A15 35 0 0 1 50 85A15 35 0 0 1 50 15" fill="none"></path>
|
|
||||||
<path id="patha" d="M0 0A15 35 0 0 1 0 70A15 35 0 0 1 0 0" fill="none"></path>
|
|
||||||
</defs><g transform="rotate(0 50 50)">
|
|
||||||
<use xlink:href="#path" stroke="#dfdfdf" stroke-width="3"></use>
|
|
||||||
</g><g transform="rotate(60 50 50)">
|
|
||||||
<use xlink:href="#path" stroke="#dfdfdf" stroke-width="3"></use>
|
|
||||||
</g><g transform="rotate(120 50 50)">
|
|
||||||
<use xlink:href="#path" stroke="#dfdfdf" stroke-width="3"></use>
|
|
||||||
</g><g transform="rotate(0 50 50)">
|
|
||||||
<circle cx="50" cy="15" r="9" fill="#e15b64">
|
|
||||||
<animateMotion dur="1s" repeatCount="indefinite" begin="0s">
|
|
||||||
<mpath xlink:href="#patha"></mpath>
|
|
||||||
</animateMotion>
|
|
||||||
</circle>
|
|
||||||
</g><g transform="rotate(60 50 50)">
|
|
||||||
<circle cx="50" cy="15" r="9" fill="#f8b26a">
|
|
||||||
<animateMotion dur="1s" repeatCount="indefinite" begin="-0.16666666666666666s">
|
|
||||||
<mpath xlink:href="#patha"></mpath>
|
|
||||||
</animateMotion>
|
|
||||||
</circle>
|
|
||||||
</g><g transform="rotate(120 50 50)">
|
|
||||||
<circle cx="50" cy="15" r="9" fill="#abbd81">
|
|
||||||
<animateMotion dur="1s" repeatCount="indefinite" begin="-0.3333333333333333s">
|
|
||||||
<mpath xlink:href="#patha"></mpath>
|
|
||||||
</animateMotion>
|
|
||||||
</circle>
|
|
||||||
</g></svg>
|
|
Before Width: | Height: | Size: 1.4 KiB |
@ -1,11 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import loading from './loading.svg'
|
|
||||||
|
|
||||||
export default () => {
|
|
||||||
return (
|
|
||||||
<div style={{ textAlign: 'center' }}>
|
|
||||||
<image src={loading} />
|
|
||||||
<p>客官,您慢点儿...</p>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
32
.dumirc.ts
32
.dumirc.ts
@ -1,8 +1,6 @@
|
|||||||
import { defineConfig } from 'dumi';
|
import { defineConfig } from 'dumi';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
console.log(path.join(__dirname, 'packages/hooks/src'));
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
logo: '/logo.jpg',
|
logo: '/logo.jpg',
|
||||||
favicons: ['/logo.jpg'],
|
favicons: ['/logo.jpg'],
|
||||||
@ -18,31 +16,31 @@ export default defineConfig({
|
|||||||
'@zhst/biz': path.join(__dirname, 'packages/biz/src'),
|
'@zhst/biz': path.join(__dirname, 'packages/biz/src'),
|
||||||
'@zhst/meta': path.join(__dirname, 'packages/meta/src'),
|
'@zhst/meta': path.join(__dirname, 'packages/meta/src'),
|
||||||
'@zhst/request': path.join(__dirname, 'packages/request/src'),
|
'@zhst/request': path.join(__dirname, 'packages/request/src'),
|
||||||
|
'@zhst/slave': path.join(__dirname, 'packages/slave/src'),
|
||||||
|
'@zhst/material': path.join(__dirname, 'packages/material/src'),
|
||||||
|
'@zhst/icon': path.join(__dirname, 'packages/icon/src'),
|
||||||
|
'@zhst/icon-v2': path.join(__dirname, 'packages/icon-v2/src'),
|
||||||
|
'@zhst/map': path.join(__dirname, 'packages/map/src'),
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
docDirs: ['docs'],
|
docDirs: ['docs'],
|
||||||
atomDirs: [
|
atomDirs: [
|
||||||
{ type: 'hooks', dir: 'packages/hooks/src' },
|
{ type: 'hooks', dir: 'packages/hooks/src' },
|
||||||
{ type: 'utils', dir: 'packages/func/src' },
|
{ type: 'utils', dir: 'packages/func/src' },
|
||||||
{ type: 'biz', dir: 'packages/biz/src' },
|
{ type: 'module', subType: 'biz', dir: 'packages/biz/src' },
|
||||||
{ type: 'meta', dir: 'packages/meta/src' },
|
{ type: 'module', subType: 'meta', dir: 'packages/meta/src' },
|
||||||
{ type: 'request', dir: 'packages/request/src' },
|
{ type: 'other', subType: 'request', dir: 'packages/request/src' },
|
||||||
{ type: 'constants', dir: 'packages/constants/src' },
|
{ type: 'other', subType: 'constants', dir: 'packages/constants/src' },
|
||||||
{ type: 'types', dir: 'packages/types/src' },
|
{ type: 'other', subType: 'types', dir: 'packages/types/src' },
|
||||||
|
{ type: 'slave', dir: 'packages/slave/src' },
|
||||||
|
{ type: 'material', dir: 'packages/material/src' },
|
||||||
|
{ type: 'icon', dir: 'packages/icon/src' },
|
||||||
|
{ type: 'icon-v2', dir: 'packages/icon-v2/src' },
|
||||||
|
{ type: 'map', dir: 'packages/map/src' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
monorepoRedirect: {
|
monorepoRedirect: {
|
||||||
srcDir: ['packages', 'src'],
|
srcDir: ['packages', 'src'],
|
||||||
peerDeps: true,
|
peerDeps: true,
|
||||||
},
|
},
|
||||||
extraBabelPlugins: [
|
|
||||||
[
|
|
||||||
'import',
|
|
||||||
{
|
|
||||||
libraryName: 'antd',
|
|
||||||
libraryDirectory: 'es',
|
|
||||||
style: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
20
.fatherrc.ts
20
.fatherrc.ts
@ -1,15 +1,15 @@
|
|||||||
import { defineConfig } from 'father';
|
import { defineConfig } from 'father-plugin-less';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
|
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
|
||||||
extraBabelPlugins: [
|
esm: {
|
||||||
[
|
output: 'es',
|
||||||
'import',
|
ignores: ['**/demo/*', 'src/**/demo/*'],
|
||||||
{
|
transformer: 'babel',
|
||||||
libraryName: 'antd',
|
},
|
||||||
libraryDirectory: 'es',
|
cjs: {
|
||||||
style: true,
|
output: 'lib',
|
||||||
|
ignores: ['**/demo/*', 'src/**/demo/*'],
|
||||||
|
transformer: 'babel',
|
||||||
},
|
},
|
||||||
],
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@ -9,5 +9,10 @@ vueuse
|
|||||||
/temp
|
/temp
|
||||||
packages/**/es
|
packages/**/es
|
||||||
packages/**/lib
|
packages/**/lib
|
||||||
|
**/es
|
||||||
|
**/lib
|
||||||
|
**/**/es
|
||||||
|
**/**/lib
|
||||||
/es
|
/es
|
||||||
/lib
|
/lib
|
||||||
|
pnpm-lock.yaml
|
||||||
|
@ -1,12 +1,36 @@
|
|||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
|
- package
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
cache:
|
||||||
|
policy: pull
|
||||||
|
key: '$CI_COMMIT_REF_NAME'
|
||||||
|
paths:
|
||||||
|
- node_modules/
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
image: registry.zhst.com/video-analysis/pnpm4-lambo
|
||||||
tags:
|
tags:
|
||||||
- linux
|
- linux_docker_web_204
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
- cd /home
|
- chmod +x ./deploy/build.sh && ./deploy/build.sh
|
||||||
- ls
|
artifacts:
|
||||||
- git
|
name: '${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME}_${CI_PIPELINE_ID}'
|
||||||
- node
|
paths:
|
||||||
|
- ./app/public/*
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
package:
|
||||||
|
tags:
|
||||||
|
- linux_shell
|
||||||
|
stage: package
|
||||||
|
script:
|
||||||
|
- chmod +x ./deploy/package.sh && ./deploy/package.sh
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
|
||||||
|
4
.npmrc
4
.npmrc
@ -1,4 +1,6 @@
|
|||||||
|
//10.0.0.77:4874/:always-auth=true
|
||||||
|
//10.0.0.77:4874/:_authToken=VbcnvB0eKGAqsT5ZNbfKiw==
|
||||||
registry="https://registry.npmmirror.com"
|
registry="https://registry.npmmirror.com"
|
||||||
@zhst:registry="http://10.0.0.77:4874"
|
@zhst:registry="http://10.0.0.77:4874/"
|
||||||
strict-peer-dependencies=false
|
strict-peer-dependencies=false
|
||||||
ignore-workspace-root-check=true
|
ignore-workspace-root-check=true
|
||||||
|
10
.vscode/launch.json
vendored
Normal file
10
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"type": "chrome",
|
||||||
|
"name": "lambo",
|
||||||
|
"request": "launch",
|
||||||
|
"url": "http://localhost:8000/metas"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -10,6 +10,9 @@
|
|||||||
"flvjs",
|
"flvjs",
|
||||||
"indicatorsize",
|
"indicatorsize",
|
||||||
"lambo",
|
"lambo",
|
||||||
|
"mapbox",
|
||||||
|
"maxzoom",
|
||||||
|
"minzoom",
|
||||||
"remuxer",
|
"remuxer",
|
||||||
"stylelint",
|
"stylelint",
|
||||||
"transmuxer",
|
"transmuxer",
|
||||||
|
5
Dockerfile
Normal file
5
Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM registry.zhst.com/video-analysis/alpine:latest
|
||||||
|
|
||||||
|
ADD ./app/public/ /app/public/
|
||||||
|
|
||||||
|
CMD [ "sh", "-c", "while true; do echo zhst-web; sleep 1; done" ]
|
22
deploy/build.sh
Executable file
22
deploy/build.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
pnpm --version
|
||||||
|
pnpm -v
|
||||||
|
node -v
|
||||||
|
pnpm install --force
|
||||||
|
|
||||||
|
pnpm run pkg:build
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
pnpm run pub
|
||||||
|
|
||||||
|
# 打tag失败
|
||||||
|
|
||||||
|
pnpm run build:master
|
||||||
|
|
||||||
|
mkdir -p ./app/public/
|
||||||
|
|
||||||
|
mv ./dist/* ./app/public/
|
||||||
|
|
||||||
|
cat ./app/public/index.html | head -n 7
|
10
deploy/package.sh
Normal file
10
deploy/package.sh
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||||
|
docker login registry.zhst.com -u zhst -p Zhst666\&
|
||||||
|
|
||||||
|
# docker build -t registry.zhst.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME//\//-}-${CI_PIPELINE_ID} -f Dockerfile .
|
||||||
|
# docker push registry.zhst.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME//\//-}-${CI_PIPELINE_ID}
|
||||||
|
docker buildx build --platform linux/arm64,linux/amd64 -t registry.zhst.com/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}:${CI_COMMIT_REF_NAME//\//-}-${CI_PIPELINE_ID} -f Dockerfile . --push
|
||||||
|
|
@ -1,40 +1,81 @@
|
|||||||
---
|
---
|
||||||
hero:
|
hero:
|
||||||
title: lambo
|
title: lambo
|
||||||
description: 致力于提升前端开发效率与规范
|
description: 致力于提升前端开发效率与规范(开发前请先阅读开发流程)
|
||||||
actions:
|
actions:
|
||||||
- text: 快速上手
|
- text: 快速上手
|
||||||
link: /bizs
|
link: /bizs
|
||||||
features:
|
# features:
|
||||||
- title: biz
|
# - title: biz
|
||||||
emoji: 🍑
|
# emoji: 🍑
|
||||||
description: 业务库
|
# description: 业务库
|
||||||
- title: hooks
|
# - title: hooks
|
||||||
emoji: 💎
|
# emoji: 💎
|
||||||
description: hooks
|
# description: hooks
|
||||||
- title: func
|
# - title: func
|
||||||
emoji: 🌈
|
# emoji: 🌈
|
||||||
description: 常用函数库
|
# description: 常用函数库
|
||||||
- title: meta
|
# - title: meta
|
||||||
emoji: ☀️
|
# emoji: ☀️
|
||||||
description: 原子组件库
|
# description: 原子组件库
|
||||||
- title: constants
|
# - title: constants
|
||||||
emoji: 🈶️
|
# emoji: 🈶️
|
||||||
description: 静态定义库
|
# description: 静态定义库
|
||||||
- title: request
|
# - title: request
|
||||||
emoji: 🥣
|
# emoji: 🥣
|
||||||
description: 网络请求库
|
# description: 网络请求库
|
||||||
- title: types
|
# - title: types
|
||||||
emoji: 🈸
|
# emoji: 🈸
|
||||||
description: typescript 声明库
|
# description: typescript 声明库
|
||||||
- title: material
|
# - title: material
|
||||||
emoji: 🥱
|
# emoji: 🥱
|
||||||
description: 物料库
|
# description: 物料库
|
||||||
- title: cli
|
# - title: cli
|
||||||
emoji: 🐔
|
# emoji: 🐔
|
||||||
description: 脚手架
|
# description: 脚手架
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 开发流程
|
||||||
|
|
||||||
|
### 1. 确定需求
|
||||||
|
|
||||||
|
从 gitlab 上的 [issue](http://10.0.0.88/web-project/zhst-lambo/boards) 模块找到对应的需求。将 Assignee 负责人指派为自己(如果多人协同开发可以将需求拆分为多个需求,分别指派),然后将 Labels 标签改为 doing 状态。(截止日期选填)
|
||||||
|
|
||||||
|
> issuse 命名规则:@zhst/{包名} - {模块名},然后在详情页描述对应需求。
|
||||||
|
|
||||||
|
### 2. 创建 git 分支
|
||||||
|
|
||||||
|
按照 git flow 规范从 [master](http://10.0.0.88/web-project/zhst-lambo) 上创建分支, 分支的命名规则参考:
|
||||||
|
|
||||||
|
1. feat/XXX: 需求新增
|
||||||
|
2. hotfix/XXX: bug 修复
|
||||||
|
|
||||||
|
### 3. 开始开发
|
||||||
|
|
||||||
|
进入项目文件夹,在 packages 下找到对应的 npm 包, 然后在 src 目录下按已有的格式进行开发,如果是功能变更就找到对应的页面进行修改
|
||||||
|
|
||||||
|
### 4. 提交代码,并提交 mr 到 develop 分支
|
||||||
|
|
||||||
|
完成开发后,给代码提交 commit,格式参考 ${行为}(${影响范围}): ${变更内容}, 例如:
|
||||||
|
|
||||||
|
> feat(package.json): 修改版本号
|
||||||
|
> fix(app.ts): 修改环境变量
|
||||||
|
|
||||||
|
对应的变更会在最终的 npm 包版本号体现:a.b.c - a 对应重构(一般用不上) - b 对应 feat(功能新增) - c 对应 hotfix(一般是 bug 修复)
|
||||||
|
|
||||||
|
push 完代码之后,在 gitlab 上提交一个 mr 到 develop 分支,指定给对应的人员审核(@江志雄),合并成功之后,将 [issue](http://10.0.0.88/web-project/zhst-lambo/boards) 对应的 Labels 状态改为 waittingPublish。
|
||||||
|
|
||||||
|
### 5. 发布成功
|
||||||
|
|
||||||
|
发布成功之后,会有两个行为:
|
||||||
|
|
||||||
|
1. 在钉钉群通知发布成功。
|
||||||
|
2. 生成线上预览[说明文档](http://10.0.0.204:30080)
|
||||||
|
|
||||||
|
一旦触发了钉钉通知,则需要去到 [issue](http://10.0.0.88/web-project/zhst-lambo/boards) 板块将对应的需求 **close** 掉。
|
||||||
|
|
||||||
|
这就是 npm 包整个开发链路。
|
||||||
|
|
||||||
## 目录结构
|
## 目录结构
|
||||||
|
|
||||||
<Tree>
|
<Tree>
|
||||||
|
4
global.d.ts
vendored
4
global.d.ts
vendored
@ -0,0 +1,4 @@
|
|||||||
|
declare module '*.less';
|
||||||
|
declare module '*.png';
|
||||||
|
declare module '*.jpg';
|
||||||
|
declare module '*.jpeg';
|
15
package.json
15
package.json
@ -14,7 +14,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"add": "pnpm changeset add",
|
"add": "pnpm changeset add",
|
||||||
"build": "pnpm --filter=@zhst/* run build",
|
"build:master": "dumi build",
|
||||||
"build:watch": "father dev",
|
"build:watch": "father dev",
|
||||||
"dev": "dumi dev",
|
"dev": "dumi dev",
|
||||||
"docs:build": "dumi build",
|
"docs:build": "dumi build",
|
||||||
@ -22,6 +22,7 @@
|
|||||||
"lint": "npm run lint:es && npm run lint:css",
|
"lint": "npm run lint:es && npm run lint:css",
|
||||||
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
||||||
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
||||||
|
"pkg:build": "pnpm --filter=@zhst/* run build",
|
||||||
"prepare": "husky install && dumi setup",
|
"prepare": "husky install && dumi setup",
|
||||||
"prepublishOnly": "father doctor && npm run build",
|
"prepublishOnly": "father doctor && npm run build",
|
||||||
"pub": "pnpm changeset publish",
|
"pub": "pnpm changeset publish",
|
||||||
@ -50,7 +51,6 @@
|
|||||||
"prettier --parser=typescript --write"
|
"prettier --parser=typescript --write"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@changesets/cli": "^2.27.1",
|
"@changesets/cli": "^2.27.1",
|
||||||
"@commitlint/cli": "^17.1.2",
|
"@commitlint/cli": "^17.1.2",
|
||||||
@ -58,10 +58,10 @@
|
|||||||
"@types/react": "^18.0.0",
|
"@types/react": "^18.0.0",
|
||||||
"@types/react-dom": "^18.0.0",
|
"@types/react-dom": "^18.0.0",
|
||||||
"@umijs/lint": "^4.0.0",
|
"@umijs/lint": "^4.0.0",
|
||||||
"babel-plugin-import": "^1.13.8",
|
|
||||||
"dumi": "^2.2.13",
|
"dumi": "^2.2.13",
|
||||||
"eslint": "^8.23.0",
|
"eslint": "^8.23.0",
|
||||||
"father": "^4.1.0",
|
"father": "^4.1.0",
|
||||||
|
"father-plugin-less": "^0.0.2",
|
||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"lerna": "^8.0.0",
|
"lerna": "^8.0.0",
|
||||||
"lint-staged": "^13.0.3",
|
"lint-staged": "^13.0.3",
|
||||||
@ -83,5 +83,12 @@
|
|||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
"dev<710328466@qq.com>"
|
"dev<710328466@qq.com>"
|
||||||
]
|
],
|
||||||
|
"dependencies": {
|
||||||
|
"@ant-design/happy-work-theme": "^1.0.0",
|
||||||
|
"@zhst/meta": "workspace:^",
|
||||||
|
"rc-rate": "~2.12.0",
|
||||||
|
"react-fast-marquee": "^1.6.4",
|
||||||
|
"react-infinite-scroll-component": "^6.1.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
import { defineConfig } from 'father';
|
import { defineConfig } from 'father-plugin-less';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
|
// more father config: https://github.com/umijs/father/blob/master/docs/config.md
|
||||||
esm: {
|
esm: {
|
||||||
output: 'es',
|
output: 'es',
|
||||||
ignores: ['**/demo/*', 'src/**/demo/*']
|
ignores: ['**/demo/*', 'src/**/demo/*'],
|
||||||
|
transformer: 'babel',
|
||||||
},
|
},
|
||||||
cjs: {
|
cjs: {
|
||||||
output: 'lib',
|
output: 'lib',
|
||||||
ignores: ['**/demo/*', 'src/**/demo/*']
|
ignores: ['**/demo/*', 'src/**/demo/*'],
|
||||||
|
transformer: 'babel',
|
||||||
},
|
},
|
||||||
|
lessInBabel: {
|
||||||
|
modifyVars: {
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: ['father-plugin-less'],
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,609 @@
|
|||||||
# @zhst/biz
|
# @zhst/biz
|
||||||
|
|
||||||
|
## 0.34.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- feat(material,biz,meta): 修改算法配置物料,树组件业务传参,修复大图组件 od 变化不重新渲染
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.30.0
|
||||||
|
|
||||||
|
## 0.33.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 修改穿梭框不能修改宽度
|
||||||
|
|
||||||
|
## 0.33.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 修改穿梭框不能修改宽度 bug
|
||||||
|
|
||||||
|
## 0.33.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- feat(biz): 修改穿梭框的样式和注释
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.29.0
|
||||||
|
|
||||||
|
## 0.32.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.28.0
|
||||||
|
|
||||||
|
## 0.32.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/icon@0.8.0
|
||||||
|
- @zhst/meta@0.27.1
|
||||||
|
|
||||||
|
## 0.32.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/biz 废弃 tree 组件
|
||||||
|
|
||||||
|
## 0.31.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 修改 less to css 配置
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.17.0
|
||||||
|
- @zhst/hooks@0.15.0
|
||||||
|
- @zhst/icon@0.7.0
|
||||||
|
- @zhst/meta@0.27.0
|
||||||
|
|
||||||
|
## 0.30.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 新增 zhst/biz 的大图组件 v2,修改其它包打包样式文件为 css
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.14.0
|
||||||
|
- @zhst/icon@0.6.0
|
||||||
|
- @zhst/meta@0.26.0
|
||||||
|
|
||||||
|
## 0.29.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/biz: 添加 treePanel 的一些例子,修复一些 ts 报错
|
||||||
|
|
||||||
|
## 0.28.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/biz: 新增树面板
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.25.0
|
||||||
|
|
||||||
|
## 0.27.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/meta 全量迁移 antd-5.17.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.24.0
|
||||||
|
|
||||||
|
## 0.26.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 穿梭框完成,新增 meta 组件
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.23.0
|
||||||
|
- @zhst/hooks@0.13.2
|
||||||
|
- @zhst/func@0.16.1
|
||||||
|
- @zhst/icon@0.5.1
|
||||||
|
|
||||||
|
## 0.25.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- feat(zhst/map,zhst/biz): map 完善文档,biz 修改 boxSelectTree 的文档格式
|
||||||
|
|
||||||
|
## 0.25.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/map:拓展地图 api,加入 tools 组件、cluster 组价、marker 组件、draw 组件、popup 组件;zhst/mata:添加 floatButton 组件
|
||||||
|
|
||||||
|
## 0.24.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 树组件支持 tag 面板、优化 filter 传参、优化 option 传参、废弃之前的定制化方案
|
||||||
|
|
||||||
|
## 0.23.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- feat(biz 无限滚动组件): 添加无限滚动组件,屏幕自适应撑开
|
||||||
|
|
||||||
|
## 0.22.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.16.0
|
||||||
|
- @zhst/hooks@0.13.1
|
||||||
|
- @zhst/meta@0.21.2
|
||||||
|
|
||||||
|
## 0.22.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- fix: 修改 cropperHelper 的无效引用
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.21.1
|
||||||
|
|
||||||
|
## 0.22.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- fix: zhst/meta、zhst/biz、zhst/material-修改图片标注组件
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.21.0
|
||||||
|
|
||||||
|
## 0.21.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- fix: 修改 zhst/meta
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.3
|
||||||
|
|
||||||
|
## 0.21.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz、zhst/meta、zhst/material: 修改 od、修改 boxSelectTree
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.2
|
||||||
|
|
||||||
|
## 0.21.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz: fix: 边框颜色主题色,实时监控窗口有图片和选中,预警记录文字溢出
|
||||||
|
|
||||||
|
## 0.21.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.1
|
||||||
|
|
||||||
|
## 0.21.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.20.0
|
||||||
|
|
||||||
|
## 0.21.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- feat: 修复之前发版错乱问题
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.13.0
|
||||||
|
- @zhst/func@0.15.0
|
||||||
|
- @zhst/icon@0.5.0
|
||||||
|
- @zhst/meta@0.19.0
|
||||||
|
|
||||||
|
## 0.20.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.14.1
|
||||||
|
- @zhst/hooks@0.12.1
|
||||||
|
- @zhst/meta@0.18.1
|
||||||
|
|
||||||
|
## 0.20.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- feat: 重新发版
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- fix: zhst/biz 优化实时监控布局
|
||||||
|
|
||||||
|
## 0.19.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz: 实时监控预警记录添加滚动条
|
||||||
|
|
||||||
|
## 0.19.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- fix: 修复适配问题
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.11.0
|
||||||
|
- @zhst/func@0.13.0
|
||||||
|
- @zhst/icon@0.3.0
|
||||||
|
- @zhst/meta@0.17.0
|
||||||
|
|
||||||
|
## 0.18.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.12.0
|
||||||
|
- @zhst/hooks@0.10.4
|
||||||
|
- @zhst/meta@0.16.4
|
||||||
|
|
||||||
|
## 0.18.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @zhst/func@0.11.3
|
||||||
|
- @zhst/hooks@0.10.3
|
||||||
|
- @zhst/meta@0.16.3
|
||||||
|
|
||||||
|
## 0.18.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- biz 优化无限滚动组件、boxselectTree 组件;material 修改算法编辑模块
|
||||||
|
|
||||||
|
## 0.18.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz 优化 boxselecttree
|
||||||
|
|
||||||
|
## 0.18.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- biz-transfer: 修改删除时透出
|
||||||
|
|
||||||
|
## 0.18.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz - 修改穿梭框事件透出
|
||||||
|
|
||||||
|
## 0.18.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @zhst/func@0.11.2
|
||||||
|
- @zhst/hooks@0.10.2
|
||||||
|
- @zhst/meta@0.16.2
|
||||||
|
|
||||||
|
## 0.18.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @zhst/func@0.11.1
|
||||||
|
- @zhst/hooks@0.10.1
|
||||||
|
- @zhst/meta@0.16.1
|
||||||
|
|
||||||
|
## 0.18.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/biz:新增摘要列表-无限滚动组件
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.10.0
|
||||||
|
- @zhst/func@0.11.0
|
||||||
|
- @zhst/meta@0.16.0
|
||||||
|
|
||||||
|
## 0.17.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 视频添加 OD 框,查看大图首次点击修复
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.15.0
|
||||||
|
- @zhst/func@0.10.2
|
||||||
|
- @zhst/hooks@0.9.2
|
||||||
|
|
||||||
|
## 0.16.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- zhst/biz: fix: 在业务层控制窗口切换状态
|
||||||
|
|
||||||
|
## 0.16.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- zhst/meta 大图圈选组件点击选不上 bug 修复,attach 遮挡底部框事件阻止修复
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.14.0
|
||||||
|
|
||||||
|
## 0.15.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- biz: 视频播放首图添加 od 框
|
||||||
|
|
||||||
|
## 0.14.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- biz:新增 od 弹框、预警图片 od;meta:新增人脸碰撞模型组件、扫描组件、termial 组件;material:新增中心连接物料
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.13.0
|
||||||
|
- @zhst/hooks@0.9.1
|
||||||
|
- @zhst/func@0.10.1
|
||||||
|
|
||||||
|
## 0.13.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 修改业务组件的 boxSelectTree
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.9.0
|
||||||
|
- @zhst/func@0.10.0
|
||||||
|
- @zhst/meta@0.12.0
|
||||||
|
|
||||||
|
## 0.12.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 修改盒子组件顺序
|
||||||
|
- @zhst/func@0.9.3
|
||||||
|
- @zhst/hooks@0.8.12
|
||||||
|
- @zhst/meta@0.11.1
|
||||||
|
|
||||||
|
## 0.12.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 修改物料库算法编辑新增箭头选择,元组件新增图片标记组件
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.11.0
|
||||||
|
- @zhst/func@0.9.2
|
||||||
|
- @zhst/hooks@0.8.11
|
||||||
|
|
||||||
|
## 0.12.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 优化 meta 预览图组件
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.10.0
|
||||||
|
|
||||||
|
## 0.11.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @zhst/func@0.9.1
|
||||||
|
- @zhst/hooks@0.8.10
|
||||||
|
- @zhst/meta@0.9.7
|
||||||
|
|
||||||
|
## 0.11.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.9.0
|
||||||
|
- @zhst/hooks@0.8.9
|
||||||
|
- @zhst/meta@0.9.6
|
||||||
|
|
||||||
|
## 0.11.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- biz 打包没打上
|
||||||
|
|
||||||
|
## 0.11.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 添加 traansfer 组件 searchProps 透传
|
||||||
|
|
||||||
|
## 0.10.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 初始化物料库
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.8.8
|
||||||
|
- @zhst/func@0.8.3
|
||||||
|
- @zhst/meta@0.9.5
|
||||||
|
|
||||||
|
## 0.10.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 初始化物料包
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.8.7
|
||||||
|
- @zhst/func@0.8.2
|
||||||
|
- @zhst/meta@0.9.4
|
||||||
|
|
||||||
|
## 0.10.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.8.1
|
||||||
|
- @zhst/hooks@0.8.6
|
||||||
|
- @zhst/meta@0.9.3
|
||||||
|
|
||||||
|
## 0.10.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/func@0.8.0
|
||||||
|
- @zhst/hooks@0.8.5
|
||||||
|
- @zhst/meta@0.9.2
|
||||||
|
|
||||||
|
## 0.10.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.9.1
|
||||||
|
|
||||||
|
## 0.10.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 修改 metad 大图组建
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.9.0
|
||||||
|
|
||||||
|
## 0.9.8
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- @zhst/func@0.7.5
|
||||||
|
- @zhst/hooks@0.8.4
|
||||||
|
- @zhst/meta@0.8.5
|
||||||
|
|
||||||
|
## 0.9.7
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 新增 RealTimeMonitor,VideoPlayerCard,ViewLargerImageModal,WarningRecordCard 组件,优化盒子树创建弹框规则校验
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/meta@0.8.5
|
||||||
|
|
||||||
|
## 0.9.6
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 新增 tree 组件的监听事件,优化 meta 全选的回调事件监听
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.8.3
|
||||||
|
- @zhst/func@0.7.4
|
||||||
|
- @zhst/meta@0.8.4
|
||||||
|
|
||||||
|
## 0.9.5
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 删除预览图组件,新增摄像头状态判断,修复 ts 生成失败问题
|
||||||
|
|
||||||
|
## 0.9.4
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 添加 biz 模块修改树形盒子组件监听事件
|
||||||
|
|
||||||
|
## 0.9.3
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 新增监听点击事件自定义
|
||||||
|
|
||||||
|
## 0.9.2
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 新增 BoxSelectTree 监听时钟点击事件,导入盒子事件
|
||||||
|
|
||||||
|
## 0.9.1
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- 修改 boxSelectTree 类型提示
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.8.2
|
||||||
|
- @zhst/func@0.7.3
|
||||||
|
- @zhst/meta@0.8.3
|
||||||
|
|
||||||
|
## 0.9.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 优化 boxSelectTree 组件,添加可以自定义配置按钮功能
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.8.1
|
||||||
|
- @zhst/func@0.7.2
|
||||||
|
- @zhst/meta@0.8.2
|
||||||
|
|
||||||
|
## 0.8.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- @zhst/biz 优化数组件
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies
|
||||||
|
- @zhst/hooks@0.8.0
|
||||||
|
- @zhst/func@0.7.1
|
||||||
|
- @zhst/meta@0.8.1
|
||||||
|
|
||||||
|
## 0.7.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- 新增预警记录卡片组件
|
||||||
|
|
||||||
## 0.6.0
|
## 0.6.0
|
||||||
|
|
||||||
### Minor Changes
|
### Minor Changes
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,26 +0,0 @@
|
|||||||
import * as React from 'react';
|
|
||||||
import classnames from 'classnames';
|
|
||||||
import { Icon, Button } from '@zhst/meta';
|
|
||||||
import "./index.less";
|
|
||||||
var componentName = "zhst-image__nav";
|
|
||||||
var Navigation = function Navigation(props) {
|
|
||||||
var show = props.show,
|
|
||||||
prev = props.prev,
|
|
||||||
next = props.next,
|
|
||||||
disabled = props.disabled,
|
|
||||||
onClick = props.onClick,
|
|
||||||
className = props.className,
|
|
||||||
color = props.color;
|
|
||||||
return /*#__PURE__*/React.createElement("div", {
|
|
||||||
className: classnames("".concat(componentName), prev && "".concat(componentName, "-prev"), next && "".concat(componentName, "-next"), disabled && "".concat(componentName, "--disable"), !show && "".concat(componentName, "--hide"), className)
|
|
||||||
}, /*#__PURE__*/React.createElement(Button, {
|
|
||||||
type: "text",
|
|
||||||
disabled: disabled,
|
|
||||||
onClick: onClick
|
|
||||||
}, /*#__PURE__*/React.createElement(Icon, {
|
|
||||||
size: 28,
|
|
||||||
color: color,
|
|
||||||
icon: prev ? 'icon-qiehuanzuo' : 'icon-qiehuanyou'
|
|
||||||
})));
|
|
||||||
};
|
|
||||||
export default Navigation;
|
|
3
packages/biz/es/BigImageModal/index.d.ts
vendored
3
packages/biz/es/BigImageModal/index.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
import BigImageModal from "./BigImageModal";
|
|
||||||
export type { BigImageModalProps } from './BigImageModal';
|
|
||||||
export default BigImageModal;
|
|
@ -1,2 +0,0 @@
|
|||||||
import BigImageModal from "./BigImageModal";
|
|
||||||
export default BigImageModal;
|
|
@ -1,514 +0,0 @@
|
|||||||
.zhst-image {
|
|
||||||
.zhst-dialog-content {
|
|
||||||
box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-tabs .zhst-tabs-nav-wrap {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
&-view-container {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
|
|
||||||
&__nav {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 99;
|
|
||||||
top: 50%;
|
|
||||||
width: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
background: #d9d9d9;
|
|
||||||
border-radius: 100%;
|
|
||||||
cursor: pointer;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--disabled {
|
|
||||||
opacity: 0.3;
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__nav:hover {
|
|
||||||
background: #09f;
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-tool-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__face-score {
|
|
||||||
position: absolute;
|
|
||||||
right: 90px;
|
|
||||||
bottom: 80px;
|
|
||||||
color: red;
|
|
||||||
font-family: 'Microsoft YaHei';
|
|
||||||
font-size: 19px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-carousel-container {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
margin-top: 16px;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.zhst-image__tool {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
&-split {
|
|
||||||
width: 0;
|
|
||||||
height: 14px;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
border-left: 1px solid #e6e7eb;
|
|
||||||
content: '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-zoom {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&> :not(:last-child) {
|
|
||||||
margin-right: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__scale {
|
|
||||||
display: inline-block;
|
|
||||||
width: 38px;
|
|
||||||
height: 14px;
|
|
||||||
|
|
||||||
// margin-left: 15px;
|
|
||||||
box-sizing: content-box;
|
|
||||||
border: 1px solid rgb(77 77 77 / 100%);
|
|
||||||
margin-top: 2px; //对齐
|
|
||||||
background: rgb(255 255 255 / 100%);
|
|
||||||
border-radius: 2px;
|
|
||||||
color: #4d4d4d;
|
|
||||||
cursor: default;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 14px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-switch {
|
|
||||||
display: flex;
|
|
||||||
width: 30px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin: 0 26px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-left {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
&> :not(:last-child) {
|
|
||||||
margin-right: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-right {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
|
|
||||||
&> :not(:first-child) {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-icon-container {
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
&--active {
|
|
||||||
color: #5584ff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&> :first-child {
|
|
||||||
margin-right: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__carousel {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
width: 742px;
|
|
||||||
height: 100px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border: 1px solid #f0f0f0;
|
|
||||||
margin: 0 auto;
|
|
||||||
background: #fafafa;
|
|
||||||
border-radius: 2px;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
&-container {
|
|
||||||
width: (58px + 8px) * 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item {
|
|
||||||
display: flex;
|
|
||||||
width: 58px + 8px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item-img {
|
|
||||||
/* 尝试消除transform 副作用 */
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
// width: 58px;
|
|
||||||
// height: 76px;
|
|
||||||
display: flex;
|
|
||||||
width: 66px;
|
|
||||||
height: 84px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #fafafa;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
/* 尝试消除transform 副作用 end */
|
|
||||||
&--active {
|
|
||||||
border: 2px solid #09f;
|
|
||||||
border-radius: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
/* 尝试消除transform 副作用 */
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
|
|
||||||
/* 尝试消除transform 副作用 end */
|
|
||||||
&>img {
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
object-fit: contain;
|
|
||||||
transition: all 0.2s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: scale(1.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__trackmodel {
|
|
||||||
&__panel {
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
width: 320px;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
&--head {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
padding: 0 16px;
|
|
||||||
border-bottom: 1px solid #f0f0f0;
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--track {
|
|
||||||
height: calc(100% - 40px);
|
|
||||||
}
|
|
||||||
|
|
||||||
&-date {
|
|
||||||
padding: 10px 6px;
|
|
||||||
|
|
||||||
// position: absolute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--bigImage {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 100;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 59px;
|
|
||||||
background: rgb(0 0 0 / 40%);
|
|
||||||
|
|
||||||
&--image {
|
|
||||||
width: 946px;
|
|
||||||
height: 532px;
|
|
||||||
|
|
||||||
&>img {
|
|
||||||
width: 946px;
|
|
||||||
height: 532px;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--close {
|
|
||||||
margin-left: 16px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__flooter {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 999;
|
|
||||||
bottom: -124px;
|
|
||||||
left: 0;
|
|
||||||
width: calc(100% - 320px - 10px);
|
|
||||||
height: 144px;
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 0 0 8px 0 rgb(172 172 172 / 50%);
|
|
||||||
|
|
||||||
&--head {
|
|
||||||
display: flex;
|
|
||||||
height: 20px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #f6f6f6;
|
|
||||||
color: #999;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--body {
|
|
||||||
display: flex;
|
|
||||||
height: calc(100% - 20px);
|
|
||||||
padding-left: 50px;
|
|
||||||
|
|
||||||
&__title {
|
|
||||||
color: #333;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__text {
|
|
||||||
overflow: hidden;
|
|
||||||
color: #333;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 16px;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--left {
|
|
||||||
display: flex;
|
|
||||||
width: 75px;
|
|
||||||
height: 100;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&>img {
|
|
||||||
width: 75px;
|
|
||||||
height: 100px;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--middle {
|
|
||||||
display: grid;
|
|
||||||
width: 331px;
|
|
||||||
justify-content: flex-start;
|
|
||||||
padding: 8px 20px;
|
|
||||||
border-right: 1px solid #f0f0f0;
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--right {
|
|
||||||
display: grid;
|
|
||||||
width: calc(100% - 331px - 75px);
|
|
||||||
padding: 8px 20px;
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__button-list {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
margin-right: 20px;
|
|
||||||
|
|
||||||
&>span {
|
|
||||||
color: #09f !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
&>span {
|
|
||||||
color: #247fdb !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes close {
|
|
||||||
from {
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
bottom: -124px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes open {
|
|
||||||
from {
|
|
||||||
bottom: -124px;
|
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--close {
|
|
||||||
bottom: -124px;
|
|
||||||
animation-duration: 1s;
|
|
||||||
animation-name: close;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--open {
|
|
||||||
bottom: 0;
|
|
||||||
animation-duration: 1s;
|
|
||||||
animation-name: open;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__attributePanel {
|
|
||||||
margin: 0 66px;
|
|
||||||
background: #f6f6f6;
|
|
||||||
margin-top: 20px;
|
|
||||||
padding-top: 16px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
&>div:first-child {
|
|
||||||
width: fit-content;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-title {
|
|
||||||
color: rgb(0 0 0 / 88%);
|
|
||||||
font-weight: bold;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-label {
|
|
||||||
color: rgb(0 0 0 / 45%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&-value {
|
|
||||||
color: rgb(0 0 0 / 88%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedWrapper {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
padding: 0 30px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.relatedTabs {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedContent {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.relatedPics {
|
|
||||||
width: 742px;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
|
||||||
color: rgba(0, 0, 0, 25%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedBtn {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #09f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:global {
|
|
||||||
.ant-tabs-left>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane {
|
|
||||||
padding-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-tabs-tab {
|
|
||||||
padding: 8px 12px !important;
|
|
||||||
text-align: right !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-tabs .ant-tabs-tab {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: right;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,473 +0,0 @@
|
|||||||
export var IMAGE_DATA = {
|
|
||||||
"enAbleDeleteFeature": true,
|
|
||||||
"tabsFilter": ["COMPATER", "NORMAL"],
|
|
||||||
"selectIndex": 4,
|
|
||||||
"disableBtn": [0, 1, 4, 20],
|
|
||||||
"dataSource": [{
|
|
||||||
"objectId": "1742110565582518272",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.7163062,
|
|
||||||
"timestamp": 1704186491979,
|
|
||||||
"deviceId": "129533",
|
|
||||||
"id": "129533",
|
|
||||||
"name": "4楼门口过道人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.125,
|
|
||||||
"latitude": 30.280500411987305,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742110565582518272",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129533",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742110532019697664",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704186491979",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 1920,
|
|
||||||
"originHeight": 1080,
|
|
||||||
"offsetTime": "24714687",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.603125,
|
|
||||||
"y": 0.3314815,
|
|
||||||
"w": 0.0578125,
|
|
||||||
"h": 0.2712963
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.546875,
|
|
||||||
"y": 0.2638889,
|
|
||||||
"w": 0.17135416,
|
|
||||||
"h": 0.40648147
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565603489792.jpg",
|
|
||||||
"confidence": 0.817271,
|
|
||||||
"sourceObjectId": "1742110565603489792",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 1,
|
|
||||||
"subObjectType": ["OBJECT_TYPE_FACE"],
|
|
||||||
"subObjectIds": ["1742110532015503360"],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"compaterImages": ["http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"],
|
|
||||||
"imgSummary": "singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565603489792.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129533",
|
|
||||||
"cameraName": "4楼门口过道人脸"
|
|
||||||
}, {
|
|
||||||
"objectId": "1742092680994764802",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.7007122,
|
|
||||||
"timestamp": 1704182225679,
|
|
||||||
"deviceId": "129533",
|
|
||||||
"id": "129533",
|
|
||||||
"name": "4楼门口过道人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.125,
|
|
||||||
"latitude": 30.280500411987305,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742092680994764802",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129533",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742092646219790337",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704182225679",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 1920,
|
|
||||||
"originHeight": 1080,
|
|
||||||
"offsetTime": "20448387",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.5265625,
|
|
||||||
"y": 0.49537036,
|
|
||||||
"w": 0.104166664,
|
|
||||||
"h": 0.35833332
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.465625,
|
|
||||||
"y": 0.40648147,
|
|
||||||
"w": 0.22708334,
|
|
||||||
"h": 0.537963
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092681720379392.jpg",
|
|
||||||
"confidence": 0.769764,
|
|
||||||
"sourceObjectId": "1742092681720379392",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 0,
|
|
||||||
"subObjectType": [],
|
|
||||||
"subObjectIds": [],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"compaterImages": ["http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"],
|
|
||||||
"imgSummary": "singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092681720379392.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129533",
|
|
||||||
"cameraName": "4楼门口过道人脸"
|
|
||||||
}, {
|
|
||||||
"objectId": "1742092514409592832",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.703765,
|
|
||||||
"timestamp": 1704182186451,
|
|
||||||
"deviceId": "129529",
|
|
||||||
"id": "129529",
|
|
||||||
"name": "4入口人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.12100219726562,
|
|
||||||
"latitude": 30.280099868774414,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742092514409592832",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129529",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742092482440607744",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704182186451",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 2560,
|
|
||||||
"originHeight": 1440,
|
|
||||||
"offsetTime": "20409182",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.6195313,
|
|
||||||
"y": 0.24583334,
|
|
||||||
"w": 0.09804688,
|
|
||||||
"h": 0.41944444
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.53515625,
|
|
||||||
"y": 0.14027777,
|
|
||||||
"w": 0.26640624,
|
|
||||||
"h": 0.63125
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092515508500480.jpg",
|
|
||||||
"confidence": 0.92494,
|
|
||||||
"sourceObjectId": "1742092515508500480",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 1,
|
|
||||||
"subObjectType": ["OBJECT_TYPE_FACE"],
|
|
||||||
"subObjectIds": ["1742092482432219136"],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"compaterImages": ["http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"],
|
|
||||||
"imgSummary": "singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092515508500480.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129529",
|
|
||||||
"cameraName": "4入口人脸"
|
|
||||||
}],
|
|
||||||
"isArchiveDetail": false,
|
|
||||||
"ToolProps": {
|
|
||||||
"renderVideoBtn": true,
|
|
||||||
"disableVideo": false
|
|
||||||
},
|
|
||||||
"specialTitle": ""
|
|
||||||
};
|
|
||||||
export var BIG_IMAGE_DATA = [{
|
|
||||||
imageKey: 'http://10.0.0.120:30003/file/singer-20240110/1/5/1744894622934503424.jpg',
|
|
||||||
imgSummary: "http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
flvUrl: 'ws://10.0.0.120:9033/flv/Sip/34020000001310000301.flv?ip=10.0.0.120&stime=1704815972&etime=1704815992',
|
|
||||||
compaterImages: ['http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg', "http://10.0.0.120:30003/file/public/public_20240117/file/dfdd3340-53c8-4dc4-9921-f13230aa0355.jpg"],
|
|
||||||
odRect: {
|
|
||||||
"x": 0.5445312,
|
|
||||||
"y": 0.19166666,
|
|
||||||
"w": 0.08671875,
|
|
||||||
"h": 0.40138888
|
|
||||||
},
|
|
||||||
attachImg: [{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894622695428096.jpg",
|
|
||||||
"label": "形体"
|
|
||||||
}, {
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894588427964418.jpg",
|
|
||||||
"label": "人脸"
|
|
||||||
}],
|
|
||||||
score: '0.6',
|
|
||||||
// 人脸质量分
|
|
||||||
showScore: true,
|
|
||||||
// 人脸质量分
|
|
||||||
cameraPosition: 'string',
|
|
||||||
// 摄像头位置
|
|
||||||
time: '2022-01-01',
|
|
||||||
// 摄像头拍摄时间
|
|
||||||
objects: [{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746832189053474816",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"level": 0,
|
|
||||||
"confidence": 0.881164,
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705312223057",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.61418945,
|
|
||||||
"y": 0.34309354,
|
|
||||||
"w": 0.067661405,
|
|
||||||
"h": 0.34659258
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
imageKey: 'http://10.0.0.120:30003/file/singer-20240115/1/9/1746795581994436608.jpg',
|
|
||||||
imgSummary: "http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
odRect: {
|
|
||||||
"x": 0.553125,
|
|
||||||
"y": 0.29722223,
|
|
||||||
"w": 0.048958335,
|
|
||||||
"h": 0.2462963
|
|
||||||
},
|
|
||||||
attachImg: [{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795581163964416.jpg",
|
|
||||||
"label": "形体"
|
|
||||||
}, {
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795546867140608.jpg",
|
|
||||||
"label": "人脸"
|
|
||||||
}],
|
|
||||||
flvUrl: 'ws://10.0.0.120:9033/flv/HaikangNvr/34.flv?ip=10.0.2.103&stime=1705302394&etime=1705302414',
|
|
||||||
score: 0.815207,
|
|
||||||
// 人脸质量分
|
|
||||||
showScore: true,
|
|
||||||
// 人脸质量分
|
|
||||||
cameraPosition: 'string',
|
|
||||||
// 摄像头位置
|
|
||||||
time: '2022-01-01',
|
|
||||||
// 摄像头拍摄时间
|
|
||||||
objects: [{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746816737430472704",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705308539109",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.5519352,
|
|
||||||
"y": 0.2965385,
|
|
||||||
"w": 0.05185461,
|
|
||||||
"h": 0.24698898
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0
|
|
||||||
}, {
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746816737430472705",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"level": 0,
|
|
||||||
"confidence": 0.9310699,
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705308539109",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.58543766,
|
|
||||||
"y": 0.3203356,
|
|
||||||
"w": 0.052037954,
|
|
||||||
"h": 0.2664015
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0
|
|
||||||
}]
|
|
||||||
}];
|
|
||||||
export var attributeList = [{
|
|
||||||
title: '人员属性',
|
|
||||||
children: [{
|
|
||||||
key: '1',
|
|
||||||
label: '性别',
|
|
||||||
children: '男'
|
|
||||||
}, {
|
|
||||||
key: '2',
|
|
||||||
label: '年龄',
|
|
||||||
children: '成年'
|
|
||||||
}, {
|
|
||||||
key: '3',
|
|
||||||
label: '帽子',
|
|
||||||
children: '无'
|
|
||||||
}, {
|
|
||||||
key: '4',
|
|
||||||
label: '上身颜色',
|
|
||||||
children: '灰'
|
|
||||||
}, {
|
|
||||||
key: '5',
|
|
||||||
label: '下身颜色',
|
|
||||||
children: '蓝色'
|
|
||||||
}, {
|
|
||||||
key: '6',
|
|
||||||
label: '附着物',
|
|
||||||
children: '无'
|
|
||||||
}, {
|
|
||||||
key: '7',
|
|
||||||
label: '骑行',
|
|
||||||
children: '否'
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
title: '社区规范',
|
|
||||||
children: [{
|
|
||||||
key: '1',
|
|
||||||
label: '性别',
|
|
||||||
children: '男'
|
|
||||||
}, {
|
|
||||||
key: '2',
|
|
||||||
label: '年龄',
|
|
||||||
children: '成年'
|
|
||||||
}, {
|
|
||||||
key: '3',
|
|
||||||
label: '帽子',
|
|
||||||
children: '无'
|
|
||||||
}, {
|
|
||||||
key: '4',
|
|
||||||
label: '上身颜色',
|
|
||||||
children: '灰'
|
|
||||||
}, {
|
|
||||||
key: '5',
|
|
||||||
label: '下身颜色',
|
|
||||||
children: '蓝色'
|
|
||||||
}, {
|
|
||||||
key: '6',
|
|
||||||
label: '附着物',
|
|
||||||
children: '无'
|
|
||||||
}, {
|
|
||||||
key: '7',
|
|
||||||
label: '骑行',
|
|
||||||
children: '否'
|
|
||||||
}]
|
|
||||||
}];
|
|
@ -1,14 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Button } from '@zhst/meta';
|
|
||||||
import { useThrottleFn } from '@zhst/hooks';
|
|
||||||
export default (function () {
|
|
||||||
var _useThrottleFn = useThrottleFn(function () {
|
|
||||||
return console.log('123');
|
|
||||||
}),
|
|
||||||
run = _useThrottleFn.run;
|
|
||||||
return /*#__PURE__*/React.createElement(Button, {
|
|
||||||
onClick: function onClick() {
|
|
||||||
return run();
|
|
||||||
}
|
|
||||||
}, "\u6D4B\u8BD5");
|
|
||||||
});
|
|
@ -1,45 +0,0 @@
|
|||||||
import { Dayjs as Moment } from 'dayjs';
|
|
||||||
export declare const getDefaultRadius: () => number;
|
|
||||||
export declare const setDefaultRadius: (radius: number) => void;
|
|
||||||
export declare const setSearchIntervalDuration: (duration: number) => void;
|
|
||||||
export declare const getSearchIntervalDuration: (time: number) => number;
|
|
||||||
export declare const operateTrackById: (smartTrackId: number, operationType: OperationType) => Promise<void>;
|
|
||||||
export declare const deleteTrackById: (smartTrackId: number) => Promise<void>;
|
|
||||||
export declare const modifyTrackImgs: (smartTrackId: number, images: Array<Object>) => Promise<void>;
|
|
||||||
export declare const modifyTrackConf: (conf: any, smartTrackId: number) => Promise<void>;
|
|
||||||
export declare const getTrackTaskById: (smartTrackId?: number) => Promise<any>;
|
|
||||||
export declare const getTackDetailInfo: (smartTrackId?: number) => Promise<any>;
|
|
||||||
export declare const getTaskCameraByCenterAndPower: (value: {
|
|
||||||
taskPower: {
|
|
||||||
facePower: number;
|
|
||||||
bodyPower: number;
|
|
||||||
};
|
|
||||||
cameraInfos: Array<Object>;
|
|
||||||
center: [number, number];
|
|
||||||
}) => Promise<Object[]>;
|
|
||||||
/**创建追踪任务 */
|
|
||||||
export declare const createIntelligentTrack: (value: {
|
|
||||||
images: Array<Object>;
|
|
||||||
deviceIds: Array<string>;
|
|
||||||
circleCenter: [number, number];
|
|
||||||
model: number;
|
|
||||||
circleRadius: number;
|
|
||||||
facePower?: number;
|
|
||||||
bodyPower?: number;
|
|
||||||
historyTime?: [Moment, Moment];
|
|
||||||
topping?: boolean;
|
|
||||||
}) => Promise<any>;
|
|
||||||
export declare const emitHeartbeat: (smartTrackId: number) => Promise<void>;
|
|
||||||
export declare const ModifyTrackCameras: (value: {
|
|
||||||
smartTrackId: number;
|
|
||||||
deviceIds: Array<number>;
|
|
||||||
centerPoint: [number, number];
|
|
||||||
}) => Promise<void>;
|
|
||||||
export declare const setIntelligentTrackCircleInfo: (smartTrackId: number, circleCenter: [number, number]) => Promise<void>;
|
|
||||||
export declare const getTackCameraInfo: (value: {
|
|
||||||
circleCenter: [Moment, Moment];
|
|
||||||
radius: number;
|
|
||||||
zoom: number;
|
|
||||||
}) => Promise<any>;
|
|
||||||
export declare const getCameraInfoByCircle: (circleCenter: any, radius: any, zoom?: number) => Promise<any>;
|
|
||||||
export declare const taskInfoToSearchItem: (taskInfo: any) => any[];
|
|
File diff suppressed because one or more lines are too long
5
packages/biz/es/index.d.ts
vendored
5
packages/biz/es/index.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
export { default as BigImageModal } from './BigImageModal';
|
|
||||||
export { default as BoxSelectTree } from './boxSelectTree';
|
|
||||||
export { default as Tree } from './tree';
|
|
||||||
export { default as TreeTransfer } from './treeTransfer';
|
|
||||||
export { default as TreeTransferModal } from './treeTransferModal';
|
|
@ -1,5 +0,0 @@
|
|||||||
export { default as BigImageModal } from "./BigImageModal";
|
|
||||||
export { default as BoxSelectTree } from "./boxSelectTree";
|
|
||||||
export { default as Tree } from "./tree";
|
|
||||||
export { default as TreeTransfer } from "./treeTransfer";
|
|
||||||
export { default as TreeTransferModal } from "./treeTransferModal";
|
|
@ -1,95 +0,0 @@
|
|||||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
||||||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
||||||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
||||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
||||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
||||||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
||||||
import { useMemo } from 'react';
|
|
||||||
import { throttle as loadshThrottle, noop } from '@zhst/func';
|
|
||||||
import { useDeepEffect, useLatest } from '@zhst/hooks';
|
|
||||||
import ws from "./ws";
|
|
||||||
var getSelf = function getSelf(v) {
|
|
||||||
return v;
|
|
||||||
};
|
|
||||||
export var SocketApi = {
|
|
||||||
CameraTaskStatue: 'singer.DeviceService/SubScribeCameraTaskStatus',
|
|
||||||
DeviceStatus: 'singer.TaskManagerService/SubscribeTaskStatus',
|
|
||||||
SubscribeSolutionDeploy: 'singer.SolutionManagerService/SubscribeSolutionDeploy',
|
|
||||||
SubscribeTasksSummary: 'singer.TaskManagerService/SubscribeTasksSummary',
|
|
||||||
MonitorSubscribeResult: 'singer.MonitorService/MonitorSubscribeResult',
|
|
||||||
MonitorSubscribeStatus: 'singer.MonitorService/MonitorSubscribeStatus',
|
|
||||||
SubscribeArchiveGroupUpload: 'singer.ArchiveGroupService/CreateArchiveByImport',
|
|
||||||
SubscribeJointTask: 'singer.JointTaskService/SubscribeJointTask',
|
|
||||||
SubscribeGroupFragment: 'singer.VideoService/SubscribeVideoFragmentStatus',
|
|
||||||
// 监听视频分片状态变化,包括新建、删除、变化
|
|
||||||
SubscribeGroup: 'singer.VideoService/SubscribeGroup',
|
|
||||||
// 监听视频分组状态变化,列表变化也通知
|
|
||||||
SubscribeStreamEvent: 'singer.MediaManagerService/SubscribeStreamEvent' // 监听视频分组状态变化,列表变化也通知
|
|
||||||
};
|
|
||||||
export default (function (topic) {
|
|
||||||
var iterator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
||||||
var opt = arguments.length > 2 ? arguments[2] : undefined;
|
|
||||||
var _ref = opt || {},
|
|
||||||
_ref$req = _ref.req,
|
|
||||||
req = _ref$req === void 0 ? {} : _ref$req,
|
|
||||||
_ref$throttle = _ref.throttle,
|
|
||||||
throttle = _ref$throttle === void 0 ? 0 : _ref$throttle,
|
|
||||||
_ref$beforeLoopTmp = _ref.beforeLoopTmp,
|
|
||||||
beforeLoopTmp = _ref$beforeLoopTmp === void 0 ? getSelf : _ref$beforeLoopTmp,
|
|
||||||
_ref$shouldBreak = _ref.shouldBreak,
|
|
||||||
shouldBreak = _ref$shouldBreak === void 0 ? false : _ref$shouldBreak,
|
|
||||||
forceRefresh = _ref.forceRefresh,
|
|
||||||
close = _ref.close;
|
|
||||||
|
|
||||||
// 带上token
|
|
||||||
var reqstring = useMemo(function () {
|
|
||||||
var newReq = _objectSpread(_objectSpread({}, req), {}, {
|
|
||||||
extraHeaders: {
|
|
||||||
authorization: localStorage.getItem('USER-TOKEN')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return JSON.stringify(newReq);
|
|
||||||
}, [req]);
|
|
||||||
var latestIterator = useLatest(iterator);
|
|
||||||
useDeepEffect(function () {
|
|
||||||
if (close) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//控制socket 请求发送
|
|
||||||
if (shouldBreak) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//去抖动
|
|
||||||
|
|
||||||
var tmpData = [];
|
|
||||||
var throttleUpdate = loadshThrottle(function () {
|
|
||||||
if (tmpData.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var _tmpData = beforeLoopTmp(tmpData);
|
|
||||||
latestIterator.current(_tmpData); //加了throttle 数据就变成数组
|
|
||||||
tmpData = [];
|
|
||||||
}, throttle);
|
|
||||||
var unSubscribe = ws.subscribe(SocketApi[topic], reqstring, function (socketData) {
|
|
||||||
try {
|
|
||||||
if (!throttle) {
|
|
||||||
latestIterator.current(socketData);
|
|
||||||
} else {
|
|
||||||
tmpData.push(socketData);
|
|
||||||
throttleUpdate();
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('useSocke:', error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return function () {
|
|
||||||
try {
|
|
||||||
unSubscribe();
|
|
||||||
throttleUpdate.cancel();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}, [topic, reqstring, shouldBreak, forceRefresh, close]);
|
|
||||||
});
|
|
2
packages/biz/es/useSocket/onceChannel.d.ts
vendored
2
packages/biz/es/useSocket/onceChannel.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
declare const startChannel: (topic: any, req: any, callback: any) => () => void;
|
|
||||||
export default startChannel;
|
|
@ -1,24 +0,0 @@
|
|||||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
||||||
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
||||||
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
||||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
||||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
||||||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
||||||
//@ts-nocheck
|
|
||||||
import channel from "./ws";
|
|
||||||
var startChannel = function startChannel(topic, req, callback) {
|
|
||||||
// 带上token
|
|
||||||
var reqstring = JSON.stringify(_objectSpread(_objectSpread({}, req), {}, {
|
|
||||||
extraHeaders: {
|
|
||||||
authorization: localStorage.getItem('USER-TOKEN')
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
var unSubscribe = channel.subscribe(topic, reqstring, function (socketData) {
|
|
||||||
var shouldStop = callback(socketData);
|
|
||||||
if (shouldStop) {
|
|
||||||
unSubscribe === null || unSubscribe === void 0 || unSubscribe();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return unSubscribe;
|
|
||||||
};
|
|
||||||
export default startChannel;
|
|
26
packages/biz/es/useSocket/ws.d.ts
vendored
26
packages/biz/es/useSocket/ws.d.ts
vendored
@ -1,26 +0,0 @@
|
|||||||
declare class Channel {
|
|
||||||
/**
|
|
||||||
* io 实例化对象
|
|
||||||
*/
|
|
||||||
ioIns: any;
|
|
||||||
/**
|
|
||||||
* 已存在的订阅列表
|
|
||||||
*/
|
|
||||||
listeners: never[];
|
|
||||||
/**
|
|
||||||
* 调试信息 记录订阅/反订阅次数
|
|
||||||
*/
|
|
||||||
subscribeListenerId: never[];
|
|
||||||
unSubscribeListenerId: never[];
|
|
||||||
init: () => void;
|
|
||||||
retry: (listener: {
|
|
||||||
[x: string]: any;
|
|
||||||
lastRetryInterval: number | undefined;
|
|
||||||
intervalId: NodeJS.Timeout;
|
|
||||||
} | undefined) => void;
|
|
||||||
doEmit: (topic: any, req: any, listenerId: any) => void;
|
|
||||||
subscribe(topic: any, req: any, handle: any): () => void;
|
|
||||||
unSubscribe(topic: any, req: any, handleId: any, listenerId: any): void;
|
|
||||||
}
|
|
||||||
declare const channelIns: Channel;
|
|
||||||
export default channelIns;
|
|
@ -1,244 +0,0 @@
|
|||||||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
||||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
||||||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
||||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
||||||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
||||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
||||||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
||||||
// @ts-nocheck
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
import { has } from '@zhst/func';
|
|
||||||
import io from 'socket.io-client';
|
|
||||||
import { SOCKET_HOST } from '@common/constants';
|
|
||||||
var EMITSTATE = {
|
|
||||||
NOT_CONNECT: 0,
|
|
||||||
WAITING: 1,
|
|
||||||
CONNECT: 2
|
|
||||||
};
|
|
||||||
var initRetryTime = 0;
|
|
||||||
var intervalTime = 5 * 1000; //下次重试增加时间
|
|
||||||
var maxIntervalTime = 1 * 60 * 60 * 1000; //最大重试时间1小时
|
|
||||||
var Channel = /*#__PURE__*/function () {
|
|
||||||
function Channel() {
|
|
||||||
var _this = this;
|
|
||||||
_classCallCheck(this, Channel);
|
|
||||||
/**
|
|
||||||
* io 实例化对象
|
|
||||||
*/
|
|
||||||
_defineProperty(this, "ioIns", void 0);
|
|
||||||
/**
|
|
||||||
* 已存在的订阅列表
|
|
||||||
*/
|
|
||||||
_defineProperty(this, "listeners", [
|
|
||||||
// {
|
|
||||||
// topic: "",
|
|
||||||
// req: "",
|
|
||||||
// suInfo: {},
|
|
||||||
// hasEmit: false,//是否已经订阅
|
|
||||||
// lastRetryInterval: 0,
|
|
||||||
// handles: {
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
]);
|
|
||||||
/**
|
|
||||||
* 调试信息 记录订阅/反订阅次数
|
|
||||||
*/
|
|
||||||
_defineProperty(this, "subscribeListenerId", []);
|
|
||||||
_defineProperty(this, "unSubscribeListenerId", []);
|
|
||||||
_defineProperty(this, "init", function () {
|
|
||||||
var ioIns = _this.ioIns = io(SOCKET_HOST, {
|
|
||||||
reconnection: true,
|
|
||||||
transports: ['websocket'],
|
|
||||||
forceNew: true
|
|
||||||
});
|
|
||||||
ioIns.on('connect', function () {
|
|
||||||
for (var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
||||||
arg[_key] = arguments[_key];
|
|
||||||
}
|
|
||||||
console.debug('connect', arg);
|
|
||||||
_this.ioIns = ioIns;
|
|
||||||
_this.listeners.forEach(function (v) {
|
|
||||||
_this.doEmit(v['topic'], v['req'], v['id']);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
ioIns.on('event', function () {
|
|
||||||
for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
||||||
arg[_key2] = arguments[_key2];
|
|
||||||
}
|
|
||||||
console.debug('event', arg);
|
|
||||||
});
|
|
||||||
ioIns.on('disconnect', function () {
|
|
||||||
for (var _len3 = arguments.length, arg = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
||||||
arg[_key3] = arguments[_key3];
|
|
||||||
}
|
|
||||||
console.debug('disconnect', arg);
|
|
||||||
_this.subscribeListenerId = [];
|
|
||||||
_this.unSubscribeListenerId = [];
|
|
||||||
});
|
|
||||||
ioIns.on('reconnect', function () {
|
|
||||||
for (var _len4 = arguments.length, arg = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
||||||
arg[_key4] = arguments[_key4];
|
|
||||||
}
|
|
||||||
console.debug('reconnect', arg);
|
|
||||||
_this.listeners.forEach(function (v) {
|
|
||||||
v['hasEmit'] = EMITSTATE.NOT_CONNECT;
|
|
||||||
_this.doEmit(v['topic'], v['req'], v['id']);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
_defineProperty(this, "retry", function (listener) {
|
|
||||||
//重试逻辑
|
|
||||||
var intervalId = setTimeout(function () {
|
|
||||||
var hasExit = _this.listeners.find(function (v) {
|
|
||||||
return v['topic'] === (listener === null || listener === void 0 ? void 0 : listener['topic']) && v['req'] === listener['req'];
|
|
||||||
});
|
|
||||||
if (!hasExit) return;
|
|
||||||
listener['hasEmit'] = EMITSTATE.NOT_CONNECT;
|
|
||||||
_this.doEmit(listener['topic'], listener['req'], listener['id']);
|
|
||||||
}, listener.lastRetryInterval);
|
|
||||||
listener.intervalId = intervalId;
|
|
||||||
listener.lastRetryInterval = intervalTime + listener.lastRetryInterval > maxIntervalTime ? maxIntervalTime : intervalTime + listener.lastRetryInterval;
|
|
||||||
});
|
|
||||||
_defineProperty(this, "doEmit", function (topic, req, listenerId) {
|
|
||||||
var _this$ioIns, _this$ioIns$emit;
|
|
||||||
if (!_this.ioIns) {
|
|
||||||
_this.init();
|
|
||||||
}
|
|
||||||
//订阅过就不订阅了
|
|
||||||
var hasEmit = _this.listeners.find(function (v) {
|
|
||||||
return v['topic'] === topic && v['req'] === req && v['hasEmit'] !== EMITSTATE.NOT_CONNECT;
|
|
||||||
});
|
|
||||||
if (hasEmit) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var listener = _this.listeners.find(function (v) {
|
|
||||||
return v['topic'] === topic && v['req'] === req;
|
|
||||||
});
|
|
||||||
listener['hasEmit'] = EMITSTATE.WAITING;
|
|
||||||
(_this$ioIns = _this.ioIns) === null || _this$ioIns === void 0 || (_this$ioIns$emit = _this$ioIns.emit) === null || _this$ioIns$emit === void 0 || _this$ioIns$emit.call(_this$ioIns, topic, req, function (data) {
|
|
||||||
var _this$ioIns2, _this$ioIns2$on;
|
|
||||||
console.info('emit', topic, req, data);
|
|
||||||
var suInfo = JSON.parse(data);
|
|
||||||
if (has(suInfo, 'Error.code')) {
|
|
||||||
if (suInfo.Error.code === 500) {
|
|
||||||
//后端出错
|
|
||||||
_this.retry(listener);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// console.debug('SUBSCRIBE', listenerId, topic, req, suInfo);
|
|
||||||
_this.subscribeListenerId.push(listenerId);
|
|
||||||
// debugger
|
|
||||||
//重新找一遍topic
|
|
||||||
var currentTopicIndex = _this.listeners.findIndex(function (v) {
|
|
||||||
return v['topic'] === topic && v['req'] === req && v['id'] === listenerId;
|
|
||||||
});
|
|
||||||
if (currentTopicIndex == -1) {
|
|
||||||
// 不存在说明listener取消了 直接反订阅
|
|
||||||
_this.ioIns.emit('UnSubscribe', JSON.stringify(suInfo), function (data) {
|
|
||||||
_this.unSubscribeListenerId.push(listenerId);
|
|
||||||
console.debug('UNSUBSCRIBE', listenerId, topic, req, data);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!suInfo['SubscribeID']) {
|
|
||||||
_this.listeners.splice(currentTopicIndex, 0);
|
|
||||||
} else {
|
|
||||||
_this.listeners[currentTopicIndex]['suInfo'] = suInfo;
|
|
||||||
_this.listeners[currentTopicIndex]['hasEmit'] = EMITSTATE.CONNECT;
|
|
||||||
}
|
|
||||||
(_this$ioIns2 = _this.ioIns) === null || _this$ioIns2 === void 0 || (_this$ioIns2$on = _this$ioIns2.on) === null || _this$ioIns2$on === void 0 || _this$ioIns2$on.call(_this$ioIns2, suInfo['SubscribeID'], function (data) {
|
|
||||||
console.info('on', suInfo['SubscribeID'], data);
|
|
||||||
try {
|
|
||||||
var socketData = JSON.parse(data);
|
|
||||||
if (has(socketData, 'Error.code')) {
|
|
||||||
if (socketData.Error.code === 500) {
|
|
||||||
//后端出错
|
|
||||||
_this.retry(listener);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var _ref = _this.listeners.find(function (v) {
|
|
||||||
return v['topic'] === topic && v['req'] === req;
|
|
||||||
}) || {},
|
|
||||||
_ref$handles = _ref.handles,
|
|
||||||
handles = _ref$handles === void 0 ? {} : _ref$handles;
|
|
||||||
Object.keys(handles).forEach(function (key) {
|
|
||||||
try {
|
|
||||||
//后面观察 为什么delete后在foreach
|
|
||||||
var func = handles[key];
|
|
||||||
if (!func) return;
|
|
||||||
func(socketData);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.debug('error', error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
_createClass(Channel, [{
|
|
||||||
key: "subscribe",
|
|
||||||
value: function subscribe(topic, req, handle) {
|
|
||||||
var handleId = uuidv4();
|
|
||||||
var listenerId = uuidv4();
|
|
||||||
var listener = this.listeners.find(function (v) {
|
|
||||||
return v['topic'] === topic && v['req'] === req;
|
|
||||||
});
|
|
||||||
if (listener) {
|
|
||||||
listener['handles'][handleId] = handle;
|
|
||||||
} else {
|
|
||||||
this.listeners.push({
|
|
||||||
topic: topic,
|
|
||||||
req: req,
|
|
||||||
suInfo: {},
|
|
||||||
id: listenerId,
|
|
||||||
hasEmit: EMITSTATE.NOT_CONNECT,
|
|
||||||
lastRetryInterval: initRetryTime,
|
|
||||||
handles: _defineProperty({}, "".concat(handleId), handle)
|
|
||||||
});
|
|
||||||
//未注册过 则去订阅
|
|
||||||
this.doEmit(topic, req, listenerId);
|
|
||||||
}
|
|
||||||
return this.unSubscribe.bind(this, topic, req, handleId, listenerId);
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
key: "unSubscribe",
|
|
||||||
value: function unSubscribe(topic, req, handleId, listenerId) {
|
|
||||||
var _this2 = this;
|
|
||||||
var listener = this.listeners.find(function (v) {
|
|
||||||
return v['topic'] === topic && v['req'] === req && v['id'] === listenerId;
|
|
||||||
});
|
|
||||||
var _ref2 = listener || {},
|
|
||||||
_ref2$handles = _ref2.handles,
|
|
||||||
handles = _ref2$handles === void 0 ? {} : _ref2$handles,
|
|
||||||
suInfo = _ref2.suInfo;
|
|
||||||
if (handles[handleId]) {
|
|
||||||
delete handles[handleId];
|
|
||||||
//如果没有其他订阅就删除
|
|
||||||
if (Object.keys(handles).length === 0) {
|
|
||||||
if (this.intervalId) {
|
|
||||||
clearTimeout(this.intervalId);
|
|
||||||
}
|
|
||||||
if (listener['hasEmit'] === EMITSTATE['CONNECT']) {
|
|
||||||
this.ioIns.emit('UnSubscribe', JSON.stringify(suInfo), function (data) {
|
|
||||||
_this2.unSubscribeListenerId.push(listenerId);
|
|
||||||
console.debug('UNSUBSCRIBE', listener['id'], topic, req, data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.listeners = this.listeners.filter(function (v) {
|
|
||||||
return !(v['topic'] === topic && v['req'] === req);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}]);
|
|
||||||
return Channel;
|
|
||||||
}(); //单例
|
|
||||||
var channelIns = new Channel();
|
|
||||||
//暴露实例 调试用
|
|
||||||
window.__channel__ = channelIns;
|
|
||||||
export default channelIns;
|
|
23
packages/biz/es/utils/constants.d.ts
vendored
23
packages/biz/es/utils/constants.d.ts
vendored
@ -1,23 +0,0 @@
|
|||||||
export declare const OBJECT_GRNER_THRESHOLD = 0.8;
|
|
||||||
export declare const OBJECT_AGE_TYPE_THRESHOLD = 0.5;
|
|
||||||
export declare const MODE_KEY = "test_mode";
|
|
||||||
export declare const SEARCH_IMG_COUNT = 10;
|
|
||||||
export declare const GLOBAL_IS_ITEM_NUMBER_SHOW = false;
|
|
||||||
export declare const publicPath = "hummingbird";
|
|
||||||
export declare const ENTER_CIRCLE = "MONITORTYPE_ENTER_CIRCLE";
|
|
||||||
export declare const OUT_CIRCLE = "MONITORTYPE_OUT_CIRCLE";
|
|
||||||
export declare const TEMP = "MONITORTYPE_TEMP";
|
|
||||||
export declare const GLOBAL_IS_BOX_VMS_SHOW = true;
|
|
||||||
export declare const BODY_SEARCH_THRESHOID = 0.45;
|
|
||||||
export declare const RECORD_VERSION = "3.0.0";
|
|
||||||
export declare const DeviceTab: {
|
|
||||||
EMPTY: number;
|
|
||||||
REAL_CAMERA: number;
|
|
||||||
PREPROCESS_CAMERA: number;
|
|
||||||
TAG_CAMERA: number;
|
|
||||||
HISTORY_VIDEO_GROUP: number;
|
|
||||||
VIRTUAL_CAMERA: number;
|
|
||||||
REAL_CAMERA_NOFACE: number;
|
|
||||||
REAL_CAMERA_ONLYFACE: number;
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: number;
|
|
||||||
};
|
|
@ -1,30 +0,0 @@
|
|||||||
export var OBJECT_GRNER_THRESHOLD = 0.8; //目标图判断性别阈值
|
|
||||||
export var OBJECT_AGE_TYPE_THRESHOLD = 0.5; //目标图判断年龄段阈值
|
|
||||||
export var MODE_KEY = 'test_mode';
|
|
||||||
//业务约定
|
|
||||||
export var SEARCH_IMG_COUNT = 10; //检索图片的最大个数
|
|
||||||
export var GLOBAL_IS_ITEM_NUMBER_SHOW = false; //是否展示索引
|
|
||||||
export var publicPath = 'hummingbird';
|
|
||||||
export var ENTER_CIRCLE = 'MONITORTYPE_ENTER_CIRCLE';
|
|
||||||
export var OUT_CIRCLE = 'MONITORTYPE_OUT_CIRCLE';
|
|
||||||
export var TEMP = 'MONITORTYPE_TEMP';
|
|
||||||
export var GLOBAL_IS_BOX_VMS_SHOW = true; //是否展示盒子vms
|
|
||||||
|
|
||||||
export var BODY_SEARCH_THRESHOID = 0.45; //形体检索阈值
|
|
||||||
export var RECORD_VERSION = '3.0.0'; //保存记录的版本号
|
|
||||||
|
|
||||||
export var DeviceTab = {
|
|
||||||
EMPTY: 0,
|
|
||||||
REAL_CAMERA: 1,
|
|
||||||
PREPROCESS_CAMERA: 2,
|
|
||||||
//摄像头列表
|
|
||||||
TAG_CAMERA: 3,
|
|
||||||
//预案列表
|
|
||||||
HISTORY_VIDEO_GROUP: 4,
|
|
||||||
//录像回放
|
|
||||||
VIRTUAL_CAMERA: 5,
|
|
||||||
//离线视频
|
|
||||||
REAL_CAMERA_NOFACE: 6,
|
|
||||||
REAL_CAMERA_ONLYFACE: 7,
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: 8 // 只有普通摄像头,没有人脸、没有盒子、直连
|
|
||||||
};
|
|
@ -1,250 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/BigImageModal/BigImageModal.tsx
|
|
||||||
var BigImageModal_exports = {};
|
|
||||||
__export(BigImageModal_exports, {
|
|
||||||
componentPrefix: () => componentPrefix,
|
|
||||||
default: () => BigImageModal_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(BigImageModal_exports);
|
|
||||||
var import_react = __toESM(require("react"));
|
|
||||||
var import_meta = require("@zhst/meta");
|
|
||||||
var import_classnames = __toESM(require("classnames"));
|
|
||||||
var import_func = require("@zhst/func");
|
|
||||||
var import_index = require("./index.less");
|
|
||||||
var import_navigation = __toESM(require("./components/navigation"));
|
|
||||||
var import_CombineImage = __toESM(require("./components/CombineImage"));
|
|
||||||
var DescriptionsItem = import_meta.Descriptions.Item;
|
|
||||||
var componentPrefix = "zhst-image";
|
|
||||||
var initialStyle = {
|
|
||||||
fontSize: "12px"
|
|
||||||
};
|
|
||||||
var BigImageModal = (0, import_react.forwardRef)((props, ref) => {
|
|
||||||
var _a;
|
|
||||||
const {
|
|
||||||
// 配置
|
|
||||||
title = "-",
|
|
||||||
open,
|
|
||||||
children,
|
|
||||||
activeTab,
|
|
||||||
attributeList = [],
|
|
||||||
isRelated = false,
|
|
||||||
tabs = {},
|
|
||||||
footer = null,
|
|
||||||
showCarousel = true,
|
|
||||||
// 数据
|
|
||||||
dataSource = [],
|
|
||||||
// 总数据源,只允许有一份
|
|
||||||
imageData = [],
|
|
||||||
relatedData = [],
|
|
||||||
// 事件
|
|
||||||
onIndexChange,
|
|
||||||
onTabChange,
|
|
||||||
transformPropFunc
|
|
||||||
} = props;
|
|
||||||
const combineImageRef = (0, import_react.useRef)(null);
|
|
||||||
const bigImagePreviewRef = (0, import_react.useRef)(null);
|
|
||||||
const videoPlayerRef = (0, import_react.useRef)(null);
|
|
||||||
const modalRef = (0, import_react.useRef)(null);
|
|
||||||
const [tab, setTab] = (0, import_react.useState)(activeTab || (0, import_func.get)(tabsConfig, "data[0].key"));
|
|
||||||
const [activeKey, setActiveKey] = (0, import_react.useState)("related");
|
|
||||||
const [currentIndex, setCurrentIndex] = (0, import_react.useState)(0);
|
|
||||||
const tabsConfig = !(0, import_func.isEmpty)(tabs) ? tabs : {
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
label: "对比图模式",
|
|
||||||
key: "COMPATER",
|
|
||||||
children: /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_CombineImage.default,
|
|
||||||
{
|
|
||||||
ref: combineImageRef,
|
|
||||||
data: dataSource[currentIndex] || {}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "场景图模式",
|
|
||||||
key: "NORMAL",
|
|
||||||
children: /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_meta.BigImagePreview,
|
|
||||||
{
|
|
||||||
ref: bigImagePreviewRef,
|
|
||||||
height: "500px",
|
|
||||||
data: dataSource[currentIndex]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
(0, import_react.useEffect)(() => {
|
|
||||||
(async () => {
|
|
||||||
let data = {};
|
|
||||||
})();
|
|
||||||
}, [currentIndex, dataSource, imageData, isRelated]);
|
|
||||||
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
||||||
ref,
|
|
||||||
tab,
|
|
||||||
setTab,
|
|
||||||
modalRef,
|
|
||||||
activeKey,
|
|
||||||
setActiveKey,
|
|
||||||
videoPlayerRef,
|
|
||||||
combineImageRef,
|
|
||||||
bigImagePreviewRef
|
|
||||||
}));
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_meta.Modal,
|
|
||||||
{
|
|
||||||
destroyOnClose: true,
|
|
||||||
open,
|
|
||||||
ref: modalRef,
|
|
||||||
footer,
|
|
||||||
className: componentPrefix,
|
|
||||||
title,
|
|
||||||
...props
|
|
||||||
},
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
"div",
|
|
||||||
{
|
|
||||||
style: {
|
|
||||||
marginTop: "16px"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_meta.ConfigProvider,
|
|
||||||
{
|
|
||||||
theme: {
|
|
||||||
token: {
|
|
||||||
colorTextSecondary: "rgba(0,0,0,0.45)"
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
Descriptions: {
|
|
||||||
titleMarginBottom: "20px",
|
|
||||||
viewBg: "#f6f6f6",
|
|
||||||
titleColor: "rgba(0,0,0,0.45)",
|
|
||||||
colorTextLabel: "rgba(0,0,0,0.45)",
|
|
||||||
contentColor: "rgba(0,0,0,0.88)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
attributeList.map((descriptions) => {
|
|
||||||
var _a2;
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_meta.Descriptions,
|
|
||||||
{
|
|
||||||
key: descriptions.title,
|
|
||||||
title: /* @__PURE__ */ import_react.default.createElement("p", { style: { margin: "12px 0 0", fontSize: initialStyle.fontSize } }, descriptions.title),
|
|
||||||
column: 8,
|
|
||||||
style: { padding: "0 64px" }
|
|
||||||
},
|
|
||||||
(_a2 = descriptions == null ? void 0 : descriptions.children) == null ? void 0 : _a2.map((item) => /* @__PURE__ */ import_react.default.createElement(
|
|
||||||
DescriptionsItem,
|
|
||||||
{
|
|
||||||
key: item.key,
|
|
||||||
label: item.label,
|
|
||||||
span: 1,
|
|
||||||
contentStyle: { fontSize: initialStyle.fontSize },
|
|
||||||
labelStyle: { fontSize: initialStyle.fontSize }
|
|
||||||
},
|
|
||||||
item.children
|
|
||||||
))
|
|
||||||
);
|
|
||||||
})
|
|
||||||
),
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
"div",
|
|
||||||
{
|
|
||||||
className: (0, import_classnames.default)(`${componentPrefix}-view-container`)
|
|
||||||
},
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_meta.Tabs,
|
|
||||||
{
|
|
||||||
activeKey: tab,
|
|
||||||
centered: true,
|
|
||||||
destroyInactiveTabPane: true,
|
|
||||||
onChange: (v) => {
|
|
||||||
setTab((pre) => {
|
|
||||||
onTabChange == null ? void 0 : onTabChange(v, pre);
|
|
||||||
return v;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
tabBarStyle: { fontSize: "18px", fontWeight: "bold" },
|
|
||||||
items: tabsConfig.data,
|
|
||||||
...tabsConfig
|
|
||||||
}
|
|
||||||
),
|
|
||||||
tab === "VIDEO" && /* @__PURE__ */ import_react.default.createElement(import_meta.VideoPlayer, { ref: videoPlayerRef, url: (_a = dataSource[currentIndex]) == null ? void 0 : _a.flvUrl }),
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_navigation.default,
|
|
||||||
{
|
|
||||||
className: (0, import_classnames.default)(
|
|
||||||
`${componentPrefix}-view-container__nav`,
|
|
||||||
currentIndex <= 0 && `${componentPrefix}-view-container__nav--disabled`,
|
|
||||||
`${componentPrefix}-view-container__nav--left`
|
|
||||||
),
|
|
||||||
show: isRelated ? imageData.length > 1 : dataSource.length > 1,
|
|
||||||
disabled: currentIndex <= 0,
|
|
||||||
prev: true,
|
|
||||||
onClick: () => {
|
|
||||||
setCurrentIndex((pre) => {
|
|
||||||
onIndexChange == null ? void 0 : onIndexChange(pre - 1, pre);
|
|
||||||
return pre - 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
/* @__PURE__ */ import_react.default.createElement(
|
|
||||||
import_navigation.default,
|
|
||||||
{
|
|
||||||
className: (0, import_classnames.default)(
|
|
||||||
`${componentPrefix}-view-container__nav`,
|
|
||||||
(currentIndex >= imageData.length - 1 || currentIndex >= dataSource.length - 1) && `${componentPrefix}-view-container__nav--disabled`,
|
|
||||||
`${componentPrefix}-view-container__nav--right`
|
|
||||||
),
|
|
||||||
show: isRelated ? imageData.length > 1 : dataSource.length > 1,
|
|
||||||
disabled: currentIndex >= imageData.length - 1 || currentIndex >= dataSource.length - 1,
|
|
||||||
next: true,
|
|
||||||
onClick: async (e) => {
|
|
||||||
setCurrentIndex((pre) => {
|
|
||||||
onIndexChange == null ? void 0 : onIndexChange(pre + 1, pre);
|
|
||||||
return pre + 1;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
var BigImageModal_default = BigImageModal;
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
componentPrefix
|
|
||||||
});
|
|
@ -1,57 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/BigImageModal/components/navigation/index.tsx
|
|
||||||
var navigation_exports = {};
|
|
||||||
__export(navigation_exports, {
|
|
||||||
default: () => navigation_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(navigation_exports);
|
|
||||||
var React = __toESM(require("react"));
|
|
||||||
var import_classnames = __toESM(require("classnames"));
|
|
||||||
var import_meta = require("@zhst/meta");
|
|
||||||
var import_index = require("./index.less");
|
|
||||||
var componentName = `zhst-image__nav`;
|
|
||||||
var Navigation = (props) => {
|
|
||||||
const { show, prev, next, disabled, onClick, className, color } = props;
|
|
||||||
return /* @__PURE__ */ React.createElement(
|
|
||||||
"div",
|
|
||||||
{
|
|
||||||
className: (0, import_classnames.default)(
|
|
||||||
`${componentName}`,
|
|
||||||
prev && `${componentName}-prev`,
|
|
||||||
next && `${componentName}-next`,
|
|
||||||
disabled && `${componentName}--disable`,
|
|
||||||
!show && `${componentName}--hide`,
|
|
||||||
className
|
|
||||||
)
|
|
||||||
},
|
|
||||||
/* @__PURE__ */ React.createElement(import_meta.Button, { type: "text", disabled, onClick }, /* @__PURE__ */ React.createElement(import_meta.Icon, { size: 28, color, icon: prev ? "icon-qiehuanzuo" : "icon-qiehuanyou" }))
|
|
||||||
);
|
|
||||||
};
|
|
||||||
var navigation_default = Navigation;
|
|
@ -1,44 +0,0 @@
|
|||||||
.zhst-image__nav {
|
|
||||||
position: absolute;
|
|
||||||
display: flex;
|
|
||||||
width: 48px;
|
|
||||||
height: 100%;
|
|
||||||
flex-shrink: 0;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0;
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
& span {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:global {
|
|
||||||
i:hover {
|
|
||||||
color: #f0f0f0 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--disable {
|
|
||||||
:global {
|
|
||||||
i {
|
|
||||||
color: #f0f0f0;
|
|
||||||
cursor: not-allowed !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--hide {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-prev {
|
|
||||||
left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-next {
|
|
||||||
right: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
3
packages/biz/lib/BigImageModal/index.d.ts
vendored
3
packages/biz/lib/BigImageModal/index.d.ts
vendored
@ -1,3 +0,0 @@
|
|||||||
import BigImageModal from "./BigImageModal";
|
|
||||||
export type { BigImageModalProps } from './BigImageModal';
|
|
||||||
export default BigImageModal;
|
|
@ -1,36 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/BigImageModal/index.tsx
|
|
||||||
var BigImageModal_exports = {};
|
|
||||||
__export(BigImageModal_exports, {
|
|
||||||
default: () => BigImageModal_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(BigImageModal_exports);
|
|
||||||
var import_BigImageModal = __toESM(require("./BigImageModal"));
|
|
||||||
var BigImageModal_default = import_BigImageModal.default;
|
|
@ -1,514 +0,0 @@
|
|||||||
.zhst-image {
|
|
||||||
.zhst-dialog-content {
|
|
||||||
box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-tabs .zhst-tabs-nav-wrap {
|
|
||||||
background-color: #f6f6f6;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
&-view-container {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
|
|
||||||
&__nav {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 99;
|
|
||||||
top: 50%;
|
|
||||||
width: 40px !important;
|
|
||||||
height: 40px !important;
|
|
||||||
background: #d9d9d9;
|
|
||||||
border-radius: 100%;
|
|
||||||
cursor: pointer;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--disabled {
|
|
||||||
opacity: 0.3;
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__nav:hover {
|
|
||||||
background: #09f;
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-tool-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
margin-bottom: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__face-score {
|
|
||||||
position: absolute;
|
|
||||||
right: 90px;
|
|
||||||
bottom: 80px;
|
|
||||||
color: red;
|
|
||||||
font-family: 'Microsoft YaHei';
|
|
||||||
font-size: 19px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-carousel-container {
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
margin-top: 16px;
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.zhst-image__tool {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
&-split {
|
|
||||||
width: 0;
|
|
||||||
height: 14px;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
border-left: 1px solid #e6e7eb;
|
|
||||||
content: '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-zoom {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&> :not(:last-child) {
|
|
||||||
margin-right: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__scale {
|
|
||||||
display: inline-block;
|
|
||||||
width: 38px;
|
|
||||||
height: 14px;
|
|
||||||
|
|
||||||
// margin-left: 15px;
|
|
||||||
box-sizing: content-box;
|
|
||||||
border: 1px solid rgb(77 77 77 / 100%);
|
|
||||||
margin-top: 2px; //对齐
|
|
||||||
background: rgb(255 255 255 / 100%);
|
|
||||||
border-radius: 2px;
|
|
||||||
color: #4d4d4d;
|
|
||||||
cursor: default;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 14px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-switch {
|
|
||||||
display: flex;
|
|
||||||
width: 30px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
margin: 0 26px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-left {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
&> :not(:last-child) {
|
|
||||||
margin-right: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-right {
|
|
||||||
display: flex;
|
|
||||||
flex: 1;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-start;
|
|
||||||
|
|
||||||
&> :not(:first-child) {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&-icon-container {
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
&--active {
|
|
||||||
color: #5584ff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&> :first-child {
|
|
||||||
margin-right: 2px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__carousel {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
width: 742px;
|
|
||||||
height: 100px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border: 1px solid #f0f0f0;
|
|
||||||
margin: 0 auto;
|
|
||||||
background: #fafafa;
|
|
||||||
border-radius: 2px;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
&-container {
|
|
||||||
width: (58px + 8px) * 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item {
|
|
||||||
display: flex;
|
|
||||||
width: 58px + 8px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item-img {
|
|
||||||
/* 尝试消除transform 副作用 */
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
// width: 58px;
|
|
||||||
// height: 76px;
|
|
||||||
display: flex;
|
|
||||||
width: 66px;
|
|
||||||
height: 84px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #fafafa;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
/* 尝试消除transform 副作用 end */
|
|
||||||
&--active {
|
|
||||||
border: 2px solid #09f;
|
|
||||||
border-radius: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
/* 尝试消除transform 副作用 */
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
|
|
||||||
/* 尝试消除transform 副作用 end */
|
|
||||||
&>img {
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
object-fit: contain;
|
|
||||||
transition: all 0.2s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: scale(1.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__trackmodel {
|
|
||||||
&__panel {
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
width: 320px;
|
|
||||||
height: 100%;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
&--head {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
padding: 0 16px;
|
|
||||||
border-bottom: 1px solid #f0f0f0;
|
|
||||||
color: #333;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--track {
|
|
||||||
height: calc(100% - 40px);
|
|
||||||
}
|
|
||||||
|
|
||||||
&-date {
|
|
||||||
padding: 10px 6px;
|
|
||||||
|
|
||||||
// position: absolute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--bigImage {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 100;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
padding-top: 59px;
|
|
||||||
background: rgb(0 0 0 / 40%);
|
|
||||||
|
|
||||||
&--image {
|
|
||||||
width: 946px;
|
|
||||||
height: 532px;
|
|
||||||
|
|
||||||
&>img {
|
|
||||||
width: 946px;
|
|
||||||
height: 532px;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--close {
|
|
||||||
margin-left: 16px;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&__flooter {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 999;
|
|
||||||
bottom: -124px;
|
|
||||||
left: 0;
|
|
||||||
width: calc(100% - 320px - 10px);
|
|
||||||
height: 144px;
|
|
||||||
background: #fff;
|
|
||||||
box-shadow: 0 0 8px 0 rgb(172 172 172 / 50%);
|
|
||||||
|
|
||||||
&--head {
|
|
||||||
display: flex;
|
|
||||||
height: 20px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #f6f6f6;
|
|
||||||
color: #999;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--body {
|
|
||||||
display: flex;
|
|
||||||
height: calc(100% - 20px);
|
|
||||||
padding-left: 50px;
|
|
||||||
|
|
||||||
&__title {
|
|
||||||
color: #333;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__text {
|
|
||||||
overflow: hidden;
|
|
||||||
color: #333;
|
|
||||||
font-size: 12px;
|
|
||||||
line-height: 16px;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--left {
|
|
||||||
display: flex;
|
|
||||||
width: 75px;
|
|
||||||
height: 100;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&>img {
|
|
||||||
width: 75px;
|
|
||||||
height: 100px;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--middle {
|
|
||||||
display: grid;
|
|
||||||
width: 331px;
|
|
||||||
justify-content: flex-start;
|
|
||||||
padding: 8px 20px;
|
|
||||||
border-right: 1px solid #f0f0f0;
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--right {
|
|
||||||
display: grid;
|
|
||||||
width: calc(100% - 331px - 75px);
|
|
||||||
padding: 8px 20px;
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
&__button-list {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
margin-right: 20px;
|
|
||||||
|
|
||||||
&>span {
|
|
||||||
color: #09f !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
&>span {
|
|
||||||
color: #247fdb !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes close {
|
|
||||||
from {
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
bottom: -124px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes open {
|
|
||||||
from {
|
|
||||||
bottom: -124px;
|
|
||||||
}
|
|
||||||
|
|
||||||
to {
|
|
||||||
bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--close {
|
|
||||||
bottom: -124px;
|
|
||||||
animation-duration: 1s;
|
|
||||||
animation-name: close;
|
|
||||||
}
|
|
||||||
|
|
||||||
&--open {
|
|
||||||
bottom: 0;
|
|
||||||
animation-duration: 1s;
|
|
||||||
animation-name: open;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__attributePanel {
|
|
||||||
margin: 0 66px;
|
|
||||||
background: #f6f6f6;
|
|
||||||
margin-top: 20px;
|
|
||||||
padding-top: 16px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
&>div:first-child {
|
|
||||||
width: fit-content;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-title {
|
|
||||||
color: rgb(0 0 0 / 88%);
|
|
||||||
font-weight: bold;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item {
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-label {
|
|
||||||
color: rgb(0 0 0 / 45%);
|
|
||||||
}
|
|
||||||
|
|
||||||
&-value {
|
|
||||||
color: rgb(0 0 0 / 88%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedWrapper {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
padding: 0 30px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.relatedTabs {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedContent {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.relatedPics {
|
|
||||||
width: 742px;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
|
||||||
color: rgba(0, 0, 0, 25%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedBtn {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #09f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:global {
|
|
||||||
.ant-tabs-left>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane {
|
|
||||||
padding-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-tabs-tab {
|
|
||||||
padding: 8px 12px !important;
|
|
||||||
text-align: right !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-tabs .ant-tabs-tab {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: right;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,567 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/BigImageModal/mock.ts
|
|
||||||
var mock_exports = {};
|
|
||||||
__export(mock_exports, {
|
|
||||||
BIG_IMAGE_DATA: () => BIG_IMAGE_DATA,
|
|
||||||
IMAGE_DATA: () => IMAGE_DATA,
|
|
||||||
attributeList: () => attributeList
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(mock_exports);
|
|
||||||
var IMAGE_DATA = {
|
|
||||||
"enAbleDeleteFeature": true,
|
|
||||||
"tabsFilter": [
|
|
||||||
"COMPATER",
|
|
||||||
"NORMAL"
|
|
||||||
],
|
|
||||||
"selectIndex": 4,
|
|
||||||
"disableBtn": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
4,
|
|
||||||
20
|
|
||||||
],
|
|
||||||
"dataSource": [
|
|
||||||
{
|
|
||||||
"objectId": "1742110565582518272",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.7163062,
|
|
||||||
"timestamp": 1704186491979,
|
|
||||||
"deviceId": "129533",
|
|
||||||
"id": "129533",
|
|
||||||
"name": "4楼门口过道人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.125,
|
|
||||||
"latitude": 30.280500411987305,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742110565582518272",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129533",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742110532019697664",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704186491979",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 1920,
|
|
||||||
"originHeight": 1080,
|
|
||||||
"offsetTime": "24714687",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.603125,
|
|
||||||
"y": 0.3314815,
|
|
||||||
"w": 0.0578125,
|
|
||||||
"h": 0.2712963
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.546875,
|
|
||||||
"y": 0.2638889,
|
|
||||||
"w": 0.17135416,
|
|
||||||
"h": 0.40648147
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565603489792.jpg",
|
|
||||||
"confidence": 0.817271,
|
|
||||||
"sourceObjectId": "1742110565603489792",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 1,
|
|
||||||
"subObjectType": [
|
|
||||||
"OBJECT_TYPE_FACE"
|
|
||||||
],
|
|
||||||
"subObjectIds": [
|
|
||||||
"1742110532015503360"
|
|
||||||
],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"compaterImages": [
|
|
||||||
"http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"
|
|
||||||
],
|
|
||||||
"imgSummary": "singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565582518272.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565603489792.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129533",
|
|
||||||
"cameraName": "4楼门口过道人脸"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"objectId": "1742092680994764802",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.7007122,
|
|
||||||
"timestamp": 1704182225679,
|
|
||||||
"deviceId": "129533",
|
|
||||||
"id": "129533",
|
|
||||||
"name": "4楼门口过道人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.125,
|
|
||||||
"latitude": 30.280500411987305,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742092680994764802",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129533",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742092646219790337",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704182225679",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 1920,
|
|
||||||
"originHeight": 1080,
|
|
||||||
"offsetTime": "20448387",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.5265625,
|
|
||||||
"y": 0.49537036,
|
|
||||||
"w": 0.104166664,
|
|
||||||
"h": 0.35833332
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.465625,
|
|
||||||
"y": 0.40648147,
|
|
||||||
"w": 0.22708334,
|
|
||||||
"h": 0.537963
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092681720379392.jpg",
|
|
||||||
"confidence": 0.769764,
|
|
||||||
"sourceObjectId": "1742092681720379392",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 0,
|
|
||||||
"subObjectType": [],
|
|
||||||
"subObjectIds": [],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"compaterImages": [
|
|
||||||
"http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"
|
|
||||||
],
|
|
||||||
"imgSummary": "singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092681720379392.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129533",
|
|
||||||
"cameraName": "4楼门口过道人脸"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"objectId": "1742092514409592832",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.703765,
|
|
||||||
"timestamp": 1704182186451,
|
|
||||||
"deviceId": "129529",
|
|
||||||
"id": "129529",
|
|
||||||
"name": "4入口人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.12100219726562,
|
|
||||||
"latitude": 30.280099868774414,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742092514409592832",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129529",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742092482440607744",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704182186451",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 2560,
|
|
||||||
"originHeight": 1440,
|
|
||||||
"offsetTime": "20409182",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.6195313,
|
|
||||||
"y": 0.24583334,
|
|
||||||
"w": 0.09804688,
|
|
||||||
"h": 0.41944444
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.53515625,
|
|
||||||
"y": 0.14027777,
|
|
||||||
"w": 0.26640624,
|
|
||||||
"h": 0.63125
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092515508500480.jpg",
|
|
||||||
"confidence": 0.92494,
|
|
||||||
"sourceObjectId": "1742092515508500480",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 1,
|
|
||||||
"subObjectType": [
|
|
||||||
"OBJECT_TYPE_FACE"
|
|
||||||
],
|
|
||||||
"subObjectIds": [
|
|
||||||
"1742092482432219136"
|
|
||||||
],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"compaterImages": [
|
|
||||||
"http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"
|
|
||||||
],
|
|
||||||
"imgSummary": "singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092515508500480.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129529",
|
|
||||||
"cameraName": "4入口人脸"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"isArchiveDetail": false,
|
|
||||||
"ToolProps": {
|
|
||||||
"renderVideoBtn": true,
|
|
||||||
"disableVideo": false
|
|
||||||
},
|
|
||||||
"specialTitle": ""
|
|
||||||
};
|
|
||||||
var BIG_IMAGE_DATA = [
|
|
||||||
{
|
|
||||||
imageKey: "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894622934503424.jpg",
|
|
||||||
imgSummary: "http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
flvUrl: "ws://10.0.0.120:9033/flv/Sip/34020000001310000301.flv?ip=10.0.0.120&stime=1704815972&etime=1704815992",
|
|
||||||
compaterImages: [
|
|
||||||
"http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
"http://10.0.0.120:30003/file/public/public_20240117/file/dfdd3340-53c8-4dc4-9921-f13230aa0355.jpg"
|
|
||||||
],
|
|
||||||
odRect: {
|
|
||||||
"x": 0.5445312,
|
|
||||||
"y": 0.19166666,
|
|
||||||
"w": 0.08671875,
|
|
||||||
"h": 0.40138888
|
|
||||||
},
|
|
||||||
attachImg: [
|
|
||||||
{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894622695428096.jpg",
|
|
||||||
"label": "形体"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894588427964418.jpg",
|
|
||||||
"label": "人脸"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
score: "0.6",
|
|
||||||
// 人脸质量分
|
|
||||||
showScore: true,
|
|
||||||
// 人脸质量分
|
|
||||||
cameraPosition: "string",
|
|
||||||
// 摄像头位置
|
|
||||||
time: "2022-01-01",
|
|
||||||
// 摄像头拍摄时间
|
|
||||||
objects: [
|
|
||||||
{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746832189053474816",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"level": 0,
|
|
||||||
"confidence": 0.881164,
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705312223057",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.61418945,
|
|
||||||
"y": 0.34309354,
|
|
||||||
"w": 0.067661405,
|
|
||||||
"h": 0.34659258
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
imageKey: "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795581994436608.jpg",
|
|
||||||
imgSummary: "http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
odRect: {
|
|
||||||
"x": 0.553125,
|
|
||||||
"y": 0.29722223,
|
|
||||||
"w": 0.048958335,
|
|
||||||
"h": 0.2462963
|
|
||||||
},
|
|
||||||
attachImg: [
|
|
||||||
{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795581163964416.jpg",
|
|
||||||
"label": "形体"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795546867140608.jpg",
|
|
||||||
"label": "人脸"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
flvUrl: "ws://10.0.0.120:9033/flv/HaikangNvr/34.flv?ip=10.0.2.103&stime=1705302394&etime=1705302414",
|
|
||||||
score: 0.815207,
|
|
||||||
// 人脸质量分
|
|
||||||
showScore: true,
|
|
||||||
// 人脸质量分
|
|
||||||
cameraPosition: "string",
|
|
||||||
// 摄像头位置
|
|
||||||
time: "2022-01-01",
|
|
||||||
// 摄像头拍摄时间
|
|
||||||
objects: [
|
|
||||||
{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746816737430472704",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705308539109",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.5519352,
|
|
||||||
"y": 0.2965385,
|
|
||||||
"w": 0.05185461,
|
|
||||||
"h": 0.24698898
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746816737430472705",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"level": 0,
|
|
||||||
"confidence": 0.9310699,
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705308539109",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.58543766,
|
|
||||||
"y": 0.3203356,
|
|
||||||
"w": 0.052037954,
|
|
||||||
"h": 0.2664015
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
var attributeList = [
|
|
||||||
{
|
|
||||||
title: "人员属性",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
key: "1",
|
|
||||||
label: "性别",
|
|
||||||
children: "男"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "2",
|
|
||||||
label: "年龄",
|
|
||||||
children: "成年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "3",
|
|
||||||
label: "帽子",
|
|
||||||
children: "无"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "4",
|
|
||||||
label: "上身颜色",
|
|
||||||
children: "灰"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "5",
|
|
||||||
label: "下身颜色",
|
|
||||||
children: "蓝色"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "6",
|
|
||||||
label: "附着物",
|
|
||||||
children: "无"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "7",
|
|
||||||
label: "骑行",
|
|
||||||
children: "否"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "社区规范",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
key: "1",
|
|
||||||
label: "性别",
|
|
||||||
children: "男"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "2",
|
|
||||||
label: "年龄",
|
|
||||||
children: "成年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "3",
|
|
||||||
label: "帽子",
|
|
||||||
children: "无"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "4",
|
|
||||||
label: "上身颜色",
|
|
||||||
children: "灰"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "5",
|
|
||||||
label: "下身颜色",
|
|
||||||
children: "蓝色"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "6",
|
|
||||||
label: "附着物",
|
|
||||||
children: "无"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: "7",
|
|
||||||
label: "骑行",
|
|
||||||
children: "否"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
BIG_IMAGE_DATA,
|
|
||||||
IMAGE_DATA,
|
|
||||||
attributeList
|
|
||||||
});
|
|
@ -1,41 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/Demo/index.tsx
|
|
||||||
var Demo_exports = {};
|
|
||||||
__export(Demo_exports, {
|
|
||||||
default: () => Demo_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(Demo_exports);
|
|
||||||
var import_react = __toESM(require("react"));
|
|
||||||
var import_meta = require("@zhst/meta");
|
|
||||||
var import_hooks = require("@zhst/hooks");
|
|
||||||
var Demo_default = () => {
|
|
||||||
const { run } = (0, import_hooks.useThrottleFn)(() => console.log("123"));
|
|
||||||
return /* @__PURE__ */ import_react.default.createElement(import_meta.Button, { onClick: () => run() }, "测试");
|
|
||||||
};
|
|
@ -1,45 +0,0 @@
|
|||||||
import { Dayjs as Moment } from 'dayjs';
|
|
||||||
export declare const getDefaultRadius: () => number;
|
|
||||||
export declare const setDefaultRadius: (radius: number) => void;
|
|
||||||
export declare const setSearchIntervalDuration: (duration: number) => void;
|
|
||||||
export declare const getSearchIntervalDuration: (time: number) => number;
|
|
||||||
export declare const operateTrackById: (smartTrackId: number, operationType: OperationType) => Promise<void>;
|
|
||||||
export declare const deleteTrackById: (smartTrackId: number) => Promise<void>;
|
|
||||||
export declare const modifyTrackImgs: (smartTrackId: number, images: Array<Object>) => Promise<void>;
|
|
||||||
export declare const modifyTrackConf: (conf: any, smartTrackId: number) => Promise<void>;
|
|
||||||
export declare const getTrackTaskById: (smartTrackId?: number) => Promise<any>;
|
|
||||||
export declare const getTackDetailInfo: (smartTrackId?: number) => Promise<any>;
|
|
||||||
export declare const getTaskCameraByCenterAndPower: (value: {
|
|
||||||
taskPower: {
|
|
||||||
facePower: number;
|
|
||||||
bodyPower: number;
|
|
||||||
};
|
|
||||||
cameraInfos: Array<Object>;
|
|
||||||
center: [number, number];
|
|
||||||
}) => Promise<Object[]>;
|
|
||||||
/**创建追踪任务 */
|
|
||||||
export declare const createIntelligentTrack: (value: {
|
|
||||||
images: Array<Object>;
|
|
||||||
deviceIds: Array<string>;
|
|
||||||
circleCenter: [number, number];
|
|
||||||
model: number;
|
|
||||||
circleRadius: number;
|
|
||||||
facePower?: number;
|
|
||||||
bodyPower?: number;
|
|
||||||
historyTime?: [Moment, Moment];
|
|
||||||
topping?: boolean;
|
|
||||||
}) => Promise<any>;
|
|
||||||
export declare const emitHeartbeat: (smartTrackId: number) => Promise<void>;
|
|
||||||
export declare const ModifyTrackCameras: (value: {
|
|
||||||
smartTrackId: number;
|
|
||||||
deviceIds: Array<number>;
|
|
||||||
centerPoint: [number, number];
|
|
||||||
}) => Promise<void>;
|
|
||||||
export declare const setIntelligentTrackCircleInfo: (smartTrackId: number, circleCenter: [number, number]) => Promise<void>;
|
|
||||||
export declare const getTackCameraInfo: (value: {
|
|
||||||
circleCenter: [Moment, Moment];
|
|
||||||
radius: number;
|
|
||||||
zoom: number;
|
|
||||||
}) => Promise<any>;
|
|
||||||
export declare const getCameraInfoByCircle: (circleCenter: any, radius: any, zoom?: number) => Promise<any>;
|
|
||||||
export declare const taskInfoToSearchItem: (taskInfo: any) => any[];
|
|
@ -1,371 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/hooks/useIntelligentTracking/index.tsx
|
|
||||||
var useIntelligentTracking_exports = {};
|
|
||||||
__export(useIntelligentTracking_exports, {
|
|
||||||
ModifyTrackCameras: () => ModifyTrackCameras,
|
|
||||||
createIntelligentTrack: () => createIntelligentTrack,
|
|
||||||
deleteTrackById: () => deleteTrackById,
|
|
||||||
emitHeartbeat: () => emitHeartbeat,
|
|
||||||
getCameraInfoByCircle: () => getCameraInfoByCircle,
|
|
||||||
getDefaultRadius: () => getDefaultRadius,
|
|
||||||
getSearchIntervalDuration: () => getSearchIntervalDuration,
|
|
||||||
getTackCameraInfo: () => getTackCameraInfo,
|
|
||||||
getTackDetailInfo: () => getTackDetailInfo,
|
|
||||||
getTaskCameraByCenterAndPower: () => getTaskCameraByCenterAndPower,
|
|
||||||
getTrackTaskById: () => getTrackTaskById,
|
|
||||||
modifyTrackConf: () => modifyTrackConf,
|
|
||||||
modifyTrackImgs: () => modifyTrackImgs,
|
|
||||||
operateTrackById: () => operateTrackById,
|
|
||||||
setDefaultRadius: () => setDefaultRadius,
|
|
||||||
setIntelligentTrackCircleInfo: () => setIntelligentTrackCircleInfo,
|
|
||||||
setSearchIntervalDuration: () => setSearchIntervalDuration,
|
|
||||||
taskInfoToSearchItem: () => taskInfoToSearchItem
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(useIntelligentTracking_exports);
|
|
||||||
var turf = __toESM(require("@turf/turf"));
|
|
||||||
var import_useTaskState = require("../useTaskState");
|
|
||||||
var import_Tree = __toESM(require("@common/components/CameraTree/Tree"));
|
|
||||||
var import_request = __toESM(require("../../utils/request"));
|
|
||||||
var import_meta = require("@zhst/meta");
|
|
||||||
var import_utils = require("@common/components/CameraTree/utils");
|
|
||||||
var import_func = require("@zhst/func");
|
|
||||||
var defaultFaceThreshold = 0.68;
|
|
||||||
var defaultBodyThreshold = 0.7;
|
|
||||||
var defaultFaceResultNum = 5;
|
|
||||||
var defaultRadius = 0.15;
|
|
||||||
var defaultQueryCycle = 10;
|
|
||||||
var getDefaultRadius = () => {
|
|
||||||
return defaultRadius;
|
|
||||||
};
|
|
||||||
var setDefaultRadius = (radius) => {
|
|
||||||
defaultRadius = radius;
|
|
||||||
};
|
|
||||||
var searchIntervalDuration = 10;
|
|
||||||
var setSearchIntervalDuration = (duration) => {
|
|
||||||
searchIntervalDuration = duration;
|
|
||||||
};
|
|
||||||
var getSearchIntervalDuration = (time) => {
|
|
||||||
return time;
|
|
||||||
};
|
|
||||||
var operateTrackById = async (smartTrackId, operationType) => {
|
|
||||||
try {
|
|
||||||
const data = {
|
|
||||||
operationType,
|
|
||||||
smartTrackId
|
|
||||||
};
|
|
||||||
await (0, import_request.default)({
|
|
||||||
method: "PUT",
|
|
||||||
url: "/singer.SmartTrackService/OperationSmartTrack",
|
|
||||||
data
|
|
||||||
});
|
|
||||||
import_meta.message.success("操作成功");
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
import_meta.message.success("操作失败");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var deleteTrackById = async (smartTrackId) => {
|
|
||||||
try {
|
|
||||||
await (0, import_request.default)({
|
|
||||||
method: "DELETE",
|
|
||||||
url: "/singer.SmartTrackService/DeleteSmartTrack",
|
|
||||||
data: {
|
|
||||||
smartTrackId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var modifyTrackImgs = async (smartTrackId, images) => {
|
|
||||||
try {
|
|
||||||
await (0, import_request.default)({
|
|
||||||
method: "PUT",
|
|
||||||
url: "/singer.SmartTrackService/ModifyTrackImg",
|
|
||||||
data: {
|
|
||||||
images,
|
|
||||||
smartTrackId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.log("err", err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var modifyTrackConf = async (conf, smartTrackId) => {
|
|
||||||
try {
|
|
||||||
await (0, import_request.default)({
|
|
||||||
method: "PUT",
|
|
||||||
url: "/singer.SmartTrackService/ModifyTrackConf",
|
|
||||||
data: {
|
|
||||||
conf,
|
|
||||||
smartTrackId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.log("err", err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var getTrackTaskById = async (smartTrackId = 0) => {
|
|
||||||
try {
|
|
||||||
const data = smartTrackId ? {
|
|
||||||
smartTrackId
|
|
||||||
} : {};
|
|
||||||
let req = await (0, import_request.default)({
|
|
||||||
method: "POST",
|
|
||||||
url: "/singer.SmartTrackService/GetSmartTrack",
|
|
||||||
data
|
|
||||||
});
|
|
||||||
return req;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var getTackDetailInfo = async (smartTrackId = 0) => {
|
|
||||||
const data = smartTrackId ? {
|
|
||||||
smartTrackId
|
|
||||||
} : {};
|
|
||||||
let req = await (0, import_request.default)({
|
|
||||||
method: "POST",
|
|
||||||
url: "/singer.SmartTrackService/GetTrackOverView",
|
|
||||||
data
|
|
||||||
});
|
|
||||||
return req;
|
|
||||||
};
|
|
||||||
var getTaskCameraByCenterAndPower = async (value) => {
|
|
||||||
let realCameraInfos = value["cameraInfos"];
|
|
||||||
let realPreprocessInfos = [];
|
|
||||||
if (!(0, import_func.isEmpty)(realCameraInfos)) {
|
|
||||||
const { taskStatus } = await (0, import_useTaskState.getListTaskStatus)();
|
|
||||||
realPreprocessInfos = (0, import_useTaskState.getCameraStatusFunc)(taskStatus);
|
|
||||||
}
|
|
||||||
const runRealCameraInfos = [];
|
|
||||||
realCameraInfos = realCameraInfos.filter((v) => {
|
|
||||||
if (import_Tree.default.judgeOccupyPowerById(v["id"], realPreprocessInfos)) {
|
|
||||||
runRealCameraInfos.push(v);
|
|
||||||
}
|
|
||||||
return !import_Tree.default.judgeOccupyPowerById(v["id"], realPreprocessInfos);
|
|
||||||
});
|
|
||||||
let from = turf.point(value["center"]);
|
|
||||||
if (realCameraInfos.length > value["taskPower"]["bodyPower"]) {
|
|
||||||
realCameraInfos.map((v) => {
|
|
||||||
let dis = turf.distance(from, turf.point([v["longitude"], v["latitude"]]));
|
|
||||||
return {
|
|
||||||
...v,
|
|
||||||
dis
|
|
||||||
};
|
|
||||||
}).sort((a, b) => {
|
|
||||||
return a - b;
|
|
||||||
});
|
|
||||||
realCameraInfos = realCameraInfos.slice(0, value["taskPower"]["bodyPower"]);
|
|
||||||
}
|
|
||||||
return [...runRealCameraInfos, ...realCameraInfos];
|
|
||||||
};
|
|
||||||
var createIntelligentTrack = async (value) => {
|
|
||||||
const data = {
|
|
||||||
images: value["images"],
|
|
||||||
type: value["model"],
|
|
||||||
normalComputerPower: value["bodyPower"] || 0,
|
|
||||||
faceComputerPower: value["facePower"] || 0,
|
|
||||||
// deviceIds: ['129537'],
|
|
||||||
deviceIds: value["deviceIds"],
|
|
||||||
conf: {
|
|
||||||
faceThreshold: defaultFaceThreshold,
|
|
||||||
bodyThreshold: defaultBodyThreshold,
|
|
||||||
faceResultNum: defaultFaceResultNum,
|
|
||||||
radius: value["circleRadius"] * 1e3,
|
|
||||||
queryCycle: defaultQueryCycle
|
|
||||||
},
|
|
||||||
centerConf: {
|
|
||||||
centerX: value["circleCenter"][0],
|
|
||||||
centerY: value["circleCenter"][1]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
const res = await (0, import_request.default)({
|
|
||||||
method: "PUT",
|
|
||||||
url: "/singer.SmartTrackService/CreateSmartTrack",
|
|
||||||
data
|
|
||||||
});
|
|
||||||
return res;
|
|
||||||
};
|
|
||||||
var emitHeartbeat = async (smartTrackId) => {
|
|
||||||
try {
|
|
||||||
await (0, import_request.default)({
|
|
||||||
method: "POST",
|
|
||||||
url: "/singer.SmartTrackService/SmartTrackHeartBeat",
|
|
||||||
data: {
|
|
||||||
smartTrackId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var ModifyTrackCameras = async (value) => {
|
|
||||||
try {
|
|
||||||
await setIntelligentTrackCircleInfo(value["smartTrackId"], value["centerPoint"]);
|
|
||||||
await (0, import_request.default)({
|
|
||||||
url: "/singer.SmartTrackService/ModifyTrackCameras",
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
smartTrackId: value["smartTrackId"],
|
|
||||||
deviceIds: value["deviceIds"]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
import_meta.message.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var setIntelligentTrackCircleInfo = async (smartTrackId, circleCenter) => {
|
|
||||||
try {
|
|
||||||
await (0, import_request.default)({
|
|
||||||
url: "/singer.SmartTrackService/ModifyTrackScopeConf",
|
|
||||||
method: "PUT",
|
|
||||||
data: {
|
|
||||||
smartTrackId,
|
|
||||||
centerConf: {
|
|
||||||
centerX: (0, import_func.get)(circleCenter, "0"),
|
|
||||||
centerY: (0, import_func.get)(circleCenter, "1")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
import_meta.message.error(err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var getTackCameraInfo = async (value) => {
|
|
||||||
let circleCameraInfos = await getCameraInfoByCircle(
|
|
||||||
value["circleCenter"],
|
|
||||||
value["radius"],
|
|
||||||
value["zoom"]
|
|
||||||
);
|
|
||||||
return circleCameraInfos;
|
|
||||||
};
|
|
||||||
var getCameraInfoByCircle = async (circleCenter, radius, zoom = 16) => {
|
|
||||||
try {
|
|
||||||
let centerFeature = turf.circle(turf.point(circleCenter), radius, {
|
|
||||||
units: "kilometers",
|
|
||||||
steps: 64
|
|
||||||
});
|
|
||||||
let minx = 0;
|
|
||||||
let maxx = 0;
|
|
||||||
let miny = 0;
|
|
||||||
let maxy = 0;
|
|
||||||
for (let i = 0; i < 4; i++) {
|
|
||||||
let point2 = turf.destination(turf.point(circleCenter), radius, 90 * i, {
|
|
||||||
units: "kilometers"
|
|
||||||
}).geometry.coordinates;
|
|
||||||
if (point2[0] < minx || minx === 0) {
|
|
||||||
minx = point2[0];
|
|
||||||
}
|
|
||||||
if (point2[0] > maxx || maxx === 0) {
|
|
||||||
maxx = point2[0];
|
|
||||||
}
|
|
||||||
if (point2[1] < miny || miny === 0) {
|
|
||||||
miny = point2[1];
|
|
||||||
}
|
|
||||||
if (point2[1] > maxy || maxy === 0) {
|
|
||||||
maxy = point2[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let { clusterPoint } = await (0, import_request.default)({
|
|
||||||
url: "/singer.DeviceService/GetClusters",
|
|
||||||
method: "POST",
|
|
||||||
data: {
|
|
||||||
northEast: { X: maxx, Y: maxy },
|
|
||||||
southWest: { X: minx, Y: miny },
|
|
||||||
zoom
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let cameraIds = [];
|
|
||||||
clusterPoint.forEach((v) => {
|
|
||||||
cameraIds.push(...v["cameraIDs"]);
|
|
||||||
});
|
|
||||||
const { cameras } = await (0, import_utils.SearchCamera)({
|
|
||||||
cameraId: cameraIds,
|
|
||||||
maxResults: cameraIds.length
|
|
||||||
});
|
|
||||||
const cameraInfos = cameras.filter((v) => {
|
|
||||||
let cameraPoint = turf.point([(0, import_func.get)(v, "longitude"), (0, import_func.get)(v, "latitude")]);
|
|
||||||
return turf.booleanPointInPolygon(cameraPoint, centerFeature);
|
|
||||||
});
|
|
||||||
return cameraInfos;
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var taskInfoToSearchItem = (taskInfo) => {
|
|
||||||
let imageList = [];
|
|
||||||
(0, import_func.get)(taskInfo, "images", []).forEach((v) => {
|
|
||||||
const url = (0, import_func.get)(v, "conds.0.srcImageUrl");
|
|
||||||
const objectId = (0, import_func.get)(v, "conds.0.featureInfo.objectId");
|
|
||||||
let imageItem = {
|
|
||||||
index: 0,
|
|
||||||
url,
|
|
||||||
objectId,
|
|
||||||
odRects: (0, import_func.get)(v, "conds").map((item) => {
|
|
||||||
return {
|
|
||||||
fileKey: (0, import_func.get)(item, "objectImageUrl"),
|
|
||||||
extendRect: {
|
|
||||||
algorithmVersion: (0, import_func.get)(item, "alg", ""),
|
|
||||||
...(0, import_func.get)(item, "rect", {})
|
|
||||||
},
|
|
||||||
rect: {
|
|
||||||
algorithmVersion: (0, import_func.get)(item, "alg", ""),
|
|
||||||
rect: (0, import_func.get)(item, "rect", {})
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})
|
|
||||||
};
|
|
||||||
imageList.push(imageItem);
|
|
||||||
});
|
|
||||||
return imageList;
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
ModifyTrackCameras,
|
|
||||||
createIntelligentTrack,
|
|
||||||
deleteTrackById,
|
|
||||||
emitHeartbeat,
|
|
||||||
getCameraInfoByCircle,
|
|
||||||
getDefaultRadius,
|
|
||||||
getSearchIntervalDuration,
|
|
||||||
getTackCameraInfo,
|
|
||||||
getTackDetailInfo,
|
|
||||||
getTaskCameraByCenterAndPower,
|
|
||||||
getTrackTaskById,
|
|
||||||
modifyTrackConf,
|
|
||||||
modifyTrackImgs,
|
|
||||||
operateTrackById,
|
|
||||||
setDefaultRadius,
|
|
||||||
setIntelligentTrackCircleInfo,
|
|
||||||
setSearchIntervalDuration,
|
|
||||||
taskInfoToSearchItem
|
|
||||||
});
|
|
5
packages/biz/lib/index.d.ts
vendored
5
packages/biz/lib/index.d.ts
vendored
@ -1,5 +0,0 @@
|
|||||||
export { default as BigImageModal } from './BigImageModal';
|
|
||||||
export { default as BoxSelectTree } from './boxSelectTree';
|
|
||||||
export { default as Tree } from './tree';
|
|
||||||
export { default as TreeTransfer } from './treeTransfer';
|
|
||||||
export { default as TreeTransferModal } from './treeTransferModal';
|
|
@ -1,51 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/index.tsx
|
|
||||||
var src_exports = {};
|
|
||||||
__export(src_exports, {
|
|
||||||
BigImageModal: () => import_BigImageModal.default,
|
|
||||||
BoxSelectTree: () => import_boxSelectTree.default,
|
|
||||||
Tree: () => import_tree.default,
|
|
||||||
TreeTransfer: () => import_treeTransfer.default,
|
|
||||||
TreeTransferModal: () => import_treeTransferModal.default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(src_exports);
|
|
||||||
var import_BigImageModal = __toESM(require("./BigImageModal"));
|
|
||||||
var import_boxSelectTree = __toESM(require("./boxSelectTree"));
|
|
||||||
var import_tree = __toESM(require("./tree"));
|
|
||||||
var import_treeTransfer = __toESM(require("./treeTransfer"));
|
|
||||||
var import_treeTransferModal = __toESM(require("./treeTransferModal"));
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
BigImageModal,
|
|
||||||
BoxSelectTree,
|
|
||||||
Tree,
|
|
||||||
TreeTransfer,
|
|
||||||
TreeTransferModal
|
|
||||||
});
|
|
@ -1,118 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/useSocket/index.ts
|
|
||||||
var useSocket_exports = {};
|
|
||||||
__export(useSocket_exports, {
|
|
||||||
SocketApi: () => SocketApi,
|
|
||||||
default: () => useSocket_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(useSocket_exports);
|
|
||||||
var import_react = require("react");
|
|
||||||
var import_func = require("@zhst/func");
|
|
||||||
var import_hooks = require("@zhst/hooks");
|
|
||||||
var import_ws = __toESM(require("./ws"));
|
|
||||||
var getSelf = (v) => v;
|
|
||||||
var SocketApi = {
|
|
||||||
CameraTaskStatue: "singer.DeviceService/SubScribeCameraTaskStatus",
|
|
||||||
DeviceStatus: "singer.TaskManagerService/SubscribeTaskStatus",
|
|
||||||
SubscribeSolutionDeploy: "singer.SolutionManagerService/SubscribeSolutionDeploy",
|
|
||||||
SubscribeTasksSummary: "singer.TaskManagerService/SubscribeTasksSummary",
|
|
||||||
MonitorSubscribeResult: "singer.MonitorService/MonitorSubscribeResult",
|
|
||||||
MonitorSubscribeStatus: "singer.MonitorService/MonitorSubscribeStatus",
|
|
||||||
SubscribeArchiveGroupUpload: "singer.ArchiveGroupService/CreateArchiveByImport",
|
|
||||||
SubscribeJointTask: "singer.JointTaskService/SubscribeJointTask",
|
|
||||||
SubscribeGroupFragment: "singer.VideoService/SubscribeVideoFragmentStatus",
|
|
||||||
// 监听视频分片状态变化,包括新建、删除、变化
|
|
||||||
SubscribeGroup: "singer.VideoService/SubscribeGroup",
|
|
||||||
// 监听视频分组状态变化,列表变化也通知
|
|
||||||
SubscribeStreamEvent: "singer.MediaManagerService/SubscribeStreamEvent"
|
|
||||||
// 监听视频分组状态变化,列表变化也通知
|
|
||||||
};
|
|
||||||
var useSocket_default = (topic, iterator = import_func.noop, opt) => {
|
|
||||||
const {
|
|
||||||
req = {},
|
|
||||||
throttle = 0,
|
|
||||||
beforeLoopTmp = getSelf,
|
|
||||||
shouldBreak = false,
|
|
||||||
forceRefresh,
|
|
||||||
close
|
|
||||||
} = opt || {};
|
|
||||||
const reqstring = (0, import_react.useMemo)(() => {
|
|
||||||
const newReq = {
|
|
||||||
...req,
|
|
||||||
extraHeaders: {
|
|
||||||
authorization: localStorage.getItem("USER-TOKEN")
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return JSON.stringify(newReq);
|
|
||||||
}, [req]);
|
|
||||||
const latestIterator = (0, import_hooks.useLatest)(iterator);
|
|
||||||
(0, import_hooks.useDeepEffect)(() => {
|
|
||||||
if (close) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (shouldBreak) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let tmpData = [];
|
|
||||||
const throttleUpdate = (0, import_func.throttle)(() => {
|
|
||||||
if (tmpData.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const _tmpData = beforeLoopTmp(tmpData);
|
|
||||||
latestIterator.current(_tmpData);
|
|
||||||
tmpData = [];
|
|
||||||
}, throttle);
|
|
||||||
const unSubscribe = import_ws.default.subscribe(SocketApi[topic], reqstring, (socketData) => {
|
|
||||||
try {
|
|
||||||
if (!throttle) {
|
|
||||||
latestIterator.current(socketData);
|
|
||||||
} else {
|
|
||||||
tmpData.push(socketData);
|
|
||||||
throttleUpdate();
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("useSocke:", error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return () => {
|
|
||||||
try {
|
|
||||||
unSubscribe();
|
|
||||||
throttleUpdate.cancel();
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}, [topic, reqstring, shouldBreak, forceRefresh, close]);
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
SocketApi
|
|
||||||
});
|
|
2
packages/biz/lib/useSocket/onceChannel.d.ts
vendored
2
packages/biz/lib/useSocket/onceChannel.d.ts
vendored
@ -1,2 +0,0 @@
|
|||||||
declare const startChannel: (topic: any, req: any, callback: any) => () => void;
|
|
||||||
export default startChannel;
|
|
@ -1,51 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/useSocket/onceChannel.tsx
|
|
||||||
var onceChannel_exports = {};
|
|
||||||
__export(onceChannel_exports, {
|
|
||||||
default: () => onceChannel_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(onceChannel_exports);
|
|
||||||
var import_ws = __toESM(require("./ws"));
|
|
||||||
var startChannel = (topic, req, callback) => {
|
|
||||||
let reqstring = JSON.stringify({
|
|
||||||
...req,
|
|
||||||
extraHeaders: {
|
|
||||||
authorization: localStorage.getItem("USER-TOKEN")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let unSubscribe = import_ws.default.subscribe(topic, reqstring, (socketData) => {
|
|
||||||
let shouldStop = callback(socketData);
|
|
||||||
if (shouldStop) {
|
|
||||||
unSubscribe == null ? void 0 : unSubscribe();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return unSubscribe;
|
|
||||||
};
|
|
||||||
var onceChannel_default = startChannel;
|
|
26
packages/biz/lib/useSocket/ws.d.ts
vendored
26
packages/biz/lib/useSocket/ws.d.ts
vendored
@ -1,26 +0,0 @@
|
|||||||
declare class Channel {
|
|
||||||
/**
|
|
||||||
* io 实例化对象
|
|
||||||
*/
|
|
||||||
ioIns: any;
|
|
||||||
/**
|
|
||||||
* 已存在的订阅列表
|
|
||||||
*/
|
|
||||||
listeners: never[];
|
|
||||||
/**
|
|
||||||
* 调试信息 记录订阅/反订阅次数
|
|
||||||
*/
|
|
||||||
subscribeListenerId: never[];
|
|
||||||
unSubscribeListenerId: never[];
|
|
||||||
init: () => void;
|
|
||||||
retry: (listener: {
|
|
||||||
[x: string]: any;
|
|
||||||
lastRetryInterval: number | undefined;
|
|
||||||
intervalId: NodeJS.Timeout;
|
|
||||||
} | undefined) => void;
|
|
||||||
doEmit: (topic: any, req: any, listenerId: any) => void;
|
|
||||||
subscribe(topic: any, req: any, handle: any): () => void;
|
|
||||||
unSubscribe(topic: any, req: any, handleId: any, listenerId: any): void;
|
|
||||||
}
|
|
||||||
declare const channelIns: Channel;
|
|
||||||
export default channelIns;
|
|
@ -1,224 +0,0 @@
|
|||||||
var __create = Object.create;
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __getProtoOf = Object.getPrototypeOf;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
||||||
// If the importer is in node compatibility mode or this is not an ESM
|
|
||||||
// file that has been converted to a CommonJS file using a Babel-
|
|
||||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
||||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
||||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
||||||
mod
|
|
||||||
));
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/useSocket/ws.ts
|
|
||||||
var ws_exports = {};
|
|
||||||
__export(ws_exports, {
|
|
||||||
default: () => ws_default
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(ws_exports);
|
|
||||||
var import_uuid = require("uuid");
|
|
||||||
var import_func = require("@zhst/func");
|
|
||||||
var import_socket = __toESM(require("socket.io-client"));
|
|
||||||
var import_constants = require("@common/constants");
|
|
||||||
var EMITSTATE = {
|
|
||||||
NOT_CONNECT: 0,
|
|
||||||
WAITING: 1,
|
|
||||||
CONNECT: 2
|
|
||||||
};
|
|
||||||
var initRetryTime = 0;
|
|
||||||
var intervalTime = 5 * 1e3;
|
|
||||||
var maxIntervalTime = 1 * 60 * 60 * 1e3;
|
|
||||||
var Channel = class {
|
|
||||||
constructor() {
|
|
||||||
/**
|
|
||||||
* 已存在的订阅列表
|
|
||||||
*/
|
|
||||||
this.listeners = [
|
|
||||||
// {
|
|
||||||
// topic: "",
|
|
||||||
// req: "",
|
|
||||||
// suInfo: {},
|
|
||||||
// hasEmit: false,//是否已经订阅
|
|
||||||
// lastRetryInterval: 0,
|
|
||||||
// handles: {
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
];
|
|
||||||
/**
|
|
||||||
* 调试信息 记录订阅/反订阅次数
|
|
||||||
*/
|
|
||||||
this.subscribeListenerId = [];
|
|
||||||
this.unSubscribeListenerId = [];
|
|
||||||
this.init = () => {
|
|
||||||
const ioIns = this.ioIns = (0, import_socket.default)(import_constants.SOCKET_HOST, {
|
|
||||||
reconnection: true,
|
|
||||||
transports: ["websocket"],
|
|
||||||
forceNew: true
|
|
||||||
});
|
|
||||||
ioIns.on("connect", (...arg) => {
|
|
||||||
console.debug("connect", arg);
|
|
||||||
this.ioIns = ioIns;
|
|
||||||
this.listeners.forEach((v) => {
|
|
||||||
this.doEmit(v["topic"], v["req"], v["id"]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
ioIns.on("event", (...arg) => {
|
|
||||||
console.debug("event", arg);
|
|
||||||
});
|
|
||||||
ioIns.on("disconnect", (...arg) => {
|
|
||||||
console.debug("disconnect", arg);
|
|
||||||
this.subscribeListenerId = [];
|
|
||||||
this.unSubscribeListenerId = [];
|
|
||||||
});
|
|
||||||
ioIns.on("reconnect", (...arg) => {
|
|
||||||
console.debug("reconnect", arg);
|
|
||||||
this.listeners.forEach((v) => {
|
|
||||||
v["hasEmit"] = EMITSTATE.NOT_CONNECT;
|
|
||||||
this.doEmit(v["topic"], v["req"], v["id"]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
this.retry = (listener) => {
|
|
||||||
const intervalId = setTimeout(() => {
|
|
||||||
const hasExit = this.listeners.find(
|
|
||||||
(v) => v["topic"] === (listener == null ? void 0 : listener["topic"]) && v["req"] === listener["req"]
|
|
||||||
);
|
|
||||||
if (!hasExit)
|
|
||||||
return;
|
|
||||||
listener["hasEmit"] = EMITSTATE.NOT_CONNECT;
|
|
||||||
this.doEmit(listener["topic"], listener["req"], listener["id"]);
|
|
||||||
}, listener.lastRetryInterval);
|
|
||||||
listener.intervalId = intervalId;
|
|
||||||
listener.lastRetryInterval = intervalTime + listener.lastRetryInterval > maxIntervalTime ? maxIntervalTime : intervalTime + listener.lastRetryInterval;
|
|
||||||
};
|
|
||||||
this.doEmit = (topic, req, listenerId) => {
|
|
||||||
var _a, _b;
|
|
||||||
if (!this.ioIns) {
|
|
||||||
this.init();
|
|
||||||
}
|
|
||||||
const hasEmit = this.listeners.find(
|
|
||||||
(v) => v["topic"] === topic && v["req"] === req && v["hasEmit"] !== EMITSTATE.NOT_CONNECT
|
|
||||||
);
|
|
||||||
if (hasEmit) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const listener = this.listeners.find((v) => v["topic"] === topic && v["req"] === req);
|
|
||||||
listener["hasEmit"] = EMITSTATE.WAITING;
|
|
||||||
(_b = (_a = this.ioIns) == null ? void 0 : _a.emit) == null ? void 0 : _b.call(_a, topic, req, (data) => {
|
|
||||||
var _a2, _b2;
|
|
||||||
console.info("emit", topic, req, data);
|
|
||||||
const suInfo = JSON.parse(data);
|
|
||||||
if ((0, import_func.has)(suInfo, "Error.code")) {
|
|
||||||
if (suInfo.Error.code === 500) {
|
|
||||||
this.retry(listener);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.subscribeListenerId.push(listenerId);
|
|
||||||
const currentTopicIndex = this.listeners.findIndex(
|
|
||||||
(v) => v["topic"] === topic && v["req"] === req && v["id"] === listenerId
|
|
||||||
);
|
|
||||||
if (currentTopicIndex == -1) {
|
|
||||||
this.ioIns.emit("UnSubscribe", JSON.stringify(suInfo), (data2) => {
|
|
||||||
this.unSubscribeListenerId.push(listenerId);
|
|
||||||
console.debug("UNSUBSCRIBE", listenerId, topic, req, data2);
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!suInfo["SubscribeID"]) {
|
|
||||||
this.listeners.splice(currentTopicIndex, 0);
|
|
||||||
} else {
|
|
||||||
this.listeners[currentTopicIndex]["suInfo"] = suInfo;
|
|
||||||
this.listeners[currentTopicIndex]["hasEmit"] = EMITSTATE.CONNECT;
|
|
||||||
}
|
|
||||||
(_b2 = (_a2 = this.ioIns) == null ? void 0 : _a2.on) == null ? void 0 : _b2.call(_a2, suInfo["SubscribeID"], (data2) => {
|
|
||||||
console.info("on", suInfo["SubscribeID"], data2);
|
|
||||||
try {
|
|
||||||
const socketData = JSON.parse(data2);
|
|
||||||
if ((0, import_func.has)(socketData, "Error.code")) {
|
|
||||||
if (socketData.Error.code === 500) {
|
|
||||||
this.retry(listener);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const { handles = {} } = this.listeners.find((v) => v["topic"] === topic && v["req"] === req) || {};
|
|
||||||
Object.keys(handles).forEach((key) => {
|
|
||||||
try {
|
|
||||||
const func = handles[key];
|
|
||||||
if (!func)
|
|
||||||
return;
|
|
||||||
func(socketData);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (error) {
|
|
||||||
console.debug("error", error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
}
|
|
||||||
subscribe(topic, req, handle) {
|
|
||||||
const handleId = (0, import_uuid.v4)();
|
|
||||||
const listenerId = (0, import_uuid.v4)();
|
|
||||||
const listener = this.listeners.find((v) => v["topic"] === topic && v["req"] === req);
|
|
||||||
if (listener) {
|
|
||||||
listener["handles"][handleId] = handle;
|
|
||||||
} else {
|
|
||||||
this.listeners.push({
|
|
||||||
topic,
|
|
||||||
req,
|
|
||||||
suInfo: {},
|
|
||||||
id: listenerId,
|
|
||||||
hasEmit: EMITSTATE.NOT_CONNECT,
|
|
||||||
lastRetryInterval: initRetryTime,
|
|
||||||
handles: {
|
|
||||||
[`${handleId}`]: handle
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.doEmit(topic, req, listenerId);
|
|
||||||
}
|
|
||||||
return this.unSubscribe.bind(this, topic, req, handleId, listenerId);
|
|
||||||
}
|
|
||||||
unSubscribe(topic, req, handleId, listenerId) {
|
|
||||||
const listener = this.listeners.find(
|
|
||||||
(v) => v["topic"] === topic && v["req"] === req && v["id"] === listenerId
|
|
||||||
);
|
|
||||||
const { handles = {}, suInfo } = listener || {};
|
|
||||||
if (handles[handleId]) {
|
|
||||||
delete handles[handleId];
|
|
||||||
if (Object.keys(handles).length === 0) {
|
|
||||||
if (this.intervalId) {
|
|
||||||
clearTimeout(this.intervalId);
|
|
||||||
}
|
|
||||||
if (listener["hasEmit"] === EMITSTATE["CONNECT"]) {
|
|
||||||
this.ioIns.emit("UnSubscribe", JSON.stringify(suInfo), (data) => {
|
|
||||||
this.unSubscribeListenerId.push(listenerId);
|
|
||||||
console.debug("UNSUBSCRIBE", listener["id"], topic, req, data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.listeners = this.listeners.filter((v) => !(v["topic"] === topic && v["req"] === req));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
var channelIns = new Channel();
|
|
||||||
window.__channel__ = channelIns;
|
|
||||||
var ws_default = channelIns;
|
|
23
packages/biz/lib/utils/constants.d.ts
vendored
23
packages/biz/lib/utils/constants.d.ts
vendored
@ -1,23 +0,0 @@
|
|||||||
export declare const OBJECT_GRNER_THRESHOLD = 0.8;
|
|
||||||
export declare const OBJECT_AGE_TYPE_THRESHOLD = 0.5;
|
|
||||||
export declare const MODE_KEY = "test_mode";
|
|
||||||
export declare const SEARCH_IMG_COUNT = 10;
|
|
||||||
export declare const GLOBAL_IS_ITEM_NUMBER_SHOW = false;
|
|
||||||
export declare const publicPath = "hummingbird";
|
|
||||||
export declare const ENTER_CIRCLE = "MONITORTYPE_ENTER_CIRCLE";
|
|
||||||
export declare const OUT_CIRCLE = "MONITORTYPE_OUT_CIRCLE";
|
|
||||||
export declare const TEMP = "MONITORTYPE_TEMP";
|
|
||||||
export declare const GLOBAL_IS_BOX_VMS_SHOW = true;
|
|
||||||
export declare const BODY_SEARCH_THRESHOID = 0.45;
|
|
||||||
export declare const RECORD_VERSION = "3.0.0";
|
|
||||||
export declare const DeviceTab: {
|
|
||||||
EMPTY: number;
|
|
||||||
REAL_CAMERA: number;
|
|
||||||
PREPROCESS_CAMERA: number;
|
|
||||||
TAG_CAMERA: number;
|
|
||||||
HISTORY_VIDEO_GROUP: number;
|
|
||||||
VIRTUAL_CAMERA: number;
|
|
||||||
REAL_CAMERA_NOFACE: number;
|
|
||||||
REAL_CAMERA_ONLYFACE: number;
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: number;
|
|
||||||
};
|
|
@ -1,80 +0,0 @@
|
|||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/utils/constants.ts
|
|
||||||
var constants_exports = {};
|
|
||||||
__export(constants_exports, {
|
|
||||||
BODY_SEARCH_THRESHOID: () => BODY_SEARCH_THRESHOID,
|
|
||||||
DeviceTab: () => DeviceTab,
|
|
||||||
ENTER_CIRCLE: () => ENTER_CIRCLE,
|
|
||||||
GLOBAL_IS_BOX_VMS_SHOW: () => GLOBAL_IS_BOX_VMS_SHOW,
|
|
||||||
GLOBAL_IS_ITEM_NUMBER_SHOW: () => GLOBAL_IS_ITEM_NUMBER_SHOW,
|
|
||||||
MODE_KEY: () => MODE_KEY,
|
|
||||||
OBJECT_AGE_TYPE_THRESHOLD: () => OBJECT_AGE_TYPE_THRESHOLD,
|
|
||||||
OBJECT_GRNER_THRESHOLD: () => OBJECT_GRNER_THRESHOLD,
|
|
||||||
OUT_CIRCLE: () => OUT_CIRCLE,
|
|
||||||
RECORD_VERSION: () => RECORD_VERSION,
|
|
||||||
SEARCH_IMG_COUNT: () => SEARCH_IMG_COUNT,
|
|
||||||
TEMP: () => TEMP,
|
|
||||||
publicPath: () => publicPath
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(constants_exports);
|
|
||||||
var OBJECT_GRNER_THRESHOLD = 0.8;
|
|
||||||
var OBJECT_AGE_TYPE_THRESHOLD = 0.5;
|
|
||||||
var MODE_KEY = "test_mode";
|
|
||||||
var SEARCH_IMG_COUNT = 10;
|
|
||||||
var GLOBAL_IS_ITEM_NUMBER_SHOW = false;
|
|
||||||
var publicPath = "hummingbird";
|
|
||||||
var ENTER_CIRCLE = "MONITORTYPE_ENTER_CIRCLE";
|
|
||||||
var OUT_CIRCLE = "MONITORTYPE_OUT_CIRCLE";
|
|
||||||
var TEMP = "MONITORTYPE_TEMP";
|
|
||||||
var GLOBAL_IS_BOX_VMS_SHOW = true;
|
|
||||||
var BODY_SEARCH_THRESHOID = 0.45;
|
|
||||||
var RECORD_VERSION = "3.0.0";
|
|
||||||
var DeviceTab = {
|
|
||||||
EMPTY: 0,
|
|
||||||
REAL_CAMERA: 1,
|
|
||||||
PREPROCESS_CAMERA: 2,
|
|
||||||
//摄像头列表
|
|
||||||
TAG_CAMERA: 3,
|
|
||||||
//预案列表
|
|
||||||
HISTORY_VIDEO_GROUP: 4,
|
|
||||||
//录像回放
|
|
||||||
VIRTUAL_CAMERA: 5,
|
|
||||||
//离线视频
|
|
||||||
REAL_CAMERA_NOFACE: 6,
|
|
||||||
REAL_CAMERA_ONLYFACE: 7,
|
|
||||||
REAL_CAMERA_NOFACE_NOBOX_NODIRECONNECT: 8
|
|
||||||
// 只有普通摄像头,没有人脸、没有盒子、直连
|
|
||||||
};
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
0 && (module.exports = {
|
|
||||||
BODY_SEARCH_THRESHOID,
|
|
||||||
DeviceTab,
|
|
||||||
ENTER_CIRCLE,
|
|
||||||
GLOBAL_IS_BOX_VMS_SHOW,
|
|
||||||
GLOBAL_IS_ITEM_NUMBER_SHOW,
|
|
||||||
MODE_KEY,
|
|
||||||
OBJECT_AGE_TYPE_THRESHOLD,
|
|
||||||
OBJECT_GRNER_THRESHOLD,
|
|
||||||
OUT_CIRCLE,
|
|
||||||
RECORD_VERSION,
|
|
||||||
SEARCH_IMG_COUNT,
|
|
||||||
TEMP,
|
|
||||||
publicPath
|
|
||||||
});
|
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@zhst/biz",
|
"name": "@zhst/biz",
|
||||||
"version": "0.6.0",
|
"version": "0.34.0",
|
||||||
"description": "业务库",
|
"description": "业务库",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"business",
|
"business",
|
||||||
@ -35,16 +35,20 @@
|
|||||||
"registry": "http://10.0.0.77:4874"
|
"registry": "http://10.0.0.77:4874"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/zhst": "workspace:^"
|
"@swc/core": "^1.3.9",
|
||||||
|
"@zhst/types": "workspace:^"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ant-design/icons": "^5.2.6",
|
"@ant-design/icons": "^5.2.6",
|
||||||
"@ant-design/pro-components": "^2.6.49",
|
"@ant-design/pro-components": "^2.6.49",
|
||||||
"@zhst/func": "workspace:^",
|
"@zhst/func": "workspace:^",
|
||||||
"@zhst/hooks": "workspace:^",
|
"@zhst/hooks": "workspace:^",
|
||||||
|
"@zhst/icon": "workspace:^",
|
||||||
"@zhst/meta": "workspace:^",
|
"@zhst/meta": "workspace:^",
|
||||||
"antd": "^5.12.5",
|
"antd": "^5.12.5",
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
"rc-util": "^5.38.1"
|
"dayjs": "^1.11.10",
|
||||||
|
"rc-util": "^5.38.1",
|
||||||
|
"react-infinite-scroll-component": "^6.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
304
packages/biz/src/BigImage/BigImage.tsx
Normal file
304
packages/biz/src/BigImage/BigImage.tsx
Normal file
@ -0,0 +1,304 @@
|
|||||||
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react'
|
||||||
|
import {
|
||||||
|
ConfigProvider,
|
||||||
|
Descriptions,
|
||||||
|
CropperImage,
|
||||||
|
AttachImage,
|
||||||
|
VideoPlayer,
|
||||||
|
RelatedImage,
|
||||||
|
Radio,
|
||||||
|
Tooltip,
|
||||||
|
Button,
|
||||||
|
Tabs
|
||||||
|
} from '@zhst/meta';
|
||||||
|
import classNames from 'classnames'
|
||||||
|
import { IconFont } from '@zhst/icon'
|
||||||
|
import { BigImageProps, BigImageRef } from './interface'
|
||||||
|
import CombineImage from './components/CombineImage'
|
||||||
|
import './index.less'
|
||||||
|
|
||||||
|
const DescriptionsItem = Descriptions.Item
|
||||||
|
|
||||||
|
export const componentPrefix = 'zhst-big-image'
|
||||||
|
|
||||||
|
const initialStyle ={
|
||||||
|
fontSize: '12px'
|
||||||
|
}
|
||||||
|
|
||||||
|
const BigImage = forwardRef<BigImageRef, BigImageProps>((props, ref) => {
|
||||||
|
const {
|
||||||
|
// ------------ 通用配置 -------------------
|
||||||
|
type,
|
||||||
|
viewHeight,
|
||||||
|
width = '100%',
|
||||||
|
children,
|
||||||
|
// ------------ 顶部按钮 -----------------
|
||||||
|
topButtonRender,
|
||||||
|
// ------------ 描述 -----------------
|
||||||
|
descriptionList = [],
|
||||||
|
showDescription,
|
||||||
|
// ------------- tab 导航 ----------------
|
||||||
|
customTabBarExtraContent,
|
||||||
|
tabProps,
|
||||||
|
onTabChange,
|
||||||
|
// ------------- 场景图 -------------
|
||||||
|
cropperImageProps = {
|
||||||
|
cropButtonList: []
|
||||||
|
},
|
||||||
|
// ----------------- 对比图 ---------------------
|
||||||
|
combineImageProps,
|
||||||
|
// ------------ 视频模式 -----------------
|
||||||
|
videoProps,
|
||||||
|
// ------------ view 操作按钮 -----------------
|
||||||
|
showModeChange,
|
||||||
|
modeButtonGroupProps,
|
||||||
|
viewTopModeButtonList = [
|
||||||
|
{
|
||||||
|
key: 'image',
|
||||||
|
label: '图片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'video',
|
||||||
|
label: '视频'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// ------------------ 翻页 ----------------------
|
||||||
|
showNavigation,
|
||||||
|
prevButtonProps,
|
||||||
|
onPrevButtonClick,
|
||||||
|
onNextButtonClick,
|
||||||
|
nextButtonProps,
|
||||||
|
// ------------------ 人脸碰撞模型 -----------------
|
||||||
|
relatedImageProps,
|
||||||
|
isRelated = false,
|
||||||
|
theme,
|
||||||
|
} = props
|
||||||
|
const combineImageRef = useRef<any>(null)
|
||||||
|
const videoPlayerRef = useRef<any>(null)
|
||||||
|
const cropperImageRef = useRef<any>(null)
|
||||||
|
|
||||||
|
cropperImageProps.cropButtonList = cropperImageProps?.cropButtonList || [
|
||||||
|
{
|
||||||
|
key: 'auto',
|
||||||
|
icon: <IconFont icon='icon-zidong' />,
|
||||||
|
label: '智能框选',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'custom',
|
||||||
|
icon: <IconFont icon='icon-shoudong' />,
|
||||||
|
label: '手动框选',
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// ------------------- 初始化模式 ----------------------
|
||||||
|
const initMode = (type: BigImageProps['type'] = 'normal') => {
|
||||||
|
switch (type) {
|
||||||
|
case 'compater':
|
||||||
|
return (
|
||||||
|
<CombineImage
|
||||||
|
// @ts-ignore
|
||||||
|
ref={combineImageRef}
|
||||||
|
height={viewHeight}
|
||||||
|
{...combineImageProps}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
case 'normal':
|
||||||
|
return (
|
||||||
|
<div style={{ height: viewHeight, width: '100%' }}>
|
||||||
|
<CropperImage
|
||||||
|
ref={cropperImageRef}
|
||||||
|
type='rect'
|
||||||
|
// @ts-ignore
|
||||||
|
height={viewHeight}
|
||||||
|
{...cropperImageProps}
|
||||||
|
>
|
||||||
|
{/* // ------------ 显示条件:当不为编辑状态,并且有图片值 ----------------- */}
|
||||||
|
{!cropperImageProps?.editAble && cropperImageProps?.attachImageData && (
|
||||||
|
<>
|
||||||
|
<AttachImage
|
||||||
|
data={cropperImageProps?.attachImageData}
|
||||||
|
{...cropperImageProps?.attachImageProps}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
right: '4px',
|
||||||
|
bottom: '4px',
|
||||||
|
fontSize: '18px',
|
||||||
|
color: 'red',
|
||||||
|
cursor: 'default'
|
||||||
|
}}
|
||||||
|
>{`人脸质量分:${(Number(cropperImageProps?.score) as number).toFixed(2)}`}</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{/* // ------------ 场景图绘制工具栏 ----------------- */}
|
||||||
|
{cropperImageProps?.showEditTools && (
|
||||||
|
<div className={`${componentPrefix}-view-cropper-btn`}>
|
||||||
|
<Radio.Group
|
||||||
|
className={`${componentPrefix}-view-cropper-btn-group`}
|
||||||
|
size="small"
|
||||||
|
buttonStyle='solid'
|
||||||
|
// @ts-ignore
|
||||||
|
onChange={cropperImageProps?.onCropperTypeChange}
|
||||||
|
{...cropperImageProps.btnGroupProps}
|
||||||
|
>
|
||||||
|
{cropperImageProps?.cropButtonList?.map(btn => (
|
||||||
|
<Tooltip key={btn.key} title={btn.label}>
|
||||||
|
{/* @ts-ignore */}
|
||||||
|
<Radio.Button value={btn.key}{...btn.props}><div className={`${componentPrefix}-view-cropper-btn-group-radio`}>{btn.icon} {btn.label}</div></Radio.Button>
|
||||||
|
</Tooltip>
|
||||||
|
))}
|
||||||
|
</Radio.Group>
|
||||||
|
<Button onClick={cropperImageProps?.onExitEdit} className={`${componentPrefix}-view-cropper-btn_close`} type="primary" size="small" icon={<IconFont icon="icon-danchuangguanbi" />} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</CropperImage>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
case 'video':
|
||||||
|
return (
|
||||||
|
// @ts-ignore
|
||||||
|
<VideoPlayer ref={videoPlayerRef} height={viewHeight} {...videoProps} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 暴露 ref 实例
|
||||||
|
useImperativeHandle(ref, () => ({
|
||||||
|
// @ts-ignore
|
||||||
|
cropperImageRef: cropperImageRef?.current,
|
||||||
|
videoPlayerRef: videoPlayerRef?.current,
|
||||||
|
combineImageRef: combineImageRef?.current,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={classNames(`${componentPrefix}-view`)}
|
||||||
|
style={{ width: `${parseInt(width as string)}px` }}
|
||||||
|
>
|
||||||
|
<div className={classNames(`${componentPrefix}-view-btns`)}>
|
||||||
|
{topButtonRender}
|
||||||
|
</div>
|
||||||
|
{showDescription && (
|
||||||
|
<div
|
||||||
|
className={classNames(`${componentPrefix}-view-desc`)}
|
||||||
|
>
|
||||||
|
<ConfigProvider
|
||||||
|
theme={{
|
||||||
|
components: {
|
||||||
|
Descriptions: {
|
||||||
|
viewBg: '#f6f6f6',
|
||||||
|
colorBgLayout:'#ccc',
|
||||||
|
titleColor: 'rgba(0,0,0,0.45)',
|
||||||
|
colorTextLabel: 'rgba(0,0,0,0.45)',
|
||||||
|
contentColor: 'rgba(0,0,0,0.88)',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...theme
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{descriptionList.map(descriptions => (
|
||||||
|
<Descriptions
|
||||||
|
key={descriptions.title}
|
||||||
|
title={descriptions.showTitle && descriptions.title}
|
||||||
|
column={8}
|
||||||
|
{...descriptions.props}
|
||||||
|
>
|
||||||
|
{descriptions?.children?.map(item => (
|
||||||
|
<DescriptionsItem
|
||||||
|
key={item.key}
|
||||||
|
label={item.label}
|
||||||
|
span={1}
|
||||||
|
contentStyle={{ fontSize: initialStyle.fontSize }}
|
||||||
|
labelStyle={{ fontSize: initialStyle.fontSize }}
|
||||||
|
>{item.children}</DescriptionsItem>
|
||||||
|
))}
|
||||||
|
</Descriptions>
|
||||||
|
))}
|
||||||
|
</ConfigProvider>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<Tabs
|
||||||
|
tabBarExtraContent={customTabBarExtraContent}
|
||||||
|
onChange={onTabChange}
|
||||||
|
items={[
|
||||||
|
{
|
||||||
|
label: `场景图`,
|
||||||
|
key: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: `对比图`,
|
||||||
|
key: '2',
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
{...tabProps}
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className={classNames(`${componentPrefix}-view-container`)}
|
||||||
|
>
|
||||||
|
{/* ---------------- view 视图左上角导航按钮 ------------------ */}
|
||||||
|
{showModeChange && (
|
||||||
|
<div
|
||||||
|
className={classNames(`${componentPrefix}-view-container-modeNav`)}
|
||||||
|
>
|
||||||
|
<Radio.Group
|
||||||
|
buttonStyle='solid'
|
||||||
|
size='small'
|
||||||
|
{...modeButtonGroupProps}
|
||||||
|
>
|
||||||
|
{viewTopModeButtonList?.map(btn => (
|
||||||
|
<Tooltip key={btn.key} title={btn.tooltipTxt}>
|
||||||
|
{/* @ts-ignore */}
|
||||||
|
<Radio.Button value={btn.key} {...btn.props}>{btn.icon} {btn.label}</Radio.Button>
|
||||||
|
</Tooltip>
|
||||||
|
))}
|
||||||
|
</Radio.Group>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* --------------------------------- 视频播放模式 --------------------------------- */}
|
||||||
|
{initMode(type)}
|
||||||
|
{/* 切换按钮组件 */}
|
||||||
|
{/* ----------------------------------- 上一张按钮 ---------------------------------- */}
|
||||||
|
{showNavigation && (
|
||||||
|
<Button
|
||||||
|
className={classNames(
|
||||||
|
`${componentPrefix}-view-container-nav`,
|
||||||
|
`${componentPrefix}-view-container-nav_left`
|
||||||
|
)}
|
||||||
|
icon={<IconFont icon="icon-qiehuanzuo" />}
|
||||||
|
type="primary"
|
||||||
|
// style={{ backgroundColor: 'rgba(255,255,255,0.8)' }}
|
||||||
|
shape='circle'
|
||||||
|
onClick={onPrevButtonClick}
|
||||||
|
{...prevButtonProps}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{/* ----------------------------------- 下一张按钮 ---------------------------------- */}
|
||||||
|
{showNavigation && (
|
||||||
|
<Button
|
||||||
|
className={classNames(
|
||||||
|
`${componentPrefix}-view-container-nav`,
|
||||||
|
`${componentPrefix}-view-container-nav_right`
|
||||||
|
)}
|
||||||
|
icon={<IconFont icon="icon-qiehuanyou" />}
|
||||||
|
type="primary"
|
||||||
|
// style={{ backgroundColor: 'rgba(255,255,255,0.8)' }}
|
||||||
|
shape='circle'
|
||||||
|
onClick={onNextButtonClick}
|
||||||
|
{...nextButtonProps}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{/* ----------------------------------- 人脸碰撞组件 ---------------------------------- */}
|
||||||
|
{isRelated && (
|
||||||
|
// @ts-ignore
|
||||||
|
<RelatedImage
|
||||||
|
{...relatedImageProps}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default BigImage
|
@ -0,0 +1,3 @@
|
|||||||
|
.zhst-big-image-combime-image {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
82
packages/biz/src/BigImage/components/CombineImage/index.tsx
Normal file
82
packages/biz/src/BigImage/components/CombineImage/index.tsx
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
|
||||||
|
import React, { FC, useRef, forwardRef, useImperativeHandle } from 'react';
|
||||||
|
import { CompareImage, Flex, Progress, ProgressProps, CompareImageProps } from '@zhst/meta'
|
||||||
|
import './index.less'
|
||||||
|
|
||||||
|
export interface ComBineImageProps {
|
||||||
|
height?: string | number
|
||||||
|
data: {
|
||||||
|
imgSummary: string;
|
||||||
|
compaterImage: string;
|
||||||
|
imageKey: string;
|
||||||
|
score: number;
|
||||||
|
}
|
||||||
|
prevDisable?: boolean;
|
||||||
|
nextDisable?: boolean;
|
||||||
|
onPre?: () => void;
|
||||||
|
onNext?: () => void;
|
||||||
|
openRoll?: boolean
|
||||||
|
targetImageProps?: CompareImageProps
|
||||||
|
sourceImageProps?: CompareImageProps
|
||||||
|
}
|
||||||
|
|
||||||
|
const conicColors: ProgressProps['strokeColor'] = {
|
||||||
|
'0%': '#42E2AC',
|
||||||
|
'50%': '#DFAF2E',
|
||||||
|
'100%': '#F95C55',
|
||||||
|
};
|
||||||
|
|
||||||
|
const componentName = 'zhst-big-image-combime-image'
|
||||||
|
|
||||||
|
const ComBineImage: FC<ComBineImageProps> = forwardRef((props, ref) => {
|
||||||
|
const {
|
||||||
|
height,
|
||||||
|
data,
|
||||||
|
prevDisable,
|
||||||
|
nextDisable,
|
||||||
|
onNext,
|
||||||
|
onPre,
|
||||||
|
openRoll
|
||||||
|
} = props
|
||||||
|
const { imgSummary, compaterImage, score } = data
|
||||||
|
const targetImageRef = useRef(null)
|
||||||
|
const compareImageRef = useRef(null)
|
||||||
|
|
||||||
|
useImperativeHandle(ref, () => ({
|
||||||
|
compareImageRef,
|
||||||
|
targetImageRef
|
||||||
|
}));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex className={componentName} justify='space-between' align='center' >
|
||||||
|
<CompareImage
|
||||||
|
ref={targetImageRef}
|
||||||
|
height={height as string}
|
||||||
|
width="400px"
|
||||||
|
preDisable={prevDisable}
|
||||||
|
nextDisable={nextDisable}
|
||||||
|
onNext={onNext}
|
||||||
|
onPre={onPre}
|
||||||
|
showScore={false}
|
||||||
|
openRoll={openRoll}
|
||||||
|
url={imgSummary}
|
||||||
|
label="目标图"
|
||||||
|
{...props.targetImageProps}
|
||||||
|
/>
|
||||||
|
<Progress type="circle" size={72} strokeWidth={6} percent={Number(score || 0)} strokeColor={conicColors} />
|
||||||
|
<CompareImage
|
||||||
|
ref={compareImageRef}
|
||||||
|
width="400px"
|
||||||
|
height={height as string}
|
||||||
|
url={compaterImage}
|
||||||
|
openRoll={false}
|
||||||
|
score={score}
|
||||||
|
label="预警图"
|
||||||
|
labelColor='#FA5852'
|
||||||
|
{...props.sourceImageProps}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default ComBineImage
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
:global {
|
:global {
|
||||||
i:hover {
|
i:hover {
|
||||||
color: #f0f0f0 !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,10 +35,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-prev {
|
&-prev {
|
||||||
left: 20px;
|
left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-next {
|
&-next {
|
||||||
right: 20px;
|
right: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
40
packages/biz/src/BigImage/components/navigation/index.tsx
Normal file
40
packages/biz/src/BigImage/components/navigation/index.tsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// !! 已废弃
|
||||||
|
import * as React from 'react';
|
||||||
|
import classnames from 'classnames';
|
||||||
|
import { Button } from '@zhst/meta';
|
||||||
|
import { IconFont } from '@zhst/icon'
|
||||||
|
import './index.less';
|
||||||
|
|
||||||
|
const componentName = `zhst-image__nav`;
|
||||||
|
|
||||||
|
const Navigation: React.FC<{
|
||||||
|
show?: boolean;
|
||||||
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
||||||
|
prev?: boolean;
|
||||||
|
next?: boolean;
|
||||||
|
disabled?: boolean;
|
||||||
|
className?: string;
|
||||||
|
color?: string;
|
||||||
|
hoverColor?: string;
|
||||||
|
}> = (props) => {
|
||||||
|
const { show, prev, next, disabled, onClick, className, color } = props;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={classnames(
|
||||||
|
`${componentName}`,
|
||||||
|
prev && `${componentName}-prev`,
|
||||||
|
next && `${componentName}-next`,
|
||||||
|
disabled && `${componentName}--disable`,
|
||||||
|
!show && `${componentName}--hide`,
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Button type="text" disabled={disabled} shape='circle' onClick={onClick}>
|
||||||
|
<IconFont size={28} color={color} icon={prev ? 'icon-qiehuanzuo' : 'icon-qiehuanyou'} />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Navigation;
|
Binary file not shown.
After Width: | Height: | Size: 143 KiB |
71
packages/biz/src/BigImage/demo/index.tsx
Normal file
71
packages/biz/src/BigImage/demo/index.tsx
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { BigImage } from '@zhst/biz'
|
||||||
|
import { Space, Switch } from '@zhst/meta'
|
||||||
|
import { pick, get } from '@zhst/func'
|
||||||
|
import { BIG_IMAGE_DATA, attributeList } from '../mock'
|
||||||
|
import Img from './imgs/photo-1503185912284-5271ff81b9a8.webp'
|
||||||
|
|
||||||
|
const BigModal = (props: any) => {
|
||||||
|
const {
|
||||||
|
} = props
|
||||||
|
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
||||||
|
const [showDesc, setShowDesc] = useState(true)
|
||||||
|
const [type, setType] = useState('normal')
|
||||||
|
const modalRef = useRef(null)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ padding: '32px', border: '1px solid #09f' }}>
|
||||||
|
<Space>
|
||||||
|
<span>显示属性:<Switch value={showDesc} onChange={e => setShowDesc(pre => !pre)} /></span>
|
||||||
|
</Space>
|
||||||
|
<BigImage
|
||||||
|
type={type}
|
||||||
|
ref={modalRef}
|
||||||
|
width={896}
|
||||||
|
viewHeight={'440px'}
|
||||||
|
showModeChange
|
||||||
|
onTabChange={(newVal) => setType(newVal === '1'? 'normal': 'compater')}
|
||||||
|
// ------------ 属性列表 -----------------
|
||||||
|
showDescription={showDesc}
|
||||||
|
descriptionList={attributeList}
|
||||||
|
// ------------ 图片/视频切换 -----------------
|
||||||
|
viewTopModeButtonList={[
|
||||||
|
{
|
||||||
|
key: 'image',
|
||||||
|
label: '图片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'video',
|
||||||
|
label: '视频'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
modeButtonGroupProps={{
|
||||||
|
defaultValue: 'image',
|
||||||
|
onChange: e => console.log('模式切换', e)
|
||||||
|
}}
|
||||||
|
// ------------ 导航功能 -----------------
|
||||||
|
showNavigation
|
||||||
|
onPrevButtonClick={val => console.log('pre', val)}
|
||||||
|
onNextButtonClick={val => console.log('next', val)}
|
||||||
|
// ------------ 场景图功能 -----------------
|
||||||
|
cropperImageProps={{
|
||||||
|
url: Img,
|
||||||
|
score: 50,
|
||||||
|
odList: get(dataSource, 'odRect', []),
|
||||||
|
attachImageData: get(dataSource, 'attachImg', []),
|
||||||
|
}}
|
||||||
|
// ------------ 对比图模式 -----------------
|
||||||
|
combineImageProps={{
|
||||||
|
data: pick(dataSource, 'compaterImage', 'imgSummary', 'imageKey', 'score'),
|
||||||
|
}}
|
||||||
|
// ------------ 视频模块 -----------------
|
||||||
|
videoProps={{
|
||||||
|
url: get(dataSource, 'flvUrl', '')
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
</BigImage>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BigModal
|
128
packages/biz/src/BigImage/demo/oldData.tsx
Normal file
128
packages/biz/src/BigImage/demo/oldData.tsx
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { BigImageModal } from '@zhst/biz'
|
||||||
|
import { Button, DescriptionsProps } from '@zhst/meta'
|
||||||
|
import { IMAGE_DATA, BIG_IMAGE_DATA } from '../mock'
|
||||||
|
import bigImageModalAdapter from '../util/bigImageModalAdapter'
|
||||||
|
import { get } from '@zhst/func';
|
||||||
|
|
||||||
|
const descriptionList: DescriptionsProps['items'] = [
|
||||||
|
{
|
||||||
|
title: '人员属性',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: '性别',
|
||||||
|
children: '男',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
label: '年龄',
|
||||||
|
children: '成年',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
label: '帽子',
|
||||||
|
children: '无',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4',
|
||||||
|
label: '上身颜色',
|
||||||
|
children: '灰',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5',
|
||||||
|
label: '下身颜色',
|
||||||
|
children: '蓝色',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '6',
|
||||||
|
label: '附着物',
|
||||||
|
children: '无',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '7',
|
||||||
|
label: '骑行',
|
||||||
|
children: '否',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 适配器,适配老接口
|
||||||
|
const NewImageModal = bigImageModalAdapter(BigImageModal, {
|
||||||
|
oldMode: true
|
||||||
|
})
|
||||||
|
|
||||||
|
const BigModal = (props) => {
|
||||||
|
const {
|
||||||
|
onClose,
|
||||||
|
isArchiveDetail = false,
|
||||||
|
specialTitle = '对比图2',
|
||||||
|
transformPropFunc,
|
||||||
|
screenshotButtonRender,
|
||||||
|
showLowFaceTip = false
|
||||||
|
} = props
|
||||||
|
const [visible, setVisible] = useState(false)
|
||||||
|
const [selectIndex, setSelectIndex] = useState(0)
|
||||||
|
const [dataSource, setDataSource] = useState(IMAGE_DATA.dataSource)
|
||||||
|
const [dataSources, setDataSources] = useState(IMAGE_DATA.dataSource)
|
||||||
|
const [selectItem, setSelectItem] = useState({})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Button onClick={() => setVisible(true)} >查看大图</Button>
|
||||||
|
<NewImageModal
|
||||||
|
title="查看大图"
|
||||||
|
dataSource={dataSource}
|
||||||
|
imageData={dataSource}
|
||||||
|
width={1098}
|
||||||
|
onClose={() => onClose}
|
||||||
|
descriptionConfig={{ data: descriptionList }}
|
||||||
|
visible={visible}
|
||||||
|
isArchiveDetail={isArchiveDetail}
|
||||||
|
ToolProps={{
|
||||||
|
// renderLeft: leftOperateBar({ disableBtn, onActionClick: onBigImageActionClick }),
|
||||||
|
// renderRight: rightOperateBar({
|
||||||
|
// disableBtn,
|
||||||
|
// onActionClick: onBigImageActionClick,
|
||||||
|
// isArchiveDetail,
|
||||||
|
// }),
|
||||||
|
// renderVideoBtn: !disableBtn.includes(OPT['PLAY_VIDEO']),
|
||||||
|
// disableVideo: disableVideo,
|
||||||
|
}}
|
||||||
|
selectIndex={selectIndex}
|
||||||
|
onSelectIndexChange={(index: number) => {
|
||||||
|
index > 0 && index < dataSources.length && setSelectIndex(index);
|
||||||
|
}}
|
||||||
|
// tabsFilter={tabsFilter}
|
||||||
|
specialTitle={specialTitle}
|
||||||
|
transformPropFunc={async (item: any) => {
|
||||||
|
let bigImageInfo = !!transformPropFunc && (await transformPropFunc(item));
|
||||||
|
setSelectItem({ ...bigImageInfo });
|
||||||
|
return { ...bigImageInfo };
|
||||||
|
}}
|
||||||
|
screenshotButtonRender={screenshotButtonRender}
|
||||||
|
//@ts-ignore
|
||||||
|
transformVideoPropFunc={async (item) => {
|
||||||
|
const { maxDuration: duration = 20 } = item || {};
|
||||||
|
const time = get(item, 'timestamp');
|
||||||
|
const cameraId = get(item, 'cameraId');
|
||||||
|
const { url: flvUrl } = {
|
||||||
|
url: 'url',
|
||||||
|
downloadUrl: 'url',
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
flvUrl,
|
||||||
|
maxDuration: duration,
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
nullDialogProp={{
|
||||||
|
emptyText: showLowFaceTip ? '目标图人脸质量较低,暂无聚类数据' : '暂无数据',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BigModal
|
89
packages/biz/src/BigImage/demo/withEdit.tsx
Normal file
89
packages/biz/src/BigImage/demo/withEdit.tsx
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { BigImage } from '@zhst/biz'
|
||||||
|
import { Space, Switch, Button } from '@zhst/meta'
|
||||||
|
import { pick, get } from '@zhst/func'
|
||||||
|
import { BIG_IMAGE_DATA, attributeList } from '../mock'
|
||||||
|
import Img from './imgs/photo-1503185912284-5271ff81b9a8.webp'
|
||||||
|
|
||||||
|
const testOd = [
|
||||||
|
{
|
||||||
|
"id": "456",
|
||||||
|
"x": 0.58543766,
|
||||||
|
"y": 0.3203356,
|
||||||
|
"w": 0.052037954,
|
||||||
|
"h": 0.2664015
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const BigModal = (props: any) => {
|
||||||
|
const {
|
||||||
|
} = props
|
||||||
|
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
||||||
|
const [showDesc, setShowDesc] = useState(true)
|
||||||
|
const [editAble, setEditAble] = useState(false)
|
||||||
|
const [odList, setOdList] = useState(get(dataSource, 'odRect', []))
|
||||||
|
const [type, setType] = useState('normal')
|
||||||
|
const bigImageRef = useRef(null)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ padding: '32px', border: '1px solid #09f' }}>
|
||||||
|
<Space>
|
||||||
|
<span>显示属性:<Switch value={showDesc} onChange={e => setShowDesc(pre => !pre)} /></span>
|
||||||
|
<span>打开编辑模式:<Switch value={editAble} onChange={e => setEditAble(pre => !pre)} /></span>
|
||||||
|
<Button onClick={() => setOdList(testOd)}>修改Od</Button>
|
||||||
|
</Space>
|
||||||
|
<BigImage
|
||||||
|
type={type}
|
||||||
|
ref={bigImageRef}
|
||||||
|
width={896}
|
||||||
|
viewHeight={'440px'}
|
||||||
|
showModeChange
|
||||||
|
onTabChange={(newVal) => setType(newVal === '1'? 'normal': 'compater')}
|
||||||
|
// ------------ 属性列表 -----------------
|
||||||
|
showDescription={showDesc}
|
||||||
|
descriptionList={attributeList}
|
||||||
|
// ------------ 图片/视频切换 -----------------
|
||||||
|
viewTopModeButtonList={[
|
||||||
|
{
|
||||||
|
key: 'image',
|
||||||
|
label: '图片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'video',
|
||||||
|
label: '视频'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
modeButtonGroupProps={{
|
||||||
|
defaultValue: 'image',
|
||||||
|
onChange: e => console.log('模式切换', e)
|
||||||
|
}}
|
||||||
|
// ------------ 导航功能 -----------------
|
||||||
|
showNavigation
|
||||||
|
onPrevButtonClick={val => console.log('pre', val)}
|
||||||
|
onNextButtonClick={val => console.log('next', val)}
|
||||||
|
// ------------ 场景图功能 -----------------
|
||||||
|
cropperImageProps={{
|
||||||
|
editAble,
|
||||||
|
url: Img,
|
||||||
|
score: 50,
|
||||||
|
odList: odList,
|
||||||
|
showEditTools: editAble,
|
||||||
|
attachImageData: get(dataSource, 'attachImg', []),
|
||||||
|
onCropperTypeChange: v => console.log('框选模式', v),
|
||||||
|
onExitEdit: () => setEditAble(pre => !pre)
|
||||||
|
}}
|
||||||
|
// ------------ 对比图模式 -----------------
|
||||||
|
combineImageProps={{
|
||||||
|
data: pick(dataSource, 'compaterImage', 'imgSummary', 'imageKey', 'score'),
|
||||||
|
}}
|
||||||
|
// ------------ 视频模块 -----------------
|
||||||
|
videoProps={{
|
||||||
|
url: get(dataSource, 'flvUrl', '')
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
</BigImage>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BigModal
|
78
packages/biz/src/BigImage/demo/withRelatedImage.tsx
Normal file
78
packages/biz/src/BigImage/demo/withRelatedImage.tsx
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { BigImage } from '@zhst/biz'
|
||||||
|
import { Button, Space, Switch } from '@zhst/meta'
|
||||||
|
import { pick, get } from '@zhst/func'
|
||||||
|
import { BIG_IMAGE_DATA, attributeList, RELATED_IMAGES } from '../mock'
|
||||||
|
|
||||||
|
const BigModal = (props: any) => {
|
||||||
|
const {
|
||||||
|
} = props
|
||||||
|
const [visible, setVisible] = useState(true)
|
||||||
|
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
||||||
|
const [selectedItemKey, setSelectedItemKey] = useState()
|
||||||
|
const [showFaceModel, setShowFaceModel] = useState(true)
|
||||||
|
const [type, setType] = useState('normal')
|
||||||
|
const modalRef = useRef(null)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ padding: '32px', border: '1px solid #09f' }}>
|
||||||
|
<Space>
|
||||||
|
<span>显示人脸碰撞模型:<Switch value={showFaceModel} onChange={e => setShowFaceModel(pre => !pre)} /></span>
|
||||||
|
</Space>
|
||||||
|
<BigImage
|
||||||
|
type={type}
|
||||||
|
open={visible}
|
||||||
|
ref={modalRef}
|
||||||
|
viewHeight={'440px'}
|
||||||
|
width={896}
|
||||||
|
onCancel={() => setVisible(false)}
|
||||||
|
showModeChange
|
||||||
|
onTabChange={(newVal, oldVal) => setType(newVal === '1'? 'normal': 'compater')}
|
||||||
|
// ------------ 图片/视频切换 -----------------
|
||||||
|
viewTopModeButtonList={[
|
||||||
|
{
|
||||||
|
key: 'image',
|
||||||
|
label: '图片'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'video',
|
||||||
|
label: '视频'
|
||||||
|
}
|
||||||
|
]}
|
||||||
|
modeButtonGroupProps={{
|
||||||
|
defaultValue: 'image',
|
||||||
|
onChange: e => console.log('模式切换', e)
|
||||||
|
}}
|
||||||
|
// ------------ 场景图功能 -----------------
|
||||||
|
cropperImageProps={{
|
||||||
|
url: "https://gw.alipayobjects.com/zos/antfincdn/LlvErxo8H9/photo-1503185912284-5271ff81b9a8.webp",
|
||||||
|
score: 50,
|
||||||
|
odList: get(dataSource, 'odRect', []),
|
||||||
|
attachImageData: get(dataSource, 'attachImg', []),
|
||||||
|
}}
|
||||||
|
// ------------ 对比图模式 -----------------
|
||||||
|
combineImageProps={{
|
||||||
|
data: pick(dataSource, 'compaterImage', 'imgSummary', 'imageKey', 'score'),
|
||||||
|
}}
|
||||||
|
// ------------ 视频模块 -----------------
|
||||||
|
videoProps={{
|
||||||
|
url: get(dataSource, 'flvUrl', '')
|
||||||
|
}}
|
||||||
|
// ------------ 人脸碰撞模型 -----------------
|
||||||
|
isRelated={showFaceModel}
|
||||||
|
relatedImageProps={{
|
||||||
|
activeTab: 'related',
|
||||||
|
selectedItemKey,
|
||||||
|
data: RELATED_IMAGES,
|
||||||
|
onCancel: () => console.log('取消关联'),
|
||||||
|
onConnect: () => console.log('关联'),
|
||||||
|
onTabChange: (newVal, oldVal) => console.log('tab切换', newVal, oldVal),
|
||||||
|
onItemSelected: (item) => setSelectedItemKey(item.key)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
</BigImage>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BigModal
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
132
packages/biz/src/BigImage/index.less
Normal file
132
packages/biz/src/BigImage/index.less
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
.zhst-big-image {
|
||||||
|
.zhst-dialog-content {
|
||||||
|
box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.zhst-tabs .zhst-tabs-nav-wrap {
|
||||||
|
background-color: #f6f6f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-view {
|
||||||
|
&-btns {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
&-desc {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
padding: 16px 16px 0 16px;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
.zhst-descriptions-header {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.zhst-descriptions-title {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ------------ tab -----------------
|
||||||
|
.zhst-tabs-nav {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
.zhst-tabs-tab {
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-left: 24px;
|
||||||
|
}
|
||||||
|
padding: 0;
|
||||||
|
padding-bottom: 4px;
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-container {
|
||||||
|
position: relative;
|
||||||
|
min-height: 440px;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
font-size: 0;
|
||||||
|
&-modeNav {
|
||||||
|
padding: 2px;
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
left: 4px;
|
||||||
|
z-index: 10;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
&__nav {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 99;
|
||||||
|
top: 50%;
|
||||||
|
width: 40px !important;
|
||||||
|
height: 40px !important;
|
||||||
|
background: #d9d9d9;
|
||||||
|
border-radius: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
|
||||||
|
&>button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--disabled {
|
||||||
|
opacity: 0.3;
|
||||||
|
|
||||||
|
&>button {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&__nav:hover {
|
||||||
|
background: #09f;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
// ------------ 导航 -----------------
|
||||||
|
&-nav {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8)!important;
|
||||||
|
}
|
||||||
|
&_left {
|
||||||
|
left: 8px;
|
||||||
|
}
|
||||||
|
&_right {
|
||||||
|
right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ------------ 场景图 -----------------
|
||||||
|
&-cropper-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 4px;
|
||||||
|
&_close {
|
||||||
|
margin-left: 4px;
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
&-group {
|
||||||
|
.zhst-radio-button-wrapper {
|
||||||
|
display: inline-flex;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #191919;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8)
|
||||||
|
}
|
||||||
|
&-radio {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
.anticon {
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
96
packages/biz/src/BigImage/index.md
Normal file
96
packages/biz/src/BigImage/index.md
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
---
|
||||||
|
group: 进阶组件
|
||||||
|
category: Components
|
||||||
|
subtitle: 大图组件
|
||||||
|
toc: content
|
||||||
|
title: BigImage 大图组件
|
||||||
|
---
|
||||||
|
|
||||||
|
## 大图弹框
|
||||||
|
|
||||||
|
<code src="./demo/index.tsx">基本</code>
|
||||||
|
<code src="./demo/withRelatedImage.tsx">人脸碰撞模型</code>
|
||||||
|
<code src="./demo/withEdit.tsx">编辑模式</code>
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| type | 当前模式 | 'compater'、'normal'、'video' | - | |
|
||||||
|
| viewHeight | 视图高度 | string、number | - | |
|
||||||
|
| width | 宽度 | string、number | - | |
|
||||||
|
| showDescription | 描述列表显示\隐藏 | boolean | false | |
|
||||||
|
| descriptionsProps | 描述列表透传 | | antd - DescriptionsProps | |
|
||||||
|
| descriptionList | 描述列表数据(见下文) | | IDescriptionList | |
|
||||||
|
| topButtonRender | 顶部按钮 | | ReactNode、string | |
|
||||||
|
| customTabBarExtraContent | 自定义tab尾部导航插槽 | | ReactNode、 string | |
|
||||||
|
| onTabChange | tab事件监听 | | antd - TabsProps['onChange'] | |
|
||||||
|
| tabProps | tab透传 | | antd - TabsProps | |
|
||||||
|
| showModeChange | 是否显示模式切换按钮 | | boolean | |
|
||||||
|
| viewTopModeButtonList | 模式切换按钮列表 | | TypeRadio[] | |
|
||||||
|
| modeButtonGroupProps | 模式切换按钮组透传 | RadioGroupProps | - | |
|
||||||
|
| isRelated | 人脸碰撞模型显示\隐藏 | boolean | | |
|
||||||
|
| relatedImageProps | 人脸碰撞模型透传 | zhst/meta - RelatedImageProps | | |
|
||||||
|
| cropperImageProps | 场景图模式透传 | ICropperImageProps | | |
|
||||||
|
| combineImageProps | 对比图模式透传 | ComBineImageProps | | |
|
||||||
|
| videoProps | 视频模式透传 | videoProps | | |
|
||||||
|
| showNavigation | 是否展示导航 | boolean | | |
|
||||||
|
| prevButtonProps | 前翻箭头透传 | prevButtonProps | | |
|
||||||
|
| onPrevButtonClick | 前翻箭头点击事件 | () => void; | | |
|
||||||
|
| nextButtonProps | 下翻箭头透传 | () => void; | | |
|
||||||
|
| onNextButtonClick | 下翻箭头点击事件 | () => void; | | |
|
||||||
|
| children | | ReactNode | | |
|
||||||
|
|
||||||
|
### IDescriptionList
|
||||||
|
|
||||||
|
```ts
|
||||||
|
interface IDescriptionList {
|
||||||
|
title: string;
|
||||||
|
showTitle?: boolean;
|
||||||
|
props?: DescriptionsProps
|
||||||
|
children: DescriptionsProps['items']
|
||||||
|
}[]
|
||||||
|
```
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
```ts
|
||||||
|
interface ICropperImageProps extends CropperImageProps {
|
||||||
|
showEditTools?: boolean // 是否展示编辑按钮
|
||||||
|
editAble?: boolean // 是否开启编辑模式
|
||||||
|
score?: string | number // 分数
|
||||||
|
btnGroupProps?: BtnGroupProps; // crop 场景图模式下的按钮拓展
|
||||||
|
cropButtonList?: TypeRadio[] // 编辑按钮列表
|
||||||
|
onCropperTypeChange?: (type: RadioProps['onChange']) => void
|
||||||
|
onExitEdit?: ButtonProps['onClick'] // 退出编辑模式
|
||||||
|
attachImageData?: AttachImageProps['data'] // 左下角预览图
|
||||||
|
attachImageProps?: AttachImageProps // 左下角预览图透传
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 设计方案
|
||||||
|
|
||||||
|
结合当下的业务场景,目前大图组件有三种模式
|
||||||
|
|
||||||
|
1. 场景图模式
|
||||||
|
-
|
||||||
|
2. 对比图模式
|
||||||
|
3. 视频模式
|
||||||
|
|
||||||
|
场景图和视频模式,支持用户编辑圈选
|
||||||
|
|
||||||
|
三种模式状态下,都会有外层模块的嵌套,目前有以下几种:
|
||||||
|
|
||||||
|
1. 描述模块
|
||||||
|
2. 顶部拓展
|
||||||
|
- 目前仅支持自定义
|
||||||
|
- 默认下边间距 16px
|
||||||
|
3. tabs 切换
|
||||||
|
- 默认下间距:16px
|
||||||
|
- 支持自定义文案
|
||||||
|
- 支持自定义数量
|
||||||
|
- 支持后方插槽
|
||||||
|
4. 人脸碰撞模型
|
||||||
|
- 支持用户自定义传入数据
|
||||||
|
|
||||||
|
本来想通过插件的形式按需加载
|
5
packages/biz/src/BigImage/index.tsx
Normal file
5
packages/biz/src/BigImage/index.tsx
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import BigImage from "./BigImage";
|
||||||
|
|
||||||
|
export type { BigImageProps, BigImageRef } from './interface'
|
||||||
|
|
||||||
|
export default BigImage
|
84
packages/biz/src/BigImage/interface.ts
Normal file
84
packages/biz/src/BigImage/interface.ts
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import { ReactNode } from 'react'
|
||||||
|
import {
|
||||||
|
ButtonProps,
|
||||||
|
RadioProps,
|
||||||
|
RadioGroupProps,
|
||||||
|
VideoViewProps,
|
||||||
|
DescriptionsProps,
|
||||||
|
TabsProps,
|
||||||
|
RelatedImageProps,
|
||||||
|
BtnGroupProps,
|
||||||
|
CropperImageProps,
|
||||||
|
VideoViewRef,
|
||||||
|
AttachImageProps
|
||||||
|
} from '@zhst/meta'
|
||||||
|
import { ComBineImageProps } from './components/CombineImage'
|
||||||
|
|
||||||
|
export type TypeRadio = {
|
||||||
|
label?: string;
|
||||||
|
key: string;
|
||||||
|
tooltipTxt?: string;
|
||||||
|
onClick?: ButtonProps['onClick']
|
||||||
|
icon?: ReactNode | string;
|
||||||
|
props?: ButtonProps
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypePlugin = 'compater' | 'normal' | 'video' | 'faceMode'
|
||||||
|
|
||||||
|
export interface BigImageProps {
|
||||||
|
type?: TypePlugin // 当前 tab
|
||||||
|
viewHeight?: string | number;
|
||||||
|
width?: string | number
|
||||||
|
typePlugins?: TypePlugin[] // TODO: 开启插件类型
|
||||||
|
// ------------ 描述列表 -----------------
|
||||||
|
showDescription?: boolean;
|
||||||
|
descriptionsProps?: DescriptionsProps
|
||||||
|
descriptionList?: {
|
||||||
|
title: string;
|
||||||
|
showTitle?: boolean;
|
||||||
|
props?: DescriptionsProps
|
||||||
|
children: DescriptionsProps['items']
|
||||||
|
}[]
|
||||||
|
// ------------------ 顶部按钮列表
|
||||||
|
topButtonRender?: ReactNode | string
|
||||||
|
// ---------------- Tabs 导航 ------------------
|
||||||
|
customTabBarExtraContent?: string | ReactNode
|
||||||
|
onTabChange?: TabsProps['onChange']
|
||||||
|
tabProps?: TabsProps
|
||||||
|
// ------------ 图片 | 视频切换导航 -----------------
|
||||||
|
showModeChange?: boolean
|
||||||
|
viewTopModeButtonList?: TypeRadio[]
|
||||||
|
modeButtonGroupProps?: RadioGroupProps
|
||||||
|
// ----------------- 人脸碰转 -----------------
|
||||||
|
isRelated?: boolean // 人脸碰撞功能打开
|
||||||
|
relatedImageProps?: RelatedImageProps
|
||||||
|
// -------------------------- crop 场景图模式 -----------------------
|
||||||
|
cropperImageProps?: CropperImageProps & {
|
||||||
|
showEditTools?: boolean
|
||||||
|
editAble?: boolean
|
||||||
|
score?: string | number
|
||||||
|
btnGroupProps?: BtnGroupProps; // crop 场景图模式下的按钮拓展
|
||||||
|
cropButtonList?: TypeRadio[]
|
||||||
|
onCropperTypeChange?: (type: RadioProps['onChange']) => void
|
||||||
|
onExitEdit?: ButtonProps['onClick']
|
||||||
|
attachImageData?: AttachImageProps['data']
|
||||||
|
attachImageProps?: AttachImageProps
|
||||||
|
}
|
||||||
|
// -------------------- 对比图模式 -------------------------
|
||||||
|
combineImageProps?: ComBineImageProps
|
||||||
|
// ------------ 导航 -----------------
|
||||||
|
showNavigation?: boolean // 是否展示导航箭头
|
||||||
|
prevButtonProps?: any;
|
||||||
|
onPrevButtonClick?: () => void;
|
||||||
|
nextButtonProps?: any
|
||||||
|
onNextButtonClick?: () => void;
|
||||||
|
theme?: any
|
||||||
|
children?: React.ReactNode
|
||||||
|
// ------------ 视频模式 -----------------
|
||||||
|
videoProps?: VideoViewProps
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BigImageRef {
|
||||||
|
videoPlayerRef: VideoViewRef
|
||||||
|
combineImageRef: any
|
||||||
|
}
|
293
packages/biz/src/BigImage/mock.ts
Normal file
293
packages/biz/src/BigImage/mock.ts
Normal file
@ -0,0 +1,293 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import imageUrl from './demo/imgs/photo-1503185912284-5271ff81b9a8.webp'
|
||||||
|
|
||||||
|
export const IMAGE_DATA = {
|
||||||
|
"enAbleDeleteFeature": true,
|
||||||
|
"tabsFilter": [
|
||||||
|
"COMPATER",
|
||||||
|
"NORMAL"
|
||||||
|
],
|
||||||
|
"selectIndex": 4,
|
||||||
|
"disableBtn": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
4,
|
||||||
|
20
|
||||||
|
],
|
||||||
|
"dataSource": {
|
||||||
|
"objectId": "1742110565582518272",
|
||||||
|
"condition": {
|
||||||
|
"featureInfo": null,
|
||||||
|
"featureData": "AAAAAAAAAAAAAAAAAAAAAAA==",
|
||||||
|
"imageData": "",
|
||||||
|
"alg": "VERSION_REID_HEAD_ATTR",
|
||||||
|
"rect": {
|
||||||
|
"x": 0.271875,
|
||||||
|
"y": 0.32222223,
|
||||||
|
"w": 0.2859375,
|
||||||
|
"h": 0.67777777
|
||||||
|
},
|
||||||
|
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
||||||
|
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
||||||
|
},
|
||||||
|
"score": 0.7163062,
|
||||||
|
"timestamp": 1704186491979,
|
||||||
|
"deviceId": "129533",
|
||||||
|
"id": "129533",
|
||||||
|
"name": "4楼门口过道人脸",
|
||||||
|
"dirid": "0",
|
||||||
|
"status": "1",
|
||||||
|
"longitude": 120.125,
|
||||||
|
"latitude": 30.280500411987305,
|
||||||
|
"caseId": "0",
|
||||||
|
"caseGroup": "",
|
||||||
|
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
||||||
|
"objectIndex": {
|
||||||
|
"objectId": "1742110565582518272",
|
||||||
|
"solutionId": "1",
|
||||||
|
"deviceId": "129533",
|
||||||
|
"fragmentId": "0"
|
||||||
|
},
|
||||||
|
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
||||||
|
"isObjectTrack": true,
|
||||||
|
"pathId": "1742110532019697664",
|
||||||
|
"frameInfo": {
|
||||||
|
"frameId": "0",
|
||||||
|
"frameTimestamp": "1704186491979",
|
||||||
|
"width": 0,
|
||||||
|
"height": 0,
|
||||||
|
"originWidth": 1920,
|
||||||
|
"originHeight": 1080,
|
||||||
|
"offsetTime": "24714687",
|
||||||
|
"skipNumber": "0"
|
||||||
|
},
|
||||||
|
"level": 1,
|
||||||
|
"bboxInFrame": {
|
||||||
|
"x": 0.603125,
|
||||||
|
"y": 0.3314815,
|
||||||
|
"w": 0.0578125,
|
||||||
|
"h": 0.2712963
|
||||||
|
},
|
||||||
|
"bboxExtInFrame": {
|
||||||
|
"x": 0.546875,
|
||||||
|
"y": 0.2638889,
|
||||||
|
"w": 0.17135416,
|
||||||
|
"h": 0.40648147
|
||||||
|
},
|
||||||
|
"objectImageKey": "",
|
||||||
|
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565582518272.jpg",
|
||||||
|
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565603489792.jpg",
|
||||||
|
"confidence": 0.817271,
|
||||||
|
"sourceObjectId": "1742110565603489792",
|
||||||
|
"storeTimestamp": "0",
|
||||||
|
"gbNumber": "",
|
||||||
|
"qualityScore": 0,
|
||||||
|
"subObjectCount": 1,
|
||||||
|
"subObjectType": [
|
||||||
|
"OBJECT_TYPE_FACE"
|
||||||
|
],
|
||||||
|
"subObjectIds": [
|
||||||
|
"1742110532015503360"
|
||||||
|
],
|
||||||
|
"solutionId": "1",
|
||||||
|
"fragmentId": "0",
|
||||||
|
"contrastKey": "singer-20240102/1/129533/1742110565582518272.jpg",
|
||||||
|
"compaterImages": [
|
||||||
|
"http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"
|
||||||
|
],
|
||||||
|
"imgSummary": "singer-20240102/1/129533/1742110565582518272.jpg",
|
||||||
|
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565582518272.jpg",
|
||||||
|
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742110565603489792.jpg",
|
||||||
|
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
||||||
|
"cameraId": "129533",
|
||||||
|
"cameraName": "4楼门口过道人脸"
|
||||||
|
},
|
||||||
|
"isArchiveDetail": false,
|
||||||
|
"ToolProps": {
|
||||||
|
"renderVideoBtn": true,
|
||||||
|
"disableVideo": false
|
||||||
|
},
|
||||||
|
"specialTitle": ""
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RELATED_IMAGES = [
|
||||||
|
{ key: '123', url: imageUrl },
|
||||||
|
{ key: '22', url: imageUrl },
|
||||||
|
{ key: '22122333', url: imageUrl },
|
||||||
|
{ key: '2212243', url: imageUrl },
|
||||||
|
{ key: '224523433', url: imageUrl },
|
||||||
|
{ key: '224235453', url: imageUrl },
|
||||||
|
{ key: '245423', url: imageUrl },
|
||||||
|
{ key: '224233543', url: imageUrl },
|
||||||
|
{ key: '22452343', url: imageUrl },
|
||||||
|
{ key: '22323243', url: imageUrl },
|
||||||
|
{ key: '2236456', url: imageUrl },
|
||||||
|
{ key: '224563', url: imageUrl },
|
||||||
|
{ key: '24565423', url: imageUrl },
|
||||||
|
{ key: '245645623', url: imageUrl },
|
||||||
|
{ key: '2456435623', url: imageUrl },
|
||||||
|
{ key: '2323', url: imageUrl }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const BIG_IMAGE_DATA = {
|
||||||
|
imageKey: imageUrl,
|
||||||
|
imgSummary: imageUrl,
|
||||||
|
flvUrl: 'ws://10.0.0.120:9033/flv/HaikangNvr/45.flv?ip=10.0.2.103&stime=1712539148&etime=1712539168',
|
||||||
|
compaterImage: imageUrl,
|
||||||
|
odRect: [
|
||||||
|
{
|
||||||
|
id: '123',
|
||||||
|
"x":0.5445312,
|
||||||
|
"y":0.19166666,
|
||||||
|
"w":0.08671875,
|
||||||
|
"h":0.40138888
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "123",
|
||||||
|
"x": 0.5519352,
|
||||||
|
"y": 0.2965385,
|
||||||
|
"w": 0.05185461,
|
||||||
|
"h": 0.24698898,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "456",
|
||||||
|
"x": 0.58543766,
|
||||||
|
"y": 0.3203356,
|
||||||
|
"w": 0.052037954,
|
||||||
|
"h": 0.2664015
|
||||||
|
}
|
||||||
|
],
|
||||||
|
attachImg: [
|
||||||
|
{
|
||||||
|
"url": imageUrl,
|
||||||
|
"label": "形体"
|
||||||
|
},{
|
||||||
|
"url": imageUrl,
|
||||||
|
"label": "人脸"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
score: 60, // 人脸质量分
|
||||||
|
showScore: true, // 人脸质量分
|
||||||
|
cameraPosition: 'string', // 摄像头位置
|
||||||
|
time: '2022-01-01', // 摄像头拍摄时间
|
||||||
|
objects: [
|
||||||
|
{
|
||||||
|
"objectIndex": {
|
||||||
|
"objectId": "1746832189053474816",
|
||||||
|
"solutionId": "0",
|
||||||
|
"deviceId": "0",
|
||||||
|
"fragmentId": "0"
|
||||||
|
},
|
||||||
|
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
||||||
|
"sourceObjectId": "0",
|
||||||
|
"level": 0,
|
||||||
|
"confidence": 0.881164,
|
||||||
|
"frameInfo": {
|
||||||
|
"frameId": "0",
|
||||||
|
"frameTimestamp": "1705312223057",
|
||||||
|
"width": 0,
|
||||||
|
"height": 0,
|
||||||
|
"originWidth": 0,
|
||||||
|
"originHeight": 0,
|
||||||
|
"offsetTime": "0",
|
||||||
|
"skipNumber": "0"
|
||||||
|
},
|
||||||
|
"infoOnSource": {
|
||||||
|
"bboxInFrame": {
|
||||||
|
"bboxRatio": {
|
||||||
|
"x": 0.61418945,
|
||||||
|
"y": 0.34309354,
|
||||||
|
"w": 0.067661405,
|
||||||
|
"h": 0.34659258
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"countInSource": 0,
|
||||||
|
"indexInSource": 0
|
||||||
|
},
|
||||||
|
"qualityScore": 0,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const attributeList = [
|
||||||
|
{
|
||||||
|
title: '人员属性',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: '性别',
|
||||||
|
children: '男',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
label: '年龄',
|
||||||
|
children: '成年',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
label: '帽子',
|
||||||
|
children: '无',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4',
|
||||||
|
label: '上身颜色',
|
||||||
|
children: '灰',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5',
|
||||||
|
label: '下身颜色',
|
||||||
|
children: '蓝色',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '6',
|
||||||
|
label: '附着物',
|
||||||
|
children: '无',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '7',
|
||||||
|
label: '骑行',
|
||||||
|
children: '否',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '社区规范',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
key: '1',
|
||||||
|
label: '性别',
|
||||||
|
children: '男',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '2',
|
||||||
|
label: '年龄',
|
||||||
|
children: '成年',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3',
|
||||||
|
label: '帽子',
|
||||||
|
children: '无',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4',
|
||||||
|
label: '上身颜色',
|
||||||
|
children: '灰',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5',
|
||||||
|
label: '下身颜色',
|
||||||
|
children: '蓝色',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '6',
|
||||||
|
label: '附着物',
|
||||||
|
children: '无',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '7',
|
||||||
|
label: '骑行',
|
||||||
|
children: '否',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
];
|
195
packages/biz/src/BigImage/util/bigImageModalAdapter.tsx
Normal file
195
packages/biz/src/BigImage/util/bigImageModalAdapter.tsx
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
/**
|
||||||
|
* 适配老的大屏组件数据格式传入
|
||||||
|
*/
|
||||||
|
import React, { } from 'react';
|
||||||
|
import { AlgorithmVersionStr, HumanProperty, ObjectType, Rect, IScreenshotButtonProp } from '@zhst/types'
|
||||||
|
import { VideoViewProps, ImgViewProps, VideoViewRef, ImgViewRef } from '@zhst/meta'
|
||||||
|
|
||||||
|
export type TAB_TYPE = 'COMPATER' | 'NORMAL' | 'TRACK';
|
||||||
|
export type MODEL_TYPE = 'VIDEO' | 'IMAGE';
|
||||||
|
|
||||||
|
export interface CarouselProps {
|
||||||
|
hasPre?: boolean;
|
||||||
|
hasNext?: boolean;
|
||||||
|
selectIndex: number;
|
||||||
|
setSelectIndex: React.Dispatch<React.SetStateAction<number>>;
|
||||||
|
dataSource: Array<{
|
||||||
|
key: string;
|
||||||
|
url: string;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ISelectItem = Partial<Omit<ImgViewProps, 'screenshotButtonRender'>> &
|
||||||
|
Partial<Omit<VideoViewProps, 'screenshotButtonRender'>>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述列表 description
|
||||||
|
*/
|
||||||
|
export interface HeaderProps {
|
||||||
|
value: TAB_TYPE;
|
||||||
|
onChange: (type: TAB_TYPE) => void;
|
||||||
|
tabsFilter: TAB_TYPE[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ParamProps {
|
||||||
|
tab: string;
|
||||||
|
selectItem: ISelectItem;
|
||||||
|
imgViewRef: React.MutableRefObject<ImgViewRef>;
|
||||||
|
VideoViewRef: React.MutableRefObject<VideoViewRef>;
|
||||||
|
model: MODEL_TYPE;
|
||||||
|
setModel: React.Dispatch<React.SetStateAction<MODEL_TYPE>>;
|
||||||
|
/* 可观测值 */
|
||||||
|
scale$: number;
|
||||||
|
showCrop$: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工具栏
|
||||||
|
*/
|
||||||
|
export interface ToolProps {
|
||||||
|
renderRight?: (props: ParamProps) => React.ReactNode;
|
||||||
|
renderLeft?: (props: ParamProps) => React.ReactNode;
|
||||||
|
renderVideoBtn?: boolean;
|
||||||
|
param: ParamProps;
|
||||||
|
disableVideo: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface BigImageData {
|
||||||
|
//imageKey 小图
|
||||||
|
extendRectList: (Rect & { algorithmVersion: AlgorithmVersionStr; imageKey: string })[];
|
||||||
|
rectList: (Rect & { algorithmVersion: AlgorithmVersionStr; imageKey: string })[];
|
||||||
|
attachImg: { url: string; label: '形体' | '人脸' }[];
|
||||||
|
odRect: Rect;
|
||||||
|
compaterImages: string[] // 目标图列表
|
||||||
|
constractKey: string; // 当前比较中的目标图
|
||||||
|
frameImageKey: string; // 场景图
|
||||||
|
imageKey?: string; // 大图
|
||||||
|
imgSummary: string; // 摘要图
|
||||||
|
objectExtImageKey: string; //比对到的目标图扩展图 === imgSummary
|
||||||
|
|
||||||
|
attributeList: { label: string; list: any[] }[];
|
||||||
|
archiveImages?: any;
|
||||||
|
spaceName: string;
|
||||||
|
|
||||||
|
objectIndex?: {
|
||||||
|
deviceId: string;
|
||||||
|
fragmentId: string;
|
||||||
|
objectId: string;
|
||||||
|
solutionId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
objectType: ObjectType;
|
||||||
|
objectId: string; //这张摘要本身的Id
|
||||||
|
bodyObjectId?: string;
|
||||||
|
faceObjectId?: string; //这张摘要下的人脸Id(如果有)
|
||||||
|
sourceObjectId?: string; //这张摘要上游的形体Id(如果有)
|
||||||
|
cameraId: string;
|
||||||
|
cameraName: string;
|
||||||
|
selectIndex: number;
|
||||||
|
humanProperty: HumanProperty;
|
||||||
|
qualityScore?: number; //人脸质量分
|
||||||
|
score: number; // 相似度
|
||||||
|
timestamp: string;
|
||||||
|
bodyImageUrl: string;
|
||||||
|
faceImageUrl: string;
|
||||||
|
algorithmVersion: AlgorithmVersionStr;
|
||||||
|
|
||||||
|
bodySpaceName: string;
|
||||||
|
faceSpaceName: string;
|
||||||
|
position: {
|
||||||
|
lat: number
|
||||||
|
lng: number
|
||||||
|
}
|
||||||
|
|
||||||
|
solutionId?: string;
|
||||||
|
[index: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface IOldImageData {
|
||||||
|
visible?: boolean; // 显示隐藏弹框
|
||||||
|
defaultModel?: MODEL_TYPE; // 视频模式 | 图片模式
|
||||||
|
onClose?: () => void; // 关闭弹框
|
||||||
|
isLoading?: boolean; // 是否加载中
|
||||||
|
hasPre?: boolean; // 向前翻页
|
||||||
|
hasNext?: boolean; // 向后翻页
|
||||||
|
selectIndex?: number; // 选中的数据(dataSource为数组情况下)
|
||||||
|
onSelectIndexChange?: (i: number) => void; // 修改当前下标
|
||||||
|
dataSource: BigImageData[]; // 数据1
|
||||||
|
dataSources: BigImageData[]; // 数据2
|
||||||
|
relatedData?: BigImageData[]; // 数据3
|
||||||
|
transformPropFunc: (item: any) => ISelectItem; // 格式化数据方法
|
||||||
|
transformVideoPropFunc: (
|
||||||
|
item: ISelectItem
|
||||||
|
) => Promise<Omit<VideoViewProps, 'screenshotButtonRender'>>; // 视频模式格式化数据方法
|
||||||
|
screenshotButtonRender?: (screenshotButtonProp: IScreenshotButtonProp) => React.ReactElement;
|
||||||
|
showTool?: boolean; // 是否显示底部菜单
|
||||||
|
showCarousel?: boolean; //
|
||||||
|
imgViewProp?: Partial<ImgViewProps>; // 图片模式的配置
|
||||||
|
videoViewProp?: Partial<VideoViewProps>; // 视频模式的配置
|
||||||
|
ToolProps?: Partial<ToolProps>; // 底部菜单的配置
|
||||||
|
nullDialogProp?: {
|
||||||
|
emptyText?: string;
|
||||||
|
}; // 暂无数据的配置
|
||||||
|
showHeader?: boolean; // 是否显示 description
|
||||||
|
tabsFilter?: TAB_TYPE[]; // tabs 过滤
|
||||||
|
useVirtual?: boolean; // 是否显示虚拟
|
||||||
|
loadNext?: (i: number) => Promise<void>; // 下一个
|
||||||
|
loadPre?: (i: number) => Promise<void>; // 前一个
|
||||||
|
children: React.ReactNode; // 子元素
|
||||||
|
title?: string; // 标题
|
||||||
|
specialTitle?: string; // 对比图模式下标题
|
||||||
|
isRelated?: boolean;
|
||||||
|
carouselProp?: Partial<CarouselProps>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface ImageModalDataProps {
|
||||||
|
targetData: BigImageData[]
|
||||||
|
compactData: BigImageData[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ModalAdapterConfigProps {
|
||||||
|
oldMode?: boolean; // 是否是老模式
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 兼容老数据格式
|
||||||
|
* @param _data 老数据格式
|
||||||
|
* @returns newData
|
||||||
|
*/
|
||||||
|
const translateOldImageData = (_data: IOldImageData) => {
|
||||||
|
return {
|
||||||
|
..._data,
|
||||||
|
open: _data.visible,
|
||||||
|
onCancel: _data.onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大图组件适配器,兼容老接口
|
||||||
|
* @param Cmp 大图组件
|
||||||
|
* @param config 额外配置
|
||||||
|
* @returns 大图组件
|
||||||
|
*/
|
||||||
|
const adapter = (Cmp: any, config: ModalAdapterConfigProps): any => {
|
||||||
|
const { oldMode = false } = config
|
||||||
|
|
||||||
|
return (props: IOldImageData) => {
|
||||||
|
const newProps = oldMode ? translateOldImageData(props) : props
|
||||||
|
console.log('adapter----适配数据', props, newProps)
|
||||||
|
|
||||||
|
// 该属性已经废弃
|
||||||
|
delete newProps.visible
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Cmp
|
||||||
|
{...newProps}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default adapter
|
36
packages/biz/src/BigImage/util/interface.ts
Normal file
36
packages/biz/src/BigImage/util/interface.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
export interface IBigImageModalData {
|
||||||
|
imageKey?: string // 目标图
|
||||||
|
imgSummary?: string // 大图
|
||||||
|
flvUrl?: string // 视频链接
|
||||||
|
compaterImages?: string[] // 对比图
|
||||||
|
odRect?: { // od 框数据
|
||||||
|
"x": number
|
||||||
|
"y": number
|
||||||
|
"w": number
|
||||||
|
"h": number
|
||||||
|
[key: string]: string | number; // 拓展参数
|
||||||
|
}[],
|
||||||
|
attachImg?: { // 小图,只有在场景图模式生效(人脸、形体)
|
||||||
|
"url": string
|
||||||
|
"label": string
|
||||||
|
[key: string]: string
|
||||||
|
}[],
|
||||||
|
score?: number | string // 人脸质量分
|
||||||
|
showScore?: boolean // 人脸质量分
|
||||||
|
cameraPosition?: string // 摄像头位置
|
||||||
|
time?: string // 摄像头拍摄时间
|
||||||
|
objects: { // 拓展参数、可以自由支配
|
||||||
|
objectIndex: {
|
||||||
|
[key: string]: any
|
||||||
|
},
|
||||||
|
objectType: string
|
||||||
|
sourceObjectId: string
|
||||||
|
level: number
|
||||||
|
confidence: number
|
||||||
|
infoOnSource: {
|
||||||
|
[key: string]: any
|
||||||
|
},
|
||||||
|
qualityScore: number
|
||||||
|
[key: string]: any
|
||||||
|
}[]
|
||||||
|
}
|
@ -1,26 +1,47 @@
|
|||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
import React, { forwardRef, useImperativeHandle, useRef, useState, useEffect } from 'react'
|
import React, { forwardRef, useImperativeHandle, useRef, useState, useEffect } from 'react'
|
||||||
import { ConfigProvider, Descriptions, Modal, Tabs, Button, BigImagePreview, VideoPlayer } from '@zhst/meta';
|
import {
|
||||||
|
ConfigProvider,
|
||||||
|
Descriptions,
|
||||||
|
Modal,
|
||||||
|
Tabs,
|
||||||
|
Button,
|
||||||
|
CropperImage,
|
||||||
|
AttachImage,
|
||||||
|
VideoPlayer,
|
||||||
|
BtnGroup,
|
||||||
|
RelatedImage
|
||||||
|
} from '@zhst/meta';
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
import type { ModalProps, DescriptionsProps, TabsProps, VideoViewRef, ImgViewRef } from '@zhst/meta'
|
import type {
|
||||||
import { get, isEmpty } from '@zhst/func';
|
ModalProps,
|
||||||
|
DescriptionsProps,
|
||||||
|
TabsProps,
|
||||||
import './index.less'
|
VideoViewRef,
|
||||||
|
ImgViewRef,
|
||||||
|
CompareImageProps,
|
||||||
|
CropperImageProps,
|
||||||
|
AttachImageProps,
|
||||||
|
BtnGroupProps,
|
||||||
|
ThemeConfig,
|
||||||
|
RelatedImageProps
|
||||||
|
} from '@zhst/meta'
|
||||||
|
import { get, isEmpty, pick } from '@zhst/func';
|
||||||
import Navigation from './components/navigation';
|
import Navigation from './components/navigation';
|
||||||
import CombineImage from './components/CombineImage'
|
import CombineImage from './components/CombineImage'
|
||||||
import { BIG_IMAGE_DATA } from './mock'
|
import './index.less'
|
||||||
|
|
||||||
const DescriptionsItem = Descriptions.Item
|
const DescriptionsItem = Descriptions.Item
|
||||||
|
|
||||||
export const componentPrefix = 'zhst-image'
|
export const componentPrefix = 'zhst-image'
|
||||||
|
|
||||||
export type TAB_TYPE = 'COMPATER' | 'NORMAL' | 'VIDEO';
|
export type TAB_TYPE = 'COMPATER' | 'NORMAL' | 'VIDEO'; // 对比图模式、场景图模式、视频模式
|
||||||
export type MODEL_TYPE = 'VIDEO' | 'IMAGE';
|
export type MODEL_TYPE = 'VIDEO' | 'IMAGE';
|
||||||
|
|
||||||
export interface BigImageModalProps extends ModalProps {
|
export interface BigImageModalProps {
|
||||||
visible: boolean // 弹框显示隐藏
|
visible: boolean // 弹框显示隐藏
|
||||||
activeTab?: TAB_TYPE // 当前 tab
|
activeTab?: TAB_TYPE // 当前 tab
|
||||||
|
width?: number | string
|
||||||
attributeList: {
|
attributeList: {
|
||||||
title: string;
|
title: string;
|
||||||
children: Pick<DescriptionsProps, 'items'>
|
children: Pick<DescriptionsProps, 'items'>
|
||||||
@ -30,18 +51,33 @@ export interface BigImageModalProps extends ModalProps {
|
|||||||
key: TAB_TYPE // !! TRACK 模式已废弃、新增:VIDEO 模式
|
key: TAB_TYPE // !! TRACK 模式已废弃、新增:VIDEO 模式
|
||||||
} // 导航栏列表
|
} // 导航栏列表
|
||||||
}
|
}
|
||||||
|
tabsProps?: TabsProps // tab菜单的透传
|
||||||
dataSource: any
|
dataSource: any
|
||||||
imageData: any
|
onCancel?: () => void
|
||||||
|
|
||||||
relatedData: any
|
isRelated?: boolean // 人脸碰撞功能打开
|
||||||
isRelated?: boolean
|
|
||||||
|
|
||||||
footer?: React.ReactNode
|
footer?: React.ReactNode
|
||||||
showCarousel?: boolean
|
|
||||||
|
|
||||||
onTabChange?: (newVal?: TAB_TYPE, oldVal?: TAB_TYPE) => void
|
onTabChange?: (newVal?: TAB_TYPE, oldVal?: TAB_TYPE) => void
|
||||||
onIndexChange?: (newVal?: number, oldVal?: number) => void
|
|
||||||
transformPropFunc: (data: any) => void // 格式化数据方法
|
compareImageProps?: CompareImageProps
|
||||||
|
modalProps?: ModalProps
|
||||||
|
cropperImageProps?: CropperImageProps & {
|
||||||
|
showEditTools?: boolean
|
||||||
|
}
|
||||||
|
showNavigation?: boolean // 是否展示箭头
|
||||||
|
prevButtonProps?: any;
|
||||||
|
onPrevButtonClick?: () => void;
|
||||||
|
nextButtonProps?: any
|
||||||
|
onNextButtonClick?: () => void;
|
||||||
|
btnGroupProps?: BtnGroupProps;
|
||||||
|
|
||||||
|
descriptionsProps?: DescriptionsProps
|
||||||
|
relatedImageProps?: RelatedImageProps
|
||||||
|
|
||||||
|
theme?: ThemeConfig
|
||||||
|
children?: React.ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
interface BigModalRef {
|
interface BigModalRef {
|
||||||
@ -52,7 +88,6 @@ interface BigModalRef {
|
|||||||
setActiveKey: (val: string) => void
|
setActiveKey: (val: string) => void
|
||||||
videoPlayerRef: VideoViewRef
|
videoPlayerRef: VideoViewRef
|
||||||
combineImageRef: any
|
combineImageRef: any
|
||||||
bigImagePreviewRef: ImgViewRef
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialStyle ={
|
const initialStyle ={
|
||||||
@ -63,45 +98,76 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
const {
|
const {
|
||||||
// 配置
|
// 配置
|
||||||
title = '-',
|
title = '-',
|
||||||
|
width,
|
||||||
open,
|
open,
|
||||||
children,
|
children,
|
||||||
|
onCancel,
|
||||||
activeTab,
|
activeTab,
|
||||||
attributeList = [],
|
attributeList = [],
|
||||||
isRelated = false,
|
isRelated = false,
|
||||||
tabs = {},
|
tabs = {},
|
||||||
footer = null,
|
footer = null,
|
||||||
showCarousel = true,
|
|
||||||
// 数据
|
// 数据
|
||||||
dataSource = [], // 总数据源,只允许有一份
|
dataSource = {}, // 总数据源,只允许有一份
|
||||||
imageData = [],
|
|
||||||
relatedData = [],
|
|
||||||
// 事件
|
// 事件
|
||||||
onIndexChange,
|
|
||||||
onTabChange,
|
onTabChange,
|
||||||
transformPropFunc
|
compareImageProps,
|
||||||
|
showNavigation,
|
||||||
|
modalProps,
|
||||||
|
cropperImageProps,
|
||||||
|
prevButtonProps,
|
||||||
|
onPrevButtonClick,
|
||||||
|
onNextButtonClick,
|
||||||
|
nextButtonProps,
|
||||||
|
tabsProps,
|
||||||
|
btnGroupProps,
|
||||||
|
descriptionsProps,
|
||||||
|
relatedImageProps,
|
||||||
|
theme,
|
||||||
} = props
|
} = props
|
||||||
|
|
||||||
const combineImageRef = useRef(null)
|
const combineImageRef = useRef(null)
|
||||||
const bigImagePreviewRef = useRef(null)
|
|
||||||
const videoPlayerRef = useRef(null)
|
const videoPlayerRef = useRef(null)
|
||||||
const modalRef = useRef(null)
|
const modalRef = useRef(null)
|
||||||
|
|
||||||
// ========================== 头切换 =========================
|
// ========================== 头切换 =========================
|
||||||
const [tab, setTab] = useState<TAB_TYPE>(activeTab || get(tabsConfig, 'data[0].key'));
|
const [tab, setTab] = useState<TAB_TYPE>(activeTab || get(tabsProps, 'data[0].key'));
|
||||||
const [activeKey, setActiveKey] = useState<string>('related');
|
const [activeKey, setActiveKey] = useState<string>('related');
|
||||||
|
|
||||||
// ========================= 预览切换下标 =========================
|
// ========================= 预览切换下标 =========================
|
||||||
const [currentIndex, setCurrentIndex] = useState<number>(0)
|
const [cropType, setCropType] = useState<'auto' | 'custom' | 'close'>('auto')
|
||||||
|
const cropBtnDataSource = [
|
||||||
|
{
|
||||||
|
key: 'close',
|
||||||
|
icon: 'icon-danchuangguanbi',
|
||||||
|
title: '退出',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'auto',
|
||||||
|
icon: 'icon-zidong',
|
||||||
|
title: '智能框选',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'custom',
|
||||||
|
icon: 'icon-shoudong',
|
||||||
|
title: '手动框选',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const tabsConfig = !isEmpty(tabs) ? tabs : {
|
const handleCropBtnClick = (v: string) => {
|
||||||
data: [
|
setCropType(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
const defaultTabsProps: TabsProps = !isEmpty(tabs) ? tabs : {
|
||||||
|
items: [
|
||||||
{
|
{
|
||||||
label: '对比图模式',
|
label: '对比图模式',
|
||||||
key: 'COMPATER',
|
key: 'COMPATER',
|
||||||
children: (
|
children: (
|
||||||
<CombineImage
|
<CombineImage
|
||||||
ref={combineImageRef}
|
ref={combineImageRef}
|
||||||
data={dataSource[currentIndex] || {}}
|
data={pick(dataSource, 'compaterImage', 'imgSummary', 'imageKey', 'score')}
|
||||||
|
{...compareImageProps}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
@ -109,34 +175,54 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
label: '场景图模式',
|
label: '场景图模式',
|
||||||
key: 'NORMAL',
|
key: 'NORMAL',
|
||||||
children: (
|
children: (
|
||||||
<BigImagePreview
|
<div style={{ display: 'flex', justifyContent: 'center', width: '100%' }}>
|
||||||
ref={bigImagePreviewRef}
|
<div style={{ width: '85%', height: '500px' }}>
|
||||||
height={'500px'}
|
<CropperImage
|
||||||
data={dataSource[currentIndex]}
|
type='rect'
|
||||||
|
odList={get(dataSource, 'odRect', [])}
|
||||||
|
{...cropperImageProps}
|
||||||
|
>
|
||||||
|
{!cropperImageProps?.editAble && (
|
||||||
|
<>
|
||||||
|
<AttachImage
|
||||||
|
data={[
|
||||||
|
{ label: '测试', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' }
|
||||||
|
]}
|
||||||
/>
|
/>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
right: '24px',
|
||||||
|
bottom: '24px',
|
||||||
|
fontSize: '18px',
|
||||||
|
color: 'red',
|
||||||
|
cursor: 'default'
|
||||||
|
}}
|
||||||
|
>{`人脸质量分:${(Number(cropperImageProps?.score) as number).toFixed(2)}`}</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{cropperImageProps?.showEditTools && (
|
||||||
|
<BtnGroup
|
||||||
|
circle
|
||||||
|
style={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
right: 0
|
||||||
|
}}
|
||||||
|
dataSource={cropBtnDataSource}
|
||||||
|
onClick={handleCropBtnClick}
|
||||||
|
selectKey={cropType}
|
||||||
|
{...btnGroupProps}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</CropperImage>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: 页面初始化
|
|
||||||
useEffect(() => {
|
|
||||||
(async () => {
|
|
||||||
let data: any = {};
|
|
||||||
// if (isRelated) {
|
|
||||||
// data = await transformPropFunc(imageData[currentIndex]);
|
|
||||||
// } else {
|
|
||||||
// data = await transformPropFunc(dataSource[currentIndex]);
|
|
||||||
// }
|
|
||||||
// setAttributeList(get(data, 'attributeList', []));
|
|
||||||
//防背推
|
|
||||||
// if (currentIndex === latestSelectIndex.current) {
|
|
||||||
// setSelectItem(data);
|
|
||||||
// }
|
|
||||||
})();
|
|
||||||
}, [currentIndex, dataSource, imageData, isRelated]);
|
|
||||||
|
|
||||||
// 暴露 ref 实例
|
// 暴露 ref 实例
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
ref,
|
ref,
|
||||||
@ -147,18 +233,19 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
setActiveKey,
|
setActiveKey,
|
||||||
videoPlayerRef,
|
videoPlayerRef,
|
||||||
combineImageRef,
|
combineImageRef,
|
||||||
bigImagePreviewRef,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
|
width={width}
|
||||||
open={open}
|
open={open}
|
||||||
ref={modalRef}
|
ref={modalRef}
|
||||||
footer={footer}
|
footer={footer}
|
||||||
className={componentPrefix}
|
className={componentPrefix}
|
||||||
title={title}
|
title={title}
|
||||||
{...props}
|
onCancel={onCancel}
|
||||||
|
{...modalProps}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
@ -179,6 +266,7 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
contentColor: 'rgba(0,0,0,0.88)',
|
contentColor: 'rgba(0,0,0,0.88)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
...theme
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{attributeList.map(descriptions => (
|
{attributeList.map(descriptions => (
|
||||||
@ -191,6 +279,7 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
}
|
}
|
||||||
column={8}
|
column={8}
|
||||||
style={{ padding: '0 64px' }}
|
style={{ padding: '0 64px' }}
|
||||||
|
{...descriptionsProps}
|
||||||
>
|
>
|
||||||
{descriptions?.children?.map(item => (
|
{descriptions?.children?.map(item => (
|
||||||
<DescriptionsItem
|
<DescriptionsItem
|
||||||
@ -218,70 +307,49 @@ const BigImageModal: React.FC<BigImageModalProps, BigModalRef> = forwardRef((pro
|
|||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
tabBarStyle={{ fontSize: '18px', fontWeight:'bold' }}
|
tabBarStyle={{ fontSize: '18px', fontWeight:'bold' }}
|
||||||
items={tabsConfig.data}
|
{...defaultTabsProps}
|
||||||
{...tabsConfig}
|
{...tabsProps}
|
||||||
/>
|
/>
|
||||||
{/* --------------------------------- 视频播放模式 --------------------------------- */}
|
{/* --------------------------------- 视频播放模式 --------------------------------- */}
|
||||||
{tab === 'VIDEO' && (
|
{tab === 'VIDEO' && (
|
||||||
<VideoPlayer ref={videoPlayerRef} url={dataSource[currentIndex]?.flvUrl} />
|
<VideoPlayer ref={videoPlayerRef} url={dataSource?.flvUrl} />
|
||||||
)}
|
)}
|
||||||
{/* 切换按钮组件 */}
|
{/* 切换按钮组件 */}
|
||||||
{/* ----------------------------------- 上一张按钮 ---------------------------------- */}
|
{/* ----------------------------------- 上一张按钮 ---------------------------------- */}
|
||||||
<Navigation
|
<Navigation
|
||||||
className={classNames(
|
className={classNames(
|
||||||
`${componentPrefix}-view-container__nav`,
|
`${componentPrefix}-view-container__nav`,
|
||||||
currentIndex <= 0 && `${componentPrefix}-view-container__nav--disabled`,
|
prevButtonProps?.disabled && `${componentPrefix}-view-container__nav--disabled`,
|
||||||
`${componentPrefix}-view-container__nav--left`
|
`${componentPrefix}-view-container__nav--left`
|
||||||
)}
|
)}
|
||||||
show={isRelated ? (imageData.length > 1) : (dataSource.length > 1)}
|
|
||||||
disabled={currentIndex <= 0}
|
|
||||||
prev
|
prev
|
||||||
onClick={() => {
|
show={showNavigation}
|
||||||
setCurrentIndex((pre) => {
|
onClick={onPrevButtonClick}
|
||||||
onIndexChange?.(pre - 1, pre)
|
{...prevButtonProps}
|
||||||
return pre - 1
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{/* ----------------------------------- 下一张按钮 ---------------------------------- */}
|
{/* ----------------------------------- 下一张按钮 ---------------------------------- */}
|
||||||
<Navigation
|
<Navigation
|
||||||
className={classNames(
|
className={classNames(
|
||||||
`${componentPrefix}-view-container__nav`,
|
`${componentPrefix}-view-container__nav`,
|
||||||
((currentIndex >= imageData.length - 1) || (currentIndex >= dataSource.length - 1)) && `${componentPrefix}-view-container__nav--disabled`,
|
nextButtonProps?.disabled && `${componentPrefix}-view-container__nav--disabled`,
|
||||||
`${componentPrefix}-view-container__nav--right`
|
`${componentPrefix}-view-container__nav--right`
|
||||||
)}
|
)}
|
||||||
show={isRelated ? (imageData.length > 1) : (dataSource.length > 1)}
|
|
||||||
disabled={((currentIndex >= imageData.length - 1) || (currentIndex >= dataSource.length - 1))}
|
|
||||||
next
|
next
|
||||||
onClick={async (e) => {
|
show={showNavigation}
|
||||||
setCurrentIndex((pre) => {
|
onClick={onNextButtonClick}
|
||||||
onIndexChange?.(pre + 1, pre)
|
{...nextButtonProps}
|
||||||
return pre + 1
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
{/* --------------------------------- 模型碰撞组件 --------------------------------- */}
|
{/* ----------------------------------- 人脸碰撞组件 ---------------------------------- */}
|
||||||
{/* {isRelated && (
|
{isRelated && (
|
||||||
<div className="relatedWrapper">
|
<div style={{ margin: '24px 0' }}>
|
||||||
<Tabs
|
<RelatedImage
|
||||||
className="relatedTabs"
|
{...relatedImageProps}
|
||||||
tabPosition={'left'}
|
|
||||||
activeKey={activeKey}
|
|
||||||
onChange={(key: string) => {
|
|
||||||
setActiveKey(key);
|
|
||||||
}}
|
|
||||||
items={tabList.map((item) => {
|
|
||||||
return {
|
|
||||||
label: item.label,
|
|
||||||
key: item.key,
|
|
||||||
children: item.children,
|
|
||||||
};
|
|
||||||
})}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)} */}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{children}
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -1,22 +1,33 @@
|
|||||||
|
|
||||||
import React, { FC, useRef, forwardRef, useImperativeHandle, useState } from 'react';
|
import React, { FC, useRef, forwardRef, useImperativeHandle } from 'react';
|
||||||
import { CompareImage, Flex, Score } from '@zhst/meta'
|
import { CompareImage, Flex, Score } from '@zhst/meta'
|
||||||
|
|
||||||
interface ComBineImageProps {
|
interface ComBineImageProps {
|
||||||
data: {
|
data: {
|
||||||
imgSummary: string;
|
imgSummary: string;
|
||||||
compaterImages: string[];
|
compaterImage: string;
|
||||||
imageKey: string;
|
imageKey: string;
|
||||||
score: number;
|
score: number;
|
||||||
}
|
}
|
||||||
|
prevDisable?: boolean;
|
||||||
|
nextDisable?: boolean;
|
||||||
|
onPre?: () => void;
|
||||||
|
onNext?: () => void;
|
||||||
|
openRoll?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const ComBineImage: FC<ComBineImageProps> = forwardRef((props, ref) => {
|
const ComBineImage: FC<ComBineImageProps> = forwardRef((props, ref) => {
|
||||||
const { data } = props
|
const {
|
||||||
const { imgSummary, compaterImages = [] } = data
|
data,
|
||||||
|
prevDisable,
|
||||||
|
nextDisable,
|
||||||
|
onNext,
|
||||||
|
onPre,
|
||||||
|
openRoll
|
||||||
|
} = props
|
||||||
|
const { imgSummary, compaterImage, score } = data
|
||||||
const targetImageRef = useRef(null)
|
const targetImageRef = useRef(null)
|
||||||
const compareImageRef = useRef(null)
|
const compareImageRef = useRef(null)
|
||||||
const [targetIndex, setTargetIndex] = useState(compaterImages.findIndex(_url => imgSummary === _url) || 0)
|
|
||||||
|
|
||||||
useImperativeHandle(ref, () => ({
|
useImperativeHandle(ref, () => ({
|
||||||
compareImageRef,
|
compareImageRef,
|
||||||
@ -27,21 +38,21 @@ const ComBineImage: FC<ComBineImageProps> = forwardRef((props, ref) => {
|
|||||||
<Flex justify='space-evenly' align='center' style={{ padding:'0 32px' }}>
|
<Flex justify='space-evenly' align='center' style={{ padding:'0 32px' }}>
|
||||||
<CompareImage
|
<CompareImage
|
||||||
ref={targetImageRef}
|
ref={targetImageRef}
|
||||||
preDisable={targetIndex === 0}
|
preDisable={prevDisable}
|
||||||
nextDisable={targetIndex >= compaterImages.length - 1}
|
nextDisable={nextDisable}
|
||||||
onNext={() => setTargetIndex(targetIndex + 1)}
|
onNext={onNext}
|
||||||
onPre={() => setTargetIndex(targetIndex - 1)}
|
onPre={onPre}
|
||||||
showScore={false}
|
showScore={false}
|
||||||
openRoll={!!compaterImages.length}
|
openRoll={openRoll}
|
||||||
url={compaterImages[targetIndex] || imgSummary}
|
url={imgSummary}
|
||||||
label="目标图"
|
label="目标图"
|
||||||
/>
|
/>
|
||||||
<Score score={data.score} />
|
<Score score={score} />
|
||||||
<CompareImage
|
<CompareImage
|
||||||
ref={compareImageRef}
|
ref={compareImageRef}
|
||||||
url={data.imageKey}
|
url={compaterImage}
|
||||||
openRoll={false}
|
openRoll={false}
|
||||||
score={data.score}
|
score={score}
|
||||||
label="对比图"
|
label="对比图"
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
:global {
|
:global {
|
||||||
i:hover {
|
i:hover {
|
||||||
color: #f0f0f0 !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,10 +35,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&-prev {
|
&-prev {
|
||||||
left: 20px;
|
left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-next {
|
&-next {
|
||||||
right: 20px;
|
right: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
import { Icon, Button } from '@zhst/meta';
|
import { Button } from '@zhst/meta';
|
||||||
|
import { IconFont } from '@zhst/icon'
|
||||||
import './index.less';
|
import './index.less';
|
||||||
|
|
||||||
const componentName = `zhst-image__nav`;
|
const componentName = `zhst-image__nav`;
|
||||||
@ -28,8 +29,8 @@ const Navigation: React.FC<{
|
|||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Button type="text" disabled={disabled} onClick={onClick}>
|
<Button type="text" disabled={disabled} shape='circle' onClick={onClick}>
|
||||||
<Icon size={28} color={color} icon={prev ? 'icon-qiehuanzuo' : 'icon-qiehuanyou'} />
|
<IconFont size={28} color={color} icon={prev ? 'icon-qiehuanzuo' : 'icon-qiehuanyou'} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -11,6 +11,8 @@ const BigModal = (props: any) => {
|
|||||||
} = props
|
} = props
|
||||||
const [visible, setVisible] = useState(true)
|
const [visible, setVisible] = useState(true)
|
||||||
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
||||||
|
const [selectedItemKey, setSelectedItemKey] = useState()
|
||||||
|
const [editAble, setEditAble] = useState(false)
|
||||||
const modalRef = useRef(null)
|
const modalRef = useRef(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -29,19 +31,30 @@ const BigModal = (props: any) => {
|
|||||||
footer={(
|
footer={(
|
||||||
<Space>
|
<Space>
|
||||||
<Button onClick={() => modalRef.current?.setTab('VIDEO')} >查看视频</Button>
|
<Button onClick={() => modalRef.current?.setTab('VIDEO')} >查看视频</Button>
|
||||||
<Button onClick={() => modalRef.current?.bigImagePreviewRef.current.setShowCrop(true)} >编辑模式</Button>
|
<Button onClick={() => modalRef.current?.setTab('COMPATER')} >对比图模式</Button>
|
||||||
<Button onClick={() => modalRef.current?.bigImagePreviewRef.current.setShowCrop(false)} >取消编辑</Button>
|
|
||||||
</Space>
|
</Space>
|
||||||
)}
|
)}
|
||||||
|
showNavigation
|
||||||
open={visible}
|
open={visible}
|
||||||
ref={modalRef}
|
ref={modalRef}
|
||||||
onCancel={() => setVisible(false)}
|
onCancel={() => setVisible(false)}
|
||||||
dataSource={dataSource}
|
dataSource={dataSource}
|
||||||
imageData={dataSource}
|
onTabChange={(newVal, oldVal) => console.log(oldVal, newVal)}
|
||||||
onIndexChange={(oldVal, newVal) => console.log(oldVal, newVal)}
|
|
||||||
onTabChange={(oldVal, newVal) => console.log(oldVal, newVal)}
|
|
||||||
width={1098}
|
width={1098}
|
||||||
attributeList={attributeList}
|
attributeList={attributeList}
|
||||||
|
cropperImageProps={{
|
||||||
|
editAble,
|
||||||
|
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
|
||||||
|
score: 50,
|
||||||
|
showEditTools: true
|
||||||
|
}}
|
||||||
|
btnGroupProps={{
|
||||||
|
onClick: v => {
|
||||||
|
v === 'custom' && setEditAble(true)
|
||||||
|
v === 'close' && setEditAble(false)
|
||||||
|
v === 'auto' && console.log('自动补点')
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
</BigImageModal>
|
</BigImageModal>
|
||||||
</div>
|
</div>
|
||||||
|
57
packages/biz/src/BigImageModal/demo/noDescription.tsx
Normal file
57
packages/biz/src/BigImageModal/demo/noDescription.tsx
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { BigImageModal } from '@zhst/biz'
|
||||||
|
import { Button, Space } from '@zhst/meta'
|
||||||
|
import { BIG_IMAGE_DATA, attributeList } from '../mock'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const BigModal = (props: any) => {
|
||||||
|
const {
|
||||||
|
} = props
|
||||||
|
const [visible, setVisible] = useState(false)
|
||||||
|
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
||||||
|
const [selectedItemKey, setSelectedItemKey] = useState()
|
||||||
|
const [editAble, setEditAble] = useState(false)
|
||||||
|
const modalRef = useRef(null)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(modalRef.current)
|
||||||
|
}, [modalRef.current?.currentIndex])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(modalRef.current)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Button onClick={() => setVisible(true)} >查看大图</Button>
|
||||||
|
<BigImageModal
|
||||||
|
title="查看大图"
|
||||||
|
showNavigation
|
||||||
|
open={visible}
|
||||||
|
ref={modalRef}
|
||||||
|
onCancel={() => setVisible(false)}
|
||||||
|
dataSource={dataSource}
|
||||||
|
onTabChange={(newVal, oldVal) => console.log(oldVal, newVal)}
|
||||||
|
width={1098}
|
||||||
|
cropperImageProps={{
|
||||||
|
editAble,
|
||||||
|
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
|
||||||
|
score: 50,
|
||||||
|
showEditTools: true
|
||||||
|
}}
|
||||||
|
btnGroupProps={{
|
||||||
|
onClick: v => {
|
||||||
|
v === 'custom' && setEditAble(true)
|
||||||
|
v === 'close' && setEditAble(false)
|
||||||
|
v === 'auto' && console.log('自动补点')
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
</BigImageModal>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BigModal
|
59
packages/biz/src/BigImageModal/demo/withRelatedImage.tsx
Normal file
59
packages/biz/src/BigImageModal/demo/withRelatedImage.tsx
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
|
import { BigImageModal } from '@zhst/biz'
|
||||||
|
import { Button, Space } from '@zhst/meta'
|
||||||
|
import { BIG_IMAGE_DATA, attributeList, RELATED_IMAGES } from '../mock'
|
||||||
|
|
||||||
|
const BigModal = (props: any) => {
|
||||||
|
const {
|
||||||
|
} = props
|
||||||
|
const [visible, setVisible] = useState(false)
|
||||||
|
const [dataSource, setDataSource] = useState(BIG_IMAGE_DATA)
|
||||||
|
const [selectedItemKey, setSelectedItemKey] = useState()
|
||||||
|
const [editAble, setEditAble] = useState(false)
|
||||||
|
const modalRef = useRef(null)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Button onClick={() => setVisible(true)} >查看大图</Button>
|
||||||
|
<BigImageModal
|
||||||
|
title="查看大图"
|
||||||
|
showNavigation
|
||||||
|
open={visible}
|
||||||
|
ref={modalRef}
|
||||||
|
onCancel={() => setVisible(false)}
|
||||||
|
dataSource={dataSource}
|
||||||
|
onTabChange={(newVal, oldVal) => console.log(oldVal, newVal)}
|
||||||
|
width={1098}
|
||||||
|
attributeList={attributeList}
|
||||||
|
cropperImageProps={{
|
||||||
|
editAble,
|
||||||
|
url: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
|
||||||
|
score: 50,
|
||||||
|
showEditTools: true
|
||||||
|
}}
|
||||||
|
btnGroupProps={{
|
||||||
|
onClick: v => {
|
||||||
|
v === 'custom' && setEditAble(true)
|
||||||
|
v === 'close' && setEditAble(false)
|
||||||
|
v === 'auto' && console.log('自动补点')
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
isRelated
|
||||||
|
relatedImageProps={{
|
||||||
|
carouselWidth: '900px',
|
||||||
|
activeTab: 'related',
|
||||||
|
selectedItemKey,
|
||||||
|
data: RELATED_IMAGES,
|
||||||
|
onCancel: () => console.log('取消关联'),
|
||||||
|
onConnect: () => console.log('关联'),
|
||||||
|
onTabChange: (newVal, oldVal) => console.log('tab切换', newVal, oldVal),
|
||||||
|
onItemSelecteditem: (item) => setSelectedItemKey(item.key)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
</BigImageModal>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default BigModal
|
@ -160,75 +160,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.zhst-image__carousel {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
width: 742px;
|
|
||||||
height: 100px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
border: 1px solid #f0f0f0;
|
|
||||||
margin: 0 auto;
|
|
||||||
background: #fafafa;
|
|
||||||
border-radius: 2px;
|
|
||||||
user-select: none;
|
|
||||||
|
|
||||||
&-container {
|
|
||||||
width: (58px + 8px) * 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item {
|
|
||||||
display: flex;
|
|
||||||
width: 58px + 8px;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-item-img {
|
|
||||||
/* 尝试消除transform 副作用 */
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
// width: 58px;
|
|
||||||
// height: 76px;
|
|
||||||
display: flex;
|
|
||||||
width: 66px;
|
|
||||||
height: 84px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: #fafafa;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
/* 尝试消除transform 副作用 end */
|
|
||||||
&--active {
|
|
||||||
border: 2px solid #09f;
|
|
||||||
border-radius: 1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&>div {
|
|
||||||
/* 尝试消除transform 副作用 */
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
overflow: hidden;
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
|
|
||||||
/* 尝试消除transform 副作用 end */
|
|
||||||
&>img {
|
|
||||||
width: 58px;
|
|
||||||
height: 76px;
|
|
||||||
object-fit: contain;
|
|
||||||
transition: all 0.2s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
transform: scale(1.5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.zhst-image__trackmodel {
|
.zhst-image__trackmodel {
|
||||||
&__panel {
|
&__panel {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -454,61 +385,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.relatedWrapper {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
padding: 0 30px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.relatedTabs {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedContent {
|
|
||||||
width: 100%;
|
|
||||||
height: 100px;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.relatedPics {
|
|
||||||
width: 742px;
|
|
||||||
height: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.disabled {
|
|
||||||
color: rgba(0, 0, 0, 25%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.relatedBtn {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
display: flex;
|
|
||||||
align-items: flex-end;
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: #09f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:global {
|
|
||||||
.ant-tabs-left>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane {
|
|
||||||
padding-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-tabs-tab {
|
|
||||||
padding: 8px 12px !important;
|
|
||||||
text-align: right !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-tabs .ant-tabs-tab {
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: right;
|
|
||||||
justify-content: flex-end;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -2,14 +2,93 @@
|
|||||||
group: 进阶组件
|
group: 进阶组件
|
||||||
category: Components
|
category: Components
|
||||||
subtitle: 大图预览组件
|
subtitle: 大图预览组件
|
||||||
|
toc: content
|
||||||
title: BigImagePreview 大图预览组件
|
title: BigImagePreview 大图预览组件
|
||||||
demo:
|
demo:
|
||||||
cols: 2
|
cols: 2
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 大图弹框
|
||||||
# 大图弹框
|
|
||||||
|
|
||||||
<code src="./demo/index.tsx">基本</code>
|
<code src="./demo/index.tsx">基本</code>
|
||||||
<code src="./demo/oldData.tsx">老数据版本</code>
|
<code src="./demo/withRelatedImage.tsx">人脸碰撞模型</code>
|
||||||
|
<code src="./demo/noDescription.tsx">不要描述</code>
|
||||||
|
|
||||||
|
### API
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| dataSource | 数据源 | DataProps | - | |
|
||||||
|
| visible | 弹框显示隐藏 | boolean | - | |
|
||||||
|
| activeTab | 模式 | 'COMPATER' 'NORMAL' 'VIDEO' | - | 对比图模式、场景图模式、视频模式 |
|
||||||
|
| width | 宽度 | string number | - | |
|
||||||
|
| attributeList | 图片列表 | IAttributeList | - | |
|
||||||
|
| tabs | 图片列表 | DataProps | - | |
|
||||||
|
| tabsProps | tab菜单的透传,参考 antd-tabs | TabsProps | - | |
|
||||||
|
| onTabChange | tab切换 | (newVal?: TAB_TYPE, oldVal?: TAB_TYPE) => void | - | |
|
||||||
|
| isRelated | 人脸碰撞功能 | boolean | - | |
|
||||||
|
| footer | 底部dom | React.ReactNode | - | |
|
||||||
|
| onCancel | 关闭弹框 | () => void | - | |
|
||||||
|
| compareImageProps | 参考@zhst/meta-CompareImage | CompareImageProps | - | |
|
||||||
|
| modalProps | 参考antd-Modal | ModalProps | - | |
|
||||||
|
| cropperImageProps | 参考@zhst/meta-cropperImage | cropperImageProps | - | |
|
||||||
|
| prevButtonProps | 上一页透传 | any | - | |
|
||||||
|
| onPrevButtonClick | 上一页 | () => void | - | |
|
||||||
|
| nextButtonProps | 下一页透传 | any | - | |
|
||||||
|
| onNextButtonClick | 下一页 | () => void | - | |
|
||||||
|
| btnGroupProps | 参考@zhst/meta-btnGroup | ModalProps | - | |
|
||||||
|
| descriptionsProps | 参考antd-descriptions | ModalProps | - | |
|
||||||
|
| relatedImageProps | 参考@zhst/meta-relatedImage | RelatedImageProps | - | |
|
||||||
|
| theme | 参考antd-themeConfig | ThemeConfig | - | |
|
||||||
|
| children | 参考antd-Modal | React.ReactNode | - | |
|
||||||
|
|
||||||
|
### IBigImageModalData
|
||||||
|
|
||||||
|
```js
|
||||||
|
export interface IBigImageModalData {
|
||||||
|
imageKey?: string // 目标图
|
||||||
|
imgSummary?: string // 大图
|
||||||
|
flvUrl?: string // 视频链接
|
||||||
|
compaterImage?: string // 对比图
|
||||||
|
odRect?: { // od 框数据
|
||||||
|
"x": number
|
||||||
|
"y": number
|
||||||
|
"w": number
|
||||||
|
"h": number
|
||||||
|
[key: string]: string | number; // 拓展参数
|
||||||
|
}[],
|
||||||
|
attachImg?: { // 小图,只有在场景图模式生效(人脸、形体)
|
||||||
|
"url": string
|
||||||
|
"label": string
|
||||||
|
[key: string]: string
|
||||||
|
}[],
|
||||||
|
score?: number | string // 人脸质量分
|
||||||
|
showScore?: boolean // 人脸质量分
|
||||||
|
cameraPosition?: string // 摄像头位置
|
||||||
|
time?: string // 摄像头拍摄时间
|
||||||
|
objects: { // 拓展参数、可以自由支配
|
||||||
|
objectIndex: {
|
||||||
|
[key: string]: any
|
||||||
|
},
|
||||||
|
objectType: string
|
||||||
|
sourceObjectId: string
|
||||||
|
level: number
|
||||||
|
confidence: number
|
||||||
|
infoOnSource: {
|
||||||
|
[key: string]: any
|
||||||
|
},
|
||||||
|
qualityScore: number
|
||||||
|
[key: string]: any
|
||||||
|
}[]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### IAttributeList
|
||||||
|
|
||||||
|
```js
|
||||||
|
type IAttributeList {
|
||||||
|
title: string;
|
||||||
|
children: Pick<DescriptionsProps, 'items'>
|
||||||
|
}[]
|
||||||
|
```
|
||||||
|
|
||||||
|
@ -11,8 +11,7 @@ export const IMAGE_DATA = {
|
|||||||
4,
|
4,
|
||||||
20
|
20
|
||||||
],
|
],
|
||||||
"dataSource": [
|
"dataSource": {
|
||||||
{
|
|
||||||
"objectId": "1742110565582518272",
|
"objectId": "1742110565582518272",
|
||||||
"condition": {
|
"condition": {
|
||||||
"featureInfo": null,
|
"featureInfo": null,
|
||||||
@ -100,179 +99,6 @@ export const IMAGE_DATA = {
|
|||||||
"cameraId": "129533",
|
"cameraId": "129533",
|
||||||
"cameraName": "4楼门口过道人脸"
|
"cameraName": "4楼门口过道人脸"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"objectId": "1742092680994764802",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.7007122,
|
|
||||||
"timestamp": 1704182225679,
|
|
||||||
"deviceId": "129533",
|
|
||||||
"id": "129533",
|
|
||||||
"name": "4楼门口过道人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.125,
|
|
||||||
"latitude": 30.280500411987305,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742092680994764802",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129533",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742092646219790337",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704182225679",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 1920,
|
|
||||||
"originHeight": 1080,
|
|
||||||
"offsetTime": "20448387",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.5265625,
|
|
||||||
"y": 0.49537036,
|
|
||||||
"w": 0.104166664,
|
|
||||||
"h": 0.35833332
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.465625,
|
|
||||||
"y": 0.40648147,
|
|
||||||
"w": 0.22708334,
|
|
||||||
"h": 0.537963
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092681720379392.jpg",
|
|
||||||
"confidence": 0.769764,
|
|
||||||
"sourceObjectId": "1742092681720379392",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 0,
|
|
||||||
"subObjectType": [],
|
|
||||||
"subObjectIds": [],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"compaterImages": [
|
|
||||||
"http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"
|
|
||||||
],
|
|
||||||
"imgSummary": "singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092680994764802.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129533/1742092681720379392.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129533",
|
|
||||||
"cameraName": "4楼门口过道人脸"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"objectId": "1742092514409592832",
|
|
||||||
"condition": {
|
|
||||||
"featureInfo": null,
|
|
||||||
"featureData": "AAAAAAAAAAAAAAAAAAAAAAAA==",
|
|
||||||
"imageData": "",
|
|
||||||
"alg": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"rect": {
|
|
||||||
"x": 0.271875,
|
|
||||||
"y": 0.32222223,
|
|
||||||
"w": 0.2859375,
|
|
||||||
"h": 0.67777777
|
|
||||||
},
|
|
||||||
"objectImageUrl": "singer-20240102/1/129529/1742047651878156288.jpg",
|
|
||||||
"srcImageUrl": "singer-20240102/1/129529/1742047652511496192.jpg"
|
|
||||||
},
|
|
||||||
"score": 0.703765,
|
|
||||||
"timestamp": 1704182186451,
|
|
||||||
"deviceId": "129529",
|
|
||||||
"id": "129529",
|
|
||||||
"name": "4入口人脸",
|
|
||||||
"dirid": "0",
|
|
||||||
"status": "1",
|
|
||||||
"longitude": 120.12100219726562,
|
|
||||||
"latitude": 30.280099868774414,
|
|
||||||
"caseId": "0",
|
|
||||||
"caseGroup": "",
|
|
||||||
"isDeleted": "DEVICEMANAGER_BOOL_DEFAULT",
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1742092514409592832",
|
|
||||||
"solutionId": "1",
|
|
||||||
"deviceId": "129529",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"isObjectTrack": true,
|
|
||||||
"pathId": "1742092482440607744",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1704182186451",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 2560,
|
|
||||||
"originHeight": 1440,
|
|
||||||
"offsetTime": "20409182",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"level": 1,
|
|
||||||
"bboxInFrame": {
|
|
||||||
"x": 0.6195313,
|
|
||||||
"y": 0.24583334,
|
|
||||||
"w": 0.09804688,
|
|
||||||
"h": 0.41944444
|
|
||||||
},
|
|
||||||
"bboxExtInFrame": {
|
|
||||||
"x": 0.53515625,
|
|
||||||
"y": 0.14027777,
|
|
||||||
"w": 0.26640624,
|
|
||||||
"h": 0.63125
|
|
||||||
},
|
|
||||||
"objectImageKey": "",
|
|
||||||
"objectExtImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"frameImageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092515508500480.jpg",
|
|
||||||
"confidence": 0.92494,
|
|
||||||
"sourceObjectId": "1742092515508500480",
|
|
||||||
"storeTimestamp": "0",
|
|
||||||
"gbNumber": "",
|
|
||||||
"qualityScore": 0,
|
|
||||||
"subObjectCount": 1,
|
|
||||||
"subObjectType": [
|
|
||||||
"OBJECT_TYPE_FACE"
|
|
||||||
],
|
|
||||||
"subObjectIds": [
|
|
||||||
"1742092482432219136"
|
|
||||||
],
|
|
||||||
"solutionId": "1",
|
|
||||||
"fragmentId": "0",
|
|
||||||
"contrastKey": "singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"compaterImages": [
|
|
||||||
"http://10.0.0.7:30003/file/singer-20240102/1/129529/1742047651878156288.jpg"
|
|
||||||
],
|
|
||||||
"imgSummary": "singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"imageKey": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092514409592832.jpg",
|
|
||||||
"srcImageUrl": "http://10.0.0.7:30003/file/singer-20240102/1/129529/1742092515508500480.jpg",
|
|
||||||
"algorithmVersion": "VERSION_REID_HEAD_ATTR",
|
|
||||||
"cameraId": "129529",
|
|
||||||
"cameraName": "4入口人脸"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"isArchiveDetail": false,
|
"isArchiveDetail": false,
|
||||||
"ToolProps": {
|
"ToolProps": {
|
||||||
"renderVideoBtn": true,
|
"renderVideoBtn": true,
|
||||||
@ -281,27 +107,59 @@ export const IMAGE_DATA = {
|
|||||||
"specialTitle": ""
|
"specialTitle": ""
|
||||||
}
|
}
|
||||||
|
|
||||||
export const BIG_IMAGE_DATA = [
|
export const RELATED_IMAGES = [
|
||||||
|
{ key: '123', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '22', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '22122333', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '2212243', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '224523433', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '224235453', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '245423', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '224233543', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '22452343', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '22323243', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '2236456', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '224563', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '24565423', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '245645623', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '2456435623', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' },
|
||||||
|
{ key: '2323', url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png' }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const BIG_IMAGE_DATA = {
|
||||||
|
imageKey: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
||||||
|
imgSummary: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
|
||||||
|
flvUrl: 'ws://10.0.0.120:9033/flv/HaikangNvr/45.flv?ip=10.0.2.103&stime=1712539148&etime=1712539168',
|
||||||
|
compaterImage: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
||||||
|
odRect: [
|
||||||
{
|
{
|
||||||
imageKey: 'http://10.0.0.120:30003/file/singer-20240110/1/5/1744894622934503424.jpg',
|
id: '123',
|
||||||
imgSummary: "http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
flvUrl: 'ws://10.0.0.120:9033/flv/Sip/34020000001310000301.flv?ip=10.0.0.120&stime=1704815972&etime=1704815992',
|
|
||||||
compaterImages: [
|
|
||||||
'http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg',
|
|
||||||
"http://10.0.0.120:30003/file/public/public_20240117/file/dfdd3340-53c8-4dc4-9921-f13230aa0355.jpg"
|
|
||||||
],
|
|
||||||
odRect: {
|
|
||||||
"x":0.5445312,
|
"x":0.5445312,
|
||||||
"y":0.19166666,
|
"y":0.19166666,
|
||||||
"w":0.08671875,
|
"w":0.08671875,
|
||||||
"h":0.40138888
|
"h":0.40138888
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "123",
|
||||||
|
"x": 0.5519352,
|
||||||
|
"y": 0.2965385,
|
||||||
|
"w": 0.05185461,
|
||||||
|
"h": 0.24698898,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "456",
|
||||||
|
"x": 0.58543766,
|
||||||
|
"y": 0.3203356,
|
||||||
|
"w": 0.052037954,
|
||||||
|
"h": 0.2664015
|
||||||
|
}
|
||||||
|
],
|
||||||
attachImg: [
|
attachImg: [
|
||||||
{
|
{
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894622695428096.jpg",
|
"url": "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
|
||||||
"label": "形体"
|
"label": "形体"
|
||||||
},{
|
},{
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240110/1/5/1744894588427964418.jpg",
|
"url": "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png",
|
||||||
"label": "人脸"
|
"label": "人脸"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -346,98 +204,7 @@ export const BIG_IMAGE_DATA = [
|
|||||||
"qualityScore": 0,
|
"qualityScore": 0,
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
{
|
|
||||||
imageKey: 'http://10.0.0.120:30003/file/singer-20240115/1/9/1746795581994436608.jpg',
|
|
||||||
imgSummary: "http://10.0.0.120:30003/file/singer-20240117/1/5/1747536346412488704.jpg",
|
|
||||||
odRect:{
|
|
||||||
"x":0.553125,"y":0.29722223,"w":0.048958335,"h":0.2462963
|
|
||||||
},
|
|
||||||
attachImg: [
|
|
||||||
{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795581163964416.jpg","label": "形体"
|
|
||||||
},{
|
|
||||||
"url": "http://10.0.0.120:30003/file/singer-20240115/1/9/1746795546867140608.jpg",
|
|
||||||
"label": "人脸"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
flvUrl: 'ws://10.0.0.120:9033/flv/HaikangNvr/34.flv?ip=10.0.2.103&stime=1705302394&etime=1705302414',
|
|
||||||
score: 0.815207, // 人脸质量分
|
|
||||||
showScore: true, // 人脸质量分
|
|
||||||
cameraPosition: 'string', // 摄像头位置
|
|
||||||
time: '2022-01-01', // 摄像头拍摄时间
|
|
||||||
objects: [
|
|
||||||
{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746816737430472704",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705308539109",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.5519352,
|
|
||||||
"y": 0.2965385,
|
|
||||||
"w": 0.05185461,
|
|
||||||
"h": 0.24698898
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"objectIndex": {
|
|
||||||
"objectId": "1746816737430472705",
|
|
||||||
"solutionId": "0",
|
|
||||||
"deviceId": "0",
|
|
||||||
"fragmentId": "0"
|
|
||||||
},
|
|
||||||
"objectType": "OBJECT_TYPE_PEDESTRAIN",
|
|
||||||
"sourceObjectId": "0",
|
|
||||||
"level": 0,
|
|
||||||
"confidence": 0.9310699,
|
|
||||||
"frameInfo": {
|
|
||||||
"frameId": "0",
|
|
||||||
"frameTimestamp": "1705308539109",
|
|
||||||
"width": 0,
|
|
||||||
"height": 0,
|
|
||||||
"originWidth": 0,
|
|
||||||
"originHeight": 0,
|
|
||||||
"offsetTime": "0",
|
|
||||||
"skipNumber": "0"
|
|
||||||
},
|
|
||||||
"infoOnSource": {
|
|
||||||
"bboxInFrame": {
|
|
||||||
"bboxRatio": {
|
|
||||||
"x": 0.58543766,
|
|
||||||
"y": 0.3203356,
|
|
||||||
"w": 0.052037954,
|
|
||||||
"h": 0.2664015
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"countInSource": 0,
|
|
||||||
"indexInSource": 0
|
|
||||||
},
|
|
||||||
"qualityScore": 0,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
export const attributeList = [
|
export const attributeList = [
|
||||||
{
|
{
|
||||||
|
36
packages/biz/src/BigImageModal/util/interface.ts
Normal file
36
packages/biz/src/BigImageModal/util/interface.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
export interface IBigImageModalData {
|
||||||
|
imageKey?: string // 目标图
|
||||||
|
imgSummary?: string // 大图
|
||||||
|
flvUrl?: string // 视频链接
|
||||||
|
compaterImages?: string[] // 对比图
|
||||||
|
odRect?: { // od 框数据
|
||||||
|
"x": number
|
||||||
|
"y": number
|
||||||
|
"w": number
|
||||||
|
"h": number
|
||||||
|
[key: string]: string | number; // 拓展参数
|
||||||
|
}[],
|
||||||
|
attachImg?: { // 小图,只有在场景图模式生效(人脸、形体)
|
||||||
|
"url": string
|
||||||
|
"label": string
|
||||||
|
[key: string]: string
|
||||||
|
}[],
|
||||||
|
score?: number | string // 人脸质量分
|
||||||
|
showScore?: boolean // 人脸质量分
|
||||||
|
cameraPosition?: string // 摄像头位置
|
||||||
|
time?: string // 摄像头拍摄时间
|
||||||
|
objects: { // 拓展参数、可以自由支配
|
||||||
|
objectIndex: {
|
||||||
|
[key: string]: any
|
||||||
|
},
|
||||||
|
objectType: string
|
||||||
|
sourceObjectId: string
|
||||||
|
level: number
|
||||||
|
confidence: number
|
||||||
|
infoOnSource: {
|
||||||
|
[key: string]: any
|
||||||
|
},
|
||||||
|
qualityScore: number
|
||||||
|
[key: string]: any
|
||||||
|
}[]
|
||||||
|
}
|
102
packages/biz/src/CustomCard/components/commonCard/CommonCard.tsx
Normal file
102
packages/biz/src/CustomCard/components/commonCard/CommonCard.tsx
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
/**
|
||||||
|
* Created by jiangzhixiong on 2024/04/28
|
||||||
|
*/
|
||||||
|
|
||||||
|
import React, { forwardRef, ReactNode, useContext, useImperativeHandle } from 'react'
|
||||||
|
import { ConfigProvider, EMPTY_BASE64 } from '@zhst/meta'
|
||||||
|
import { Image } from 'antd';
|
||||||
|
import './index.less'
|
||||||
|
|
||||||
|
const { ConfigContext } = ConfigProvider
|
||||||
|
|
||||||
|
export interface IData {
|
||||||
|
id?: string | number;
|
||||||
|
url?: string;
|
||||||
|
sort?: number;
|
||||||
|
title?: string;
|
||||||
|
subtitle?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommonCardProps extends IData {
|
||||||
|
prefixCls?: string;
|
||||||
|
data?: IData
|
||||||
|
width?: string;
|
||||||
|
height?: string;
|
||||||
|
onCreateTxt?: string;
|
||||||
|
onCreate?: () => void;
|
||||||
|
onAddTxt?: string;
|
||||||
|
onAdd?: (data: any) => void;
|
||||||
|
onRemoveTxt?: string;
|
||||||
|
onRemove?: (data: any) => void;
|
||||||
|
actions?: ReactNode[]
|
||||||
|
onItemClick?: (data: any, e: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommonCardRefProps {
|
||||||
|
}
|
||||||
|
|
||||||
|
const CommonCard = forwardRef<CommonCardRefProps, CommonCardProps>((props, ref) => {
|
||||||
|
const {
|
||||||
|
prefixCls: customizePrefixCls,
|
||||||
|
url,
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
subtitle,
|
||||||
|
sort,
|
||||||
|
data,
|
||||||
|
actions = [],
|
||||||
|
width = '184px',
|
||||||
|
height = '100%',
|
||||||
|
onItemClick
|
||||||
|
} = props
|
||||||
|
const { getPrefixCls } = useContext(ConfigContext)
|
||||||
|
const componentName = getPrefixCls('biz-search-card', customizePrefixCls);
|
||||||
|
|
||||||
|
const optionListRender = (_actions: ReactNode[]) => {
|
||||||
|
return _actions.map((action, i) => (
|
||||||
|
// eslint-disable-next-line react/no-array-index-key
|
||||||
|
<li key={`${componentName}-main-opt-action-${i}`}>
|
||||||
|
{action}
|
||||||
|
{i !== _actions.length - 1 && <em className={`${componentName}-main-opt-action-split`} />}
|
||||||
|
</li>
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleItemClick = (e: React.MouseEvent<HTMLDivElement, MouseEvent>, _data: IData | undefined) => {
|
||||||
|
onItemClick?.(data, e)
|
||||||
|
}
|
||||||
|
|
||||||
|
useImperativeHandle(ref, () => ({
|
||||||
|
}))
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={componentName}
|
||||||
|
style={{
|
||||||
|
width,
|
||||||
|
height
|
||||||
|
}}
|
||||||
|
onClick={e => handleItemClick(e, data)}
|
||||||
|
>
|
||||||
|
<div className={`${componentName}-main`}>
|
||||||
|
<i className={`${componentName}-main-num`}>{sort || id}</i>
|
||||||
|
<Image
|
||||||
|
className={`${componentName}-main-img`}
|
||||||
|
src={url || data?.url}
|
||||||
|
height={'240px'}
|
||||||
|
preview={false}
|
||||||
|
fallback={EMPTY_BASE64}
|
||||||
|
/>
|
||||||
|
<ul className={`${componentName}-main-opt`}>
|
||||||
|
{optionListRender(actions)}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div className={`${componentName}-footer`}>
|
||||||
|
<p className={`${componentName}-footer-tit`}>{title || data?.title}</p>
|
||||||
|
<p className={`${componentName}-footer-subtitle`}>{subtitle || data?.subtitle}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default CommonCard
|
109
packages/biz/src/CustomCard/components/commonCard/index.less
Normal file
109
packages/biz/src/CustomCard/components/commonCard/index.less
Normal file
@ -0,0 +1,109 @@
|
|||||||
|
.zhst-biz-search-card {
|
||||||
|
display: inline-block;
|
||||||
|
border: 2px solid transparent;
|
||||||
|
transition: .1s ease-in all;
|
||||||
|
cursor: pointer;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
transition: .5s ease all;
|
||||||
|
border: 2px solid #09f;
|
||||||
|
|
||||||
|
.zhst-biz-search-card-main-opt {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-main {
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&-num {
|
||||||
|
position: absolute;
|
||||||
|
right: 2px;
|
||||||
|
top: 2px;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-style: normal;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
color: rgb(153, 153, 153);
|
||||||
|
background-color: rgba(255, 255, 255, 75%);
|
||||||
|
z-index: 1;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-img {
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
transition: .5s ease-in all;
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-opt {
|
||||||
|
display: none;
|
||||||
|
margin: 0;
|
||||||
|
position: absolute;
|
||||||
|
padding: 6px 3px;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
background-color: #09f;
|
||||||
|
color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
transition: .2s ease-in all;
|
||||||
|
|
||||||
|
li {
|
||||||
|
position: relative;
|
||||||
|
list-style: none;
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-action-split {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: 0;
|
||||||
|
width: 1px;
|
||||||
|
height: 80%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.88;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-footer {
|
||||||
|
padding: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&-tit {
|
||||||
|
margin: 0;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-subtitle {
|
||||||
|
margin: 0;
|
||||||
|
line-height: 20px;
|
||||||
|
transition: .1s ease-in all;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #09f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
import CommonCard from './CommonCard'
|
||||||
|
|
||||||
|
export type { CommonCardProps, CommonCardRefProps } from './CommonCard'
|
||||||
|
|
||||||
|
export default CommonCard
|
42
packages/biz/src/CustomCard/demo/commonCard.tsx
Normal file
42
packages/biz/src/CustomCard/demo/commonCard.tsx
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import React, { useEffect, useState } from 'react'
|
||||||
|
import { CommonCard } from '@zhst/biz'
|
||||||
|
import { uniqueId } from '@zhst/func'
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const [data, setData] = useState([])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetch('https://randomuser.me/api/?results=10&inc=id,key,name,gender,email,nat,picture&noinfo')
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((body) => {
|
||||||
|
let res = body.results.map((o, index) => {
|
||||||
|
return {
|
||||||
|
id: uniqueId(),
|
||||||
|
sort: index + 1,
|
||||||
|
title: o.name.first,
|
||||||
|
subtitle: o.name.last,
|
||||||
|
url: o.picture.large
|
||||||
|
}
|
||||||
|
})
|
||||||
|
setData(res);
|
||||||
|
})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{data?.map(item => (
|
||||||
|
<CommonCard
|
||||||
|
key={item.id}
|
||||||
|
sort={item.sort}
|
||||||
|
data={item}
|
||||||
|
width="184px"
|
||||||
|
actions={[
|
||||||
|
<a>创建检索</a>,
|
||||||
|
<a>创建布控</a>,
|
||||||
|
<a>删除点位</a>
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
31
packages/biz/src/CustomCard/index.md
Normal file
31
packages/biz/src/CustomCard/index.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
---
|
||||||
|
category: Components
|
||||||
|
title: CustomCard 定制化卡片
|
||||||
|
toc: content
|
||||||
|
group:
|
||||||
|
title: 数据展示
|
||||||
|
---
|
||||||
|
|
||||||
|
定制化卡片
|
||||||
|
|
||||||
|
## 代码演示
|
||||||
|
|
||||||
|
<code src="./demo/commonCard.tsx">基本卡片</code>
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
### CommonCardProps
|
||||||
|
|
||||||
|
| 参数 | 说明 | 类型 | 默认值 | 版本 |
|
||||||
|
| --- | --- | --- | --- | --- |
|
||||||
|
| data | 数据源 | IData[] | [] | - |
|
||||||
|
| prefixCls | 数据源 | string | [] | - |
|
||||||
|
| width | 宽度 | string | [] | - |
|
||||||
|
| height | 高度 | string | [] | - |
|
||||||
|
| onCreateTxt | 创建方法文字 | string | [] | - |
|
||||||
|
| onCreate | 创建方法 | () => void | [] | - |
|
||||||
|
| onAddTxt | 数据源 | string | [] | - |
|
||||||
|
| onAdd | 数据源 | () => void | [] | - |
|
||||||
|
| onRemoveTxt | 数据源 | string | [] | - |
|
||||||
|
| onRemove | 数据源 | () => void | [] | - |
|
||||||
|
| customOptionRender | 数据源 | React.ReactNode | - | - |
|
6
packages/biz/src/CustomCard/index.tsx
Normal file
6
packages/biz/src/CustomCard/index.tsx
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* Created by jiangzhixiong on 2024/04/28
|
||||||
|
*/
|
||||||
|
|
||||||
|
export { default as CommonCard } from './components/commonCard'
|
||||||
|
export type { CommonCardProps, CommonCardRefProps } from './components/commonCard'
|
@ -1,12 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import { Button } from '@zhst/meta'
|
|
||||||
import { useThrottleFn } from '@zhst/hooks'
|
|
||||||
|
|
||||||
export default () => {
|
|
||||||
|
|
||||||
const { run } = useThrottleFn(() => console.log('123'))
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button onClick={() => run()} >测试</Button>
|
|
||||||
)
|
|
||||||
}
|
|
92
packages/biz/src/RealTimeMonitor/RealTimeMonitor.tsx
Normal file
92
packages/biz/src/RealTimeMonitor/RealTimeMonitor.tsx
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import React, { useContext, useRef } from 'react';
|
||||||
|
import WindowToggle, { ISize } from './components/WindowToggle';
|
||||||
|
import WarningRecordList from './components/WarningRecordList';
|
||||||
|
import { ConfigProvider } from '@zhst/meta';
|
||||||
|
import { IRecord } from '../WarningRecordCard';
|
||||||
|
import { VideoPlayerCardProps } from '../VideoPlayerCard';
|
||||||
|
import { ViewLargerImageModalRef } from '../ViewLargerImageModal';
|
||||||
|
|
||||||
|
interface RealTimeMonitorProps {
|
||||||
|
prefixCls?: string
|
||||||
|
videoDataSource?: VideoPlayerCardProps[];
|
||||||
|
handleWindowClick?: (key?: string) => void;
|
||||||
|
handleCloseButtonClick?: (key?: string) => void;
|
||||||
|
selectedWindowKey?: string;
|
||||||
|
warningDataSource?: IRecord[];
|
||||||
|
viewLargerImageModalRef?: React.RefObject<ViewLargerImageModalRef>;
|
||||||
|
/*
|
||||||
|
处理 图片下载按钮点击事件
|
||||||
|
*/
|
||||||
|
handleDownloadImg?: (imageKey?: string) => void;
|
||||||
|
/*
|
||||||
|
处理 预警记录卡片点击事件
|
||||||
|
*/
|
||||||
|
onRecordClick?: (record?: IRecord) => void;
|
||||||
|
/*
|
||||||
|
获取选中的 记录 id 用于 判断是否显示 选中样式
|
||||||
|
*/
|
||||||
|
selectedRecordId?: string;
|
||||||
|
isRecordListLoading?: boolean;
|
||||||
|
recordListTitle?: string;
|
||||||
|
style?: React.CSSProperties;
|
||||||
|
cardStyle?: React.CSSProperties;
|
||||||
|
imgStyle?: React.CSSProperties;
|
||||||
|
largeImageTitle?: string;
|
||||||
|
size: ISize;
|
||||||
|
setSize: React.Dispatch<React.SetStateAction<ISize>>
|
||||||
|
maxRecordCount?: number;
|
||||||
|
warningImgStyle?: React.CSSProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const RealTimeMonitor: React.FC<RealTimeMonitorProps> = (props) => {
|
||||||
|
|
||||||
|
const { ConfigContext } = ConfigProvider;
|
||||||
|
const { getPrefixCls } = useContext(ConfigContext);
|
||||||
|
const {
|
||||||
|
prefixCls: customizePrefixCls,
|
||||||
|
videoDataSource,
|
||||||
|
handleWindowClick,
|
||||||
|
handleCloseButtonClick,
|
||||||
|
selectedWindowKey,
|
||||||
|
warningDataSource,
|
||||||
|
viewLargerImageModalRef,
|
||||||
|
handleDownloadImg,
|
||||||
|
onRecordClick,
|
||||||
|
selectedRecordId,
|
||||||
|
isRecordListLoading,
|
||||||
|
size,
|
||||||
|
setSize,
|
||||||
|
maxRecordCount,
|
||||||
|
warningImgStyle,
|
||||||
|
} = props
|
||||||
|
const toggleRef = useRef<HTMLDivElement>()
|
||||||
|
const componentName = getPrefixCls('biz-real-time-monitor', customizePrefixCls);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={componentName} style={{ display: 'flex' }} >
|
||||||
|
<WindowToggle
|
||||||
|
toggleRef={toggleRef}
|
||||||
|
selectedWindowKey={selectedWindowKey}
|
||||||
|
dataSource={videoDataSource}
|
||||||
|
handleWindowClick={handleWindowClick}
|
||||||
|
handleCloseButtonClick={handleCloseButtonClick}
|
||||||
|
size={size}
|
||||||
|
setSize={setSize}
|
||||||
|
/>
|
||||||
|
<WarningRecordList
|
||||||
|
dataSource={warningDataSource}
|
||||||
|
handleDownloadImg={handleDownloadImg}
|
||||||
|
onRecordClick={onRecordClick}
|
||||||
|
selectedRecordId={selectedRecordId}
|
||||||
|
viewLargerImageModalRef={viewLargerImageModalRef}
|
||||||
|
isRecordListLoading={isRecordListLoading}
|
||||||
|
recordListTitle="监控预警记录"
|
||||||
|
maxHeight={toggleRef.current?.offsetHeight}
|
||||||
|
maxRecordCount={maxRecordCount}
|
||||||
|
imgStyle={warningImgStyle}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default RealTimeMonitor;
|
@ -0,0 +1,89 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { IRecord } from '../../../WarningRecordCard';
|
||||||
|
import { ViewLargerImageModalRef } from '../../../ViewLargerImageModal';
|
||||||
|
import WarningRecordCard from '../../../WarningRecordCard';
|
||||||
|
import ViewLargerImageModal from '../../../ViewLargerImageModal';
|
||||||
|
import { Empty, Space, Spin } from '@zhst/meta';
|
||||||
|
import { pxToRem } from '@zhst/func'
|
||||||
|
import { LoadingOutlined } from '@ant-design/icons';
|
||||||
|
import "./index.less"
|
||||||
|
|
||||||
|
interface WarningRecordListProps {
|
||||||
|
dataSource?: IRecord[];
|
||||||
|
viewLargerImageModalRef?: React.RefObject<ViewLargerImageModalRef>;
|
||||||
|
/*
|
||||||
|
处理 图片下载按钮点击事件
|
||||||
|
*/
|
||||||
|
handleDownloadImg?: (imageKey?: string) => void;
|
||||||
|
/*
|
||||||
|
处理 预警记录卡片点击事件
|
||||||
|
*/
|
||||||
|
onRecordClick?: (record?: IRecord) => void;
|
||||||
|
/*
|
||||||
|
获取选中的 记录 id 用于 判断是否显示 选中样式
|
||||||
|
*/
|
||||||
|
selectedRecordId?: string;
|
||||||
|
isRecordListLoading?: boolean;
|
||||||
|
recordListTitle?: string;
|
||||||
|
style?: React.CSSProperties;
|
||||||
|
cardStyle?: React.CSSProperties;
|
||||||
|
imgStyle?: React.CSSProperties;
|
||||||
|
largeImageTitle?: string;
|
||||||
|
maxHeight?: number;
|
||||||
|
maxRecordCount?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const WarningRecordList: React.FC<WarningRecordListProps> = (props) => {
|
||||||
|
|
||||||
|
const {
|
||||||
|
dataSource = [],
|
||||||
|
viewLargerImageModalRef,
|
||||||
|
selectedRecordId,
|
||||||
|
handleDownloadImg,
|
||||||
|
onRecordClick,
|
||||||
|
isRecordListLoading,
|
||||||
|
recordListTitle,
|
||||||
|
style,
|
||||||
|
cardStyle,
|
||||||
|
imgStyle,
|
||||||
|
largeImageTitle,
|
||||||
|
maxHeight,
|
||||||
|
maxRecordCount = 10
|
||||||
|
} = props
|
||||||
|
return (
|
||||||
|
<div className='zhst-biz-warning-record-list' style={{ maxHeight: `${pxToRem(`${maxHeight}`)}`, ...style }} >
|
||||||
|
<div className='header'>{recordListTitle}</div>
|
||||||
|
<div className='body'>
|
||||||
|
{
|
||||||
|
isRecordListLoading ?
|
||||||
|
<div style={{ height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Spin indicator={<LoadingOutlined style={{ fontSize: 24 }} />} />
|
||||||
|
</div>
|
||||||
|
: (dataSource?.length) > 0 ?
|
||||||
|
<Space direction='vertical' size={10} >
|
||||||
|
{dataSource?.map((record, index) => {
|
||||||
|
if (index > maxRecordCount - 1) return
|
||||||
|
return (<WarningRecordCard
|
||||||
|
key={record?.id}
|
||||||
|
record={record}
|
||||||
|
onRecordClick={(record) => { onRecordClick?.(record) }}
|
||||||
|
selectedRecordId={selectedRecordId}
|
||||||
|
cardStyle={{ ...cardStyle }}
|
||||||
|
imgStyle={{ ...imgStyle }}
|
||||||
|
/>)
|
||||||
|
}
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
:
|
||||||
|
<div style={{ height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
|
||||||
|
<Empty description="暂无数据" />
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
{/* 弹窗 绑定ref 后可以调用 handleCancel方法关闭弹窗 show方法打开弹窗 */}
|
||||||
|
<ViewLargerImageModal ref={viewLargerImageModalRef} downloadImg={handleDownloadImg} title={largeImageTitle} />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WarningRecordList;
|
@ -0,0 +1,22 @@
|
|||||||
|
.zhst-biz-warning-record-list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
border-left: solid 1px #00000026;
|
||||||
|
min-width: 320px;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
width: 100%;
|
||||||
|
height: 48px;
|
||||||
|
background-color: #EFF2F4;
|
||||||
|
padding: 0 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
padding: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,2 @@
|
|||||||
|
import WarningRecordList from './WarningRecordList'
|
||||||
|
export default WarningRecordList
|
@ -0,0 +1,99 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import VideoPlayerCard from '../../../VideoPlayerCard';
|
||||||
|
import { VideoPlayerCardProps } from '../../../VideoPlayerCard';
|
||||||
|
import { Row, Col, Segmented, theme } from '@zhst/meta';
|
||||||
|
import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons';
|
||||||
|
import { pxToRem } from '@zhst/func'
|
||||||
|
import './index.less'
|
||||||
|
|
||||||
|
export type ISize = 'large' | 'small'
|
||||||
|
|
||||||
|
interface WindowToggleProps {
|
||||||
|
dataSource?: VideoPlayerCardProps[];
|
||||||
|
handleWindowClick?: (key?: string) => void;
|
||||||
|
handleCloseButtonClick?: (key?: string) => void;
|
||||||
|
selectedWindowKey?: string;
|
||||||
|
size: ISize;
|
||||||
|
setSize: React.Dispatch<React.SetStateAction<ISize>>
|
||||||
|
toggleRef: React.MutableRefObject<any>
|
||||||
|
}
|
||||||
|
|
||||||
|
export const WindowToggle: React.FC<WindowToggleProps> = (props) => {
|
||||||
|
|
||||||
|
const { dataSource = [], handleWindowClick, handleCloseButtonClick, selectedWindowKey, size = "large", setSize, toggleRef } = props
|
||||||
|
const { useToken } = theme
|
||||||
|
const { token } = useToken()
|
||||||
|
const getLabelStyle = (isSelected: boolean) => ({
|
||||||
|
padding: `0 ${pxToRem("11px")}`, background: "#fff",
|
||||||
|
...(isSelected ? { background: token.colorPrimary, color: '#fff' } : {}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='zhst-biz-window-toggle' ref={toggleRef}>
|
||||||
|
{/* 切换按钮 */}
|
||||||
|
<div className='header'>
|
||||||
|
<Segmented
|
||||||
|
defaultValue='large'
|
||||||
|
options={[
|
||||||
|
{ value: 'large', label: <div style={getLabelStyle(size === 'large')}><BarsOutlined /></div> },
|
||||||
|
{ value: 'small', label: <div style={getLabelStyle(size === 'small')}><AppstoreOutlined /></div> },
|
||||||
|
]}
|
||||||
|
onChange={(value) => {
|
||||||
|
// 当一个窗口时 默认 selectedkey 第一条数据的 windowkey
|
||||||
|
if (value === 'large' && dataSource.length > 0) {
|
||||||
|
const { windowKey } = dataSource[0]
|
||||||
|
handleWindowClick?.(windowKey)
|
||||||
|
}
|
||||||
|
setSize(value as ISize)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='body'>
|
||||||
|
|
||||||
|
<Row gutter={[0, 20]} style={{ width: "100%" }} > {/* 设置栅格间距 */}
|
||||||
|
{
|
||||||
|
size === "large" ?
|
||||||
|
<>
|
||||||
|
{
|
||||||
|
dataSource?.map((item, index) => { // 仅显示前四个元素,即两行两列
|
||||||
|
if (index > 0) return null
|
||||||
|
return (
|
||||||
|
<Col xs={24} sm={24} md={24} lg={24} xl={24} key={item.windowKey}>
|
||||||
|
<VideoPlayerCard
|
||||||
|
key={""}
|
||||||
|
selectedWindowKey={selectedWindowKey}
|
||||||
|
size={size}
|
||||||
|
handleWindowClick={handleWindowClick}
|
||||||
|
handleCloseButtonClick={handleCloseButtonClick}
|
||||||
|
{...item}
|
||||||
|
/>
|
||||||
|
</Col>)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
: <>
|
||||||
|
{dataSource?.map((item) => {
|
||||||
|
return (
|
||||||
|
<Col xs={24} sm={12} md={12} lg={12} xl={12} className='sm-card' key={item.windowKey}>
|
||||||
|
<VideoPlayerCard
|
||||||
|
key={item.windowKey}
|
||||||
|
selectedWindowKey={selectedWindowKey}
|
||||||
|
size={size}
|
||||||
|
handleWindowClick={handleWindowClick}
|
||||||
|
handleCloseButtonClick={handleCloseButtonClick}
|
||||||
|
{...item}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
);
|
||||||
|
})}</>
|
||||||
|
}
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default WindowToggle;
|
||||||
|
|
@ -0,0 +1,44 @@
|
|||||||
|
.zhst-biz-window-toggle {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
width: 100%;
|
||||||
|
height: 48px;
|
||||||
|
background-color: #EFF2F4;
|
||||||
|
padding: 10px 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.ant-segmented {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.ant-segmented-group {
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.ant-segmented-item {
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
|
.ant-segmented-item-label {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
background-color: #E5EAEC;
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.sm-card:nth-child(odd) {
|
||||||
|
padding-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sm-card:nth-child(even) {
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
import WindowToggle from './WindowToggle'
|
||||||
|
export default WindowToggle
|
||||||
|
import type { ISize } from './WindowToggle';
|
||||||
|
export type { ISize };
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user