wui-components-v2 1.1.68 → 1.1.70
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/core/index.ts +74 -74
- package/api/menu.ts +45 -45
- package/api/page.ts +114 -114
- package/api/sys.ts +12 -12
- package/components/action-popup/action-popup.vue +46 -17
- package/components/add-address-page/add-address-page.vue +77 -77
- package/components/custom-date-picker/custom-date-picker.vue +106 -106
- package/components/custom-select-picker/custom-select-picker.vue +95 -95
- package/components/demo-block/demo-block.vue +63 -63
- package/components/detail-popup/detail-popup.vue +99 -99
- package/components/evaluation-page/evaluation-page.vue +196 -192
- package/components/fold-card/fold-card.vue +171 -171
- package/components/form-control/form-control.vue +661 -661
- package/components/global-message/global-message.vue +68 -68
- package/components/label-value/label-value.vue +144 -144
- package/components/list-top-buttons/list-top-buttons.vue +19 -19
- package/components/login-form/login-form.vue +126 -126
- package/components/mulselect-picker/mulselect-picker.vue +86 -86
- package/components/product-card/product-card.vue +201 -201
- package/components/search/search.vue +128 -128
- package/components/user-choose/user-choose.vue +1 -1
- package/components/wui-enume-select-control/wui-enume-select-control.vue +92 -92
- package/components/wui-list/wui-list.vue +235 -235
- package/components/wui-menus/wui-menus.vue +247 -247
- package/components/wui-menus1/components/navbar.vue +43 -43
- package/components/wui-menus1/wui-menus.vue +564 -564
- package/components/wui-notify-info/wui-notify-info.vue +280 -280
- package/components/wui-search-history-babbar/wui-search-history-babbar.vue +204 -204
- package/components/wui-select-list/wui-select-list.vue +310 -310
- package/components/wui-select-popup/wui-select-popup.vue +612 -612
- package/components/wui-system-settings/wui-system-settings.vue +144 -144
- package/components/wui-tabbar/wui-tabbar.vue +106 -106
- package/components/wui-tree-page/components/tree-item.vue +238 -238
- package/components/wui-user/wui-user.vue +202 -197
- package/composables/useCompanyFieldFilter.ts +91 -91
- package/composables/useEnumes.ts +2 -2
- package/composables/useMenus.ts +193 -193
- package/index.ts +83 -83
- package/package.json +1 -1
- package/static/iconfont/iconfont.css +63 -63
- package/store/language.ts +151 -151
- package/styles/dark-mode.css +523 -485
- package/styles/dark-mode.min.css +1 -1
- package/styles/dark-mode.scss +28 -0
- package/type.ts +2 -2
- package/utils/control-tree.ts +2 -2
- package/utils/control-type-supportor.ts +148 -148
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
<script lang="ts" setup>
|
|
2
|
-
import { CommonUtil, useDialog } from '@wot-ui/ui'
|
|
3
|
-
import { storeToRefs } from 'pinia'
|
|
4
|
-
import { defineOptions, nextTick, ref, watch } from 'vue'
|
|
5
|
-
import { useGlobalMessage } from '../../composables/useGlobalMessage'
|
|
6
|
-
import { getCurrentPath } from '../../utils/index'
|
|
7
|
-
|
|
8
|
-
defineOptions({
|
|
9
|
-
name: 'GlobalMessage',
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
const { messageOptions, currentPage } = storeToRefs(useGlobalMessage())
|
|
13
|
-
|
|
14
|
-
const dialog = useDialog()
|
|
15
|
-
const currentPath = getCurrentPath()
|
|
16
|
-
|
|
17
|
-
// #ifdef MP-ALIPAY
|
|
18
|
-
const hackAlipayVisible = ref(false)
|
|
19
|
-
|
|
20
|
-
nextTick(() => {
|
|
21
|
-
hackAlipayVisible.value = true
|
|
22
|
-
})
|
|
23
|
-
// #endif
|
|
24
|
-
|
|
25
|
-
watch(() => messageOptions.value, (newVal) => {
|
|
26
|
-
if (newVal) {
|
|
27
|
-
if (currentPage.value === currentPath) {
|
|
28
|
-
const option = CommonUtil.deepClone(newVal)
|
|
29
|
-
const method = option.type === 'confirm'
|
|
30
|
-
? 'confirm'
|
|
31
|
-
: option.type === 'prompt'
|
|
32
|
-
? 'prompt'
|
|
33
|
-
: 'alert'
|
|
34
|
-
dialog[method](option).then((res) => {
|
|
35
|
-
if (CommonUtil.isFunction(option.success)) {
|
|
36
|
-
option.success(res)
|
|
37
|
-
}
|
|
38
|
-
}).catch((err) => {
|
|
39
|
-
if (CommonUtil.isFunction(option.fail)) {
|
|
40
|
-
option.fail(err)
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
dialog.close()
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<script lang="ts">
|
|
52
|
-
export default {
|
|
53
|
-
options: {
|
|
54
|
-
virtualHost: true,
|
|
55
|
-
addGlobalClass: true,
|
|
56
|
-
styleIsolation: 'shared',
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<template>
|
|
62
|
-
<!-- #ifdef MP-ALIPAY -->
|
|
63
|
-
<wd-dialog v-if="hackAlipayVisible" />
|
|
64
|
-
<!-- #endif -->
|
|
65
|
-
<!-- #ifndef MP-ALIPAY -->
|
|
66
|
-
<wd-dialog />
|
|
67
|
-
<!-- #endif -->
|
|
68
|
-
</template>
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { CommonUtil, useDialog } from '@wot-ui/ui'
|
|
3
|
+
import { storeToRefs } from 'pinia'
|
|
4
|
+
import { defineOptions, nextTick, ref, watch } from 'vue'
|
|
5
|
+
import { useGlobalMessage } from '../../composables/useGlobalMessage'
|
|
6
|
+
import { getCurrentPath } from '../../utils/index'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'GlobalMessage',
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const { messageOptions, currentPage } = storeToRefs(useGlobalMessage())
|
|
13
|
+
|
|
14
|
+
const dialog = useDialog()
|
|
15
|
+
const currentPath = getCurrentPath()
|
|
16
|
+
|
|
17
|
+
// #ifdef MP-ALIPAY
|
|
18
|
+
const hackAlipayVisible = ref(false)
|
|
19
|
+
|
|
20
|
+
nextTick(() => {
|
|
21
|
+
hackAlipayVisible.value = true
|
|
22
|
+
})
|
|
23
|
+
// #endif
|
|
24
|
+
|
|
25
|
+
watch(() => messageOptions.value, (newVal) => {
|
|
26
|
+
if (newVal) {
|
|
27
|
+
if (currentPage.value === currentPath) {
|
|
28
|
+
const option = CommonUtil.deepClone(newVal)
|
|
29
|
+
const method = option.type === 'confirm'
|
|
30
|
+
? 'confirm'
|
|
31
|
+
: option.type === 'prompt'
|
|
32
|
+
? 'prompt'
|
|
33
|
+
: 'alert'
|
|
34
|
+
dialog[method](option).then((res) => {
|
|
35
|
+
if (CommonUtil.isFunction(option.success)) {
|
|
36
|
+
option.success(res)
|
|
37
|
+
}
|
|
38
|
+
}).catch((err) => {
|
|
39
|
+
if (CommonUtil.isFunction(option.fail)) {
|
|
40
|
+
option.fail(err)
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
dialog.close()
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<script lang="ts">
|
|
52
|
+
export default {
|
|
53
|
+
options: {
|
|
54
|
+
virtualHost: true,
|
|
55
|
+
addGlobalClass: true,
|
|
56
|
+
styleIsolation: 'shared',
|
|
57
|
+
},
|
|
58
|
+
}
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<!-- #ifdef MP-ALIPAY -->
|
|
63
|
+
<wd-dialog v-if="hackAlipayVisible" />
|
|
64
|
+
<!-- #endif -->
|
|
65
|
+
<!-- #ifndef MP-ALIPAY -->
|
|
66
|
+
<wd-dialog />
|
|
67
|
+
<!-- #endif -->
|
|
68
|
+
</template>
|
|
@@ -1,144 +1,144 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, defineOptions, defineProps, ref } from 'vue'
|
|
3
|
-
import type { Columns, Entities } from '../../type'
|
|
4
|
-
import { downloadFile, formatItemData } from '../../utils'
|
|
5
|
-
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
6
|
-
import VideoPlay from '../video-play/video-play.vue'
|
|
7
|
-
import audioPlay from '../audio-play/audio-play.vue'
|
|
8
|
-
import { useManualTheme } from '../../composables/useManualTheme'
|
|
9
|
-
import openValueMore from './open-value-more.vue'
|
|
10
|
-
import detailPopup from '../detail-popup/detail-popup.vue'
|
|
11
|
-
|
|
12
|
-
defineOptions({
|
|
13
|
-
name: 'LabelValue',
|
|
14
|
-
})
|
|
15
|
-
const props = defineProps<{
|
|
16
|
-
exhibitData: Columns[]
|
|
17
|
-
data: Entities
|
|
18
|
-
index: number
|
|
19
|
-
}>()
|
|
20
|
-
const { primary } = useManualTheme()
|
|
21
|
-
const clums = computed(() => {
|
|
22
|
-
return props.exhibitData.filter(item => !item.title?.includes('y'))
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const videoPlayRef = ref()
|
|
26
|
-
function openVideo(uitem: any) {
|
|
27
|
-
videoPlayRef.value.open(uitem.url)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function isControlType(item: Columns): string {
|
|
31
|
-
return ControlTypeSupportor.getControlType(
|
|
32
|
-
{ ...item, hidden: false, disabled: false, defaultValue: '', transDefaultValue: '', required: false },
|
|
33
|
-
props.data.fieldMap?.[item.sourceId] || ''
|
|
34
|
-
)
|
|
35
|
-
}
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<template>
|
|
39
|
-
<view v-for="(item, sindex) in clums" :key="sindex" class="flex">
|
|
40
|
-
<view class="mr-2 w-20 p-1 text-gray-500 dark:text-white">{{ item.title }}:</view>
|
|
41
|
-
<view
|
|
42
|
-
v-if="isControlType(item) === 'file' || isControlType(item) === 'relfile' || isControlType(item) === 'video'"
|
|
43
|
-
class="flex flex-1 items-center text-gray-800 dark:text-white"
|
|
44
|
-
>
|
|
45
|
-
<view v-if="data.fieldMap[item.sourceId]">
|
|
46
|
-
<view
|
|
47
|
-
v-for="(uitem, uindex) in formatItemData(data.fieldMap[item.sourceId], isControlType(item))"
|
|
48
|
-
:key="uindex"
|
|
49
|
-
>
|
|
50
|
-
<!-- 图片 -->
|
|
51
|
-
<wd-img
|
|
52
|
-
v-if="['png', 'jpg', 'jpeg'].includes(uitem.type)"
|
|
53
|
-
enable-preview
|
|
54
|
-
:width="100"
|
|
55
|
-
:height="100"
|
|
56
|
-
:src="uitem.url"
|
|
57
|
-
>
|
|
58
|
-
<template #error>
|
|
59
|
-
<view class="flex items-center pt-4px">暂无图片~</view>
|
|
60
|
-
</template>
|
|
61
|
-
<template #loading>
|
|
62
|
-
<view class="loading-wrap">
|
|
63
|
-
<wd-loading />
|
|
64
|
-
</view>
|
|
65
|
-
</template>
|
|
66
|
-
</wd-img>
|
|
67
|
-
<!-- 视频 -->
|
|
68
|
-
<view
|
|
69
|
-
v-else-if="['mp4', 'mov', 'wmv', 'avi', 'rmvb', 'flv', 'mkv'].includes(uitem.type)"
|
|
70
|
-
style="
|
|
71
|
-
width: 70px;
|
|
72
|
-
height: 70px;
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
justify-content: center;
|
|
76
|
-
border: 1px solid #ccc;
|
|
77
|
-
border-radius: 4px;
|
|
78
|
-
"
|
|
79
|
-
@click="openVideo(uitem)"
|
|
80
|
-
>
|
|
81
|
-
<wd-icon name="play-circle-filled" size="22px" />
|
|
82
|
-
</view>
|
|
83
|
-
<!-- 音频 -->
|
|
84
|
-
<view
|
|
85
|
-
v-else-if="['mp3', 'wma', 'wav', 'aac', 'ogg', 'flac', 'm4a', 'amr'].includes(uitem.type)"
|
|
86
|
-
style="display: flex; align-items: center; justify-content: center"
|
|
87
|
-
>
|
|
88
|
-
<audioPlay :src="uitem.url" />
|
|
89
|
-
</view>
|
|
90
|
-
<!-- 文件 -->
|
|
91
|
-
<view
|
|
92
|
-
v-else-if="
|
|
93
|
-
[
|
|
94
|
-
'doc',
|
|
95
|
-
'docx',
|
|
96
|
-
'xls',
|
|
97
|
-
'xlsx',
|
|
98
|
-
'ppt',
|
|
99
|
-
'pptx',
|
|
100
|
-
'pdf',
|
|
101
|
-
'txt',
|
|
102
|
-
'zip',
|
|
103
|
-
'rar',
|
|
104
|
-
'7z',
|
|
105
|
-
'gz',
|
|
106
|
-
'bz2',
|
|
107
|
-
'tar',
|
|
108
|
-
'iso',
|
|
109
|
-
'exe',
|
|
110
|
-
'dmg',
|
|
111
|
-
'apk',
|
|
112
|
-
'apk',
|
|
113
|
-
'apk',
|
|
114
|
-
'apk',
|
|
115
|
-
'apk',
|
|
116
|
-
'apk',
|
|
117
|
-
'apk',
|
|
118
|
-
'apk',
|
|
119
|
-
].includes(uitem.type)
|
|
120
|
-
"
|
|
121
|
-
>
|
|
122
|
-
<span :style="{ color: primary }" @click="downloadFile(uitem.url)">
|
|
123
|
-
{{ uitem.name }}
|
|
124
|
-
</span>
|
|
125
|
-
</view>
|
|
126
|
-
</view>
|
|
127
|
-
</view>
|
|
128
|
-
</view>
|
|
129
|
-
<view v-else-if="item.title === '序号'" class="flex flex-1 items-center text-gray-800 dark:text-white">
|
|
130
|
-
{{ index + 1 }}
|
|
131
|
-
</view>
|
|
132
|
-
<view v-else-if="item.buttons?.includes('detail')" class="flex flex-1 items-center text-gray-800 dark:text-white">
|
|
133
|
-
<detailPopup
|
|
134
|
-
:source="item"
|
|
135
|
-
:text="formatItemData(data.fieldMap[item.sourceId], isControlType(item))"
|
|
136
|
-
:code="data.fieldMap[item.sourceId]"
|
|
137
|
-
/>
|
|
138
|
-
</view>
|
|
139
|
-
<openValueMore v-else :text="formatItemData(data.fieldMap[item.sourceId], isControlType(item))" />
|
|
140
|
-
</view>
|
|
141
|
-
<VideoPlay ref="videoPlayRef" />
|
|
142
|
-
</template>
|
|
143
|
-
|
|
144
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineOptions, defineProps, ref } from 'vue'
|
|
3
|
+
import type { Columns, Entities } from '../../type'
|
|
4
|
+
import { downloadFile, formatItemData } from '../../utils'
|
|
5
|
+
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
6
|
+
import VideoPlay from '../video-play/video-play.vue'
|
|
7
|
+
import audioPlay from '../audio-play/audio-play.vue'
|
|
8
|
+
import { useManualTheme } from '../../composables/useManualTheme'
|
|
9
|
+
import openValueMore from './open-value-more.vue'
|
|
10
|
+
import detailPopup from '../detail-popup/detail-popup.vue'
|
|
11
|
+
|
|
12
|
+
defineOptions({
|
|
13
|
+
name: 'LabelValue',
|
|
14
|
+
})
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
exhibitData: Columns[]
|
|
17
|
+
data: Entities
|
|
18
|
+
index: number
|
|
19
|
+
}>()
|
|
20
|
+
const { primary } = useManualTheme()
|
|
21
|
+
const clums = computed(() => {
|
|
22
|
+
return props.exhibitData.filter(item => !item.title?.includes('y'))
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const videoPlayRef = ref()
|
|
26
|
+
function openVideo(uitem: any) {
|
|
27
|
+
videoPlayRef.value.open(uitem.url)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function isControlType(item: Columns): string {
|
|
31
|
+
return ControlTypeSupportor.getControlType(
|
|
32
|
+
{ ...item, hidden: false, disabled: false, defaultValue: '', transDefaultValue: '', required: false },
|
|
33
|
+
props.data.fieldMap?.[item.sourceId] || ''
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<template>
|
|
39
|
+
<view v-for="(item, sindex) in clums" :key="sindex" class="flex">
|
|
40
|
+
<view class="mr-2 w-20 p-1 text-gray-500 dark:text-white">{{ item.title }}:</view>
|
|
41
|
+
<view
|
|
42
|
+
v-if="isControlType(item) === 'file' || isControlType(item) === 'relfile' || isControlType(item) === 'video'"
|
|
43
|
+
class="flex flex-1 items-center text-gray-800 dark:text-white"
|
|
44
|
+
>
|
|
45
|
+
<view v-if="data.fieldMap[item.sourceId]">
|
|
46
|
+
<view
|
|
47
|
+
v-for="(uitem, uindex) in formatItemData(data.fieldMap[item.sourceId], isControlType(item))"
|
|
48
|
+
:key="uindex"
|
|
49
|
+
>
|
|
50
|
+
<!-- 图片 -->
|
|
51
|
+
<wd-img
|
|
52
|
+
v-if="['png', 'jpg', 'jpeg'].includes(uitem.type)"
|
|
53
|
+
enable-preview
|
|
54
|
+
:width="100"
|
|
55
|
+
:height="100"
|
|
56
|
+
:src="uitem.url"
|
|
57
|
+
>
|
|
58
|
+
<template #error>
|
|
59
|
+
<view class="flex items-center pt-4px">暂无图片~</view>
|
|
60
|
+
</template>
|
|
61
|
+
<template #loading>
|
|
62
|
+
<view class="loading-wrap">
|
|
63
|
+
<wd-loading />
|
|
64
|
+
</view>
|
|
65
|
+
</template>
|
|
66
|
+
</wd-img>
|
|
67
|
+
<!-- 视频 -->
|
|
68
|
+
<view
|
|
69
|
+
v-else-if="['mp4', 'mov', 'wmv', 'avi', 'rmvb', 'flv', 'mkv'].includes(uitem.type)"
|
|
70
|
+
style="
|
|
71
|
+
width: 70px;
|
|
72
|
+
height: 70px;
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
border: 1px solid #ccc;
|
|
77
|
+
border-radius: 4px;
|
|
78
|
+
"
|
|
79
|
+
@click="openVideo(uitem)"
|
|
80
|
+
>
|
|
81
|
+
<wd-icon name="play-circle-filled" size="22px" />
|
|
82
|
+
</view>
|
|
83
|
+
<!-- 音频 -->
|
|
84
|
+
<view
|
|
85
|
+
v-else-if="['mp3', 'wma', 'wav', 'aac', 'ogg', 'flac', 'm4a', 'amr'].includes(uitem.type)"
|
|
86
|
+
style="display: flex; align-items: center; justify-content: center"
|
|
87
|
+
>
|
|
88
|
+
<audioPlay :src="uitem.url" />
|
|
89
|
+
</view>
|
|
90
|
+
<!-- 文件 -->
|
|
91
|
+
<view
|
|
92
|
+
v-else-if="
|
|
93
|
+
[
|
|
94
|
+
'doc',
|
|
95
|
+
'docx',
|
|
96
|
+
'xls',
|
|
97
|
+
'xlsx',
|
|
98
|
+
'ppt',
|
|
99
|
+
'pptx',
|
|
100
|
+
'pdf',
|
|
101
|
+
'txt',
|
|
102
|
+
'zip',
|
|
103
|
+
'rar',
|
|
104
|
+
'7z',
|
|
105
|
+
'gz',
|
|
106
|
+
'bz2',
|
|
107
|
+
'tar',
|
|
108
|
+
'iso',
|
|
109
|
+
'exe',
|
|
110
|
+
'dmg',
|
|
111
|
+
'apk',
|
|
112
|
+
'apk',
|
|
113
|
+
'apk',
|
|
114
|
+
'apk',
|
|
115
|
+
'apk',
|
|
116
|
+
'apk',
|
|
117
|
+
'apk',
|
|
118
|
+
'apk',
|
|
119
|
+
].includes(uitem.type)
|
|
120
|
+
"
|
|
121
|
+
>
|
|
122
|
+
<span :style="{ color: primary }" @click="downloadFile(uitem.url)">
|
|
123
|
+
{{ uitem.name }}
|
|
124
|
+
</span>
|
|
125
|
+
</view>
|
|
126
|
+
</view>
|
|
127
|
+
</view>
|
|
128
|
+
</view>
|
|
129
|
+
<view v-else-if="item.title === '序号'" class="flex flex-1 items-center text-gray-800 dark:text-white">
|
|
130
|
+
{{ index + 1 }}
|
|
131
|
+
</view>
|
|
132
|
+
<view v-else-if="item.buttons?.includes('detail')" class="flex flex-1 items-center text-gray-800 dark:text-white">
|
|
133
|
+
<detailPopup
|
|
134
|
+
:source="item"
|
|
135
|
+
:text="formatItemData(data.fieldMap[item.sourceId], isControlType(item))"
|
|
136
|
+
:code="data.fieldMap[item.sourceId]"
|
|
137
|
+
/>
|
|
138
|
+
</view>
|
|
139
|
+
<openValueMore v-else :text="formatItemData(data.fieldMap[item.sourceId], isControlType(item))" />
|
|
140
|
+
</view>
|
|
141
|
+
<VideoPlay ref="videoPlayRef" />
|
|
142
|
+
</template>
|
|
143
|
+
|
|
144
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { useRouter } from 'uni-mini-router'
|
|
3
|
-
|
|
4
|
-
defineOptions({
|
|
5
|
-
name: 'ListTopButtons',
|
|
6
|
-
})
|
|
7
|
-
const props = defineProps<{ mainCode: string, buttons: string[], sourceId: string, id?: string, pageTitle: string, pageType?: string, addEvent?: string, config?: any }>()
|
|
8
|
-
const router = useRouter()
|
|
9
|
-
// 跳转添加页面
|
|
10
|
-
function gotoAddPage() {
|
|
11
|
-
router.push(`/pages/edit-page/index?sourceId=${props.sourceId}&id=${props.id || ''}&title=${props.pageTitle}&mainCode=${props.mainCode}&pageType=${props.pageType}&addEvent=${props.addEvent}`)
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<template>
|
|
16
|
-
<view class="flex justify-end gap-1 py-2 px-2 bg-white dark:bg-[var(--wot-dark-background)]">
|
|
17
|
-
<wd-button class="flex-1" v-if="buttons.includes('dtmplAdd')" type="primary" @click="gotoAddPage" icon="plus">{{ props.config?.editBtnTitle || '新增' }}</wd-button>
|
|
18
|
-
</view>
|
|
19
|
-
</template>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useRouter } from 'uni-mini-router'
|
|
3
|
+
|
|
4
|
+
defineOptions({
|
|
5
|
+
name: 'ListTopButtons',
|
|
6
|
+
})
|
|
7
|
+
const props = defineProps<{ mainCode: string, buttons: string[], sourceId: string, id?: string, pageTitle: string, pageType?: string, addEvent?: string, config?: any }>()
|
|
8
|
+
const router = useRouter()
|
|
9
|
+
// 跳转添加页面
|
|
10
|
+
function gotoAddPage() {
|
|
11
|
+
router.push(`/pages/edit-page/index?sourceId=${props.sourceId}&id=${props.id || ''}&title=${props.pageTitle}&mainCode=${props.mainCode}&pageType=${props.pageType}&addEvent=${props.addEvent}`)
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<view class="flex justify-end gap-1 py-2 px-2 bg-white dark:bg-[var(--wot-dark-background)]">
|
|
17
|
+
<wd-button class="flex-1" v-if="buttons.includes('dtmplAdd')" type="primary" @click="gotoAddPage" icon="plus">{{ props.config?.editBtnTitle || '新增' }}</wd-button>
|
|
18
|
+
</view>
|
|
19
|
+
</template>
|