@shijiu/jsview-vue-samples 1.9.887 → 1.9.915
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/AnimPicture/App.vue +10 -10
- package/Basic/App.vue +1 -1
- package/Basic/components/FontStyle.css +4 -4
- package/Basic/components/anim/AnimKeyframeBasic.vue +1 -1
- package/Basic/components/anim/AnimKeyframeComposite.vue +2 -2
- package/Basic/components/anim/AnimTransition.vue +4 -4
- package/Basic/components/div/DivClip.vue +0 -39
- package/Basic/components/div/DivCssScoped.vue +1 -1
- package/Basic/components/div/DivLayout.vue +1 -1
- package/Basic/components/div/DivRadius.vue +4 -4
- package/Basic/components/img/ImageGroup.vue +2 -2
- package/Basic/components/img/ImgLayout.vue +78 -14
- package/Basic/components/text/TextDirection.vue +9 -9
- package/Basic/components/text/TextEmoji.vue +7 -2
- package/Basic/components/text/TextFontStyle.vue +4 -4
- package/Basic/components/text/TextGroup1.vue +1 -1
- package/Basic/components/text/TextGroup2.vue +2 -2
- package/BasicFocusControl/App.vue +2 -2
- package/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/BasicFocusControl/components/MainArea.vue +2 -2
- package/BasicFocusControl/components/SideBar.vue +2 -2
- package/Collision/App.vue +16 -16
- package/ColorSpace/App.vue +11 -11
- package/CssPreprocessor/App.vue +70 -0
- package/CssPreprocessor/Less/App.vue +32 -0
- package/CssPreprocessor/Less/PanelData.js +51 -0
- package/CssPreprocessor/Less/components/less-group1/LessComments.vue +34 -0
- package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +32 -0
- package/CssPreprocessor/Less/components/less-group1/LessOperations.vue +24 -0
- package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +48 -0
- package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +32 -0
- package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +27 -0
- package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +32 -0
- package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +63 -0
- package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +40 -0
- package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +33 -0
- package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +33 -0
- package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +34 -0
- package/CssPreprocessor/Less/components/less-group5/TextSettings.less +4 -0
- package/CssPreprocessor/Scss/App.vue +32 -0
- package/CssPreprocessor/Scss/PanelData.js +51 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +34 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +36 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +30 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +48 -0
- package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +36 -0
- package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +84 -0
- package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +34 -0
- package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +75 -0
- package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +40 -0
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +35 -0
- package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +33 -0
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +34 -0
- package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +4 -0
- package/CssPreprocessor/Stylus/App.vue +32 -0
- package/CssPreprocessor/Stylus/PanelData.js +51 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +36 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +30 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +47 -0
- package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +78 -0
- package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +63 -0
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +40 -0
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +33 -0
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +33 -0
- package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +4 -0
- package/CssPreprocessor/utils/ContentBlock.vue +43 -0
- package/CssPreprocessor/utils/ContentList.vue +34 -0
- package/CssPreprocessor/utils/FontStyle.css +19 -0
- package/CssPreprocessor/utils/Panel.vue +49 -0
- package/CssPreprocessor/utils/TitleBar.vue +29 -0
- package/DemoHomepage/App.vue +46 -11
- package/DemoHomepage/components/Dialog.vue +15 -15
- package/DemoHomepage/router.js +20 -12
- package/DemoHomepage/views/Homepage.vue +90 -102
- package/DivMetroPerformance/App.vue +150 -0
- package/DivMetroPerformance/Item.vue +58 -0
- 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 +385 -0
- package/DivMetroPerformance/components/MyTab.vue +129 -0
- package/DivMetroPerformance/data.js +124 -0
- package/DivMetroPerformance/utils/GridItem.vue +28 -0
- package/DivMetroPerformance/utils/GridPlate.vue +85 -0
- package/FilterDemo/AnimatePic.vue +3 -3
- package/FilterDemo/App.vue +3 -3
- package/FlipCard/App.vue +2 -2
- package/FlipCard/FlipCard.vue +2 -2
- package/GridDemo/Item.vue +13 -13
- package/HashHistory/App.vue +0 -1
- package/HashHistory/components/Item.vue +2 -2
- package/HashHistory/views/MainPage.vue +1 -1
- package/HashHistory/views/SubPage.vue +2 -2
- package/ImpactStop/App.vue +9 -11
- package/Input/InputPanel.vue +2 -4
- package/LongImage/App.vue +2 -2
- package/LongImage/Button.vue +1 -1
- package/LongImage/ButtonItem.vue +1 -1
- package/LongText/App.vue +3 -3
- package/LongText/Button.vue +1 -1
- package/LongText/ButtonItem.vue +1 -1
- package/LongText/LongTextScroll.vue +4 -4
- package/Marquee/longText.js +0 -2
- package/MaskClip/App.vue +4 -4
- package/MediaDemo/App.vue +127 -0
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +69 -0
- package/MediaDemo/components/Controllor.vue +279 -0
- package/MediaDemo/components/StatusBar.vue +100 -0
- package/MediaDemo/components/frames/AudioFrame.vue +39 -0
- package/MediaDemo/components/frames/AudioPoster.vue +48 -0
- package/MediaDemo/components/frames/MediaFrame.vue +153 -0
- package/MediaDemo/components/frames/VideoFrame.vue +39 -0
- package/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
- package/MetroWidgetDemos/Advanced/widgets/Item.vue +5 -5
- package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -2
- package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +57 -56
- package/MetroWidgetDemos/Item.vue +4 -5
- package/MetroWidgetDemos/PerformanceTest/App.vue +3 -3
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +15 -15
- package/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
- package/MetroWidgetDemos/PingPong/TabItem.vue +2 -2
- package/MetroWidgetDemos/PingPong/ViewSwiper.vue +9 -9
- package/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
- package/MetroWidgetDemos/WidgetItem.vue +2 -2
- package/NinePatchDemo/App.vue +3 -3
- package/NinePatchDemo/Item.vue +5 -5
- package/Preload/App.vue +5 -5
- package/Preload/Item.vue +1 -1
- package/QrcodeDemo/App.vue +3 -3
- package/ScaleDownNeon/App.vue +9 -9
- package/SoundPool/App.vue +6 -9
- package/SprayView/App.vue +22 -22
- package/SpriteImage/App.vue +4 -4
- package/Swiper/App.vue +2 -8
- package/TextBox/App.vue +1 -2
- package/TextBox/RenderCenter.vue +16 -16
- package/TextBox/RenderLeft.vue +16 -16
- package/TextBox/RenderOneLine.vue +12 -12
- package/TextBox/RenderRight.vue +16 -16
- package/TextShadowDemo/App.vue +4 -4
- package/TextureAnimation/App.vue +1 -17
- package/TextureAnimation/App2.vue +3 -3
- package/TextureSize/App.vue +8 -8
- package/ThrowMoveDemo/AccelerateDemo.vue +4 -4
- package/ThrowMoveDemo/LRParabolicDemo.vue +4 -4
- package/ThrowMoveDemo/TargetDemo.vue +4 -4
- package/ThrowMoveDemo/UDParabolicDemo.vue +4 -4
- package/TouchSample/App.vue +2 -2
- package/TouchSample/Item.vue +2 -2
- package/TouchSample/MetroWidgetHorizontal.vue +3 -3
- package/TouchSample/MetroWidgetVertical.vue +3 -3
- package/TouchSample/TouchContainerHorizontal.vue +2 -2
- package/TouchSample/TouchContainerVertical.vue +2 -2
- package/TransitPage/App.vue +1 -1
- package/VideoDemo/App.vue +4 -4
- package/VideoDemo/components/Button.vue +1 -1
- package/VideoDemo/components/Controllor.vue +2 -2
- package/VideoDemo/components/VideoFrame.vue +1 -1
- package/VisibleSensorDemo/App.vue +7 -7
- package/assets/bmpDemo.bmp +0 -0
- package/assets/jpegDemo.jpeg +0 -0
- package/assets/pngDemo.png +0 -0
- package/assets/pngNoAlphaDemo.png +0 -0
- package/assets/webpDemo.webp +0 -0
- package/package.json +6 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ContentList from './ContentList.vue';
|
|
3
|
+
import TitleBar from './TitleBar.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
props: {
|
|
7
|
+
style: Object,
|
|
8
|
+
panelData: Object,
|
|
9
|
+
sideline: Boolean
|
|
10
|
+
},
|
|
11
|
+
components: {
|
|
12
|
+
ContentList,
|
|
13
|
+
TitleBar,
|
|
14
|
+
},
|
|
15
|
+
computed: {
|
|
16
|
+
columnWidth() {
|
|
17
|
+
return this.style.width / this.panelData.title.length;
|
|
18
|
+
},
|
|
19
|
+
separatorColor() {
|
|
20
|
+
return 'rgba(0,0,255,0.7)'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div :style=style>
|
|
28
|
+
<!-- 分隔线 -->
|
|
29
|
+
<div v-if=sideline >
|
|
30
|
+
<div :style="{width:style.width, height:1, backgroundColor:separatorColor}" />
|
|
31
|
+
<div :style="{top:style.height, width:style.width, height:1, backgroundColor:separatorColor}" />
|
|
32
|
+
<div :style="{left: 0, width:1, height: style.height, backgroundColor:separatorColor}" />
|
|
33
|
+
<template v-for="(_, idx) in panelData.title" :key="idx" >
|
|
34
|
+
<div :style="{left: columnWidth*(idx+1), width:1, height: style.height, backgroundColor:separatorColor}" />
|
|
35
|
+
</template>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<TitleBar :style="{width: columnWidth}" :titleData=panelData.title />
|
|
39
|
+
<div :style="{top:20}" >
|
|
40
|
+
<ContentList v-for="(_, idx) in panelData.contentList.length" :key=idx
|
|
41
|
+
:style="{left: columnWidth*idx, width: columnWidth, height: style.height-20}" :startIndex=idx
|
|
42
|
+
:contentData=panelData.contentList[idx]
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style scoped>
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
props: {
|
|
4
|
+
style: Object,
|
|
5
|
+
titleData: Array
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div>
|
|
12
|
+
<template v-for="(title, index) in titleData" :key="index" >
|
|
13
|
+
<div class='title-font title-range' :style="{left: style.width * index}">
|
|
14
|
+
{{ title }}
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
@import "./FontStyle.css";
|
|
22
|
+
|
|
23
|
+
.title-range {
|
|
24
|
+
left: 0;
|
|
25
|
+
top: 0;
|
|
26
|
+
width: v-bind('style.width');
|
|
27
|
+
height: 20;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
package/DemoHomepage/App.vue
CHANGED
|
@@ -1,27 +1,62 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-06-02 13:31:00
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: Please set LastEditors
|
|
5
|
+
* @LastEditTime: 2023-02-13 14:30:06
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
|
-
<script>
|
|
9
|
-
import {
|
|
10
|
-
import { jJsvRuntimeBridge } from "jsview";
|
|
8
|
+
<script setup>
|
|
9
|
+
import { shallowRef, onMounted } from "vue";
|
|
10
|
+
import { JsvPreload, buildPreloadInfo, jJsvRuntimeBridge } from "jsview";
|
|
11
|
+
|
|
12
|
+
let backgroundImageUrl = shallowRef(null);
|
|
13
|
+
|
|
14
|
+
let preloadInfo = shallowRef([]);
|
|
15
|
+
|
|
16
|
+
let _onPreloadDone = () => {
|
|
17
|
+
console.log("background load done");
|
|
18
|
+
jJsvRuntimeBridge.notifyPageLoaded();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
console.log("simulate async get background url");
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
console.log("simulate background url got");
|
|
25
|
+
backgroundImageUrl.value =
|
|
26
|
+
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg";
|
|
27
|
+
preloadInfo.value = [buildPreloadInfo(backgroundImageUrl.value)];
|
|
28
|
+
}, 0);
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
11
31
|
|
|
32
|
+
<script>
|
|
33
|
+
import { router } from "./router.js";
|
|
12
34
|
export default {
|
|
13
35
|
Router: router,
|
|
14
|
-
mounted() {
|
|
15
|
-
jJsvRuntimeBridge.notifyPageLoaded();
|
|
16
|
-
},
|
|
17
36
|
};
|
|
18
37
|
</script>
|
|
19
38
|
|
|
20
39
|
<template>
|
|
21
40
|
<div>
|
|
22
|
-
<
|
|
41
|
+
<jsv-preload
|
|
42
|
+
:key="backgroundImageUrl"
|
|
43
|
+
:preloadList="preloadInfo"
|
|
44
|
+
:onPreloadDone="_onPreloadDone"
|
|
45
|
+
/>
|
|
46
|
+
<div
|
|
47
|
+
:style="{
|
|
48
|
+
width: 1280,
|
|
49
|
+
height: 720,
|
|
50
|
+
backgroundImage: backgroundImageUrl,
|
|
51
|
+
}"
|
|
52
|
+
/>
|
|
53
|
+
<router-view v-slot="{ Component, route }">
|
|
54
|
+
<keep-alive>
|
|
55
|
+
<component v-if="route.meta.keepAlive" :is="Component" />
|
|
56
|
+
</keep-alive>
|
|
57
|
+
<component v-if="!route.meta.keepAlive" :is="Component" />
|
|
58
|
+
</router-view>
|
|
23
59
|
</div>
|
|
24
60
|
</template>
|
|
25
61
|
|
|
26
|
-
<style scoped>
|
|
27
|
-
</style>
|
|
62
|
+
<style scoped></style>
|
|
@@ -62,33 +62,33 @@ export default {
|
|
|
62
62
|
|
|
63
63
|
<style scoped>
|
|
64
64
|
.focus {
|
|
65
|
-
top: -
|
|
66
|
-
left: -
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
65
|
+
top: -5;
|
|
66
|
+
left: -5;
|
|
67
|
+
width: 100;
|
|
68
|
+
height: 50;
|
|
69
69
|
background-color: #0000ff;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.normal {
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
73
|
+
width: 90;
|
|
74
|
+
height: 40;
|
|
75
75
|
color: #ffffff;
|
|
76
76
|
text-align: center;
|
|
77
|
-
font-size:
|
|
77
|
+
font-size: 30;
|
|
78
78
|
}
|
|
79
79
|
.background {
|
|
80
|
-
left:
|
|
81
|
-
top:
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
80
|
+
left: 0;
|
|
81
|
+
top: 0;
|
|
82
|
+
width: 350;
|
|
83
|
+
height: 200;
|
|
84
84
|
background-color: rgba(0, 0, 0, 0.7);
|
|
85
85
|
}
|
|
86
86
|
.message {
|
|
87
|
-
top:
|
|
88
|
-
width:
|
|
89
|
-
height:
|
|
87
|
+
top: 20;
|
|
88
|
+
width: 350;
|
|
89
|
+
height: 50;
|
|
90
90
|
color: #ffffff;
|
|
91
|
-
font-size:
|
|
91
|
+
font-size: 40;
|
|
92
92
|
text-align: center;
|
|
93
93
|
}
|
|
94
94
|
</style>
|
package/DemoHomepage/router.js
CHANGED
|
@@ -7,12 +7,20 @@ const routeList = [
|
|
|
7
7
|
name: 'Home',
|
|
8
8
|
path: '/',
|
|
9
9
|
component: () => import('./views/Homepage.vue'),
|
|
10
|
+
meta: {
|
|
11
|
+
keepAlive: true // 需要被缓存(测试Router keep alive机制)
|
|
12
|
+
}
|
|
10
13
|
},
|
|
11
14
|
{
|
|
12
15
|
name: '基础示例合集',
|
|
13
16
|
path: '/feature/Basic',
|
|
14
17
|
component: () => import('jsview-vue-samples/Basic/App.vue'),
|
|
15
18
|
},
|
|
19
|
+
{
|
|
20
|
+
name: 'CSS预处理',
|
|
21
|
+
path: '/feature/CssPreprocessor',
|
|
22
|
+
component: () => import('jsview-vue-samples/CssPreprocessor/App.vue'),
|
|
23
|
+
},
|
|
16
24
|
{
|
|
17
25
|
name: '可视化变化通知',
|
|
18
26
|
path: '/feature/VisibleSensorDemo',
|
|
@@ -136,7 +144,7 @@ const routeList = [
|
|
|
136
144
|
},
|
|
137
145
|
{
|
|
138
146
|
name: '公祭日黑白效果',
|
|
139
|
-
path: '/feature/
|
|
147
|
+
path: '/feature/GrayDown',
|
|
140
148
|
component: () => import('jsview-vue-samples/FilterDemo/App.vue'),
|
|
141
149
|
},
|
|
142
150
|
{
|
|
@@ -150,20 +158,20 @@ const routeList = [
|
|
|
150
158
|
component: () => import('jsview-vue-samples/ScaleDownNeon/App.vue'),
|
|
151
159
|
},
|
|
152
160
|
{
|
|
153
|
-
name: '
|
|
161
|
+
name: '碰撞检测',
|
|
162
|
+
path: '/feature/Collision',
|
|
163
|
+
component: () => import('jsview-vue-samples/Collision/App.vue'),
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: '碰撞即停',
|
|
167
|
+
path: '/feature/ImpactStop',
|
|
168
|
+
component: () => import('jsview-vue-samples/ImpactStop/App.vue'),
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: '滚动图',
|
|
154
172
|
path: '/feature/Swiper',
|
|
155
173
|
component: () => import('jsview-vue-samples/Swiper/App.vue'),
|
|
156
174
|
},
|
|
157
|
-
// {
|
|
158
|
-
// name: '碰撞检测',
|
|
159
|
-
// path: '/feature/Collision',
|
|
160
|
-
// component: () => import('jsview-vue-samples/Collision/App'),
|
|
161
|
-
// },
|
|
162
|
-
// {
|
|
163
|
-
// name: '碰撞即停',
|
|
164
|
-
// path: '/feature/ImpactStop',
|
|
165
|
-
// component: () => import('jsview-vue-samples/ImpactStop/App'),
|
|
166
|
-
// },
|
|
167
175
|
|
|
168
176
|
// MetroWidget示例
|
|
169
177
|
{
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import {
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, shallowRef, onActivated } from "vue";
|
|
3
|
+
import { jJsvRuntimeBridge, EdgeDirection, useFocusHub } from "jsview";
|
|
3
4
|
import TabFrame from "../components/TabFrame.vue";
|
|
4
5
|
import BodyFrame from "../components/BodyFrame.vue";
|
|
5
6
|
import Dialog from "../components/Dialog.vue";
|
|
6
7
|
import { routeList } from "../router.js";
|
|
7
8
|
|
|
9
|
+
const isDevelopment = process.env.NODE_ENV !== 'production';
|
|
10
|
+
|
|
8
11
|
const colorTemplete = ["#89BEB2", "#C9BA83", "#DED38C", "#DE9C53"];
|
|
9
12
|
|
|
10
13
|
const featureData = [];
|
|
@@ -27,101 +30,88 @@ for (let item of routeList) {
|
|
|
27
30
|
}
|
|
28
31
|
const dataList = [featureData, metroWidgetData];
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// 处理返回键
|
|
62
|
-
if (
|
|
63
|
-
ev.keyCode == 8 || // Backspace
|
|
64
|
-
ev.keyCode == 27 || // Escape
|
|
65
|
-
ev.keyCode == 10000 // 盒子返回键
|
|
66
|
-
) {
|
|
67
|
-
this.showExitDialog = !this.showExitDialog;
|
|
68
|
-
if (!this.showExitDialog) {
|
|
69
|
-
this.changeFocus(this.preFocusName);
|
|
70
|
-
} else {
|
|
71
|
-
this.preFocusName = this.curFocusName;
|
|
72
|
-
this.curFocusName = this.name + "/exitDialog";
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return true;
|
|
76
|
-
},
|
|
77
|
-
changeFocus(name) {
|
|
78
|
-
this.preFocusName = this.curFocusName;
|
|
79
|
-
this.curFocusName = name;
|
|
80
|
-
this.$refs.rootNode.findBlockByName(name).requestFocus();
|
|
81
|
-
},
|
|
82
|
-
onTabEdge(edgeInfo) {
|
|
83
|
-
if (edgeInfo.direction === EdgeDirection.bottom) {
|
|
84
|
-
this.changeFocus(this.name + "/bodyFrame");
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
onContentEdge(edgeInfo) {
|
|
88
|
-
if (edgeInfo.direction === EdgeDirection.top) {
|
|
89
|
-
this.changeFocus(this.name + "/tabFrame");
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
tabItemFocus(data) {
|
|
93
|
-
if (data.id != this.tabId) {
|
|
94
|
-
this.tabId = data.id;
|
|
95
|
-
this.contentData = dataList[this.tabId];
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
onDialogAction(msg) {
|
|
99
|
-
this.showExitDialog = false;
|
|
100
|
-
this.changeFocus(this.preFocusName);
|
|
101
|
-
switch (msg) {
|
|
102
|
-
case "ok":
|
|
103
|
-
jJsvRuntimeBridge.closePage();
|
|
104
|
-
// if (!window.JsView) {
|
|
105
|
-
// // 浏览器调试
|
|
106
|
-
// window.location.href = "about:blank";
|
|
107
|
-
// }
|
|
108
|
-
break;
|
|
109
|
-
case "back":
|
|
110
|
-
case "cancel":
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
created() {
|
|
116
|
-
if (typeof localStorage.curTab !== "undefined") {
|
|
117
|
-
this.tabId = parseInt(localStorage.curTab);
|
|
33
|
+
let showExitDialog = shallowRef(false);
|
|
34
|
+
let contentData = shallowRef(dataList[0]);
|
|
35
|
+
let tabId = shallowRef(0);
|
|
36
|
+
|
|
37
|
+
let preFocusName = "";
|
|
38
|
+
let curFocusName = "";
|
|
39
|
+
let name = "/home";
|
|
40
|
+
|
|
41
|
+
let focusHub = useFocusHub();
|
|
42
|
+
|
|
43
|
+
let address = computed(() => {
|
|
44
|
+
return window.localStorage.href;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
let onFocus = () => {
|
|
48
|
+
changeFocus(name + "/bodyFrame");
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
let onKeyDown = (ev) => {
|
|
52
|
+
// 处理返回键
|
|
53
|
+
if (
|
|
54
|
+
ev.keyCode == 8 || // Backspace
|
|
55
|
+
ev.keyCode == 27 || // Escape
|
|
56
|
+
ev.keyCode == 10000 // 盒子返回键
|
|
57
|
+
) {
|
|
58
|
+
showExitDialog.value = !showExitDialog.value;
|
|
59
|
+
if (!showExitDialog.value) {
|
|
60
|
+
changeFocus(preFocusName);
|
|
61
|
+
} else {
|
|
62
|
+
preFocusName = curFocusName;
|
|
63
|
+
curFocusName = name + "/exitDialog";
|
|
118
64
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
let changeFocus = (name) => {
|
|
70
|
+
preFocusName = curFocusName;
|
|
71
|
+
curFocusName = name;
|
|
72
|
+
focusHub.setFocus(name);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
let onTabEdge = (edgeInfo) => {
|
|
76
|
+
if (edgeInfo.direction === EdgeDirection.bottom) {
|
|
77
|
+
changeFocus(name + "/bodyFrame");
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
let onContentEdge = (edgeInfo) => {
|
|
82
|
+
if (edgeInfo.direction === EdgeDirection.top) {
|
|
83
|
+
changeFocus(name + "/tabFrame");
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
let tabItemFocus = (data) => {
|
|
88
|
+
if (data.id != tabId.value) {
|
|
89
|
+
tabId.value = data.id;
|
|
90
|
+
contentData.value = dataList[data.id];
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
let onDialogAction = (msg) => {
|
|
95
|
+
showExitDialog.value = false;
|
|
96
|
+
changeFocus(preFocusName);
|
|
97
|
+
switch (msg) {
|
|
98
|
+
case "ok":
|
|
99
|
+
jJsvRuntimeBridge.closePage();
|
|
100
|
+
// if (!window.JsView) {
|
|
101
|
+
// // 浏览器调试
|
|
102
|
+
// window.location.href = "about:blank";
|
|
103
|
+
// }
|
|
104
|
+
break;
|
|
105
|
+
case "back":
|
|
106
|
+
case "cancel":
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
124
109
|
};
|
|
110
|
+
|
|
111
|
+
// keep-alive后 router 返回本页面时要激活一下focus
|
|
112
|
+
onActivated(() => {
|
|
113
|
+
onFocus();
|
|
114
|
+
});
|
|
125
115
|
</script>
|
|
126
116
|
|
|
127
117
|
<template>
|
|
@@ -133,7 +123,6 @@ export default {
|
|
|
133
123
|
|
|
134
124
|
<jsv-focus-block
|
|
135
125
|
autoFocus
|
|
136
|
-
ref="rootNode"
|
|
137
126
|
:onAction="{
|
|
138
127
|
onKeyDown: onKeyDown,
|
|
139
128
|
onFocus: onFocus,
|
|
@@ -173,24 +162,23 @@ export default {
|
|
|
173
162
|
|
|
174
163
|
<style scoped>
|
|
175
164
|
.rootSize {
|
|
176
|
-
width:
|
|
177
|
-
height:
|
|
178
|
-
background-color: #334c4c;
|
|
165
|
+
width: 1920;
|
|
166
|
+
height: 1080;
|
|
179
167
|
}
|
|
180
168
|
|
|
181
169
|
.address {
|
|
182
170
|
width: 1280;
|
|
183
171
|
height: 30;
|
|
184
172
|
color: #ffffff;
|
|
185
|
-
font-size:
|
|
173
|
+
font-size: 20;
|
|
186
174
|
}
|
|
187
175
|
|
|
188
176
|
.logo {
|
|
189
177
|
top: 10;
|
|
190
|
-
width:
|
|
178
|
+
width: 1260;
|
|
191
179
|
height: 30;
|
|
192
180
|
color: #00ff00;
|
|
193
|
-
font-size:
|
|
181
|
+
font-size: 20;
|
|
194
182
|
font-weight: bold;
|
|
195
183
|
text-align: right;
|
|
196
184
|
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { Options, Vue } from "vue-class-component";
|
|
3
|
+
import { data1, data2, data3 } from "./data";
|
|
4
|
+
import GridPlate from "./utils/GridPlate.vue";
|
|
5
|
+
import Item from "./components/ContentItem.vue";
|
|
6
|
+
import MyTab from "./components/MyTab.vue";
|
|
7
|
+
|
|
8
|
+
@Options({
|
|
9
|
+
components: {
|
|
10
|
+
GridPlate,
|
|
11
|
+
Item,
|
|
12
|
+
MyTab,
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
class App extends Vue {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.focusNode = null;
|
|
19
|
+
this.contentData = data1;
|
|
20
|
+
this.myId = 0;
|
|
21
|
+
this.focusStyle = {};
|
|
22
|
+
this.requestDataTime = 0;
|
|
23
|
+
|
|
24
|
+
window.sStyleChangeCount = 0;
|
|
25
|
+
window.sStyleChangeCost = 0;
|
|
26
|
+
window.sStyleTextChangeCost = 0;
|
|
27
|
+
|
|
28
|
+
window.sStylePropCount = 0;
|
|
29
|
+
window.sStylePropCost = 0;
|
|
30
|
+
|
|
31
|
+
console.log("App created");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
onKeyDown(ev) {
|
|
35
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
36
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
37
|
+
this.$router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getMeasures() {
|
|
44
|
+
return {
|
|
45
|
+
width: 227,
|
|
46
|
+
height: 351,
|
|
47
|
+
focusable: true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
onFocus() {
|
|
51
|
+
console.log("App onFocus", this.$refs.rootNode);
|
|
52
|
+
}
|
|
53
|
+
onItemFocus(id) {
|
|
54
|
+
if (this.requestDataTime != 0) {
|
|
55
|
+
clearTimeout(this.requestDataTime);
|
|
56
|
+
this.requestDataTime = 0;
|
|
57
|
+
}
|
|
58
|
+
// this.requestDataTime = setTimeout(()=>{
|
|
59
|
+
if (!window.JsvDebugTimeToken) {
|
|
60
|
+
window.JsvDebugTimeToken = {
|
|
61
|
+
start: 0,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
window.JsvDebugTimeToken.start = Date.now();
|
|
65
|
+
console.log(
|
|
66
|
+
"JsvTestTime onItemFocus start time=" + window.JsvDebugTimeToken.start
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
window.sStyleChangeCount = 0;
|
|
70
|
+
window.sStyleChangeCost = 0;
|
|
71
|
+
window.sStyleTextChangeCost = 0;
|
|
72
|
+
window.sStylePropCount = 0;
|
|
73
|
+
window.sStylePropCost = 0;
|
|
74
|
+
|
|
75
|
+
switch (id) {
|
|
76
|
+
case 0:
|
|
77
|
+
this.contentData = data1;
|
|
78
|
+
break;
|
|
79
|
+
case 1:
|
|
80
|
+
this.contentData = data2;
|
|
81
|
+
break;
|
|
82
|
+
case 2:
|
|
83
|
+
this.contentData = data3;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
this.myId = id;
|
|
87
|
+
// }, 0);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
beforeUnmount() {
|
|
91
|
+
if (this.requestDataTime != 0) {
|
|
92
|
+
clearTimeout(this.requestDataTime);
|
|
93
|
+
this.requestDataTime = 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
mounted() {
|
|
98
|
+
this.$refs.rootNode.findBlockByName("tab").requestFocus();
|
|
99
|
+
window.jJsvRuntimeBridge?.notifyPageLoaded();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export default App;
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<template>
|
|
107
|
+
<jsv-focus-block
|
|
108
|
+
ref="rootNode"
|
|
109
|
+
autoFocus
|
|
110
|
+
:onKeyDown="onKeyDown"
|
|
111
|
+
:onFocus="onFocus"
|
|
112
|
+
>
|
|
113
|
+
<div class="rootSize">
|
|
114
|
+
<div :style="{ left: 50, top: 50 }">
|
|
115
|
+
<my-tab name="tab" :onItemFocus="onItemFocus" />
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div class="widgetPos">
|
|
119
|
+
<grid-plate
|
|
120
|
+
name="simpleWidget"
|
|
121
|
+
:key="myId"
|
|
122
|
+
:data="contentData"
|
|
123
|
+
:width="1253"
|
|
124
|
+
:height="600"
|
|
125
|
+
:measures="getMeasures"
|
|
126
|
+
>
|
|
127
|
+
<template #renderItem="{ data }">
|
|
128
|
+
<Item :data="data" />
|
|
129
|
+
</template>
|
|
130
|
+
</grid-plate>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
</jsv-focus-block>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<style scoped>
|
|
137
|
+
.rootSize {
|
|
138
|
+
top: 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.widgetPos {
|
|
142
|
+
top: 120;
|
|
143
|
+
left: 50;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.focusPos {
|
|
147
|
+
top: 10;
|
|
148
|
+
left: 10;
|
|
149
|
+
}
|
|
150
|
+
</style>
|