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,99 +1,99 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import type { Columns, Entities } from '../../type'
|
|
4
|
-
import { formatItemData } from '../../utils'
|
|
5
|
-
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
6
|
-
import { detailPageConfig, detailPageData } from '../../api/page'
|
|
7
|
-
|
|
8
|
-
defineOptions({
|
|
9
|
-
name: 'DetailPopup',
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
const props = defineProps<{
|
|
13
|
-
source: Columns
|
|
14
|
-
text: string
|
|
15
|
-
code: string
|
|
16
|
-
}>()
|
|
17
|
-
interface DetailItem {
|
|
18
|
-
/** 行数据 */
|
|
19
|
-
data: Entities
|
|
20
|
-
/** 字段配置 */
|
|
21
|
-
columns: Columns[]
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const showDetail = ref(false)
|
|
25
|
-
const exhibitData = ref<Columns[]>([])
|
|
26
|
-
const rowData = ref<Entities>({} as Entities)
|
|
27
|
-
const columns = ref<Columns[]>([])
|
|
28
|
-
|
|
29
|
-
function isControlType(item: Columns): string {
|
|
30
|
-
return ControlTypeSupportor.getControlType(
|
|
31
|
-
{ ...item, hidden: false, disabled: false, defaultValue: '', transDefaultValue: '', required: false },
|
|
32
|
-
rowData.value.fieldMap[item.sourceId]
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
async function open(item: DetailItem) {
|
|
36
|
-
const code = props.code.split('@R@')[0]
|
|
37
|
-
const formRes = await detailPageConfig(props.source.sourceId)
|
|
38
|
-
const valueRes = await detailPageData(props.source.sourceId, code)
|
|
39
|
-
if (formRes.status === 'success') {
|
|
40
|
-
columns.value = formRes.dtmplConfig.groups?.[0].fields || []
|
|
41
|
-
}
|
|
42
|
-
if (valueRes.status === 'success') {
|
|
43
|
-
rowData.value = valueRes.entity || {}
|
|
44
|
-
}
|
|
45
|
-
showDetail.value = true
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function handleClose() {
|
|
49
|
-
showDetail.value = false
|
|
50
|
-
}
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
<template>
|
|
54
|
-
<view class="text-[#1c64fd]" @click="open">{{ text }}</view>
|
|
55
|
-
<wd-popup v-model="showDetail" custom-style="border-radius: 32rpx;">
|
|
56
|
-
<view class="custom-popup">
|
|
57
|
-
<view class="text-center mb-4 text-gray-900 dark:text-gray-100">详情内容</view>
|
|
58
|
-
<scroll-view scroll-y class="scroll-area">
|
|
59
|
-
<view class="flex items-center gap-2 mb-4 text-gray-500 dark:text-gray-400" v-for="(item, sindex) in columns" :key="sindex">
|
|
60
|
-
<view class="break-words dark:text-gray-400">{{ item.title }}:</view>
|
|
61
|
-
<view class="text-gray-800 dark:text-gray-200 break-all">
|
|
62
|
-
{{ formatItemData(rowData.fieldMap[item.sourceId], isControlType(item)) }}
|
|
63
|
-
</view>
|
|
64
|
-
</view>
|
|
65
|
-
</scroll-view>
|
|
66
|
-
<view class="footer flex justify-center items-center">
|
|
67
|
-
<wd-button class="flex-1" @click="handleClose">确定</wd-button>
|
|
68
|
-
</view>
|
|
69
|
-
</view>
|
|
70
|
-
</wd-popup>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<style scoped lang="scss">
|
|
74
|
-
.custom-popup {
|
|
75
|
-
color: var(--wot-dark-color, #333);
|
|
76
|
-
padding: 24rpx;
|
|
77
|
-
width: 600rpx;
|
|
78
|
-
max-width: 600rpx;
|
|
79
|
-
font-size: 40rpx;
|
|
80
|
-
border-radius: 32rpx;
|
|
81
|
-
position: relative;
|
|
82
|
-
|
|
83
|
-
.scroll-area {
|
|
84
|
-
height: 50vh;
|
|
85
|
-
overflow: hidden;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.footer {
|
|
89
|
-
margin-top: 24rpx;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// 暗黑模式适配
|
|
94
|
-
:global(.wot-theme-dark) {
|
|
95
|
-
.custom-popup {
|
|
96
|
-
color: var(--wot-dark-color2, #e0e0e0);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
</style>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import type { Columns, Entities } from '../../type'
|
|
4
|
+
import { formatItemData } from '../../utils'
|
|
5
|
+
import ControlTypeSupportor from '../../utils/control-type-supportor'
|
|
6
|
+
import { detailPageConfig, detailPageData } from '../../api/page'
|
|
7
|
+
|
|
8
|
+
defineOptions({
|
|
9
|
+
name: 'DetailPopup',
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
source: Columns
|
|
14
|
+
text: string
|
|
15
|
+
code: string
|
|
16
|
+
}>()
|
|
17
|
+
interface DetailItem {
|
|
18
|
+
/** 行数据 */
|
|
19
|
+
data: Entities
|
|
20
|
+
/** 字段配置 */
|
|
21
|
+
columns: Columns[]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const showDetail = ref(false)
|
|
25
|
+
const exhibitData = ref<Columns[]>([])
|
|
26
|
+
const rowData = ref<Entities>({} as Entities)
|
|
27
|
+
const columns = ref<Columns[]>([])
|
|
28
|
+
|
|
29
|
+
function isControlType(item: Columns): string {
|
|
30
|
+
return ControlTypeSupportor.getControlType(
|
|
31
|
+
{ ...item, hidden: false, disabled: false, defaultValue: '', transDefaultValue: '', required: false },
|
|
32
|
+
rowData.value.fieldMap[item.sourceId]
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
async function open(item: DetailItem) {
|
|
36
|
+
const code = props.code.split('@R@')[0]
|
|
37
|
+
const formRes = await detailPageConfig(props.source.sourceId)
|
|
38
|
+
const valueRes = await detailPageData(props.source.sourceId, code)
|
|
39
|
+
if (formRes.status === 'success') {
|
|
40
|
+
columns.value = formRes.dtmplConfig.groups?.[0].fields || []
|
|
41
|
+
}
|
|
42
|
+
if (valueRes.status === 'success') {
|
|
43
|
+
rowData.value = valueRes.entity || {}
|
|
44
|
+
}
|
|
45
|
+
showDetail.value = true
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function handleClose() {
|
|
49
|
+
showDetail.value = false
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<view class="text-[#1c64fd]" @click="open">{{ text }}</view>
|
|
55
|
+
<wd-popup v-model="showDetail" custom-style="border-radius: 32rpx;">
|
|
56
|
+
<view class="custom-popup">
|
|
57
|
+
<view class="text-center mb-4 text-gray-900 dark:text-gray-100">详情内容</view>
|
|
58
|
+
<scroll-view scroll-y class="scroll-area">
|
|
59
|
+
<view class="flex items-center gap-2 mb-4 text-gray-500 dark:text-gray-400" v-for="(item, sindex) in columns" :key="sindex">
|
|
60
|
+
<view class="break-words dark:text-gray-400">{{ item.title }}:</view>
|
|
61
|
+
<view class="text-gray-800 dark:text-gray-200 break-all">
|
|
62
|
+
{{ formatItemData(rowData.fieldMap[item.sourceId], isControlType(item)) }}
|
|
63
|
+
</view>
|
|
64
|
+
</view>
|
|
65
|
+
</scroll-view>
|
|
66
|
+
<view class="footer flex justify-center items-center">
|
|
67
|
+
<wd-button class="flex-1" @click="handleClose">确定</wd-button>
|
|
68
|
+
</view>
|
|
69
|
+
</view>
|
|
70
|
+
</wd-popup>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<style scoped lang="scss">
|
|
74
|
+
.custom-popup {
|
|
75
|
+
color: var(--wot-dark-color, #333);
|
|
76
|
+
padding: 24rpx;
|
|
77
|
+
width: 600rpx;
|
|
78
|
+
max-width: 600rpx;
|
|
79
|
+
font-size: 40rpx;
|
|
80
|
+
border-radius: 32rpx;
|
|
81
|
+
position: relative;
|
|
82
|
+
|
|
83
|
+
.scroll-area {
|
|
84
|
+
height: 50vh;
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.footer {
|
|
89
|
+
margin-top: 24rpx;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// 暗黑模式适配
|
|
94
|
+
:global(.wot-theme-dark) {
|
|
95
|
+
.custom-popup {
|
|
96
|
+
color: var(--wot-dark-color2, #e0e0e0);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -1,192 +1,196 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
import { onLoad } from '@dcloudio/uni-app'
|
|
4
|
-
import { detailPageConfig, detailPageData, pageConfig as OperationPageConfig, actionDataSave } from '../../api/page'
|
|
5
|
-
import type { Entities, Groups, dtmplConfig, rowActions } from '../../type'
|
|
6
|
-
import LabelValue from '../label-value/label-value.vue'
|
|
7
|
-
import ActionPopup from '../action-popup/action-popup.vue'
|
|
8
|
-
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
9
|
-
|
|
10
|
-
defineOptions({
|
|
11
|
-
name: 'EvaluationPage',
|
|
12
|
-
})
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
<view v-
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
:
|
|
189
|
-
:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { onLoad } from '@dcloudio/uni-app'
|
|
4
|
+
import { detailPageConfig, detailPageData, pageConfig as OperationPageConfig, actionDataSave } from '../../api/page'
|
|
5
|
+
import type { Entities, Groups, dtmplConfig, rowActions } from '../../type'
|
|
6
|
+
import LabelValue from '../label-value/label-value.vue'
|
|
7
|
+
import ActionPopup from '../action-popup/action-popup.vue'
|
|
8
|
+
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
9
|
+
|
|
10
|
+
defineOptions({
|
|
11
|
+
name: 'EvaluationPage',
|
|
12
|
+
})
|
|
13
|
+
const props = defineProps<{
|
|
14
|
+
/** 评价提交成功后的跳转地址,不传则默认刷新详情 */
|
|
15
|
+
successUrl?: string
|
|
16
|
+
}>()
|
|
17
|
+
const toast = useGlobalToast()
|
|
18
|
+
const sourceId = ref('')
|
|
19
|
+
const id = ref('')
|
|
20
|
+
const title = ref('')
|
|
21
|
+
const pageConfig = ref<dtmplConfig>({
|
|
22
|
+
id: '',
|
|
23
|
+
title: '',
|
|
24
|
+
groups: [],
|
|
25
|
+
entity: {} as any,
|
|
26
|
+
buttons: [],
|
|
27
|
+
})
|
|
28
|
+
const data = ref<Entities>({
|
|
29
|
+
code: '',
|
|
30
|
+
fieldMap: {},
|
|
31
|
+
arrayMap: {},
|
|
32
|
+
})
|
|
33
|
+
const groups = ref<Groups>({
|
|
34
|
+
id: '',
|
|
35
|
+
buttons: ['detail'],
|
|
36
|
+
fields: [],
|
|
37
|
+
title: '',
|
|
38
|
+
type: '',
|
|
39
|
+
pointSourceId: '',
|
|
40
|
+
mstrucId: '',
|
|
41
|
+
relationNames: [],
|
|
42
|
+
readOnly: false,
|
|
43
|
+
displayConfig: [],
|
|
44
|
+
})
|
|
45
|
+
const loading = ref(false)
|
|
46
|
+
// 折叠面板
|
|
47
|
+
const collapses = ref()
|
|
48
|
+
// 评价操作配置
|
|
49
|
+
const evaluationActions = ref<rowActions[]>([])
|
|
50
|
+
onLoad((option: any) => {
|
|
51
|
+
sourceId.value = option.sourceId
|
|
52
|
+
id.value = option.id
|
|
53
|
+
// #ifdef MP-WEIXIN
|
|
54
|
+
const q = decodeURIComponent(option.q) // 获取到二维码原始链接内容
|
|
55
|
+
const sc: any = getQueryParams(q)
|
|
56
|
+
sourceId.value = sc.sourceId || option.sourceId
|
|
57
|
+
id.value = sc.id || option.id
|
|
58
|
+
// #endif
|
|
59
|
+
title.value = option.title
|
|
60
|
+
uni.setNavigationBarTitle({
|
|
61
|
+
title: `${option.title}`,
|
|
62
|
+
})
|
|
63
|
+
getPageConfig()
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
// 将 URL 中问号后面的参数转换为对象
|
|
67
|
+
function getQueryParams(url: string) {
|
|
68
|
+
// 获取问号后面的部分
|
|
69
|
+
const queryString = url.split('?')[1]
|
|
70
|
+
|
|
71
|
+
if (!queryString) {
|
|
72
|
+
return {}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 将参数字符串分割成键值对数组
|
|
76
|
+
const pairs = queryString.split('&')
|
|
77
|
+
|
|
78
|
+
// 创建结果对象
|
|
79
|
+
const result: { [key: string]: string } = {}
|
|
80
|
+
|
|
81
|
+
// 遍历键值对
|
|
82
|
+
pairs.forEach(pair => {
|
|
83
|
+
const [key, value] = pair.split('=')
|
|
84
|
+
// 解码URI组件并添加到结果对象
|
|
85
|
+
result[decodeURIComponent(key)] = decodeURIComponent(value || '')
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
return result
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// 获取页面配置
|
|
92
|
+
async function getPageConfig() {
|
|
93
|
+
try {
|
|
94
|
+
loading.value = true
|
|
95
|
+
const res = await detailPageConfig(sourceId.value)
|
|
96
|
+
// 初始化折叠面板
|
|
97
|
+
if (res.dtmplConfig) {
|
|
98
|
+
uni.setNavigationBarTitle({
|
|
99
|
+
title: `${res.dtmplConfig.title}`,
|
|
100
|
+
})
|
|
101
|
+
pageConfig.value = res.dtmplConfig
|
|
102
|
+
collapses.value = pageConfig.value.groups.map((item: Groups) => {
|
|
103
|
+
return item.id
|
|
104
|
+
})
|
|
105
|
+
getDetailData()
|
|
106
|
+
getOperationPageConfig()
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
console.log(error)
|
|
110
|
+
loading.value = false
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// 获取详情数据
|
|
115
|
+
async function getDetailData() {
|
|
116
|
+
try {
|
|
117
|
+
const res = await detailPageData(sourceId.value, id.value)
|
|
118
|
+
data.value = res.entity
|
|
119
|
+
loading.value = false
|
|
120
|
+
} catch (error) {
|
|
121
|
+
loading.value = false
|
|
122
|
+
console.log(error)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async function getOperationPageConfig() {
|
|
126
|
+
try {
|
|
127
|
+
const res: any = await OperationPageConfig(sourceId.value)
|
|
128
|
+
// 筛选出评价相关的操作
|
|
129
|
+
if (res.ltmplConfig?.rowActions) {
|
|
130
|
+
evaluationActions.value = res.ltmplConfig.rowActions.filter((item: rowActions) => item.title.includes('评价'))
|
|
131
|
+
}
|
|
132
|
+
} catch (error) {
|
|
133
|
+
console.log(error)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const actionItemShow = ref(false)
|
|
138
|
+
const actionItem = ref<Groups>()
|
|
139
|
+
const code = ref('')
|
|
140
|
+
const enumColumn = ref()
|
|
141
|
+
// 模拟 zpaging 对象,用于 ActionPopup 刷新
|
|
142
|
+
const mockZpaging = {
|
|
143
|
+
reload: () => getDetailData(),
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 评价按钮点击事件 - 迁移自 card-botom-buttons 的 select action 功能
|
|
147
|
+
async function handleEvaluationClick() {
|
|
148
|
+
if (evaluationActions.value.length === 0) {
|
|
149
|
+
toast.error({ msg: '未找到评价操作配置' })
|
|
150
|
+
return
|
|
151
|
+
}
|
|
152
|
+
// 取第一个评价操作
|
|
153
|
+
const subitem = evaluationActions.value[0]
|
|
154
|
+
if (subitem.writes.length) {
|
|
155
|
+
actionItem.value = {
|
|
156
|
+
...groups.value,
|
|
157
|
+
fields: subitem.writes,
|
|
158
|
+
id: subitem.id,
|
|
159
|
+
}
|
|
160
|
+
code.value = id.value
|
|
161
|
+
actionItemShow.value = true
|
|
162
|
+
} else {
|
|
163
|
+
try {
|
|
164
|
+
await actionDataSave(subitem.id, id.value, {})
|
|
165
|
+
toast.success({ msg: '评价成功!' })
|
|
166
|
+
} catch (error: any) {
|
|
167
|
+
toast.error(error)
|
|
168
|
+
console.log(error)
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
</script>
|
|
173
|
+
|
|
174
|
+
<template>
|
|
175
|
+
<view class="p-4">
|
|
176
|
+
<view v-if="loading" class="flex justify-center p-3">
|
|
177
|
+
<wd-loading />
|
|
178
|
+
</view>
|
|
179
|
+
<view v-else>
|
|
180
|
+
<view v-for="(group, index) in pageConfig.groups" :key="group.id" :title="group.title" :name="group.id">
|
|
181
|
+
<view class="text-sm space-y-3">
|
|
182
|
+
<LabelValue :index="index" :exhibit-data="group.fields" :data="data" />
|
|
183
|
+
</view>
|
|
184
|
+
</view>
|
|
185
|
+
</view>
|
|
186
|
+
<wd-button type="primary" class="mt-4 w-full" @click="handleEvaluationClick">评价</wd-button>
|
|
187
|
+
<ActionPopup
|
|
188
|
+
v-model:show="actionItemShow"
|
|
189
|
+
:enum-column="enumColumn"
|
|
190
|
+
:zpaging="mockZpaging"
|
|
191
|
+
:field-group="actionItem"
|
|
192
|
+
:code="code"
|
|
193
|
+
:success-url="props.successUrl + '?sourceId=' + sourceId"
|
|
194
|
+
/>
|
|
195
|
+
</view>
|
|
196
|
+
</template>
|