wui-components-v2 1.2.11 → 1.2.13
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.
|
@@ -62,7 +62,7 @@ const giveDefaultValue = (value: any) => {
|
|
|
62
62
|
defaultValue[key] = typeof val === 'string' && val.includes('@R@') ? val.split('@R@')[0] : val
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
return defaultValue[value]
|
|
65
|
+
return defaultValue[value] ?? ''
|
|
66
66
|
}
|
|
67
67
|
giveDefaultValue({})
|
|
68
68
|
// 初始化表单数据
|
|
@@ -79,10 +79,18 @@ function initFormData() {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (ControlTypeSupportor.getControlType(item, props.entity && props.entity[item.sourceId]) === 'relselect') {
|
|
82
|
-
|
|
83
|
-
(props.entity && props.entity[item.sourceId]
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const rawRel =
|
|
83
|
+
(props.entity && props.entity[item.sourceId]) || item.transDefaultValue || item.defaultValue || ''
|
|
84
|
+
// 解析 $$user. 占位符:取当前用户对应扩展字段的值(实体字段为 code@R@name,需保留完整值供回显)
|
|
85
|
+
let resolvedRel: any = rawRel
|
|
86
|
+
if (typeof rawRel === 'string' && rawRel.includes('$$user.')) {
|
|
87
|
+
const ukey = rawRel.split('$$user.')[1]
|
|
88
|
+
const { extInfo = {} } = uni.getStorageSync('userInfo') || {}
|
|
89
|
+
const fmap = extInfo.fieldMap || {}
|
|
90
|
+
const uval = fmap[ukey]
|
|
91
|
+
resolvedRel = uval !== undefined && uval !== null ? String(uval) : ''
|
|
92
|
+
}
|
|
93
|
+
return (models[item.sourceId] = resolvedRel ? String(resolvedRel).split('@,@') : [])
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
// 文件
|
|
@@ -136,7 +144,7 @@ function initFormData() {
|
|
|
136
144
|
return (models[item.sourceId] = isYes ? '是' : '否')
|
|
137
145
|
}
|
|
138
146
|
|
|
139
|
-
return (models[item.sourceId] = (props.entity && props.entity[item.sourceId]) || item.transDefaultValue || '')
|
|
147
|
+
return (models[item.sourceId] = (props.entity && props.entity[item.sourceId]) || item.transDefaultValue || item.defaultValue || '')
|
|
140
148
|
})
|
|
141
149
|
|
|
142
150
|
// 遍历 models,处理 $$user. 前缀
|
|
@@ -39,6 +39,11 @@ const props = defineProps({
|
|
|
39
39
|
type: Boolean,
|
|
40
40
|
default: true,
|
|
41
41
|
},
|
|
42
|
+
// 菜单网格列数,调用方可覆盖默认 4 列
|
|
43
|
+
column: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 4,
|
|
46
|
+
},
|
|
42
47
|
})
|
|
43
48
|
const languageStore = useLanguageStore()
|
|
44
49
|
const themeConfig = ref<any>({})
|
|
@@ -122,7 +127,7 @@ onMounted(() => {
|
|
|
122
127
|
>
|
|
123
128
|
<template #content>
|
|
124
129
|
<view class="menu-grid-container">
|
|
125
|
-
<wd-grid :column="
|
|
130
|
+
<wd-grid :column="props.column" clickable class="menu-grid">
|
|
126
131
|
<wd-grid-item
|
|
127
132
|
v-for="(subItem, subIndex) in item.items"
|
|
128
133
|
:key="subIndex"
|
|
@@ -132,23 +137,36 @@ onMounted(() => {
|
|
|
132
137
|
@click="gotoPage(subItem)"
|
|
133
138
|
>
|
|
134
139
|
<template #icon>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
:
|
|
140
|
+
<slot
|
|
141
|
+
name="menu-item-icon"
|
|
142
|
+
:sub-item="subItem"
|
|
143
|
+
:index="subIndex"
|
|
144
|
+
:goto="gotoPage"
|
|
145
|
+
:t="languageStore.t"
|
|
138
146
|
>
|
|
139
|
-
<
|
|
140
|
-
|
|
141
|
-
|
|
147
|
+
<view
|
|
148
|
+
class="menu-icon-wrapper flex items-center justify-center"
|
|
149
|
+
:style="{ background: subItem.color }"
|
|
150
|
+
>
|
|
151
|
+
<text class="menu-icon !text-xl iconfont" :class="[subItem.appIcon || 'i-carbon:grid']" />
|
|
152
|
+
<view class="icon-shine" />
|
|
153
|
+
</view>
|
|
154
|
+
</slot>
|
|
142
155
|
</template>
|
|
143
156
|
<template #text>
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
<slot
|
|
158
|
+
name="menu-item-text"
|
|
159
|
+
:sub-item="subItem"
|
|
160
|
+
:index="subIndex"
|
|
161
|
+
:goto="gotoPage"
|
|
162
|
+
:t="languageStore.t"
|
|
163
|
+
>
|
|
164
|
+
<view class="menu-text-wrapper">
|
|
165
|
+
<view class="menu-title text-ellipsis dark:text-white text-gray-800">
|
|
166
|
+
{{ languageStore.t(subItem.title) }}
|
|
167
|
+
</view>
|
|
147
168
|
</view>
|
|
148
|
-
|
|
149
|
-
<text class="badge-dot" />
|
|
150
|
-
</view> -->
|
|
151
|
-
</view>
|
|
169
|
+
</slot>
|
|
152
170
|
</template>
|
|
153
171
|
</wd-grid-item>
|
|
154
172
|
</wd-grid>
|