wui-components-v2 1.2.19 → 1.2.21
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.
|
@@ -13,7 +13,7 @@ defineOptions({
|
|
|
13
13
|
const sourceId = ref('')
|
|
14
14
|
const id = ref('')
|
|
15
15
|
const title = ref('')
|
|
16
|
-
const pageConfig = ref<dtmplConfig>
|
|
16
|
+
const pageConfig = ref<dtmplConfig>({
|
|
17
17
|
id: '',
|
|
18
18
|
title: '',
|
|
19
19
|
groups: [],
|
|
@@ -27,7 +27,7 @@ const data = ref<Entities>({
|
|
|
27
27
|
})
|
|
28
28
|
const groups = ref<Groups>({
|
|
29
29
|
id: '',
|
|
30
|
-
buttons: [
|
|
30
|
+
buttons: [],
|
|
31
31
|
fields: [],
|
|
32
32
|
title: '',
|
|
33
33
|
type: '',
|
|
@@ -36,7 +36,6 @@ const groups = ref<Groups>({
|
|
|
36
36
|
relationNames: [],
|
|
37
37
|
readOnly: false,
|
|
38
38
|
displayConfig: [],
|
|
39
|
-
|
|
40
39
|
})
|
|
41
40
|
const loading = ref(false)
|
|
42
41
|
// 折叠面板
|
|
@@ -73,7 +72,7 @@ function getQueryParams(url: string) {
|
|
|
73
72
|
const result: { [key: string]: string } = {}
|
|
74
73
|
|
|
75
74
|
// 遍历键值对
|
|
76
|
-
pairs.forEach(
|
|
75
|
+
pairs.forEach(pair => {
|
|
77
76
|
const [key, value] = pair.split('=')
|
|
78
77
|
// 解码URI组件并添加到结果对象
|
|
79
78
|
result[decodeURIComponent(key)] = decodeURIComponent(value || '')
|
|
@@ -98,8 +97,7 @@ async function getPageConfig() {
|
|
|
98
97
|
})
|
|
99
98
|
getDetailData()
|
|
100
99
|
}
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
100
|
+
} catch (error) {
|
|
103
101
|
console.log(error)
|
|
104
102
|
loading.value = false
|
|
105
103
|
}
|
|
@@ -111,8 +109,7 @@ async function getDetailData() {
|
|
|
111
109
|
const res = await detailPageData(sourceId.value, id.value)
|
|
112
110
|
data.value = res.entity
|
|
113
111
|
loading.value = false
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
112
|
+
} catch (error) {
|
|
116
113
|
loading.value = false
|
|
117
114
|
console.log(error)
|
|
118
115
|
}
|
|
@@ -126,15 +123,36 @@ async function getDetailData() {
|
|
|
126
123
|
</view>
|
|
127
124
|
<view v-else>
|
|
128
125
|
<wd-collapse v-model="collapses">
|
|
129
|
-
<wd-collapse-item
|
|
126
|
+
<wd-collapse-item
|
|
127
|
+
v-for="(group, index) in pageConfig.groups"
|
|
128
|
+
:key="group.id"
|
|
129
|
+
:title="group.title"
|
|
130
|
+
:name="group.id"
|
|
131
|
+
>
|
|
130
132
|
<view v-if="group.type === 'fieldGroup'" class="text-sm space-y-3">
|
|
131
133
|
<LabelValue :index="index" :exhibit-data="group.fields" :data="data" />
|
|
132
134
|
</view>
|
|
133
135
|
<view v-if="group.type === 'relation'">
|
|
134
136
|
<view v-for="(field, subindex) in data.arrayMap[group.id]" :key="field.code">
|
|
135
|
-
<foldCard2
|
|
137
|
+
<foldCard2
|
|
138
|
+
:index="subindex"
|
|
139
|
+
:enum-column="{}"
|
|
140
|
+
:groups="group"
|
|
141
|
+
:source-id="sourceId"
|
|
142
|
+
:columns="group.fields"
|
|
143
|
+
model="complex"
|
|
144
|
+
:data="field"
|
|
145
|
+
>
|
|
136
146
|
<template #buttons>
|
|
137
|
-
<CardBotomButtons
|
|
147
|
+
<CardBotomButtons
|
|
148
|
+
:primary-column="
|
|
149
|
+
group.primaryColumn || { controlType: '', extControlType: '', sourceId: '', mstrucId: '' }
|
|
150
|
+
"
|
|
151
|
+
:source-id="group.id"
|
|
152
|
+
:item="groups"
|
|
153
|
+
:code="field.code"
|
|
154
|
+
:data="data"
|
|
155
|
+
/>
|
|
138
156
|
</template>
|
|
139
157
|
</foldCard2>
|
|
140
158
|
</view>
|
|
@@ -22,6 +22,25 @@ export interface LocaleOption {
|
|
|
22
22
|
*/
|
|
23
23
|
export type ThemeMode = 'light' | 'dark'
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* 应用自定义主题变量
|
|
27
|
+
* 在 wot-design-uni 的 ConfigProviderThemeVars 基础上扩展业务自定义字段
|
|
28
|
+
*/
|
|
29
|
+
export interface CustomThemeVars extends ConfigProviderThemeVars {
|
|
30
|
+
darkBackground: string
|
|
31
|
+
darkBackground2: string
|
|
32
|
+
darkBackground3: string
|
|
33
|
+
darkBackground4: string
|
|
34
|
+
darkBackground5: string
|
|
35
|
+
darkBackground6: string
|
|
36
|
+
darkBackground7: string
|
|
37
|
+
darkColor: string
|
|
38
|
+
darkColor2: string
|
|
39
|
+
darkColor3: string
|
|
40
|
+
colorTheme: string
|
|
41
|
+
colorPrimary?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
25
44
|
/**
|
|
26
45
|
* 主题状态接口
|
|
27
46
|
*/
|
|
@@ -31,7 +50,7 @@ export interface ThemeState {
|
|
|
31
50
|
followSystem: boolean
|
|
32
51
|
hasUserSet: boolean
|
|
33
52
|
currentThemeColor: ThemeColorOption
|
|
34
|
-
themeVars:
|
|
53
|
+
themeVars: CustomThemeVars
|
|
35
54
|
}
|
|
36
55
|
|
|
37
56
|
/**
|
|
@@ -39,7 +58,7 @@ export interface ThemeState {
|
|
|
39
58
|
*/
|
|
40
59
|
export interface SystemThemeState {
|
|
41
60
|
theme: ThemeMode
|
|
42
|
-
themeVars:
|
|
61
|
+
themeVars: CustomThemeVars
|
|
43
62
|
}
|
|
44
63
|
|
|
45
64
|
/**
|
package/package.json
CHANGED
|
@@ -112,9 +112,14 @@ export const useManualThemeStore = defineStore('manualTheme', {
|
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
114
|
* 初始化主题
|
|
115
|
-
*
|
|
115
|
+
* 注:不再读取设备的系统主题色;未手动设置过时强制默认白色
|
|
116
116
|
*/
|
|
117
117
|
initTheme() {
|
|
118
|
+
// 用户未手动设置过主题时,强制默认白色
|
|
119
|
+
// 避免沿用旧版本跟随系统时期写入缓存的深色,也不跟随系统
|
|
120
|
+
if (!this.hasUserSet) {
|
|
121
|
+
this.theme = 'light'
|
|
122
|
+
}
|
|
118
123
|
console.log('初始化主题:', this.theme)
|
|
119
124
|
this.setNavigationBarColor()
|
|
120
125
|
},
|