wui-components-v2 1.1.41 → 1.1.42
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/api/feishu.ts +20 -0
- package/api/menu.ts +1 -1
- package/api/page.ts +1 -1
- package/api/sys.ts +1 -1
- package/components/add-address-list/add-address-list.vue +187 -0
- package/components/add-address-page/add-address-page.vue +76 -0
- package/components/add-address-page/config.ts +297 -0
- package/components/audio-play/audio-play.vue +3 -3
- package/components/card-botom-buttons/card-botom-buttons.vue +4 -3
- package/components/custom-date-picker/custom-date-picker.vue +114 -0
- package/components/custom-select-picker/custom-select-picker.vue +103 -0
- package/components/fold-card/fold-card.vue +16 -9
- package/components/form-control/form-control.vue +224 -143
- package/components/global-loading/global-loading.vue +1 -1
- package/components/global-message/global-message.vue +14 -10
- package/components/global-toast/global-toast.vue +1 -1
- package/components/list-top-buttons/list-top-buttons.vue +2 -2
- package/components/mulselect-picker/mulselect-picker.vue +2 -2
- package/components/privacy-popup/privacy-popup.vue +1 -1
- package/components/product-card/product-card.vue +2 -2
- package/components/search/search.vue +11 -6
- package/components/tab-search/tab-search.vue +7 -7
- package/components/user-choose/user-choose.vue +133 -0
- package/components/wui-default/wui-default.vue +1 -2
- package/components/wui-edit-page/wui-edit-page.vue +76 -53
- package/components/wui-enume-select-control/wui-enume-select-control.vue +35 -33
- package/components/wui-list/wui-list.vue +12 -8
- package/components/wui-login1/wui-login.vue +1 -1
- package/components/wui-menus1/components/banner-carousel.vue +8 -8
- package/components/wui-menus1/components/quick-panel.vue +1 -1
- package/components/wui-menus1/components/search-bar.vue +1 -1
- package/components/wui-menus1/components/section-menus.vue +1 -1
- package/components/wui-menus1/wui-menus.vue +6 -3
- package/components/wui-notify-info/notify-handle.vue +1 -1
- package/components/wui-notify-info/wui-notify-info.vue +7 -7
- package/components/wui-search-history-babbar/wui-search-history-babbar.vue +10 -10
- package/components/wui-select-list/wui-select-list.vue +48 -39
- package/components/wui-tabbar/wui-tabbar.vue +2 -2
- package/components/wui-tree-page/wui-tree-page.vue +9 -10
- package/components/wui-user/wui-user.vue +5 -5
- package/composables/types/theme.ts +1 -1
- package/composables/useCompanyFieldFilter.ts +59 -0
- package/composables/useEnumes.ts +36 -35
- package/composables/useGlobalLoading.ts +2 -2
- package/composables/useGlobalMessage.ts +7 -8
- package/composables/useGlobalToast.ts +2 -2
- package/composables/useLocale.ts +5 -5
- package/composables/useMenus.ts +1 -0
- package/composables/useTabbar.ts +2 -3
- package/index.d.ts +1 -1
- package/index.ts +2 -2
- package/package.json +1 -1
- package/store/language.ts +8 -11
- package/store/manualThemeStore.ts +2 -0
- package/store/persist.ts +1 -1
- package/type.ts +1 -0
- package/utils/control-type-supportor.ts +4 -0
- package/utils/index.ts +22 -0
|
@@ -6,7 +6,7 @@ import formControl from '../form-control/form-control.vue'
|
|
|
6
6
|
defineOptions({ name: 'Search' })
|
|
7
7
|
const props = defineProps<{
|
|
8
8
|
criterias: Fields[]
|
|
9
|
-
primaryCriteria: Fields
|
|
9
|
+
primaryCriteria: Fields | null
|
|
10
10
|
enumColumn?: Enums
|
|
11
11
|
mainCode?: string
|
|
12
12
|
split2TabCriterias?: Split2TabCriterias[]
|
|
@@ -18,13 +18,18 @@ const formControlRef = ref()
|
|
|
18
18
|
const entity = ref({})
|
|
19
19
|
const filterCriterias = computed(() => {
|
|
20
20
|
const criteriaSourceIds = props.split2TabCriterias?.map(item => item.sourceId) || []
|
|
21
|
-
|
|
21
|
+
const primarySourceId = props.primaryCriteria?.sourceId
|
|
22
|
+
if (!primarySourceId)
|
|
23
|
+
return props.criterias
|
|
24
|
+
return props.criterias.filter(item => ![primarySourceId, ...criteriaSourceIds].includes(item.sourceId))
|
|
22
25
|
})
|
|
23
26
|
function handleClose() {
|
|
24
27
|
show.value = false
|
|
25
28
|
}
|
|
26
29
|
function handleSubmit() {
|
|
27
30
|
if (!formControlRef.value) {
|
|
31
|
+
if (!props.primaryCriteria?.sourceId)
|
|
32
|
+
return
|
|
28
33
|
const data = `c_${props.primaryCriteria.sourceId}=${search.value}`
|
|
29
34
|
emits('submit', data)
|
|
30
35
|
handleClose()
|
|
@@ -33,11 +38,11 @@ function handleSubmit() {
|
|
|
33
38
|
formControlRef.value.submit().then((fdata: any) => {
|
|
34
39
|
entity.value = {
|
|
35
40
|
...fdata,
|
|
36
|
-
[props.primaryCriteria.sourceId]: search.value,
|
|
41
|
+
...(props.primaryCriteria?.sourceId ? { [props.primaryCriteria.sourceId]: search.value } : {}),
|
|
37
42
|
}
|
|
38
43
|
let data = ''
|
|
39
44
|
|
|
40
|
-
if (props.primaryCriteria
|
|
45
|
+
if (props.primaryCriteria?.sourceId) {
|
|
41
46
|
data = `c_${props.primaryCriteria.sourceId}=${search.value}`
|
|
42
47
|
}
|
|
43
48
|
|
|
@@ -73,8 +78,8 @@ function handleSubmit() {
|
|
|
73
78
|
</script>
|
|
74
79
|
|
|
75
80
|
<template>
|
|
76
|
-
<view v-if="primaryCriteria
|
|
77
|
-
<wd-search v-model="search" cancel-txt="搜索" :placeholder="`请输入${primaryCriteria
|
|
81
|
+
<view v-if="primaryCriteria?.controlType === 'text'" class="w-full">
|
|
82
|
+
<wd-search v-model="search" cancel-txt="搜索" :placeholder="`请输入${primaryCriteria?.title || ''}搜索`" @clear="handleSubmit" @cancel="handleSubmit">
|
|
78
83
|
<template v-if="filterCriterias.length" #prefix>
|
|
79
84
|
<view class="search-type">
|
|
80
85
|
<wd-icon name="filter" size="17px" class=".dark:text-white .light:text-gray-500" @click="show = true" />
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, defineEmits, defineOptions, defineProps, ref } from 'vue'
|
|
3
|
-
import type { EnumItem, Enums, Split2TabCriterias } from '../../type'
|
|
3
|
+
import type { EnumItem, Enums, Split2TabCriterias } from '../../type'
|
|
4
4
|
|
|
5
5
|
defineOptions({
|
|
6
6
|
name: 'TabSearch',
|
|
@@ -20,7 +20,7 @@ interface TabData {
|
|
|
20
20
|
}
|
|
21
21
|
// 提取枚举值
|
|
22
22
|
function enumColumn() {
|
|
23
|
-
if (!props.split2TabCriterias)
|
|
23
|
+
if (!props.split2TabCriterias)
|
|
24
24
|
return []
|
|
25
25
|
return props.split2TabCriterias.reduce<TabData[]>((acc, cur) => {
|
|
26
26
|
const data = props.enums[cur.mstrucId]?.map((item: EnumItem) => {
|
|
@@ -32,7 +32,7 @@ function enumColumn() {
|
|
|
32
32
|
}
|
|
33
33
|
// 提取特殊值
|
|
34
34
|
function specialColumn() {
|
|
35
|
-
if (!props.split2TabCriterias)
|
|
35
|
+
if (!props.split2TabCriterias)
|
|
36
36
|
return []
|
|
37
37
|
const data = []
|
|
38
38
|
for (let i = 0; i < props.split2TabCriterias.length; i++) {
|
|
@@ -57,12 +57,12 @@ function click(event: { index: number, name: string }) {
|
|
|
57
57
|
console.log(data, event)
|
|
58
58
|
if (event.name) {
|
|
59
59
|
emit('click', `c_${data?.sourceId}=${event.name}`)
|
|
60
|
-
}
|
|
60
|
+
}
|
|
61
61
|
else {
|
|
62
62
|
emit('click', '')
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
64
|
}
|
|
65
|
-
</script>
|
|
65
|
+
</script>
|
|
66
66
|
|
|
67
67
|
<template>
|
|
68
68
|
<wd-tabs v-model="tab" animated slidable="always" @click="click">
|
|
@@ -70,4 +70,4 @@ function click(event: { index: number, name: string }) {
|
|
|
70
70
|
<wd-tab :title="item.name" :name="item.value" />
|
|
71
71
|
</block>
|
|
72
72
|
</wd-tabs>
|
|
73
|
-
</template>
|
|
73
|
+
</template>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<div class="flex items-center justify-between gap-3">
|
|
4
|
+
<view @click="addUser" class=" flex-1 min-h-[20px]">
|
|
5
|
+
<view class="flex items-center gap-2">
|
|
6
|
+
<view class=" font-black font-bold">{{ showValue.name }}</view>
|
|
7
|
+
<view>{{ formatPhone(showValue.phone) }}</view>
|
|
8
|
+
</view>
|
|
9
|
+
<view>{{ showValue.address }}</view>
|
|
10
|
+
</view>
|
|
11
|
+
<wd-icon name="user" size="18px" @tap="toAddressList" />
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { ref, reactive, watch, onMounted, onUnmounted } from 'vue'
|
|
18
|
+
import { useRouter } from 'uni-mini-router'
|
|
19
|
+
import { formatPhone } from '@/core-components/utils/index'
|
|
20
|
+
import { pageKey, listData,pageConfig } from '../../api/page'
|
|
21
|
+
import { generateHighResolutionID } from '../../utils/index'
|
|
22
|
+
|
|
23
|
+
defineOptions({
|
|
24
|
+
name: 'UserChoose',
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
modelValue: [String, Array],
|
|
29
|
+
placeholder: String,
|
|
30
|
+
sourceId: String,
|
|
31
|
+
title: String,
|
|
32
|
+
extControlType: String,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const emit = defineEmits<{
|
|
36
|
+
'update:modelValue': [value: string]
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const router = useRouter()
|
|
40
|
+
|
|
41
|
+
const currentValue = ref<string>(props.modelValue as string || '')
|
|
42
|
+
const showValue = reactive({
|
|
43
|
+
name: '',
|
|
44
|
+
phone: '',
|
|
45
|
+
address: '',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
const EVENT_NAME = `userChooseSelected_${generateHighResolutionID()}`
|
|
49
|
+
|
|
50
|
+
const addUser = () => {
|
|
51
|
+
const addEvent = generateHighResolutionID()
|
|
52
|
+
router.push(`/pages/edit-page/index?sourceId=${props.sourceId}&title=${props.title}&addEvent=${addEvent}`)
|
|
53
|
+
uni.$once(addEvent, (data: any) => {
|
|
54
|
+
uni.$off(addEvent)
|
|
55
|
+
currentValue.value = data.entityCode
|
|
56
|
+
fetchDataById(data.entityCode)
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const toAddressList = () => {
|
|
61
|
+
uni.navigateTo({
|
|
62
|
+
url: `/pages/select-list/index?sourceId=${props.sourceId}&title=${props.title}&extControlType=${props.extControlType}&selectEvent=${EVENT_NAME}`,
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const fetchDataById = async (id: string) => {
|
|
67
|
+
if (!id || !props.sourceId) return
|
|
68
|
+
const newId=Array.isArray(id)?id[0]:id
|
|
69
|
+
const requestId = newId?.split('@R@')[0] || props.sourceId
|
|
70
|
+
console.log('fetchDataById', requestId, props.sourceId,id)
|
|
71
|
+
try {
|
|
72
|
+
const config = await pageConfig(props.sourceId)
|
|
73
|
+
const newConfig=config.ltmplConfig
|
|
74
|
+
const onlyCode=newConfig.extDisplayConfig?.cardShowCols?.[0]?.sourceId //获取回显字段对应参数名
|
|
75
|
+
const query=`c_${newConfig.secondCriteria?.sourceId}=${requestId}` //构建查询参数
|
|
76
|
+
const res = await pageKey(props.sourceId, '', query)
|
|
77
|
+
const data = await listData(res.key, 1, 10)
|
|
78
|
+
const item = data.entities.find((e: any) => e.code === requestId)as any
|
|
79
|
+
const {fieldMap={}}=item
|
|
80
|
+
const textArr=(fieldMap[onlyCode] || '').split(',') //拆分字符串 姓名,手机号,地址 分别对应数组的0,1,2索引
|
|
81
|
+
if (item) {
|
|
82
|
+
showValue.name = textArr?.[0] || ''
|
|
83
|
+
showValue.phone = textArr?.[1] || ''
|
|
84
|
+
showValue.address = textArr?.[2] || ''
|
|
85
|
+
}
|
|
86
|
+
} catch (error) {
|
|
87
|
+
console.error('获取数据失败:', error)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
onMounted(() => {
|
|
92
|
+
if (currentValue.value) {
|
|
93
|
+
fetchDataById(currentValue.value)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
uni.$on(EVENT_NAME, (id: string) => {
|
|
97
|
+
console.log('user-choose 接收到id:', id)
|
|
98
|
+
currentValue.value = id
|
|
99
|
+
fetchDataById(id)
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
onUnmounted(() => {
|
|
104
|
+
uni.$off(EVENT_NAME)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
watch(() => props.modelValue, (val) => {
|
|
108
|
+
const newId = val as string
|
|
109
|
+
if (newId && newId !== currentValue.value) {
|
|
110
|
+
currentValue.value = newId
|
|
111
|
+
fetchDataById(newId)
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
watch(currentValue, (val) => {
|
|
116
|
+
emit('update:modelValue', val)
|
|
117
|
+
})
|
|
118
|
+
</script>
|
|
119
|
+
|
|
120
|
+
<style scoped lang="scss">
|
|
121
|
+
.custom-select-picker {
|
|
122
|
+
width: 100%;
|
|
123
|
+
:deep(.wd-select-picker__wrapper) {
|
|
124
|
+
padding : 0 20px;
|
|
125
|
+
overflow: auto;
|
|
126
|
+
scrollbar-width: none;
|
|
127
|
+
-ms-overflow-style: none;
|
|
128
|
+
}
|
|
129
|
+
:deep(.uni-scroll-view) {
|
|
130
|
+
scrollbar-width: none;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</style>
|
|
@@ -23,10 +23,9 @@ export default {
|
|
|
23
23
|
</script>
|
|
24
24
|
|
|
25
25
|
<template>
|
|
26
|
-
<wd-config-provider :theme-vars="themeVars" :theme="theme" :custom-class="`page-wraper ${theme}`">
|
|
26
|
+
<wd-config-provider :theme-vars="themeVars" :theme="theme" :custom-class="`page-wraper ${theme} custom-layout`">
|
|
27
27
|
<slot />
|
|
28
28
|
<wd-notify />
|
|
29
|
-
<wd-message-box />
|
|
30
29
|
<wd-toast />
|
|
31
30
|
<global-loading />
|
|
32
31
|
<global-toast />
|
|
@@ -14,6 +14,10 @@ import batchUploadFile from '../batch-upload-file/batch-upload-file.vue'
|
|
|
14
14
|
defineOptions({
|
|
15
15
|
name: 'WuiEditPage',
|
|
16
16
|
})
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
companyFilter?: boolean
|
|
19
|
+
companyFieldSourceId?: string
|
|
20
|
+
}>()
|
|
17
21
|
const pageConfig = ref<dtmplConfig>({
|
|
18
22
|
id: '',
|
|
19
23
|
title: '',
|
|
@@ -24,6 +28,7 @@ const pageConfig = ref<dtmplConfig>({
|
|
|
24
28
|
fieldMap: {},
|
|
25
29
|
},
|
|
26
30
|
buttons: [],
|
|
31
|
+
smartPaste: false,
|
|
27
32
|
})
|
|
28
33
|
const tree = ref({ value: '', sourceId: '' })
|
|
29
34
|
const loading = ref(false)
|
|
@@ -49,13 +54,17 @@ const addEvent = ref('')
|
|
|
49
54
|
const editEvent = ref('')
|
|
50
55
|
const rowAddEvent = ref('')
|
|
51
56
|
const sendRowAddEvent = ref('')
|
|
57
|
+
const smartPaste=ref(false)
|
|
52
58
|
// 折叠面板
|
|
53
|
-
const collapses = ref()
|
|
59
|
+
const collapses = ref('')
|
|
54
60
|
const groupsformat = computed(() => {
|
|
55
61
|
return pageConfig.value.groups.filter((item: Groups) => {
|
|
56
62
|
return item.displayConfig.includes('displayed')
|
|
57
63
|
})
|
|
58
64
|
})
|
|
65
|
+
const canSmartPaste=computed(()=>{
|
|
66
|
+
return pageConfig.value?.smartPaste??false
|
|
67
|
+
})
|
|
59
68
|
onLoad((option: any) => {
|
|
60
69
|
sourceId.value = option.sourceId
|
|
61
70
|
mainCode.value = option.mainCode || ''
|
|
@@ -71,8 +80,7 @@ onLoad((option: any) => {
|
|
|
71
80
|
|
|
72
81
|
onUnmounted(() => {
|
|
73
82
|
console.log('页面卸载')
|
|
74
|
-
|
|
75
|
-
uni.$off(SENDSELECTEVENT)
|
|
83
|
+
// 勿在卸载时 $off 勾选事件:跳转勾选页会触发 onUnmounted,导致 $once(SELECTEVENT) 被提前移除
|
|
76
84
|
uni.$off(rowAddEvent.value)
|
|
77
85
|
// uni.$off(addEvent.value)
|
|
78
86
|
uni.$off(editEvent.value)
|
|
@@ -105,9 +113,8 @@ async function getEditPageConfig() {
|
|
|
105
113
|
uni.$off(sendRowAddEvent.value)
|
|
106
114
|
})
|
|
107
115
|
setTimeout(() => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
})
|
|
116
|
+
const visibleGroups = pageConfig.value.groups.filter((item: Groups) => item.displayConfig.includes('displayed'))
|
|
117
|
+
collapses.value = visibleGroups.length > 0 ? visibleGroups[0].id : ''
|
|
111
118
|
}, 100)
|
|
112
119
|
|
|
113
120
|
return
|
|
@@ -124,14 +131,13 @@ async function getEditPageConfig() {
|
|
|
124
131
|
}
|
|
125
132
|
loading.value = false
|
|
126
133
|
// 初始化折叠面板
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
})
|
|
134
|
+
if (res.dtmplConfig) {
|
|
135
|
+
uni.setNavigationBarTitle({
|
|
136
|
+
title: `${res.dtmplConfig.title}`,
|
|
137
|
+
})
|
|
138
|
+
pageConfig.value = res.dtmplConfig
|
|
139
|
+
const visibleGroups = pageConfig.value.groups.filter((item: Groups) => item.displayConfig.includes('displayed'))
|
|
140
|
+
collapses.value = visibleGroups.length > 0 ? visibleGroups[0].id : ''
|
|
135
141
|
|
|
136
142
|
pageConfig.value.groups.forEach((item: Groups) => {
|
|
137
143
|
// 初始化勾选数据
|
|
@@ -162,7 +168,7 @@ async function getEditPageConfig() {
|
|
|
162
168
|
}
|
|
163
169
|
}
|
|
164
170
|
// 获取枚举
|
|
165
|
-
async function getEnums() {
|
|
171
|
+
async function getEnums() {
|
|
166
172
|
try {
|
|
167
173
|
const params: string[] = []
|
|
168
174
|
pageConfig.value.groups?.forEach((item: any) => {
|
|
@@ -296,7 +302,6 @@ async function save() {
|
|
|
296
302
|
uni.$emit(editEvent.value, res.entityCode)
|
|
297
303
|
|
|
298
304
|
subLoading.value = false
|
|
299
|
-
globalToast.success('保存成功')
|
|
300
305
|
router.back()
|
|
301
306
|
}).catch((error: any) => {
|
|
302
307
|
subLoading.value = false
|
|
@@ -588,7 +593,7 @@ function canClick(group: Groups) {
|
|
|
588
593
|
/**
|
|
589
594
|
* 删除行数据
|
|
590
595
|
*/
|
|
591
|
-
function remove(group: Groups, field: Entities) {
|
|
596
|
+
function remove(group: Groups, field: Entities) {
|
|
592
597
|
// 行编辑数据
|
|
593
598
|
if (rowData.value[group.id]) {
|
|
594
599
|
rowData.value[group.id] = rowData.value[group.id].filter((item: any) => item.id !== (field.code || field.fieldMap.id))
|
|
@@ -688,51 +693,69 @@ function handleFileChange(e: any, group: Groups) {
|
|
|
688
693
|
</view>
|
|
689
694
|
<view v-else>
|
|
690
695
|
<wd-cell v-if="pageType === '树'" title="分组" title-width="100px">
|
|
691
|
-
<TreeSelectControl
|
|
696
|
+
<TreeSelectControl
|
|
692
697
|
v-model="tree" select-mode="single" :source-id="sourceId" title="分组"
|
|
693
|
-
ext-control-type="relselect " :readonly="false" :clearable="false"
|
|
698
|
+
ext-control-type="relselect " :readonly="false" :clearable="false"
|
|
694
699
|
/>
|
|
695
700
|
</wd-cell>
|
|
696
|
-
<wd-collapse v-model="collapses">
|
|
697
|
-
<wd-collapse-item v-for="group in groupsformat" :key="group.id"
|
|
698
|
-
<
|
|
701
|
+
<wd-collapse v-model="collapses" accordion>
|
|
702
|
+
<wd-collapse-item v-for="group in groupsformat" :key="group.id" :name="group.id">
|
|
703
|
+
<template #title>
|
|
704
|
+
<view class="flex items-center justify-between">
|
|
705
|
+
<view class="flex-1 flex items-center justify-between pr-2">
|
|
706
|
+
<view>{{ group.title }}</view>
|
|
707
|
+
<view v-if="group.type === 'relation'">
|
|
708
|
+
<view v-if="selectData[group.id]?.loading" class="flex justify-center p-3">
|
|
709
|
+
<wd-loading />
|
|
710
|
+
</view>
|
|
711
|
+
<view v-else>
|
|
712
|
+
<view v-if="!group.readOnly" class="w-upload flex justify-center gap-2">
|
|
713
|
+
<batchUploadFile
|
|
714
|
+
v-if="group.batchAddFileField && group.batchAddFileField.extControlType === 'file'"
|
|
715
|
+
@handle-file-change="(e) => { handleFileChange(e, group) }"
|
|
716
|
+
/>
|
|
717
|
+
<wd-button
|
|
718
|
+
v-if="group.buttons.includes('selectAdd')" :disabled="canClick(group)" type="info"
|
|
719
|
+
size="small" @click.stop="gotoSlect(group)"
|
|
720
|
+
>
|
|
721
|
+
选择
|
|
722
|
+
</wd-button>
|
|
723
|
+
<wd-button
|
|
724
|
+
v-if="group.buttons.includes('dtmplAdd')" :disabled="canClick(group)" type="primary"
|
|
725
|
+
size="small" @click.stop="gotoAdd(group)"
|
|
726
|
+
>
|
|
727
|
+
新增
|
|
728
|
+
</wd-button>
|
|
729
|
+
<wd-button
|
|
730
|
+
v-if="group.buttons.includes('rowAdd')" :disabled="canClick(group)" type="primary" size="small"
|
|
731
|
+
@click.stop="gotoRowAdd(group)"
|
|
732
|
+
>
|
|
733
|
+
新增
|
|
734
|
+
</wd-button>
|
|
735
|
+
</view>
|
|
736
|
+
</view>
|
|
737
|
+
</view>
|
|
738
|
+
</view>
|
|
739
|
+
<wd-icon :name="collapses === group.id ? 'up' : 'down'" size="24px"></wd-icon>
|
|
740
|
+
</view>
|
|
741
|
+
</template>
|
|
742
|
+
|
|
743
|
+
<FormControl
|
|
699
744
|
v-if="group.type === 'fieldGroup'" ref="formControlRef" :field-group="group"
|
|
700
|
-
:entity="pageConfig?.entity?.fieldMap" :enum-column="Enumcolumn"
|
|
745
|
+
:entity="pageConfig?.entity?.fieldMap" :enum-column="Enumcolumn"
|
|
746
|
+
:company-filter="props.companyFilter"
|
|
747
|
+
:company-field-source-id="props.companyFieldSourceId"
|
|
748
|
+
:smart-paste="canSmartPaste"
|
|
701
749
|
/>
|
|
702
750
|
<view v-if="group.type === 'relation'">
|
|
703
751
|
<view v-if="selectData[group.id]?.loading" class="flex justify-center p-3">
|
|
704
752
|
<wd-loading />
|
|
705
753
|
</view>
|
|
706
754
|
<view v-else>
|
|
707
|
-
<view v-if="!group.readOnly" class="w-upload flex justify-center gap-2">
|
|
708
|
-
<batchUploadFile
|
|
709
|
-
v-if="group.batchAddFileField && group.batchAddFileField.extControlType === 'file'"
|
|
710
|
-
@handle-file-change="(e) => { handleFileChange(e, group) }"
|
|
711
|
-
/>
|
|
712
|
-
|
|
713
|
-
<wd-button
|
|
714
|
-
v-if="group.buttons.includes('selectAdd')" :disabled="canClick(group)" type="info"
|
|
715
|
-
size="small" @click="gotoSlect(group)"
|
|
716
|
-
>
|
|
717
|
-
选择
|
|
718
|
-
</wd-button>
|
|
719
|
-
<wd-button
|
|
720
|
-
v-if="group.buttons.includes('dtmplAdd')" :disabled="canClick(group)" type="info"
|
|
721
|
-
size="small" @click="gotoAdd(group)"
|
|
722
|
-
>
|
|
723
|
-
新增
|
|
724
|
-
</wd-button>
|
|
725
|
-
<wd-button
|
|
726
|
-
v-if="group.buttons.includes('rowAdd')" :disabled="canClick(group)" type="info" size="small"
|
|
727
|
-
@click="gotoRowAdd(group)"
|
|
728
|
-
>
|
|
729
|
-
新增
|
|
730
|
-
</wd-button>
|
|
731
|
-
</view>
|
|
732
755
|
<view v-for="(field, index) in pageConfig?.entity?.arrayMap[group.id]" :key="field.code">
|
|
733
|
-
<foldCard
|
|
756
|
+
<foldCard
|
|
734
757
|
:index="index" :enum-column="{}" :groups="group" :source-id="sourceId" :columns="group.fields"
|
|
735
|
-
model="complex" :data="field"
|
|
758
|
+
model="complex" :data="field"
|
|
736
759
|
>
|
|
737
760
|
<template v-if="!group.readOnly" #buttons>
|
|
738
761
|
<wd-button v-if="group.buttons.includes('dtmplEdit')" size="small" @click="edit(group, field)">
|
|
@@ -741,9 +764,9 @@ function handleFileChange(e: any, group: Groups) {
|
|
|
741
764
|
<wd-button v-if="group.buttons.includes('rowEdit')" size="small" @click="rowEdit(group, field)">
|
|
742
765
|
编辑
|
|
743
766
|
</wd-button>
|
|
744
|
-
<wd-button
|
|
745
|
-
v-if="group.buttons.includes('singleDelete')" type="
|
|
746
|
-
@click="remove(group, field)"
|
|
767
|
+
<wd-button
|
|
768
|
+
v-if="group.buttons.includes('singleDelete')" type="danger" size="small"
|
|
769
|
+
@click="remove(group, field)"
|
|
747
770
|
>
|
|
748
771
|
删除
|
|
749
772
|
</wd-button>
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { computed, defineEmits, defineProps, onMounted, ref } from 'vue'
|
|
3
3
|
import { useEnums } from '../../composables/useEnumes'
|
|
4
|
-
import type { Config
|
|
5
|
-
import {pageConfig } from '../../api/page'
|
|
4
|
+
import type { Config } from '../../type'
|
|
5
|
+
import { pageConfig } from '../../api/page'
|
|
6
|
+
|
|
6
7
|
defineOptions({
|
|
7
8
|
name: 'WuiEnumeSelectControl',
|
|
8
9
|
})
|
|
9
10
|
|
|
10
11
|
const props = defineProps<{
|
|
11
12
|
sourceId: string
|
|
12
|
-
id:string
|
|
13
|
-
label?:string
|
|
14
|
-
title?:string
|
|
15
|
-
modelValue:string
|
|
16
|
-
placeholder?:string
|
|
17
|
-
disabled?:boolean
|
|
18
|
-
required?:boolean
|
|
19
|
-
rules?:any
|
|
20
|
-
zIndex?:number
|
|
21
|
-
type:'checkbox'|'radio'
|
|
22
|
-
labelWidth?:string
|
|
13
|
+
id: string
|
|
14
|
+
label?: string
|
|
15
|
+
title?: string
|
|
16
|
+
modelValue: string
|
|
17
|
+
placeholder?: string
|
|
18
|
+
disabled?: boolean
|
|
19
|
+
required?: boolean
|
|
20
|
+
rules?: any
|
|
21
|
+
zIndex?: number
|
|
22
|
+
type: 'checkbox' | 'radio'
|
|
23
|
+
labelWidth?: string
|
|
23
24
|
}>()
|
|
24
|
-
const emits=defineEmits(['update:modelValue'])
|
|
25
|
+
const emits = defineEmits(['update:modelValue'])
|
|
25
26
|
|
|
26
|
-
const config=ref<Config>()
|
|
27
|
-
const { enumColumn,getEnums }= useEnums({ config })
|
|
27
|
+
const config = ref<Config>()
|
|
28
|
+
const { enumColumn, getEnums } = useEnums({ config })
|
|
28
29
|
async function getPageConfig() {
|
|
29
30
|
try {
|
|
30
31
|
const res = await pageConfig(props.sourceId)
|
|
@@ -39,27 +40,28 @@ async function getPageConfig() {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
const comEnums=computed(()=>{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
43
|
+
const comEnums = computed(() => {
|
|
44
|
+
const mstrucId = config.value?.criterias?.find(item => item.sourceId === props.id)?.mstrucId
|
|
45
|
+
|
|
46
|
+
if (mstrucId) {
|
|
47
|
+
return enumColumn.value[mstrucId]?.map((item) => {
|
|
48
|
+
return {
|
|
49
|
+
id: item.id,
|
|
50
|
+
label: item.title,
|
|
51
|
+
value: `${item.id}-R-${item.value}`,
|
|
52
|
+
}
|
|
51
53
|
})
|
|
54
|
+
}
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
return []
|
|
55
57
|
})
|
|
56
58
|
|
|
57
|
-
onMounted(()=>{
|
|
58
|
-
|
|
59
|
+
onMounted(() => {
|
|
60
|
+
getPageConfig()
|
|
59
61
|
})
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
emits('update:modelValue',event.value)
|
|
63
|
+
function confirm(event: any) {
|
|
64
|
+
emits('update:modelValue', event.value)
|
|
63
65
|
}
|
|
64
66
|
</script>
|
|
65
67
|
|
|
@@ -74,5 +76,5 @@ export default {
|
|
|
74
76
|
</script>
|
|
75
77
|
|
|
76
78
|
<template>
|
|
77
|
-
<wd-select-picker :
|
|
79
|
+
<wd-select-picker :label-width="props.labelWidth" :title="props.title" :placeholder="props.placeholder" :disabled="props.disabled" :required="props.required" :rules="props.rules" :z-index="props.zIndex" :type="$props.type" :model-value="modelValue" :label="props.label" :columns="comEnums" @confirm="confirm" />
|
|
78
80
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { defineOptions, defineProps, onMounted, onUnmounted, ref } from 'vue'
|
|
3
3
|
import { onLoad } from '@dcloudio/uni-app'
|
|
4
|
-
import {listData, pageConfig, pageKey } from '../../api/page'
|
|
4
|
+
import { listData, pageConfig, pageKey } from '../../api/page'
|
|
5
5
|
import foldCard from '../fold-card/fold-card.vue'
|
|
6
6
|
import type { Config, Entities } from '../../type'
|
|
7
7
|
import Search from '../search/search.vue'
|
|
@@ -10,7 +10,8 @@ import CardBotomButtons from '../card-botom-buttons/card-botom-buttons.vue'
|
|
|
10
10
|
import { generateHighResolutionID } from '../../utils/index'
|
|
11
11
|
import productCard from '../product-card/product-card.vue'
|
|
12
12
|
import tabSearch from '../tab-search/tab-search.vue'
|
|
13
|
-
import {useEnums} from '../../composables/useEnumes'
|
|
13
|
+
import { useEnums } from '../../composables/useEnumes'
|
|
14
|
+
|
|
14
15
|
defineOptions({
|
|
15
16
|
name: 'WuiList',
|
|
16
17
|
})
|
|
@@ -57,7 +58,7 @@ const config = ref<Config>({
|
|
|
57
58
|
displayConfig: [],
|
|
58
59
|
showType: 'table',
|
|
59
60
|
})
|
|
60
|
-
const { getEnums, enumColumn} = useEnums({ config })
|
|
61
|
+
const { getEnums, enumColumn } = useEnums({ config })
|
|
61
62
|
const sourceId = ref('')
|
|
62
63
|
const datas = ref<Entities[]>([])
|
|
63
64
|
const pageTitle = ref('')
|
|
@@ -174,17 +175,20 @@ function tabSearchClick(data: any) {
|
|
|
174
175
|
>
|
|
175
176
|
<template #top>
|
|
176
177
|
<slot name="top" />
|
|
178
|
+
<view class="flex items-center pl-3 bg-white">
|
|
179
|
+
<ListTopButtons
|
|
180
|
+
:add-event="addEvent" :main-code="mainCode" :buttons="config.buttons" :source-id="sourceId"
|
|
181
|
+
:page-title="pageTitle" :page-type="pageType"
|
|
182
|
+
/>
|
|
177
183
|
<Search
|
|
178
184
|
:main-code="mainCode" :enum-column="enumColumn" :criterias="config.criterias"
|
|
179
185
|
:primary-criteria="config.primaryCriteria" :split2-tab-criterias="config.split2TabCriterias"
|
|
180
186
|
@submit="submitSearch"
|
|
181
187
|
/>
|
|
182
|
-
<view>
|
|
183
|
-
<ListTopButtons
|
|
184
|
-
:add-event="addEvent" :main-code="mainCode" :buttons="config.buttons" :source-id="sourceId"
|
|
185
|
-
:page-title="pageTitle" :page-type="pageType"
|
|
186
|
-
/>
|
|
187
188
|
</view>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
<!-- 自定义tab搜索 -->
|
|
188
192
|
<view v-if="config.split2TabCriterias">
|
|
189
193
|
<tabSearch :split2-tab-criterias="config.split2TabCriterias" :enums="enumColumn" @click="tabSearchClick" />
|
|
190
194
|
</view>
|
|
@@ -26,7 +26,7 @@ console.log(currentThemeColor)
|
|
|
26
26
|
<view class="h-[calc(100vh-44px)] flex flex-col .dark:bg-[--wot-dark-background9]">
|
|
27
27
|
<view class="position-relative h-390px w-full">
|
|
28
28
|
<image class="h-full w-full" :src="props.loginBackgroundimg" />
|
|
29
|
-
<view class="position-absolute bottom
|
|
29
|
+
<view class="position-absolute bottom-40rpx box-border w-full flex justify-center border-rd-t-2 bg-white bg-opacity-20 p-3 backdrop-blur-md .dark:bg-[--wot-dark-background2]">
|
|
30
30
|
<image class="mr-1.5 h-66px w-66px border-rd-100" :src="props.loginlog" />
|
|
31
31
|
<text class="mt-3 font-size-22px c-#171819 font-bold .dark:color-white">
|
|
32
32
|
你好,欢迎登录阀门检测
|