wui-components-v2 1.2.21 → 1.2.22
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/components/search/search.vue +63 -35
- package/components/wui-edit-page/wui-edit-page.vue +1 -1
- package/package.json +1 -1
- package/styles/dark-mode.scss +498 -498
- package/styles/dark-mode.css +0 -523
- package/styles/dark-mode.min.css +0 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, defineEmits, defineOptions, defineProps, ref } from 'vue'
|
|
3
3
|
import type { Enums, Fields, Split2TabCriterias } from '../../type'
|
|
4
4
|
import formControl from '../form-control/form-control.vue'
|
|
5
|
+
import { useManualThemeStore } from '../../store/manualThemeStore'
|
|
5
6
|
|
|
6
7
|
defineOptions({ name: 'Search' })
|
|
7
8
|
const props = defineProps<{
|
|
@@ -12,6 +13,10 @@ const props = defineProps<{
|
|
|
12
13
|
split2TabCriterias?: Split2TabCriterias[]
|
|
13
14
|
}>()
|
|
14
15
|
const emits = defineEmits(['submit'])
|
|
16
|
+
// 自行携带暗色主题,避免在非 tabBar 页面(无 wd-config-provider 祖先)时
|
|
17
|
+
// wot 组件保持亮色导致 search-type 等区域显示为白色
|
|
18
|
+
const themeStore = useManualThemeStore()
|
|
19
|
+
const theme = computed(() => themeStore.theme)
|
|
15
20
|
const show = ref(false)
|
|
16
21
|
const search = ref('')
|
|
17
22
|
const formControlRef = ref()
|
|
@@ -19,8 +24,7 @@ const entity = ref({})
|
|
|
19
24
|
const filterCriteria = computed(() => {
|
|
20
25
|
const criteriaSourceIds = props.split2TabCriterias?.map(item => item.sourceId) || []
|
|
21
26
|
const primarySourceId = props.primaryCriterion?.sourceId
|
|
22
|
-
if (!primarySourceId)
|
|
23
|
-
return props.criteria
|
|
27
|
+
if (!primarySourceId) return props.criteria
|
|
24
28
|
return props.criteria.filter(item => ![primarySourceId, ...criteriaSourceIds].includes(item.sourceId))
|
|
25
29
|
})
|
|
26
30
|
function handleClose() {
|
|
@@ -28,8 +32,7 @@ function handleClose() {
|
|
|
28
32
|
}
|
|
29
33
|
function handleSubmit() {
|
|
30
34
|
if (!formControlRef.value) {
|
|
31
|
-
if (!props.primaryCriterion?.sourceId)
|
|
32
|
-
return
|
|
35
|
+
if (!props.primaryCriterion?.sourceId) return
|
|
33
36
|
const data = `c_${props.primaryCriterion.sourceId}=${search.value}`
|
|
34
37
|
emits('submit', data)
|
|
35
38
|
handleClose()
|
|
@@ -46,22 +49,22 @@ function handleSubmit() {
|
|
|
46
49
|
data = `c_${props.primaryCriterion.sourceId}=${search.value}`
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
filterCriteria.value.forEach(
|
|
52
|
+
filterCriteria.value.forEach(item => {
|
|
50
53
|
for (const key in fdata) {
|
|
51
54
|
if (Object.prototype.hasOwnProperty.call(fdata, key)) {
|
|
52
55
|
const element = fdata[key]
|
|
53
56
|
if (item.sourceId === key) {
|
|
54
57
|
if (item.extControlType === 'relselectvalue') {
|
|
55
|
-
data = `${data}&c_${item.sourceId}=${element
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
data = `${data}&c_${item.sourceId}=${element
|
|
59
|
+
.map((item: string) => {
|
|
60
|
+
return item.split('@R@')[1]
|
|
61
|
+
})
|
|
62
|
+
.join('@,@')}`
|
|
63
|
+
} else if (item.extControlType === 'multiselect') {
|
|
60
64
|
element.forEach((subitem: string) => {
|
|
61
65
|
data = `${data}&c_${item.sourceId}=${subitem}`
|
|
62
66
|
})
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
67
|
+
} else {
|
|
65
68
|
data = `${data}&c_${item.sourceId}=${element}`
|
|
66
69
|
}
|
|
67
70
|
}
|
|
@@ -78,29 +81,56 @@ function handleSubmit() {
|
|
|
78
81
|
</script>
|
|
79
82
|
|
|
80
83
|
<template>
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
<wd-config-provider :theme="theme">
|
|
85
|
+
<view v-if="primaryCriterion?.controlType === 'text'" class="w-full">
|
|
86
|
+
<wd-search
|
|
87
|
+
v-model="search"
|
|
88
|
+
cancel-txt="搜索"
|
|
89
|
+
:placeholder="`请输入${primaryCriterion?.title || ''}搜索`"
|
|
90
|
+
@clear="handleSubmit"
|
|
91
|
+
@cancel="handleSubmit"
|
|
92
|
+
>
|
|
93
|
+
<template v-if="filterCriteria.length" #prefix>
|
|
94
|
+
<view class="search-type">
|
|
95
|
+
<wd-icon
|
|
96
|
+
name="filter"
|
|
97
|
+
size="17px"
|
|
98
|
+
class="text-gray-500 dark:text-[var(--wot-dark-color3)]"
|
|
99
|
+
@click="show = true"
|
|
100
|
+
/>
|
|
101
|
+
</view>
|
|
102
|
+
</template>
|
|
103
|
+
</wd-search>
|
|
104
|
+
</view>
|
|
105
|
+
<wd-popup v-model="show" position="bottom" custom-class="h-80vh" closable @close="handleClose">
|
|
106
|
+
<view class="relative box-border h-full p-1 bg-white dark:bg-[var(--wot-dark-background)]">
|
|
107
|
+
<view class="h-34px flex items-center justify-center text-black dark:text-[var(--wot-dark-color)]">筛i选</view>
|
|
108
|
+
<formControl
|
|
109
|
+
ref="formControlRef"
|
|
110
|
+
:field-group="{
|
|
111
|
+
fields: filterCriteria,
|
|
112
|
+
readOnly: false,
|
|
113
|
+
displayConfig: [],
|
|
114
|
+
id: '',
|
|
115
|
+
buttons: [],
|
|
116
|
+
title: '',
|
|
117
|
+
type: '',
|
|
118
|
+
pointSourceId: '',
|
|
119
|
+
mstrucId: '',
|
|
120
|
+
relationNames: [],
|
|
121
|
+
}"
|
|
122
|
+
:entity="entity"
|
|
123
|
+
:enum-column="enumColumn"
|
|
124
|
+
/>
|
|
125
|
+
<view class="h-12" />
|
|
126
|
+
<view
|
|
127
|
+
class="fixed bottom-0 left-0 right-0 box-border w-100% flex p-2 bg-white dark:bg-[var(--wot-dark-background)]"
|
|
128
|
+
>
|
|
129
|
+
<wd-button block custom-class="flex-1" @click="handleSubmit">确定</wd-button>
|
|
86
130
|
</view>
|
|
87
|
-
</template>
|
|
88
|
-
</wd-search>
|
|
89
|
-
</view>
|
|
90
|
-
<wd-popup v-model="show" position="bottom" custom-class="h-80vh" closable @close="handleClose">
|
|
91
|
-
<view class="relative box-border h-full p-1 bg-white dark:bg-[var(--wot-dark-background)]">
|
|
92
|
-
<view class="h-34px flex items-center justify-center">
|
|
93
|
-
筛选
|
|
94
|
-
</view>
|
|
95
|
-
<formControl ref="formControlRef" :field-group="{ fields: filterCriteria, readOnly: false, displayConfig: [], id: '', buttons: [], title: '', type: '', pointSourceId: '', mstrucId: '', relationNames: [] }" :entity="entity" :enum-column="enumColumn" />
|
|
96
|
-
<view class="h-12" />
|
|
97
|
-
<view class="fixed bottom-0 left-0 right-0 box-border w-100% flex p-2 bg-white dark:bg-[var(--wot-dark-background)]">
|
|
98
|
-
<wd-button block custom-class="flex-1" @click="handleSubmit">
|
|
99
|
-
确定
|
|
100
|
-
</wd-button>
|
|
101
131
|
</view>
|
|
102
|
-
</
|
|
103
|
-
</wd-
|
|
132
|
+
</wd-popup>
|
|
133
|
+
</wd-config-provider>
|
|
104
134
|
</template>
|
|
105
135
|
|
|
106
136
|
<style scoped>
|
|
@@ -123,6 +153,4 @@ function handleSubmit() {
|
|
|
123
153
|
font-size: 20px;
|
|
124
154
|
vertical-align: middle;
|
|
125
155
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
156
|
</style>
|
|
@@ -871,7 +871,7 @@ console.log(pageConfig, 'props111')
|
|
|
871
871
|
<template #title>
|
|
872
872
|
<view class="flex items-center justify-between">
|
|
873
873
|
<view class="flex-1 flex items-center justify-between pr-2">
|
|
874
|
-
<view>{{ group.title }}</view>
|
|
874
|
+
<view class="text-[#000]">{{ group.title }}</view>
|
|
875
875
|
<view v-if="group.type === 'relation'">
|
|
876
876
|
<view v-if="selectData[group.id]?.loading" class="flex justify-center p-3">
|
|
877
877
|
<wd-loading />
|