@shijiu/jsview-vue-samples 2.3.0 → 2.3.728-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/DashPath/App.vue +17 -16
- package/DashPath/AppForOperator.vue +2 -4
- package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
- package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
- package/DemoForOperator/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +184 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +249 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/Bounce.vue +33 -1
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/ChunLian/Couplets.vue +44 -1
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
- package/DemoForOperator/Firework1/App.vue +13 -2
- package/DemoForOperator/Firework1/Fireworks.vue +68 -11
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +30 -1
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
- package/DemoForOperator/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +1 -1
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +58 -11
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +47 -9
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +116 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +204 -0
- package/DemoForOperator/LongChatBox/testData.js +14 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
- package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -0
- package/DemoForOperator/Resize/App.vue +157 -0
- package/DemoForOperator/Resize/Resize/Item.vue +234 -0
- package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
- package/DemoForOperator/Ripple/Ripple.vue +16 -1
- package/DemoForOperator/ScreenShootScale/App.vue +96 -0
- package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
- package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
- package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
- package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
- package/DemoForOperator/SmoothSwiper/App.vue +50 -0
- package/DemoForOperator/Sound/Bounce/App.vue +56 -0
- package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
- package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
- package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
- package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
- package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
- package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
- package/DemoForOperator/Sound/Rain/App.vue +11 -0
- package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
- package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
- package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
- package/DemoForOperator/Sound/Sound/index.js +4 -0
- package/DemoForOperator/Sound/Sound/useSound.js +112 -0
- package/DemoForOperator/Sprite/Sprite.vue +62 -5
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
- package/DemoForOperator/TabContentVertical/App.vue +104 -0
- package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
- package/DemoForOperator/TabContentVertical/Item.vue +94 -0
- package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
- package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
- package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
- package/DemoForOperator/TabContentVertical/testData.js +76 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +26 -0
- package/DemoForOperator/routeList.js +125 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +5 -0
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +798 -140
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/DomRenderer/App.vue +133 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMove/App.vue +24 -279
- package/FreeMove/TestScene1.vue +260 -0
- package/FreeMove/TestScene3.vue +431 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +51 -22
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +111 -46
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +14 -1
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +216 -0
- package/Markdown/data.js +633 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
- package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
- package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
- package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
- package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/{TripleWidget → RenderAccelerate}/Item.vue +6 -3
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/SpatialNav/Item.vue +71 -0
- package/MetroWidgetDemos/SpatialNav/SimpleFloor.vue +86 -0
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +229 -8
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PosterPacker/App.vue +2 -2
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/ScrollBoxTest/App.vue +52 -28
- package/ScrollBoxTest/ClipBar.vue +64 -2
- package/ScrollBoxTest/NinePatchBar.vue +64 -2
- package/ScrollBoxTest/SizeDivBar.vue +64 -2
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TextureAnimation/App3.vue +11 -1
- package/TouchWidget/App.vue +90 -5
- package/TouchWidget/WidgetItem.vue +1 -0
- package/TransitPage/App.vue +2 -0
- package/ViewOpacity/App.vue +19 -0
- package/assets/logo.png +0 -0
- package/package.json +1 -1
- package/DashPath/DashPath.vue +0 -118
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -699
- package/DemoForOperator/ScalePoster/App.vue +0 -4
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -81
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -93
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +0 -111
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
- package/TextureAnimation/utils/RotateFrame.vue +0 -146
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:style="{
|
|
4
|
+
width: 1280,
|
|
5
|
+
height: 720,
|
|
6
|
+
backgroundColor: '#007788',
|
|
7
|
+
}"
|
|
8
|
+
></div>
|
|
9
|
+
<div
|
|
10
|
+
:style="{
|
|
11
|
+
left: 300,
|
|
12
|
+
top: 100,
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
<Resize
|
|
16
|
+
name="resize"
|
|
17
|
+
:provideData="provideData"
|
|
18
|
+
:measures="measures"
|
|
19
|
+
:initFocusId="0"
|
|
20
|
+
:layout="widgetLayout"
|
|
21
|
+
:padding="padding"
|
|
22
|
+
:onEdge="onEdge"
|
|
23
|
+
:anim="anim"
|
|
24
|
+
>
|
|
25
|
+
<template #itemLarge="{ data }">
|
|
26
|
+
<div
|
|
27
|
+
:style="{
|
|
28
|
+
width: 400,
|
|
29
|
+
height: 120,
|
|
30
|
+
backgroundColor: '#0F0',
|
|
31
|
+
fontSize: 30,
|
|
32
|
+
transition,
|
|
33
|
+
}"
|
|
34
|
+
>
|
|
35
|
+
{{ "测试文字" + data.content + "测试文字" }}
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<template #itemSmall="{ data, focused }">
|
|
39
|
+
<div
|
|
40
|
+
:style="{
|
|
41
|
+
width: focused ? 120 : 100,
|
|
42
|
+
height: focused ? 120 : 100,
|
|
43
|
+
backgroundColor: '#F00',
|
|
44
|
+
fontSize: 30,
|
|
45
|
+
transition,
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
{{ data.content + (data.resizable ? "展开" : "不展开") }}
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
<template #itemLeftEdge>
|
|
52
|
+
<div
|
|
53
|
+
:style="{
|
|
54
|
+
width: 10,
|
|
55
|
+
height: 10,
|
|
56
|
+
backgroundColor: '#00F',
|
|
57
|
+
}"
|
|
58
|
+
></div>
|
|
59
|
+
</template>
|
|
60
|
+
<template #itemRightEdge>
|
|
61
|
+
<div
|
|
62
|
+
:style="{
|
|
63
|
+
left: 90,
|
|
64
|
+
width: 10,
|
|
65
|
+
height: 10,
|
|
66
|
+
backgroundColor: '#00F',
|
|
67
|
+
}"
|
|
68
|
+
></div>
|
|
69
|
+
</template>
|
|
70
|
+
</Resize>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script setup>
|
|
75
|
+
import Resize from "./Resize/Resize.vue";
|
|
76
|
+
import { useFocusHub } from "jsview";
|
|
77
|
+
import { onMounted } from "vue";
|
|
78
|
+
|
|
79
|
+
const randomColor = () => {
|
|
80
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
81
|
+
return (
|
|
82
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const anim = {
|
|
87
|
+
duration: 200,
|
|
88
|
+
easing: "jsv-ease(0.2, 0.6, 2)",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const transition = `left ${anim.duration / 1000}s ${anim.easing}, top ${
|
|
92
|
+
anim.duration / 1000
|
|
93
|
+
}s ${anim.easing}, width ${anim.duration / 1000}s ${anim.easing}, height ${
|
|
94
|
+
anim.duration / 1000
|
|
95
|
+
}s ${anim.easing}`;
|
|
96
|
+
|
|
97
|
+
const focusHub = useFocusHub();
|
|
98
|
+
const dataLength = 15;
|
|
99
|
+
const provideData = () => {
|
|
100
|
+
const data = [];
|
|
101
|
+
for (let i = 0; i < dataLength; ++i) {
|
|
102
|
+
data.push({
|
|
103
|
+
width: 100,
|
|
104
|
+
height: 100,
|
|
105
|
+
marginRight: 10,
|
|
106
|
+
color: randomColor(),
|
|
107
|
+
content: i,
|
|
108
|
+
resizable: i !== 5,
|
|
109
|
+
resizeDelay: 1000,
|
|
110
|
+
blurSize: {
|
|
111
|
+
w: 100,
|
|
112
|
+
h: 100,
|
|
113
|
+
},
|
|
114
|
+
focusSize: {
|
|
115
|
+
w: 120,
|
|
116
|
+
h: 120,
|
|
117
|
+
},
|
|
118
|
+
expandSize: {
|
|
119
|
+
w: 400,
|
|
120
|
+
h: 120,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return data;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const measures = (data) => {
|
|
128
|
+
return {
|
|
129
|
+
width: data.width,
|
|
130
|
+
height: data.height,
|
|
131
|
+
marginRight: data.marginRight,
|
|
132
|
+
marginBottom: data.marginBottom,
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const onEdge = (edgeInfo) => {
|
|
137
|
+
console.log("onEdge");
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const widgetLayout = {
|
|
141
|
+
left: 0,
|
|
142
|
+
top: 0,
|
|
143
|
+
width: 700,
|
|
144
|
+
height: 200,
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const padding = {
|
|
148
|
+
left: 80,
|
|
149
|
+
top: 50,
|
|
150
|
+
right: 80,
|
|
151
|
+
bottom: 50,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
onMounted(() => {
|
|
155
|
+
focusHub.setFocus("resize");
|
|
156
|
+
});
|
|
157
|
+
</script>
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:17
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script>
|
|
7
|
+
let animToken = 0;
|
|
8
|
+
</script>
|
|
9
|
+
<script setup>
|
|
10
|
+
import { ref, onBeforeUnmount, computed } from "vue";
|
|
11
|
+
import { getKeyFramesGroup } from "jsview";
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
data: Object,
|
|
15
|
+
onAction: Object,
|
|
16
|
+
query: Object,
|
|
17
|
+
animSetting: Object,
|
|
18
|
+
itemOnClick: Function,
|
|
19
|
+
itemOnGaze: Function,
|
|
20
|
+
itemOnIgnore: Function,
|
|
21
|
+
itemOnFocus: Function,
|
|
22
|
+
itemOnBlur: Function,
|
|
23
|
+
widgetLayout: Object,
|
|
24
|
+
widgetPadding: Object,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const focused = ref(false);
|
|
28
|
+
|
|
29
|
+
const blurSize = props.data.blurSize;
|
|
30
|
+
const focusSize = props.data.focusSize;
|
|
31
|
+
const expandSize = props.data.expandSize;
|
|
32
|
+
const duration = props.animSetting.duration;
|
|
33
|
+
const easing = props.animSetting.easing;
|
|
34
|
+
const width = ref(blurSize.w);
|
|
35
|
+
const height = ref(blurSize.h);
|
|
36
|
+
const top = computed(() => (blurSize.h - height.value) / 2);
|
|
37
|
+
|
|
38
|
+
let timeoutHandler = -1;
|
|
39
|
+
|
|
40
|
+
const animInfo = {
|
|
41
|
+
duration: duration,
|
|
42
|
+
easing: easing,
|
|
43
|
+
onEnd: () => {},
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const isLarge = ref(false);
|
|
47
|
+
const showLarge = ref(false);
|
|
48
|
+
|
|
49
|
+
const transitionStr = `left ${duration / 1000}s ${easing}, top ${
|
|
50
|
+
duration / 1000
|
|
51
|
+
}s ${easing}, width ${duration / 1000}s ${easing}, height ${
|
|
52
|
+
duration / 1000
|
|
53
|
+
}s ${easing}`;
|
|
54
|
+
const animation = ref(null);
|
|
55
|
+
const scaleupAnim = `resize_item_scale_up_keep_center_${animToken++}`;
|
|
56
|
+
const scaledownAnim = `resize_item_scale_down_keep_center_${animToken++}`;
|
|
57
|
+
|
|
58
|
+
const xOffset = (focusSize.w - expandSize.w) / 2;
|
|
59
|
+
const yOffset = (focusSize.h - expandSize.h) / 2;
|
|
60
|
+
const scaleupBody = `@keyframes ${scaleupAnim} { from {transform: translate3d(${xOffset}, ${yOffset}, 0);} to {transform: translate3d(0, 0, 0);} }`;
|
|
61
|
+
const scaledownBody = `@keyframes ${scaledownAnim} { from {transform: translate3d(0, 0, 0);} to {transform: translate3d(${xOffset}, ${yOffset}, 0);}}`;
|
|
62
|
+
|
|
63
|
+
const styleSheets = getKeyFramesGroup();
|
|
64
|
+
styleSheets.insertRule(scaleupBody);
|
|
65
|
+
styleSheets.insertRule(scaledownBody);
|
|
66
|
+
function onAnimEnd() {
|
|
67
|
+
animation.value = null;
|
|
68
|
+
}
|
|
69
|
+
function onTransitionDone() {
|
|
70
|
+
if (!isLarge.value) {
|
|
71
|
+
showLarge.value = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const edgeTransition = `left ${duration / 1000}s ${easing}, top ${
|
|
76
|
+
duration / 1000
|
|
77
|
+
}s ${easing}`;
|
|
78
|
+
const rightSlotLeft = computed(() => {
|
|
79
|
+
return width.value - blurSize.w;
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
function getAnchor(targetWidth) {
|
|
83
|
+
const curPosition = props.query.position(props.query.index);
|
|
84
|
+
//position是相对于布局区域的,所以加上padding
|
|
85
|
+
let curRect = [curPosition.left + props.widgetPadding.left, curPosition.left + props.widgetPadding.left + curPosition.width];
|
|
86
|
+
//留个20不贴边
|
|
87
|
+
let targetRect = [props.widgetLayout.width - targetWidth - 20, props.widgetLayout.width];
|
|
88
|
+
console.log("ccht get anchor", curRect, targetRect);
|
|
89
|
+
if (targetRect[0] > curRect[0]) {
|
|
90
|
+
//右边有足够空间
|
|
91
|
+
return 0;
|
|
92
|
+
} else {
|
|
93
|
+
//[a,b] 映射到 [c,d] 的不动点公式 x = (ad-bc)/(a+d-b-c)
|
|
94
|
+
let fixPoint = (curRect[0] * targetRect[1] - curRect[1] * targetRect[0]) / (curRect[0] + targetRect[1] - curRect[1] - targetRect[0]);
|
|
95
|
+
console.log("ccht get anchor 2", fixPoint);
|
|
96
|
+
return (fixPoint - curRect[0]) / curPosition.width;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const onFocus = () => {
|
|
101
|
+
focused.value = true;
|
|
102
|
+
if (width.value == blurSize.w) {
|
|
103
|
+
//立即放大
|
|
104
|
+
width.value = focusSize.w;
|
|
105
|
+
height.value = focusSize.h;
|
|
106
|
+
props.query.updateItemSize(
|
|
107
|
+
props.query.index,
|
|
108
|
+
{
|
|
109
|
+
width: width.value,
|
|
110
|
+
height: blurSize.h, //布局的高度不需要改变, 只需要改宽
|
|
111
|
+
},
|
|
112
|
+
animInfo
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
if (props.data.resizable && !isLarge.value) {
|
|
116
|
+
//延迟展开
|
|
117
|
+
timeoutHandler = setTimeout(() => {
|
|
118
|
+
isLarge.value = true;
|
|
119
|
+
showLarge.value = true;
|
|
120
|
+
animation.value = `${scaleupAnim} ${duration / 1000}s ${easing}`;
|
|
121
|
+
let anchor = getAnchor(expandSize.w);
|
|
122
|
+
width.value = expandSize.w;
|
|
123
|
+
height.value = expandSize.h;
|
|
124
|
+
props.query.updateItemSize(
|
|
125
|
+
props.query.index,
|
|
126
|
+
{
|
|
127
|
+
width: width.value,
|
|
128
|
+
height: blurSize.h, //布局的高度不需要改变, 只需要改宽
|
|
129
|
+
},
|
|
130
|
+
{ ...animInfo, anchor: anchor }
|
|
131
|
+
);
|
|
132
|
+
}, props.data.resizeDelay ?? 1500);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
props.itemOnFocus?.();
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const onBlur = () => {
|
|
139
|
+
focused.value = false;
|
|
140
|
+
if (width.value != blurSize.w) {
|
|
141
|
+
if (isLarge.vue) {
|
|
142
|
+
animation.value = `${scaledownAnim} ${duration / 1000}s linear`;
|
|
143
|
+
}
|
|
144
|
+
isLarge.value = false;
|
|
145
|
+
let anchor = getAnchor(blurSize.w);
|
|
146
|
+
width.value = blurSize.w;
|
|
147
|
+
height.value = blurSize.h;
|
|
148
|
+
props.query.updateItemSize(
|
|
149
|
+
props.query.index,
|
|
150
|
+
{
|
|
151
|
+
width: width.value,
|
|
152
|
+
height: blurSize.h, //布局的高度不需要改变, 只需要改宽
|
|
153
|
+
},
|
|
154
|
+
{ ...animInfo, anchor: anchor }
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
clearTimeout(timeoutHandler);
|
|
159
|
+
timeoutHandler = -1;
|
|
160
|
+
props.itemOnBlur?.();
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const onClick = () => {
|
|
164
|
+
props.itemOnClick?.();
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const onGaze = () => {
|
|
168
|
+
props.itemOnGaze?.();
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const onIgnore = () => {
|
|
172
|
+
props.itemOnIgnore?.();
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
props.onAction.register("onFocus", onFocus);
|
|
176
|
+
props.onAction.register("onBlur", onBlur);
|
|
177
|
+
props.onAction.register("onClick", onClick);
|
|
178
|
+
props.onAction.register("onGaze", onGaze);
|
|
179
|
+
props.onAction.register("onIgnore", onIgnore);
|
|
180
|
+
|
|
181
|
+
onBeforeUnmount(() => {
|
|
182
|
+
clearTimeout(timeoutHandler);
|
|
183
|
+
timeoutHandler = -1;
|
|
184
|
+
styleSheets.removeRule(scaleupAnim);
|
|
185
|
+
styleSheets.removeRule(scaledownAnim);
|
|
186
|
+
});
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<template>
|
|
190
|
+
<div
|
|
191
|
+
:style="{
|
|
192
|
+
top: top,
|
|
193
|
+
width: width,
|
|
194
|
+
height: height,
|
|
195
|
+
transition: transitionStr,
|
|
196
|
+
overflow: 'hidden',
|
|
197
|
+
}"
|
|
198
|
+
@transitionend="onTransitionDone"
|
|
199
|
+
>
|
|
200
|
+
<div
|
|
201
|
+
:style="{
|
|
202
|
+
width: width,
|
|
203
|
+
height: height,
|
|
204
|
+
animation: animation,
|
|
205
|
+
}"
|
|
206
|
+
@animationend="onAnimEnd"
|
|
207
|
+
>
|
|
208
|
+
<div v-if="showLarge">
|
|
209
|
+
<slot name="large"></slot>
|
|
210
|
+
</div>
|
|
211
|
+
<div v-else>
|
|
212
|
+
<slot name="small" :focused="focused"></slot>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div
|
|
217
|
+
:style="{
|
|
218
|
+
top: top,
|
|
219
|
+
transition: edgeTransition,
|
|
220
|
+
}"
|
|
221
|
+
>
|
|
222
|
+
<slot name="left"></slot>
|
|
223
|
+
</div>
|
|
224
|
+
|
|
225
|
+
<div
|
|
226
|
+
:style="{
|
|
227
|
+
left: rightSlotLeft,
|
|
228
|
+
top: top,
|
|
229
|
+
transition: edgeTransition,
|
|
230
|
+
}"
|
|
231
|
+
>
|
|
232
|
+
<slot name="right"></slot>
|
|
233
|
+
</div>
|
|
234
|
+
</template>
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:08
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import {
|
|
8
|
+
ListWidget,
|
|
9
|
+
HORIZONTAL,
|
|
10
|
+
FixPositionSlide,
|
|
11
|
+
} from "jsview";
|
|
12
|
+
import Item from "./Item.vue";
|
|
13
|
+
import { onMounted } from "vue";
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
name: String,
|
|
17
|
+
provideData: Function,
|
|
18
|
+
measures: Function,
|
|
19
|
+
initFocusId: Number,
|
|
20
|
+
layout: Object,
|
|
21
|
+
onEdge: Function,
|
|
22
|
+
anim: Object,
|
|
23
|
+
padding: Object,
|
|
24
|
+
itemOnClick: Function,
|
|
25
|
+
itemOnGaze: Function,
|
|
26
|
+
itemOnIgnore: Function,
|
|
27
|
+
itemOnFocus: Function,
|
|
28
|
+
itemOnBlur: Function,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const animSetting = {
|
|
32
|
+
duration: props.anim.duration ?? 200,
|
|
33
|
+
easing: props.anim.easing ?? "jsv-ease(0.2, 0.6, 2)",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const fixPositionSlide = new FixPositionSlide({
|
|
37
|
+
fixPercent: 0,
|
|
38
|
+
align: "start",
|
|
39
|
+
...animSetting,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const onEdge = (edgeInfo) => {
|
|
43
|
+
props.onEdge(edgeInfo);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
onMounted(() => {});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<list-widget
|
|
51
|
+
:name="name"
|
|
52
|
+
:left="layout.left"
|
|
53
|
+
:top="layout.top"
|
|
54
|
+
:width="layout.width"
|
|
55
|
+
:height="layout.height"
|
|
56
|
+
:provideData="provideData"
|
|
57
|
+
:direction="HORIZONTAL"
|
|
58
|
+
:slideSetting="fixPositionSlide"
|
|
59
|
+
:measures="measures"
|
|
60
|
+
:padding="padding"
|
|
61
|
+
:onEdge="onEdge"
|
|
62
|
+
>
|
|
63
|
+
<template #renderItem="{ data, onAction, query }">
|
|
64
|
+
<item
|
|
65
|
+
:data="data"
|
|
66
|
+
:onAction="onAction"
|
|
67
|
+
:query="query"
|
|
68
|
+
:animSetting="animSetting"
|
|
69
|
+
:itemOnClick="itemOnClick"
|
|
70
|
+
:itemOnGaze="itemOnGaze"
|
|
71
|
+
:itemOnIgnore="itemOnIgnore"
|
|
72
|
+
:itemOnFocus="itemOnFocus"
|
|
73
|
+
:itemOnBlur="itemOnBlur"
|
|
74
|
+
:widgetLayout="layout"
|
|
75
|
+
:widgetPadding="padding"
|
|
76
|
+
>
|
|
77
|
+
<template #small="{ focused }">
|
|
78
|
+
<slot name="itemSmall" :data="data" :focused="focused"></slot>
|
|
79
|
+
</template>
|
|
80
|
+
<template #large>
|
|
81
|
+
<slot name="itemLarge" :data="data"></slot>
|
|
82
|
+
</template>
|
|
83
|
+
<template #right="{ width }">
|
|
84
|
+
<slot
|
|
85
|
+
name="itemRightEdge"
|
|
86
|
+
:itemSmallWidth="width"
|
|
87
|
+
:data="data"
|
|
88
|
+
></slot>
|
|
89
|
+
</template>
|
|
90
|
+
<template #left>
|
|
91
|
+
<slot name="itemLeftEdge" :data="data"></slot>
|
|
92
|
+
</template>
|
|
93
|
+
</item>
|
|
94
|
+
</template>
|
|
95
|
+
</list-widget>
|
|
96
|
+
</template>
|
|
@@ -13,7 +13,16 @@
|
|
|
13
13
|
<script setup>
|
|
14
14
|
import { JsvRipple, JsvRippleShape } from "jsview";
|
|
15
15
|
import { shallowRef } from "vue";
|
|
16
|
+
|
|
16
17
|
const props = defineProps({
|
|
18
|
+
/**
|
|
19
|
+
* 布局配置对象
|
|
20
|
+
* @prop {Object} layout
|
|
21
|
+
* @property {string} layout.left 左侧位置(带单位)
|
|
22
|
+
* @property {string} layout.top 顶部位置(带单位)
|
|
23
|
+
* @property {string|number} layout.width 宽度(带单位或数字)
|
|
24
|
+
* @property {string|number} layout.height 高度(带单位或数字)
|
|
25
|
+
*/
|
|
17
26
|
layout: {
|
|
18
27
|
type: Object,
|
|
19
28
|
required: true,
|
|
@@ -23,7 +32,13 @@ const props = defineProps({
|
|
|
23
32
|
const rippleViewRef = shallowRef();
|
|
24
33
|
|
|
25
34
|
defineExpose({
|
|
26
|
-
|
|
35
|
+
/**
|
|
36
|
+
* 添加涟漪效果
|
|
37
|
+
* @param {Object} position 涟漪起始位置
|
|
38
|
+
* @param {number} position.left 起始位置左坐标
|
|
39
|
+
* @param {number} position.top 起始位置顶坐标
|
|
40
|
+
* @param {number} [duration=3] 涟漪持续时间(单位:秒)
|
|
41
|
+
*/
|
|
27
42
|
addRipple(position, duration = 3) {
|
|
28
43
|
//duration = ln(amplitude) / timeDecay => timeDecay = ln(amplitude) / duration
|
|
29
44
|
const amplitude = 50;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Back />
|
|
3
|
+
<Front v-if="frontShow" @hidden="onFrontHidden" />
|
|
4
|
+
<ScreenShootScale
|
|
5
|
+
v-if="showScale"
|
|
6
|
+
:from="from"
|
|
7
|
+
:to="to"
|
|
8
|
+
:duration="duration"
|
|
9
|
+
:easing="easing"
|
|
10
|
+
:fromSource="fromSource"
|
|
11
|
+
:toSource="toSource"
|
|
12
|
+
@animationend="onAnimEnd"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
<script setup>
|
|
16
|
+
import Front from "./Front.vue";
|
|
17
|
+
import Back from "./Back.vue";
|
|
18
|
+
import ScreenShootScale from "./ScreenShootScale.vue";
|
|
19
|
+
import { useFocusHub, JsvTextureStoreApi } from "jsview";
|
|
20
|
+
import { onMounted, ref, provide } from "vue";
|
|
21
|
+
|
|
22
|
+
const showScale = ref(false);
|
|
23
|
+
function capture(divRef) {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
JsvTextureStoreApi.capture2Texture(
|
|
26
|
+
divRef.value,
|
|
27
|
+
(textureName, autoRecycle, w, h) => {
|
|
28
|
+
if (textureName) {
|
|
29
|
+
resolve({
|
|
30
|
+
url: `jsvtexturestore://${textureName}`,
|
|
31
|
+
release: () => {
|
|
32
|
+
console.log("release", textureName);
|
|
33
|
+
JsvTextureStoreApi.deleteTexture(textureName);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
reject();
|
|
38
|
+
}
|
|
39
|
+
if (autoRecycle) {
|
|
40
|
+
// 已经是设置了texture的自动回收,所以不再需要主动调用 JsvTextureStoreApi.deleteTexture 来释放内存
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
false // 自动回收, 不填也行,默认为true
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
let from, to, duration, easing, fromSource, toSource, releaseFunc;
|
|
48
|
+
function start(
|
|
49
|
+
_from,
|
|
50
|
+
_to,
|
|
51
|
+
_duration,
|
|
52
|
+
_easing,
|
|
53
|
+
_fromSource,
|
|
54
|
+
_toSource,
|
|
55
|
+
_releaseFunc
|
|
56
|
+
) {
|
|
57
|
+
showScale.value = true;
|
|
58
|
+
from = _from;
|
|
59
|
+
to = _to;
|
|
60
|
+
duration = _duration;
|
|
61
|
+
easing = _easing;
|
|
62
|
+
fromSource = _fromSource;
|
|
63
|
+
toSource = _toSource;
|
|
64
|
+
releaseFunc = _releaseFunc;
|
|
65
|
+
}
|
|
66
|
+
function onAnimEnd() {
|
|
67
|
+
showScale.value = false;
|
|
68
|
+
releaseFunc?.();
|
|
69
|
+
}
|
|
70
|
+
provide("capture", capture);
|
|
71
|
+
provide("start", start);
|
|
72
|
+
|
|
73
|
+
let targetPosition = {};
|
|
74
|
+
provide("setTarget", (l, t, w, h) => {
|
|
75
|
+
targetPosition.left = l;
|
|
76
|
+
targetPosition.top = t;
|
|
77
|
+
targetPosition.width = w;
|
|
78
|
+
targetPosition.height = h;
|
|
79
|
+
});
|
|
80
|
+
provide("getTarget", () => {
|
|
81
|
+
return Object.assign({}, targetPosition);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const focusHub = useFocusHub();
|
|
85
|
+
const frontShow = ref(true);
|
|
86
|
+
|
|
87
|
+
const onFrontHidden = () => {
|
|
88
|
+
console.log("onHidden");
|
|
89
|
+
focusHub.setFocus("backmw");
|
|
90
|
+
frontShow.value = false;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
onMounted(() => {
|
|
94
|
+
focusHub.setFocus("frontmw");
|
|
95
|
+
});
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2023-03-08 14:52:08
|
|
4
|
+
* @Description: file content
|
|
5
|
+
-->
|
|
6
|
+
<script setup>
|
|
7
|
+
import { MetroWidget, HORIZONTAL } from "jsview";
|
|
8
|
+
import Item from "./Item.vue";
|
|
9
|
+
import { onMounted } from "vue";
|
|
10
|
+
|
|
11
|
+
const randomColor = () => {
|
|
12
|
+
let randomColor = Math.round(Math.random() * 2 ** 24).toString(16);
|
|
13
|
+
return (
|
|
14
|
+
"#" + new Array(6 - randomColor.length).fill("0").join("") + randomColor
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const provideData = () => {
|
|
19
|
+
const data = [];
|
|
20
|
+
for (let i = 0; i < 10; ++i) {
|
|
21
|
+
data.push({
|
|
22
|
+
width: 200,
|
|
23
|
+
height: 100,
|
|
24
|
+
marginRight: 10,
|
|
25
|
+
marginBottom: 10,
|
|
26
|
+
color: randomColor(),
|
|
27
|
+
content: i,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
data[0].imgUrl =
|
|
31
|
+
"https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoForOperator/Genie/App/element_228542_icon_20230610184253.jpg";
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const measures = (data) => {
|
|
36
|
+
return {
|
|
37
|
+
width: data.width,
|
|
38
|
+
height: data.height,
|
|
39
|
+
marginRight: data.marginRight,
|
|
40
|
+
marginBottom: data.marginBottom,
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// callbacks
|
|
45
|
+
const onEdge = (edgeInfo) => {};
|
|
46
|
+
|
|
47
|
+
const onFocus = () => {};
|
|
48
|
+
|
|
49
|
+
const onBlur = () => {};
|
|
50
|
+
|
|
51
|
+
const widgetLayout = {
|
|
52
|
+
left: 50,
|
|
53
|
+
top: 450,
|
|
54
|
+
width: 1000,
|
|
55
|
+
height: 120,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
onMounted(() => {});
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<div
|
|
63
|
+
:style="{
|
|
64
|
+
width: 1280,
|
|
65
|
+
height: 720,
|
|
66
|
+
backgroundColor: '#007788',
|
|
67
|
+
}"
|
|
68
|
+
/>
|
|
69
|
+
<metro-widget
|
|
70
|
+
name="backmw"
|
|
71
|
+
:left="widgetLayout.left"
|
|
72
|
+
:top="widgetLayout.top"
|
|
73
|
+
:width="widgetLayout.width"
|
|
74
|
+
:height="widgetLayout.height"
|
|
75
|
+
:provideData="provideData"
|
|
76
|
+
:direction="HORIZONTAL"
|
|
77
|
+
:measures="measures"
|
|
78
|
+
:onEdge="onEdge"
|
|
79
|
+
:onFocus="onFocus"
|
|
80
|
+
:onBlur="onBlur"
|
|
81
|
+
>
|
|
82
|
+
<template #renderItem="{ data, onAction }">
|
|
83
|
+
<item :data="data" :onAction="onAction" />
|
|
84
|
+
</template>
|
|
85
|
+
</metro-widget>
|
|
86
|
+
</template>
|