wui-components-v2 1.2.69 → 1.2.71
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.
|
@@ -260,11 +260,7 @@ function detail() {
|
|
|
260
260
|
props.detailButtonHandle(props.data)
|
|
261
261
|
return
|
|
262
262
|
}
|
|
263
|
-
router.push(
|
|
264
|
-
`/pages/details-page/index?sourceId=${encodeURIComponent(props.sourceId)}&id=${encodeURIComponent(
|
|
265
|
-
props.code
|
|
266
|
-
)}&title=${encodeURIComponent(props.item.title || '')}`
|
|
267
|
-
)
|
|
263
|
+
router.push(`/pages/details-page/index?sourceId=${props.sourceId}&id=${props.code}&title=${props.item.title}`)
|
|
268
264
|
}
|
|
269
265
|
|
|
270
266
|
// 判断按钮是否满足条件显示
|
|
@@ -98,22 +98,19 @@ function goDetail(item: Columns) {
|
|
|
98
98
|
.map(param => {
|
|
99
99
|
const fieldValue = props.data.fieldMap[param.id]
|
|
100
100
|
const value = fieldValue ?? param.defaultValue ?? ''
|
|
101
|
-
return `${
|
|
101
|
+
return `${param.title ?? ''}=${value}`
|
|
102
102
|
})
|
|
103
103
|
.join('&')
|
|
104
104
|
const sep = params ? (fieldJump.mobilePath.includes('?') ? '&' : '?') : ''
|
|
105
|
-
//
|
|
105
|
+
// 明文拼接;encodeURI 仅编码空格等 URL 非法字符,接收端(wui-list 等)解码一次还原
|
|
106
106
|
uni.navigateTo({
|
|
107
107
|
url: encodeURI(`${fieldJump.mobilePath}${sep}${params}`),
|
|
108
108
|
})
|
|
109
109
|
return
|
|
110
110
|
}
|
|
111
|
-
// 使用字段自身的 sourceId(参考 w-card.vue goto('link')
|
|
112
|
-
// 参数统一 encodeURIComponent,避免中文/特殊字符在 App 端被截断导致乱码、参数错位
|
|
111
|
+
// 使用字段自身的 sourceId(参考 w-card.vue goto('link')),明文拼接,不手动编码
|
|
113
112
|
uni.navigateTo({
|
|
114
|
-
url: `/pages/details-page/index?sourceId=${
|
|
115
|
-
String(code)
|
|
116
|
-
)}&title=${encodeURIComponent(item.title || '')}`,
|
|
113
|
+
url: `/pages/details-page/index?sourceId=${item.sourceId}&id=${code}&title=${item.title || ''}`,
|
|
117
114
|
})
|
|
118
115
|
}
|
|
119
116
|
</script>
|
|
@@ -59,24 +59,16 @@ const loading = ref(false)
|
|
|
59
59
|
// 折叠面板
|
|
60
60
|
const collapses = ref()
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* encodeURIComponent 的基础上再自动编码一次,onLoad 收到双重编码值),
|
|
65
|
-
* 这里循环解码到稳定态,兼容 0/1/2 层编码,保证拿到明文。
|
|
62
|
+
* 简单解码:跳转端明文传参,URL 传输时浏览器/App 框架会自动编码一层,
|
|
63
|
+
* 接收端解一次即可还原明文。已解码的值(无 % 或解码抛错)原样返回。
|
|
66
64
|
*/
|
|
67
65
|
function safeDecode(value?: string): string {
|
|
68
66
|
if (!value) return ''
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (decoded === result) break
|
|
74
|
-
result = decoded
|
|
75
|
-
} catch {
|
|
76
|
-
break
|
|
77
|
-
}
|
|
67
|
+
try {
|
|
68
|
+
return decodeURIComponent(value)
|
|
69
|
+
} catch {
|
|
70
|
+
return value
|
|
78
71
|
}
|
|
79
|
-
return result
|
|
80
72
|
}
|
|
81
73
|
onLoad((option: any) => {
|
|
82
74
|
sourceId.value = safeDecode(option.sourceId)
|
|
@@ -390,24 +390,16 @@ async function batchAction(item: rowActions) {
|
|
|
390
390
|
// 优先使用 props 传入的 sourceId,未传则走 onLoad 路由获取
|
|
391
391
|
const internalSourceId = ref(props.sourceId)
|
|
392
392
|
/**
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* encodeURIComponent 的基础上再自动编码一次,onLoad 收到双重编码值),
|
|
396
|
-
* 这里循环解码到稳定态,兼容 0/1/2 层编码,保证拿到明文。
|
|
393
|
+
* 简单解码:跳转端明文传参,URL 传输时浏览器/App 框架会自动编码一层,
|
|
394
|
+
* 接收端解一次即可还原明文。已解码的值(无 % 或解码抛错)原样返回。
|
|
397
395
|
*/
|
|
398
396
|
function safeDecode(value?: string | number): string {
|
|
399
397
|
if (value === undefined || value === null) return ''
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
if (decoded === result) break
|
|
405
|
-
result = decoded
|
|
406
|
-
} catch {
|
|
407
|
-
break
|
|
408
|
-
}
|
|
398
|
+
try {
|
|
399
|
+
return decodeURIComponent(String(value))
|
|
400
|
+
} catch {
|
|
401
|
+
return String(value)
|
|
409
402
|
}
|
|
410
|
-
return result
|
|
411
403
|
}
|
|
412
404
|
onLoad((option: any) => {
|
|
413
405
|
// 如果 props 没传 sourceId,则从路由参数获取
|
|
@@ -545,6 +537,7 @@ function tabSearchClick(data: any) {
|
|
|
545
537
|
:show-loading-more-when-reload="true"
|
|
546
538
|
@query="queryList"
|
|
547
539
|
>
|
|
540
|
+
<GlobalMessage />
|
|
548
541
|
<template #top>
|
|
549
542
|
<slot name="top" />
|
|
550
543
|
<Search
|