@shijiu/jsview-vue 2.2.426-test.0 → 2.3.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/bin/jsview-vue-common.mjs +1 -1
- package/bin/jsview-vue.mjs +7506 -6980
- package/bin/types/utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.d.ts +11 -2
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue.d.ts +8 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/DebugTools.d.ts +5 -0
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue.d.ts +24 -6
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue.d.ts +24 -6
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.d.ts +9 -2
- package/bin/types/utils/JsViewEngineWidget/MetroWidget/RenderItem.d.ts +3 -0
- package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.mts +1 -0
- package/bin/types/utils/JsViewPlugin/JsvAudio/version.d.ts +1 -0
- package/bin/types/utils/JsViewPlugin/JsvLatex/BrowserJsvLatex.vue.d.ts +1 -1
- package/bin/types/utils/JsViewPlugin/JsvLatex/JsvLatex.vue.d.ts +1 -1
- package/bin/types/utils/JsViewPlugin/JsvPlayer/AckEventDefine.d.ts +10 -0
- package/bin/types/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer.vue.d.ts +1 -2
- package/bin/types/utils/JsViewPlugin/JsvPlayer/JsvMedia.d.ts +2 -2
- package/bin/types/utils/JsViewVueTools/JsvRuntimeBridge.d.ts +6 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.d.ts +21 -0
- package/bin/types/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.d.ts +1 -1
- package/bin/types/utils/JsViewVueTools/index.d.ts +0 -1
- package/bin/types/utils/JsViewVueWidget/Jsv3dDiv.vue.d.ts +120 -0
- package/bin/types/utils/JsViewVueWidget/Jsv3dStage.vue.d.ts +144 -0
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic/index.d.ts +50 -2
- package/bin/types/utils/JsViewVueWidget/JsvApic/JsvApic2/index.d.ts +23 -2
- package/bin/types/utils/JsViewVueWidget/JsvDriftScope/JsvDriftScope.vue.d.ts +4 -4
- package/bin/types/utils/JsViewVueWidget/JsvFilterView.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue.d.ts +78 -0
- package/bin/types/utils/JsViewVueWidget/JsvFlexCell/index.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.d.ts +1 -0
- package/bin/types/utils/JsViewVueWidget/JsvInput/Cursor.vue.d.ts +1 -1
- package/bin/types/utils/JsViewVueWidget/JsvMindMap/JsvMindMap.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvNinePatch.vue.d.ts +4 -4
- package/bin/types/utils/JsViewVueWidget/JsvPosterDiv.vue.d.ts +3 -0
- package/bin/types/utils/JsViewVueWidget/JsvPosterImage.vue.d.ts +3 -0
- package/bin/types/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue.d.ts +10 -37
- package/bin/types/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue.d.ts +1 -1
- package/bin/types/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue.d.ts +1 -1
- package/bin/types/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue.d.ts +3 -2
- package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/JsvVisibleSensor/index.d.ts +3 -3
- package/bin/types/utils/JsViewVueWidget/index.d.ts +2 -0
- package/package.json +1 -1
- package/utils/JsViewEngineWidget/CheckType.js +3 -3
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusBlock.vue +25 -6
- package/utils/JsViewEngineWidget/JsvFocus/JsvFocusManager.ts +22 -3
- package/utils/JsViewEngineWidget/MetroWidget/DebugFrame.vue +22 -0
- package/utils/JsViewEngineWidget/MetroWidget/DebugTools.ts +37 -0
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +42 -7
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +62 -10
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +205 -91
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +30 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +1 -1
- package/utils/JsViewPlugin/JsvAudio/version.mjs +1 -1
- package/utils/JsViewPlugin/JsvPlayer/AckEventDefine.ts +82 -0
- package/utils/JsViewPlugin/JsvPlayer/BrowserJsvPlayer.vue +49 -31
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +12 -3
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/Path.ts +38 -2
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +1 -1
- package/utils/JsViewVueTools/index.js +0 -1
- package/utils/JsViewVueWidget/Jsv3dDiv.vue +85 -0
- package/utils/JsViewVueWidget/Jsv3dStage.vue +50 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic/index.js +1 -8
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/index.js +1 -8
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFlexDiv.vue +1 -1
- package/utils/JsViewVueWidget/JsvFlexCell/JsvFullScrAdjust.vue +151 -0
- package/utils/JsViewVueWidget/JsvFlexCell/JsvScreenFlex.vue +2 -2
- package/utils/JsViewVueWidget/JsvFlexCell/index.js +1 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +8 -0
- package/utils/JsViewVueWidget/JsvInput/EditViewOperator.ts +1 -1
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +0 -9
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +57 -71
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +15 -8
- package/utils/JsViewVueWidget/JsvPosterImage.vue +11 -1
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +99 -61
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +48 -48
- package/utils/JsViewVueWidget/index.js +2 -0
- package/bin/browser/BrowserApic.vue.mjs +0 -114
- package/bin/browser/BrowserApic2.vue.mjs +0 -108
- package/bin/browser/BrowserApicLib.mjs +0 -431
- package/bin/types/utils/JsViewVueTools/JsvDemoTester.d.ts +0 -2
- package/utils/JsViewVueTools/JsvDemoTester.js +0 -81
|
@@ -24,6 +24,14 @@ class StatePackBuilder {
|
|
|
24
24
|
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.RemoveByGroup(group));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/*
|
|
28
|
+
* removeConditionByGroup
|
|
29
|
+
* 清理指定名字的condition
|
|
30
|
+
*/
|
|
31
|
+
removeConditionByName(specName: String) {
|
|
32
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.RemoveByName(specName));
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
/**
|
|
28
36
|
* activeCondition
|
|
29
37
|
* 重新激活对应gid或者specName的condition
|
|
@@ -24,7 +24,7 @@ export class EditViewOperator {
|
|
|
24
24
|
private _EditViewHandle: any = null;
|
|
25
25
|
private _CursorHandle: CursorOperater | null = null;
|
|
26
26
|
private _EditViewId: number = -1;
|
|
27
|
-
private _CursorResumeTimeoutToken:
|
|
27
|
+
private _CursorResumeTimeoutToken: any = -1;
|
|
28
28
|
|
|
29
29
|
private _InputType: number = 0;
|
|
30
30
|
private _FontStyle: FontStyleDefine | null = null
|
|
@@ -168,15 +168,6 @@ export default {
|
|
|
168
168
|
|
|
169
169
|
<template>
|
|
170
170
|
<div
|
|
171
|
-
v-if="html"
|
|
172
|
-
ref="innerViewDiv"
|
|
173
|
-
:style="{
|
|
174
|
-
top: style.top,
|
|
175
|
-
left: style.left,
|
|
176
|
-
}"
|
|
177
|
-
></div>
|
|
178
|
-
<div
|
|
179
|
-
v-else
|
|
180
171
|
:data-jsv-vw-innerview="innerViewId"
|
|
181
172
|
:style="{
|
|
182
173
|
top: style.top,
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @param {Object} style 布局样式(必须),必须包含的信息为{left, top, width, height}
|
|
8
8
|
* @param {function} getId 回调函数,用于接收ID信息,ID信息用于Native端对该view进行跟踪的标识
|
|
9
9
|
* @param {String} setId 给定命名ID,避免同进程不同context重名要和Context相关,
|
|
10
|
-
* 例如`${window.
|
|
10
|
+
* 例如`${window.JsvCoreApi?.getJsContextId()}_${you_name}`
|
|
11
11
|
* @param {number} corner 圆角的尺寸,默认为0
|
|
12
12
|
* @param {number} oversize 为了去除黑边的调整选项,让native video的尺寸信息比扣洞大多少, 默认为0
|
|
13
13
|
* @param {boolean} frontLayer 视图是在JsView界面前方,不是需要扣洞的后方,默认为false
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
<script setup>
|
|
18
18
|
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
19
|
-
import ForgeHandles from "../JsViewVueTools/ForgeHandles";
|
|
20
19
|
import { JsvTextureStoreApi } from "../JsViewVueTools/JsvTextureStore/JsvTextureStore";
|
|
21
20
|
import { onUnmounted, shallowRef } from "vue";
|
|
22
21
|
import JsvNinePatch from "./JsvNinePatch.vue";
|
|
@@ -49,77 +48,69 @@ let vInnerViewId = -1;
|
|
|
49
48
|
let vNinePatchSet = null;
|
|
50
49
|
let vBackgroudnColorValue = null;
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} else {
|
|
95
|
-
// 用背景色
|
|
96
|
-
vBackgroudnColorValue = "rgba(0,0,0,0)";
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// 通过内置函数构造定制的NativeSharedView
|
|
101
|
-
vJsvMainView = new Forge.NativeSharedView();
|
|
102
|
-
vInnerViewId = Forge.sViewStore.add(new Forge.ViewInfo(vJsvMainView));
|
|
103
|
-
if (rProps.oversize != 0) {
|
|
104
|
-
vJsvMainView.SetOverSize(rProps.oversize);
|
|
51
|
+
// 创建JsView图层穿透的texture,抠洞处理
|
|
52
|
+
|
|
53
|
+
if (!rProps.frontLayer) {
|
|
54
|
+
// 有圆角
|
|
55
|
+
if (rProps.corner > 0) {
|
|
56
|
+
let presetGap = 1; // 外延距离,以保证圆角光滑
|
|
57
|
+
vNinePatchSet = {
|
|
58
|
+
imageSize: (rProps.corner + presetGap) * 2, // 半径 + 中心点1像素
|
|
59
|
+
textureName: null,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// 用 JsvTextureStoreApi 绘制半径对等的圆形
|
|
63
|
+
let sampleImageWidth = vNinePatchSet.imageSize;
|
|
64
|
+
let innerRadius2 = sampleImageWidth; // 内直径
|
|
65
|
+
let circleLineWidth = 1.5 * rProps.corner + presetGap - rProps.corner; // 线粗要把四角盖上
|
|
66
|
+
let canvasRef;
|
|
67
|
+
|
|
68
|
+
// 创建画布
|
|
69
|
+
canvasRef = JsvTextureStoreApi.canvasTexture(
|
|
70
|
+
sampleImageWidth,
|
|
71
|
+
sampleImageWidth
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
let circleRadius =
|
|
75
|
+
Math.floor(innerRadius2 / 2) +
|
|
76
|
+
Math.floor(circleLineWidth / 2) -
|
|
77
|
+
presetGap; // 圆环绘制路径是粗线的中心线,所以要减去一半的线宽
|
|
78
|
+
let customPath = canvasRef.circlePath(
|
|
79
|
+
Math.floor(sampleImageWidth / 2),
|
|
80
|
+
Math.floor(sampleImageWidth / 2),
|
|
81
|
+
circleRadius
|
|
82
|
+
); // 创建圆环绘制路径,圆形在画布的中心点位置
|
|
83
|
+
canvasRef.drawColor("rgba(0,0,0,0)"); // 画布绘制透明底色
|
|
84
|
+
customPath.stroke(circleLineWidth, "#FF0000FF"); // 绘制alpha=1的边缘留色
|
|
85
|
+
|
|
86
|
+
// 获取填入url的内容
|
|
87
|
+
// 进行.9拉伸以适配目标尺寸
|
|
88
|
+
// 通过 alphaOverride 进行alpah叠加
|
|
89
|
+
vNinePatchSet.textureName = canvasRef.commit();
|
|
90
|
+
} else {
|
|
91
|
+
// 用背景色
|
|
92
|
+
vBackgroudnColorValue = "rgba(0,0,0,0)";
|
|
105
93
|
}
|
|
94
|
+
}
|
|
106
95
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
// 通过内置函数构造定制的NativeSharedView
|
|
97
|
+
vJsvMainView = new Forge.NativeSharedView();
|
|
98
|
+
vInnerViewId = Forge.sViewStore.add(new Forge.ViewInfo(vJsvMainView));
|
|
99
|
+
if (rProps.oversize != 0) {
|
|
100
|
+
vJsvMainView.SetOverSize(rProps.oversize);
|
|
101
|
+
}
|
|
113
102
|
|
|
114
|
-
|
|
103
|
+
// 更新宽高
|
|
104
|
+
if (typeof vJsvMainView != "undefined" && vJsvMainView) {
|
|
105
|
+
if (rProps.setId) {
|
|
106
|
+
// 使用设置进来的track id,而非自动生成
|
|
107
|
+
vJsvMainView.SetTrackId(rProps.setId);
|
|
115
108
|
}
|
|
109
|
+
|
|
110
|
+
rProps.getId?.(vJsvMainView.GetTrackId());
|
|
116
111
|
}
|
|
117
112
|
|
|
118
113
|
onUnmounted(() => {
|
|
119
|
-
if (!window.JsView) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
114
|
// 清理View管理缓存
|
|
124
115
|
if (vInnerViewId !== -1) {
|
|
125
116
|
Forge.sViewStore.remove(vInnerViewId);
|
|
@@ -135,7 +126,6 @@ onUnmounted(() => {
|
|
|
135
126
|
|
|
136
127
|
<template>
|
|
137
128
|
<div
|
|
138
|
-
v-if="!isBrowserDebug"
|
|
139
129
|
:style="{
|
|
140
130
|
left: style.left,
|
|
141
131
|
top: style.top,
|
|
@@ -173,8 +163,4 @@ onUnmounted(() => {
|
|
|
173
163
|
<slot />
|
|
174
164
|
</div>
|
|
175
165
|
</div>
|
|
176
|
-
|
|
177
|
-
<div v-else :style="{ ...style }">
|
|
178
|
-
<slot />
|
|
179
|
-
</div>
|
|
180
166
|
</template>
|
|
@@ -2,38 +2,44 @@
|
|
|
2
2
|
* @file
|
|
3
3
|
*
|
|
4
4
|
* 【模块 export 内容】
|
|
5
|
-
* JsvPosterDiv:Vue
|
|
5
|
+
* JsvPosterDiv:Vue高阶组件,海报描画, 其字内容为占位图
|
|
6
6
|
* props说明:
|
|
7
7
|
* style {Object} 包含
|
|
8
8
|
* left/top/width/height
|
|
9
9
|
* border-radius
|
|
10
10
|
* backgroundImage/backgroundColor
|
|
11
11
|
* 的style设置
|
|
12
|
+
* enableAA: {boolean} 启用非全局的抗锯齿处理,不过这个处理会使绘制的矩形比原尺寸每边少2~3像素点
|
|
12
13
|
-->
|
|
13
14
|
<script setup>
|
|
14
|
-
|
|
15
|
-
import { reactive, watchEffect } from "vue";
|
|
15
|
+
import { reactive, watchEffect, shallowRef } from "vue";
|
|
16
16
|
|
|
17
17
|
const props = defineProps({
|
|
18
18
|
style: Object,
|
|
19
|
+
enableAA: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
19
23
|
});
|
|
20
24
|
|
|
21
25
|
let common_style = reactive({});
|
|
22
26
|
let image_style = reactive({});
|
|
27
|
+
let rEnableAA = shallowRef("0");
|
|
23
28
|
|
|
24
|
-
watchEffect(()=>{
|
|
29
|
+
watchEffect(() => {
|
|
25
30
|
if (props.style) {
|
|
26
|
-
let {left, top, width, height, ...others} = props.style;
|
|
31
|
+
let { left, top, width, height, transformStyle, ...others } = props.style;
|
|
27
32
|
|
|
28
33
|
common_style.left = left;
|
|
29
34
|
common_style.top = top;
|
|
35
|
+
common_style.transformStyle = transformStyle;
|
|
30
36
|
|
|
31
37
|
image_style.width = width;
|
|
32
38
|
image_style.height = height;
|
|
33
|
-
Object.assign(image_style, others)
|
|
39
|
+
Object.assign(image_style, others);
|
|
34
40
|
}
|
|
35
|
-
|
|
36
|
-
|
|
41
|
+
rEnableAA.value = props.enableAA ? "1" : "0";
|
|
42
|
+
});
|
|
37
43
|
</script>
|
|
38
44
|
|
|
39
45
|
<template>
|
|
@@ -43,6 +49,7 @@ watchEffect(()=>{
|
|
|
43
49
|
data-jsv-vw-enable-fade="true"
|
|
44
50
|
data-jsv-vw-mask-poster-on-top="true"
|
|
45
51
|
:style="image_style"
|
|
52
|
+
:data-jsv-img-enable-aa="rEnableAA"
|
|
46
53
|
v-bind="$attrs"
|
|
47
54
|
/>
|
|
48
55
|
</div>
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
* src {string} 图片的加载地址
|
|
11
11
|
* fadeIn: {boolean} 图片加载完成是否有淡入效果,默认为打开
|
|
12
12
|
* isPosterImage: 标识是否用于海报位,对于海报位的内容,可以有下载线程控制等策略来优化整体体验
|
|
13
|
+
* enableAA: {boolean} 启用非全局的抗锯齿处理,不过这个处理会使绘制的矩形比原尺寸每边少2~3像素点
|
|
13
14
|
-->
|
|
14
15
|
|
|
15
16
|
<script setup>
|
|
16
|
-
import { reactive, watchEffect, computed } from "vue";
|
|
17
|
+
import { reactive, watchEffect, computed, shallowRef } from "vue";
|
|
17
18
|
import { JsvPerformance } from "../JsViewVueTools/JsvPerformance.ts";
|
|
18
19
|
|
|
19
20
|
const props = defineProps({
|
|
@@ -37,6 +38,10 @@ const props = defineProps({
|
|
|
37
38
|
type: String,
|
|
38
39
|
default: null,
|
|
39
40
|
},
|
|
41
|
+
enableAA: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false,
|
|
44
|
+
},
|
|
40
45
|
style: Object,
|
|
41
46
|
});
|
|
42
47
|
|
|
@@ -52,6 +57,7 @@ const isPosterImage = computed(() => {
|
|
|
52
57
|
|
|
53
58
|
let common_style = reactive({});
|
|
54
59
|
let image_style = reactive({});
|
|
60
|
+
let rEnableAA = shallowRef("0");
|
|
55
61
|
|
|
56
62
|
watchEffect(() => {
|
|
57
63
|
if (props.style) {
|
|
@@ -61,6 +67,7 @@ watchEffect(() => {
|
|
|
61
67
|
top,
|
|
62
68
|
width,
|
|
63
69
|
height,
|
|
70
|
+
transformStyle,
|
|
64
71
|
backgroundImage,
|
|
65
72
|
backgroundColor,
|
|
66
73
|
...others
|
|
@@ -69,11 +76,13 @@ watchEffect(() => {
|
|
|
69
76
|
// 承接x,y偏移和动画设置, 规避默认淡出动画被影响
|
|
70
77
|
common_style.left = left;
|
|
71
78
|
common_style.top = top;
|
|
79
|
+
common_style.transformStyle = transformStyle;
|
|
72
80
|
|
|
73
81
|
image_style.width = width;
|
|
74
82
|
image_style.height = height;
|
|
75
83
|
Object.assign(image_style, others);
|
|
76
84
|
}
|
|
85
|
+
rEnableAA.value = props.enableAA ? "1" : "0";
|
|
77
86
|
});
|
|
78
87
|
</script>
|
|
79
88
|
|
|
@@ -87,6 +96,7 @@ watchEffect(() => {
|
|
|
87
96
|
:data-jsv-img-scaledown-tex="scaleddown"
|
|
88
97
|
:data-jsv-img-color-space="colorSpace"
|
|
89
98
|
:data-jsv-img-poster-image="isPosterImage"
|
|
99
|
+
:data-jsv-img-enable-aa="rEnableAA"
|
|
90
100
|
:style="image_style"
|
|
91
101
|
:src="props.src"
|
|
92
102
|
v-bind="$attrs"
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* pointRes {string} (必需)粒子图案 可选值: 绝对路径url|url(相对路径url)|#FFFFFF|rbga(255,0,0,1.0)
|
|
14
14
|
* sprayStyle {object} (必需)粒子效果配置
|
|
15
15
|
* ignoreClip {boolean} 无视clipView描画
|
|
16
|
+
* onStop {() => void} 停止喷射回调
|
|
16
17
|
*
|
|
17
18
|
* prop中的sprayStyle说明:
|
|
18
19
|
* type {int} (必需)喷射类型 0: 一次喷射 1: 持续喷射
|
|
@@ -38,13 +39,56 @@
|
|
|
38
39
|
* alphaMax {float} 透明度最大值, 默认为1
|
|
39
40
|
* angleMin {float} 角度最小值(角度)
|
|
40
41
|
* angleMax {float} 角度最大值(角度)
|
|
42
|
+
* 方法
|
|
43
|
+
* start { () => void }
|
|
44
|
+
* @descripe 开始喷射
|
|
45
|
+
* stop { (immediate: boolean) => void }
|
|
46
|
+
* @descripe 停止喷射
|
|
47
|
+
* @param immediate { boolean } 是否立即消除粒子, false时会停止喷射,等待已有粒子消失
|
|
41
48
|
-->
|
|
42
|
-
<script>
|
|
49
|
+
<script setup>
|
|
43
50
|
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
44
51
|
import ForgeHandles from "../../JsViewVueTools/ForgeHandles";
|
|
45
52
|
import { urlCheckSet } from "../../JsViewVueTools";
|
|
53
|
+
import { ref, onBeforeUnmount, onUpdated, onMounted } from "vue";
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
const props = defineProps({
|
|
56
|
+
pointRes: {
|
|
57
|
+
type: String,
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
sprayStyle: {
|
|
61
|
+
type: Object,
|
|
62
|
+
required: true,
|
|
63
|
+
},
|
|
64
|
+
ignoreClip: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
onStop: {
|
|
69
|
+
type: Function,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const widthSize = ref(0);
|
|
75
|
+
const heightSize = ref(0);
|
|
76
|
+
let sprayView = null;
|
|
77
|
+
|
|
78
|
+
function unloadView() {
|
|
79
|
+
if (viewId.value != -1) {
|
|
80
|
+
Forge.sViewStore.remove(viewId.value);
|
|
81
|
+
viewId.value = -1;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
let buildForgeView = (
|
|
86
|
+
pointRes,
|
|
87
|
+
sprayStyle,
|
|
88
|
+
ignoreClip,
|
|
89
|
+
widthRef,
|
|
90
|
+
heightRef
|
|
91
|
+
) => {
|
|
48
92
|
if (!pointRes) {
|
|
49
93
|
return -1;
|
|
50
94
|
}
|
|
@@ -60,7 +104,7 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
|
|
|
60
104
|
texture_manager.GetImage2(image_url, false, null, "RGB_8888", null)
|
|
61
105
|
);
|
|
62
106
|
}
|
|
63
|
-
|
|
107
|
+
sprayView = new Forge.SprayView(texture_setting);
|
|
64
108
|
let add_speed = 0.1;
|
|
65
109
|
if (typeof sprayStyle.particleAddSpeed == "number") {
|
|
66
110
|
add_speed = sprayStyle.particleAddSpeed;
|
|
@@ -113,7 +157,7 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
|
|
|
113
157
|
}
|
|
114
158
|
}
|
|
115
159
|
|
|
116
|
-
|
|
160
|
+
sprayView.SetSprayInfo(
|
|
117
161
|
sprayStyle.type,
|
|
118
162
|
sprayStyle.particleNum,
|
|
119
163
|
add_speed,
|
|
@@ -142,69 +186,63 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
|
|
|
142
186
|
sprayStyle.deltaWidth === 0 ? 1 : 2 * sprayStyle.deltaWidth;
|
|
143
187
|
const view_height =
|
|
144
188
|
sprayStyle.deltaHeight === 0 ? 1 : 2 * sprayStyle.deltaHeight;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return Forge.sViewStore.add(new Forge.ViewInfo(
|
|
189
|
+
widthRef.value = view_width;
|
|
190
|
+
heightRef.value = view_height;
|
|
191
|
+
return Forge.sViewStore.add(new Forge.ViewInfo(sprayView, null));
|
|
148
192
|
};
|
|
193
|
+
const viewId = ref(
|
|
194
|
+
buildForgeView(
|
|
195
|
+
props.pointRes,
|
|
196
|
+
props.sprayStyle,
|
|
197
|
+
props.ignoreClip,
|
|
198
|
+
widthSize,
|
|
199
|
+
heightSize
|
|
200
|
+
)
|
|
201
|
+
);
|
|
149
202
|
|
|
150
|
-
|
|
151
|
-
props
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
);
|
|
189
|
-
},
|
|
190
|
-
updated() {
|
|
191
|
-
this.unloadView();
|
|
192
|
-
this.viewId = buildForgeView(
|
|
193
|
-
this.pointRes,
|
|
194
|
-
this.sprayStyle,
|
|
195
|
-
this.size,
|
|
196
|
-
this.ignoreClip
|
|
197
|
-
);
|
|
198
|
-
},
|
|
199
|
-
beforeUnmount() {
|
|
200
|
-
this.unloadView();
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
+
function onStop() {
|
|
204
|
+
props.onStop?.();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
sprayView.RegisterOnStop(onStop);
|
|
208
|
+
sprayView.RegisterEventListener();
|
|
209
|
+
|
|
210
|
+
function start() {
|
|
211
|
+
sprayView.Start();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function stop(immediate) {
|
|
215
|
+
sprayView.Stop(immediate);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
onMounted(() => {
|
|
219
|
+
start();
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
onUpdated(() => {
|
|
223
|
+
unloadView();
|
|
224
|
+
viewId.value = buildForgeView(
|
|
225
|
+
props.pointRes,
|
|
226
|
+
props.sprayStyle,
|
|
227
|
+
props.ignoreClip,
|
|
228
|
+
widthSize,
|
|
229
|
+
heightSize
|
|
230
|
+
);
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
onBeforeUnmount(() => {
|
|
234
|
+
unloadView();
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
defineExpose({
|
|
238
|
+
start,
|
|
239
|
+
stop,
|
|
240
|
+
});
|
|
203
241
|
</script>
|
|
204
242
|
|
|
205
243
|
<template>
|
|
206
244
|
<div
|
|
207
|
-
:style="{ width:
|
|
245
|
+
:style="{ width: widthSize, height: heightSize }"
|
|
208
246
|
:data-jsv-vw-innerview="viewId"
|
|
209
247
|
></div>
|
|
210
248
|
</template>
|