@lambo-design/shared 1.0.0-beta.382 → 1.0.0-beta.384
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {on} from '@lambo-design/shared/utils/dom'
|
|
2
|
-
import {buildMenuUri} from '@lambo-design/shared/utils/platform'
|
|
2
|
+
import {addOttCode, buildMenuUri} from '@lambo-design/shared/utils/platform'
|
|
3
3
|
import config from '@lambo-design/shared/config/config'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
@@ -29,15 +29,15 @@ export default {
|
|
|
29
29
|
canMove = false
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
const handleMousemove = e => {
|
|
32
|
+
const handleMousemove = async e => {
|
|
33
33
|
let xOffset = e.pageX - pageX + transformX
|
|
34
34
|
let yOffset = e.pageY - pageY + transformY
|
|
35
35
|
if (canMove) {
|
|
36
36
|
bodyDom.style.transform = `translate(${xOffset}px, ${yOffset}px)`
|
|
37
37
|
//bodyDom.style.position = `absolute`
|
|
38
38
|
//bodyDom.style.zIndex = `99999`
|
|
39
|
-
if (
|
|
40
|
-
|| Math.abs(yOffset) > parseInt(config.draggableMenuConfig.yOffset)
|
|
39
|
+
if (Math.abs(xOffset) > parseInt(config.draggableMenuConfig.xOffset)
|
|
40
|
+
|| Math.abs(yOffset) > parseInt(config.draggableMenuConfig.yOffset)) {
|
|
41
41
|
hasMove = true;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -57,12 +57,13 @@ export default {
|
|
|
57
57
|
let bodyDom = document.querySelector(binding.value.body)
|
|
58
58
|
bodyDom.style.transform = ''
|
|
59
59
|
}
|
|
60
|
+
item = await addOttCode(item)
|
|
60
61
|
window.open(buildMenuUri(item))
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
const handleMouseup = e => {
|
|
66
|
+
const handleMouseup = async e => {
|
|
66
67
|
if (binding.value.item && hasMove) {
|
|
67
68
|
let item = binding.value.item;
|
|
68
69
|
if (item.uri) {
|
|
@@ -72,6 +73,7 @@ export default {
|
|
|
72
73
|
let bodyDom = document.querySelector(binding.value.body)
|
|
73
74
|
bodyDom.style.transform = ''
|
|
74
75
|
}
|
|
76
|
+
item = await addOttCode(item)
|
|
75
77
|
window.open(buildMenuUri(item))
|
|
76
78
|
}
|
|
77
79
|
}
|
package/package.json
CHANGED
package/utils/platform.js
CHANGED
|
@@ -779,7 +779,22 @@ export const isOpenBlank = (menu) => {
|
|
|
779
779
|
}
|
|
780
780
|
return false;
|
|
781
781
|
}
|
|
782
|
-
|
|
782
|
+
export const isYqqh = (menu) => {
|
|
783
|
+
let extendProps = {}
|
|
784
|
+
if (menu && menu.meta && menu.meta.data && menu.meta.data.extension) {
|
|
785
|
+
extendProps = JSON.parse(menu.meta.data.extension)
|
|
786
|
+
}
|
|
787
|
+
if (menu && menu.extension) {
|
|
788
|
+
extendProps = JSON.parse(menu.extension)
|
|
789
|
+
}
|
|
790
|
+
if (extendProps && extendProps.is_yqqh && extendProps.is_yqqh == '1') {
|
|
791
|
+
return true;
|
|
792
|
+
}
|
|
793
|
+
if (extendProps && extendProps.isYqqh && extendProps.isYqqh == '1') {
|
|
794
|
+
return true;
|
|
795
|
+
}
|
|
796
|
+
return false;
|
|
797
|
+
}
|
|
783
798
|
/**
|
|
784
799
|
* 判断应用是否为移动应用
|
|
785
800
|
* @param app
|
|
@@ -1319,8 +1334,8 @@ export const getOttCode = async () => {
|
|
|
1319
1334
|
return ott;
|
|
1320
1335
|
}
|
|
1321
1336
|
export const addOttCode = async (item) => {
|
|
1322
|
-
if (item && item.uri && item
|
|
1323
|
-
let ott = getOttCode();
|
|
1337
|
+
if (item && item.uri && isYqqh(item)) {
|
|
1338
|
+
let ott = await getOttCode();
|
|
1324
1339
|
if (ott) {
|
|
1325
1340
|
item.ott = ott;
|
|
1326
1341
|
}
|