wui-components-v2 1.2.60 → 1.2.62
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 +2 -1
- package/components/action-popup/action-popup.vue +8 -4
- package/components/list-top-buttons/list-top-buttons.vue +13 -2
- package/components/wui-list/config.ts +0 -0
- package/components/wui-list/wui-list.vue +351 -3
- package/components/wui-list copy/wui-list.vue +367 -0
- package/components/wui-menus1/wui-menus.vue +4 -1
- package/package.json +1 -1
- package/type.ts +2 -0
package/api/core/index.ts
CHANGED
|
@@ -17,7 +17,8 @@ interface RequestOptions {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
function request(options: RequestOptions): Promise<any> {
|
|
20
|
-
|
|
20
|
+
// BASE_URL 为空时使用相对路径(H5 走 vite 代理避免跨域);有值时拼接绝对地址
|
|
21
|
+
const baseUrl = uni.getStorageSync('BASE_URL') || ''
|
|
21
22
|
const hydrocarbonProgramToken = uni.getStorageSync('HYDROCARBON_PROGRAM_TOKEN') || ''
|
|
22
23
|
const token = uni.getStorageSync('TOKEN') || uni.getStorageSync('token') || ''
|
|
23
24
|
const hydrocarbonClient = uni.getStorageSync('HYDROCARBON_CLIENT') || ''
|
|
@@ -11,13 +11,16 @@ defineOptions({
|
|
|
11
11
|
const props = defineProps<{
|
|
12
12
|
fieldGroup?: Groups
|
|
13
13
|
show: boolean
|
|
14
|
-
code
|
|
14
|
+
/** 单条记录的 code;批量场景可用 codes(逗号分隔)代替,二者取其一 */
|
|
15
|
+
code?: string
|
|
16
|
+
/** 批量操作的 codes(逗号分隔)。优先于 code 使用;用于对多条记录统一执行同一 action */
|
|
17
|
+
codes?: string
|
|
15
18
|
zpaging: any
|
|
16
19
|
enumColumn?: Enums
|
|
17
20
|
/** 提交成功后跳转的自定义页面路径,不传则默认刷新 */
|
|
18
21
|
successUrl?: string
|
|
19
22
|
}>()
|
|
20
|
-
const emits = defineEmits(['update:show'])
|
|
23
|
+
const emits = defineEmits(['update:show', 'success'])
|
|
21
24
|
const btnLoading = ref(false)
|
|
22
25
|
const toast = useGlobalToast()
|
|
23
26
|
const formControlRef = ref()
|
|
@@ -56,10 +59,11 @@ async function action() {
|
|
|
56
59
|
}
|
|
57
60
|
try {
|
|
58
61
|
const data = await formControlRef.value.submit()
|
|
59
|
-
await actionDataSave(props.fieldGroup?.id || '', props.code, formatFileData(data))
|
|
62
|
+
await actionDataSave(props.fieldGroup?.id || '', props.codes || props.code, formatFileData(data))
|
|
60
63
|
btnLoading.value = false
|
|
61
64
|
show.value = false
|
|
62
65
|
toast.success({ msg: '操作成功!' })
|
|
66
|
+
emits('success')
|
|
63
67
|
// 如果传了 successUrl,跳转到自定义页面;否则默认刷新
|
|
64
68
|
if (props.successUrl) {
|
|
65
69
|
uni.navigateTo({ url: props.successUrl })
|
|
@@ -89,7 +93,7 @@ async function action() {
|
|
|
89
93
|
<view class="h-44px bg-white dark:bg-[var(--wot-dark-background)]" />
|
|
90
94
|
<view class="w-[calc(100%-44px)] overflow-auto bg-white dark:bg-[var(--wot-dark-background)]">
|
|
91
95
|
<formControl
|
|
92
|
-
v-if="props.fieldGroup"
|
|
96
|
+
v-if="show && props.fieldGroup"
|
|
93
97
|
ref="formControlRef"
|
|
94
98
|
:field-group="props.fieldGroup"
|
|
95
99
|
:enum-column="enumColumn"
|
|
@@ -6,6 +6,10 @@ import { exportLtmplExcel, exportStatus as fetchExportStatus } from '../../api/p
|
|
|
6
6
|
defineOptions({
|
|
7
7
|
name: 'ListTopButtons',
|
|
8
8
|
})
|
|
9
|
+
// 通知父级进入批量编辑(勾选)模式
|
|
10
|
+
const emit = defineEmits<{
|
|
11
|
+
(e: 'batchEdit'): void
|
|
12
|
+
}>()
|
|
9
13
|
const props = withDefaults(
|
|
10
14
|
defineProps<{
|
|
11
15
|
mainCode: string
|
|
@@ -26,6 +30,10 @@ const props = withDefaults(
|
|
|
26
30
|
* 导出参数 withDetail,传给 /v3/export/ltmpl-data-excel,可由父级覆盖。
|
|
27
31
|
*/
|
|
28
32
|
withDetail?: boolean
|
|
33
|
+
/**
|
|
34
|
+
* 是否处于批量操作(勾选)模式。为 true 时「批量操作」按钮文本切换为「取消批量操作」。
|
|
35
|
+
*/
|
|
36
|
+
batchEditing?: boolean
|
|
29
37
|
}>(),
|
|
30
38
|
{
|
|
31
39
|
showButtons: true,
|
|
@@ -220,7 +228,7 @@ function downloadExportFile() {
|
|
|
220
228
|
url: downloadUrl,
|
|
221
229
|
method: 'GET',
|
|
222
230
|
responseType: 'arraybuffer',
|
|
223
|
-
success:
|
|
231
|
+
success: res => {
|
|
224
232
|
uni.hideLoading()
|
|
225
233
|
if (res.statusCode === 200 || res.statusCode === 201) {
|
|
226
234
|
const fs = uni.getFileSystemManager()
|
|
@@ -245,7 +253,7 @@ function downloadExportFile() {
|
|
|
245
253
|
uni.showToast({ title: `下载失败(${res.statusCode})`, icon: 'none' })
|
|
246
254
|
}
|
|
247
255
|
},
|
|
248
|
-
fail:
|
|
256
|
+
fail: err => {
|
|
249
257
|
uni.hideLoading()
|
|
250
258
|
console.error('[download] fail', err)
|
|
251
259
|
uni.showToast({ title: '下载失败', icon: 'none' })
|
|
@@ -271,6 +279,9 @@ console.log(props.buttons, '33333')
|
|
|
271
279
|
>
|
|
272
280
|
{{ props.config?.exportBtnTitle || '导出' }}
|
|
273
281
|
</wd-button>
|
|
282
|
+
<wd-button class="flex-1" type="primary" @click="emit('batchEdit')" :icon="props.batchEditing ? 'close' : 'edit'">
|
|
283
|
+
{{ props.batchEditing ? '取消批量操作' : props.config?.editBtnTitle || '批量操作' }}
|
|
284
|
+
</wd-button>
|
|
274
285
|
</view>
|
|
275
286
|
|
|
276
287
|
<!-- 导出范围选择 / 进度弹窗 -->
|
|
File without changes
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { defineOptions, onMounted, onUnmounted, ref } from 'vue'
|
|
2
|
+
import { computed, defineOptions, onMounted, onUnmounted, ref } from 'vue'
|
|
3
3
|
import { onLoad } from '@dcloudio/uni-app'
|
|
4
|
-
import { listData, pageConfig, pageKey } from '../../api/page'
|
|
4
|
+
import { actionDataSave, deleteData, listData, pageConfig, pageKey } from '../../api/page'
|
|
5
5
|
import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
6
|
-
import type { Config, EditButtonConfig, Entities } from '../../type'
|
|
6
|
+
import type { Config, EditButtonConfig, Entities, rowActions } from '../../type'
|
|
7
7
|
import Search from '../search/search.vue'
|
|
8
8
|
import ListTopButtons from '../list-top-buttons/list-top-buttons.vue'
|
|
9
9
|
import CardBotomButtons from '../card-botom-buttons/card-botom-buttons.vue'
|
|
10
|
+
import ActionPopup from '../action-popup/action-popup.vue'
|
|
10
11
|
import { generateHighResolutionID } from '../../utils/index'
|
|
11
12
|
import dayjs from 'dayjs/esm/index'
|
|
12
13
|
import productCard from '../product-card/product-card.vue'
|
|
13
14
|
import tabSearch from '../tab-search/tab-search.vue'
|
|
14
15
|
import { useEnums } from '../../composables/useEnumes'
|
|
16
|
+
import { useGlobalToast } from '../../composables/useGlobalToast'
|
|
17
|
+
import { useGlobalMessage } from '../../composables/useGlobalMessage'
|
|
15
18
|
|
|
16
19
|
defineOptions({
|
|
17
20
|
name: 'WuiList',
|
|
@@ -52,6 +55,45 @@ const props = withDefaults(
|
|
|
52
55
|
* 为 false 时:字段配置了 detail 按钮时仅显示「详情」文字,不可点击
|
|
53
56
|
*/
|
|
54
57
|
showDetailPopup?: boolean
|
|
58
|
+
/**
|
|
59
|
+
* 是否开启批量选择模式。开启后列表项左侧出现勾选框,
|
|
60
|
+
* 底部浮现批量操作条(全选 / 批量删除 / 批量执行动作)。默认 false。
|
|
61
|
+
*/
|
|
62
|
+
batchSelect?: boolean
|
|
63
|
+
/**
|
|
64
|
+
* 批量操作条上可执行的 action(复用 rowActions 结构)。
|
|
65
|
+
* 不传时默认取 config.actions。每个 action 会对选中的多条统一执行。
|
|
66
|
+
*/
|
|
67
|
+
batchActions?: rowActions[]
|
|
68
|
+
/**
|
|
69
|
+
* 批量操作条是否显示「批量删除」按钮。默认 true。
|
|
70
|
+
*/
|
|
71
|
+
showBatchDelete?: boolean
|
|
72
|
+
/**
|
|
73
|
+
* 批量删除成功后的回调,接收被删除的 codes 数组。
|
|
74
|
+
*/
|
|
75
|
+
batchDeleteSuccess?: (codes: string[]) => void
|
|
76
|
+
/**
|
|
77
|
+
* 内置批量预设动作(复用 rowActions 结构)。
|
|
78
|
+
* 当未传 batchActions 且列表配置里没有 action 时,作为兜底展示在批量操作条上。
|
|
79
|
+
* 每个动作的 id 需对应后端 action 接口;未填 id 时点击会给出提示。
|
|
80
|
+
*/
|
|
81
|
+
batchPresetActions?: rowActions[]
|
|
82
|
+
/**
|
|
83
|
+
* 顶部操作区是否显示「批量编辑」按钮。点击后进入勾选模式,
|
|
84
|
+
* 勾选多条后可统一弹出表单批量提交。默认 false。
|
|
85
|
+
*/
|
|
86
|
+
showBatchEdit?: boolean
|
|
87
|
+
/**
|
|
88
|
+
* 批量编辑的 action 配置(复用 rowActions,含 writes 表单字段)。
|
|
89
|
+
* 不传时使用内置默认(含 id 的编辑 action,可配合 batchEditSubmit 自定义提交流程)。
|
|
90
|
+
*/
|
|
91
|
+
batchEditAction?: rowActions
|
|
92
|
+
/**
|
|
93
|
+
* 批量编辑提交回调。不传时默认调用 actionDataSave(batchEditAction.id, codes, data)。
|
|
94
|
+
* 传入后可完全接管提交逻辑。
|
|
95
|
+
*/
|
|
96
|
+
batchEditSubmit?: (codes: string[], data: any) => void | Promise<void>
|
|
55
97
|
}>(),
|
|
56
98
|
{
|
|
57
99
|
// 操作按钮区域(编辑/删除/morebutns)默认显示
|
|
@@ -64,6 +106,12 @@ const props = withDefaults(
|
|
|
64
106
|
showSearch: true,
|
|
65
107
|
// 详情弹窗默认显示
|
|
66
108
|
showDetailPopup: true,
|
|
109
|
+
// 批量选择模式默认关闭
|
|
110
|
+
batchSelect: false,
|
|
111
|
+
// 批量操作条默认显示「批量删除」
|
|
112
|
+
showBatchDelete: true,
|
|
113
|
+
// 顶部「批量编辑」按钮默认不显示
|
|
114
|
+
showBatchEdit: false,
|
|
67
115
|
// 数据源 ID 默认为空
|
|
68
116
|
sourceId: '',
|
|
69
117
|
// 查询条件默认为空
|
|
@@ -121,6 +169,202 @@ const pageType = ref('')
|
|
|
121
169
|
const mainCode = ref('')
|
|
122
170
|
const queryKey = ref('') // 用于导出接口的列表查询 key
|
|
123
171
|
const addEvent = generateHighResolutionID() // 全局事件名称
|
|
172
|
+
const toast = useGlobalToast()
|
|
173
|
+
const message = useGlobalMessage()
|
|
174
|
+
|
|
175
|
+
// ===== 批量选择 =====
|
|
176
|
+
/** 已勾选记录的 code 集合 */
|
|
177
|
+
const selectedCodes = ref<Set<string>>(new Set())
|
|
178
|
+
/** 当前页是否全选 */
|
|
179
|
+
const allChecked = computed(() => {
|
|
180
|
+
const pageCodes = datas.value.map(item => item.code)
|
|
181
|
+
return pageCodes.length > 0 && pageCodes.every(code => selectedCodes.value.has(code))
|
|
182
|
+
})
|
|
183
|
+
/** 是否至少勾选了一条 */
|
|
184
|
+
const hasSelected = computed(() => selectedCodes.value.size > 0)
|
|
185
|
+
/** 是否处于勾选模式(常驻 batchSelect 或点「批量编辑」动态进入 selectMode) */
|
|
186
|
+
const inSelectMode = computed(() => props.batchSelect || selectMode.value)
|
|
187
|
+
/** 批量操作条是否显示:进入勾选模式即显示(未勾选时按钮点击会提示先勾选) */
|
|
188
|
+
const showBatchBar = computed(() => inSelectMode.value)
|
|
189
|
+
/** 顶部「批量编辑」点击后动态进入的勾选模式开关 */
|
|
190
|
+
const selectMode = ref(false)
|
|
191
|
+
/**
|
|
192
|
+
* 内置批量预设动作:当外部未传入 batchActions 且列表配置里没有 action 时兜底展示。
|
|
193
|
+
* id 为空表示尚未绑定后端 action,点击时会给出提示。
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* 批量 action 按钮列表:
|
|
197
|
+
* 1. 优先使用 props.batchActions(调用方显式指定);
|
|
198
|
+
* 2. 否则仅自动收集列表配置里的 customButtons / actions(去重),不混入 rowActions / ractions 与内置预设。
|
|
199
|
+
*/
|
|
200
|
+
const batchActionButtons = computed(() => {
|
|
201
|
+
if (props.batchActions && props.batchActions.length) {
|
|
202
|
+
return props.batchActions
|
|
203
|
+
}
|
|
204
|
+
const merged = [...(config.value.customButtons || []), ...(config.value.actions || [])]
|
|
205
|
+
const seen = new Set<string>()
|
|
206
|
+
return merged.filter(item => (seen.has(item.id) ? false : (seen.add(item.id), true)))
|
|
207
|
+
})
|
|
208
|
+
/** 已选 code 的逗号分隔字符串,供批量接口与弹窗透传 */
|
|
209
|
+
const selectedCodesStr = computed(() => Array.from(selectedCodes.value).join(','))
|
|
210
|
+
|
|
211
|
+
// 批量 action 弹窗(需要表单输入的 action)
|
|
212
|
+
const batchActionPopupShow = ref(false)
|
|
213
|
+
const batchActionFieldGroup = ref<Config>()
|
|
214
|
+
|
|
215
|
+
// ===== 批量编辑 =====
|
|
216
|
+
/** 批量编辑弹窗显隐 */
|
|
217
|
+
const batchEditPopupShow = ref(false)
|
|
218
|
+
/** 批量编辑表单字段组 */
|
|
219
|
+
const batchEditFieldGroup = ref<Config>()
|
|
220
|
+
/** 批量编辑 action(优先 props.batchEditAction,否则内置默认) */
|
|
221
|
+
const batchEditAction = computed<rowActions>(() => {
|
|
222
|
+
if (props.batchEditAction) return props.batchEditAction
|
|
223
|
+
return { id: '', title: '批量编辑', beforeExeConfirm: '', writes: config.value.fields || [], preposes: [] }
|
|
224
|
+
})
|
|
225
|
+
|
|
226
|
+
// 顶部「批量编辑」点击:进入勾选模式
|
|
227
|
+
function enterSelectMode() {
|
|
228
|
+
selectMode.value = true
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// 退出勾选模式并清空
|
|
232
|
+
function exitSelectMode() {
|
|
233
|
+
selectMode.value = false
|
|
234
|
+
clearSelection()
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// 顶部「批量操作」按钮:进入/退出勾选模式(按钮文本随之切换)
|
|
238
|
+
function toggleBatchEdit() {
|
|
239
|
+
if (selectMode.value) {
|
|
240
|
+
exitSelectMode()
|
|
241
|
+
} else {
|
|
242
|
+
enterSelectMode()
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// 点击底部操作条「批量编辑」:弹出表单,对选中的多条统一提交
|
|
247
|
+
function openBatchEdit() {
|
|
248
|
+
if (!hasSelected.value) {
|
|
249
|
+
toast.warning({ msg: '请先勾选要编辑的记录' })
|
|
250
|
+
return
|
|
251
|
+
}
|
|
252
|
+
if (!batchEditAction.value.writes || !batchEditAction.value.writes.length) {
|
|
253
|
+
toast.warning({ msg: '批量编辑表单字段未配置' })
|
|
254
|
+
return
|
|
255
|
+
}
|
|
256
|
+
batchEditFieldGroup.value = {
|
|
257
|
+
...config.value,
|
|
258
|
+
fields: batchEditAction.value.writes,
|
|
259
|
+
id: batchEditAction.value.id,
|
|
260
|
+
}
|
|
261
|
+
batchEditPopupShow.value = true
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// 单个记录勾选切换
|
|
265
|
+
function toggleSelect(code: string) {
|
|
266
|
+
const next = new Set(selectedCodes.value)
|
|
267
|
+
if (next.has(code)) {
|
|
268
|
+
next.delete(code)
|
|
269
|
+
} else {
|
|
270
|
+
next.add(code)
|
|
271
|
+
}
|
|
272
|
+
selectedCodes.value = next
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// 全选 / 取消全选当前页
|
|
276
|
+
function toggleSelectAll() {
|
|
277
|
+
if (allChecked.value) {
|
|
278
|
+
const next = new Set(selectedCodes.value)
|
|
279
|
+
datas.value.forEach(item => next.delete(item.code))
|
|
280
|
+
selectedCodes.value = next
|
|
281
|
+
} else {
|
|
282
|
+
const next = new Set(selectedCodes.value)
|
|
283
|
+
datas.value.forEach(item => next.add(item.code))
|
|
284
|
+
selectedCodes.value = next
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// 清空所有勾选
|
|
289
|
+
function clearSelection() {
|
|
290
|
+
selectedCodes.value = new Set()
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// 数据刷新后清理已不存在的勾选(可选,简单场景直接保留跨页选择)
|
|
294
|
+
// 批量删除
|
|
295
|
+
function batchDelete() {
|
|
296
|
+
if (!hasSelected.value) {
|
|
297
|
+
toast.warning({ msg: '请先勾选要删除的记录' })
|
|
298
|
+
return
|
|
299
|
+
}
|
|
300
|
+
const codes = Array.from(selectedCodes.value)
|
|
301
|
+
message.confirm({
|
|
302
|
+
msg: `确定要删除选中的 ${codes.length} 条记录吗?`,
|
|
303
|
+
title: '提示',
|
|
304
|
+
beforeConfirm: async ({ resolve }) => {
|
|
305
|
+
try {
|
|
306
|
+
const res = await deleteData(internalSourceId.value, codes.join(','))
|
|
307
|
+
if (res.status === 'success') {
|
|
308
|
+
toast.success({ msg: '删除成功!' })
|
|
309
|
+
props.batchDeleteSuccess?.(codes)
|
|
310
|
+
clearSelection()
|
|
311
|
+
Zpaging.value.reload()
|
|
312
|
+
}
|
|
313
|
+
message.close()
|
|
314
|
+
} catch (error) {
|
|
315
|
+
console.log(error)
|
|
316
|
+
} finally {
|
|
317
|
+
resolve(true)
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
})
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// 批量执行 action:需要表单输入则弹窗,否则直接提交
|
|
324
|
+
async function batchAction(item: rowActions) {
|
|
325
|
+
if (item?.path) {
|
|
326
|
+
uni.navigateTo({
|
|
327
|
+
url: item.path,
|
|
328
|
+
})
|
|
329
|
+
return
|
|
330
|
+
}
|
|
331
|
+
const codes = Array.from(selectedCodes.value)
|
|
332
|
+
if (!codes.length) {
|
|
333
|
+
toast.warning({ msg: '请先勾选要处理的记录' })
|
|
334
|
+
return
|
|
335
|
+
}
|
|
336
|
+
// 内置预设未绑定 action 时给出提示
|
|
337
|
+
if (!item.id) {
|
|
338
|
+
toast.warning({ msg: `「${item.title}」尚未配置 actionId,请在 customButtons 或 actions 中指定` })
|
|
339
|
+
return
|
|
340
|
+
}
|
|
341
|
+
if (item.writes && item.writes.length) {
|
|
342
|
+
// 需要输入字段:弹出表单
|
|
343
|
+
batchActionFieldGroup.value = {
|
|
344
|
+
...config.value,
|
|
345
|
+
fields: item.writes,
|
|
346
|
+
id: item.id,
|
|
347
|
+
}
|
|
348
|
+
batchActionPopupShow.value = true
|
|
349
|
+
return
|
|
350
|
+
}
|
|
351
|
+
// 无需输入:确认后直接提交
|
|
352
|
+
message.confirm({
|
|
353
|
+
msg: `确定对选中的 ${codes.length} 条记录执行「${item.title}」操作吗?`,
|
|
354
|
+
title: '提示',
|
|
355
|
+
success: async () => {
|
|
356
|
+
try {
|
|
357
|
+
await actionDataSave(item.id, codes.join(','), {})
|
|
358
|
+
toast.success({ msg: '操作成功!' })
|
|
359
|
+
clearSelection()
|
|
360
|
+
Zpaging.value.reload()
|
|
361
|
+
} catch (error: any) {
|
|
362
|
+
console.log(error)
|
|
363
|
+
toast.error(error?.data?.message || error?.message || '操作失败')
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
})
|
|
367
|
+
}
|
|
124
368
|
// 优先使用 props 传入的 sourceId,未传则走 onLoad 路由获取
|
|
125
369
|
const internalSourceId = ref(props.sourceId)
|
|
126
370
|
onLoad((option: any) => {
|
|
@@ -267,6 +511,8 @@ function tabSearchClick(data: any) {
|
|
|
267
511
|
:config="config"
|
|
268
512
|
:show-buttons="showTopButtons"
|
|
269
513
|
:query-key="queryKey"
|
|
514
|
+
:batch-editing="selectMode"
|
|
515
|
+
@batch-edit="toggleBatchEdit"
|
|
270
516
|
/>
|
|
271
517
|
</view>
|
|
272
518
|
<!-- 自定义tab搜索 -->
|
|
@@ -334,6 +580,11 @@ function tabSearchClick(data: any) {
|
|
|
334
580
|
:detail-button-handle="detailButtonHandle"
|
|
335
581
|
model="complex"
|
|
336
582
|
>
|
|
583
|
+
<template #select>
|
|
584
|
+
<view v-if="inSelectMode" @click.stop>
|
|
585
|
+
<wd-checkbox :model-value="selectedCodes.has(item.code)" @change="(e: any) => toggleSelect(item.code)" />
|
|
586
|
+
</view>
|
|
587
|
+
</template>
|
|
337
588
|
<template #buttons>
|
|
338
589
|
<slot name="cardBotomButtons" :data="item" />
|
|
339
590
|
<CardBotomButtons
|
|
@@ -360,8 +611,105 @@ function tabSearchClick(data: any) {
|
|
|
360
611
|
</foldCard2>
|
|
361
612
|
</view>
|
|
362
613
|
|
|
614
|
+
<!-- 底部批量操作条 -->
|
|
615
|
+
<view v-if="showBatchBar" class="batch-bar" @click.stop>
|
|
616
|
+
<view class="batch-bar__inner">
|
|
617
|
+
<view class="batch-bar__checkbox" @click.stop>
|
|
618
|
+
<wd-checkbox :model-value="allChecked" @change="toggleSelectAll">
|
|
619
|
+
<text class="batch-bar__label">全选</text>
|
|
620
|
+
</wd-checkbox>
|
|
621
|
+
</view>
|
|
622
|
+
<text class="batch-bar__count">已选 {{ selectedCodes.size }} 项</text>
|
|
623
|
+
<view class="batch-bar__actions">
|
|
624
|
+
<wd-button
|
|
625
|
+
v-for="subitem in batchActionButtons"
|
|
626
|
+
:key="subitem.id"
|
|
627
|
+
size="small"
|
|
628
|
+
plain
|
|
629
|
+
@click="batchAction(subitem)"
|
|
630
|
+
>
|
|
631
|
+
{{ subitem.title }}
|
|
632
|
+
</wd-button>
|
|
633
|
+
<wd-button v-if="config.buttons.includes('batchDelete')" size="small" type="danger" @click="batchDelete">
|
|
634
|
+
批量删除
|
|
635
|
+
</wd-button>
|
|
636
|
+
</view>
|
|
637
|
+
</view>
|
|
638
|
+
</view>
|
|
639
|
+
|
|
640
|
+
<!-- 批量 action 表单弹窗 -->
|
|
641
|
+
<ActionPopup
|
|
642
|
+
v-model:show="batchActionPopupShow"
|
|
643
|
+
:field-group="batchActionFieldGroup"
|
|
644
|
+
:codes="selectedCodesStr"
|
|
645
|
+
:zpaging="Zpaging"
|
|
646
|
+
:enum-column="enumColumn"
|
|
647
|
+
@success="clearSelection"
|
|
648
|
+
/>
|
|
649
|
+
|
|
650
|
+
<!-- 批量编辑表单弹窗:对选中的多条统一提交修改 -->
|
|
651
|
+
<ActionPopup
|
|
652
|
+
v-model:show="batchEditPopupShow"
|
|
653
|
+
:field-group="batchEditFieldGroup"
|
|
654
|
+
:codes="selectedCodesStr"
|
|
655
|
+
:zpaging="Zpaging"
|
|
656
|
+
:enum-column="enumColumn"
|
|
657
|
+
@success="exitSelectMode"
|
|
658
|
+
/>
|
|
659
|
+
|
|
363
660
|
<template #bottom>
|
|
364
661
|
<slot name="bottom" />
|
|
365
662
|
</template>
|
|
366
663
|
</z-paging>
|
|
367
664
|
</template>
|
|
665
|
+
|
|
666
|
+
<style scoped>
|
|
667
|
+
.batch-bar {
|
|
668
|
+
position: fixed;
|
|
669
|
+
left: 0;
|
|
670
|
+
right: 0;
|
|
671
|
+
bottom: 0;
|
|
672
|
+
z-index: 999;
|
|
673
|
+
padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
|
|
674
|
+
background: rgba(255, 255, 255, 0.98);
|
|
675
|
+
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
|
|
676
|
+
}
|
|
677
|
+
:global(.wot-theme-dark) .batch-bar {
|
|
678
|
+
background: rgba(28, 28, 30, 0.98);
|
|
679
|
+
}
|
|
680
|
+
.batch-bar__inner {
|
|
681
|
+
display: flex;
|
|
682
|
+
align-items: center;
|
|
683
|
+
gap: 12px;
|
|
684
|
+
overflow-x: auto;
|
|
685
|
+
/* 隐藏滚动条但保留横向滚动能力,按钮过多时可滑动 */
|
|
686
|
+
scrollbar-width: none;
|
|
687
|
+
}
|
|
688
|
+
.batch-bar__inner::-webkit-scrollbar {
|
|
689
|
+
display: none;
|
|
690
|
+
}
|
|
691
|
+
.batch-bar__checkbox {
|
|
692
|
+
flex: 0 0 auto;
|
|
693
|
+
white-space: nowrap;
|
|
694
|
+
}
|
|
695
|
+
.batch-bar__label {
|
|
696
|
+
display: inline-block;
|
|
697
|
+
min-width: 28px;
|
|
698
|
+
font-size: 14px;
|
|
699
|
+
color: inherit;
|
|
700
|
+
white-space: nowrap;
|
|
701
|
+
}
|
|
702
|
+
.batch-bar__count {
|
|
703
|
+
/* 不换行 + 不被挤压:按钮过多时可横向滚动 */
|
|
704
|
+
flex-shrink: 0;
|
|
705
|
+
white-space: nowrap;
|
|
706
|
+
font-size: 14px;
|
|
707
|
+
color: #888;
|
|
708
|
+
}
|
|
709
|
+
.batch-bar__actions {
|
|
710
|
+
display: flex;
|
|
711
|
+
align-items: center;
|
|
712
|
+
gap: 8px;
|
|
713
|
+
flex-shrink: 0;
|
|
714
|
+
}
|
|
715
|
+
</style>
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { defineOptions, onMounted, onUnmounted, ref } from 'vue'
|
|
3
|
+
import { onLoad } from '@dcloudio/uni-app'
|
|
4
|
+
import { listData, pageConfig, pageKey } from '../../api/page'
|
|
5
|
+
import foldCard2 from '../fold-card2/fold-card2.vue'
|
|
6
|
+
import type { Config, EditButtonConfig, Entities } from '../../type'
|
|
7
|
+
import Search from '../search/search.vue'
|
|
8
|
+
import ListTopButtons from '../list-top-buttons/list-top-buttons.vue'
|
|
9
|
+
import CardBotomButtons from '../card-botom-buttons/card-botom-buttons.vue'
|
|
10
|
+
import { generateHighResolutionID } from '../../utils/index'
|
|
11
|
+
import dayjs from 'dayjs/esm/index'
|
|
12
|
+
import productCard from '../product-card/product-card.vue'
|
|
13
|
+
import tabSearch from '../tab-search/tab-search.vue'
|
|
14
|
+
import { useEnums } from '../../composables/useEnumes'
|
|
15
|
+
|
|
16
|
+
defineOptions({
|
|
17
|
+
name: 'WuiList',
|
|
18
|
+
})
|
|
19
|
+
const props = withDefaults(
|
|
20
|
+
defineProps<{
|
|
21
|
+
/** 数据源 ID,用于获取页面配置和列表数据 */
|
|
22
|
+
sourceId?: string
|
|
23
|
+
/** 查询条件字符串,用于列表数据筛选 */
|
|
24
|
+
query?: string
|
|
25
|
+
isShowAction?: boolean
|
|
26
|
+
detailButtonHandle?: (data: Entities) => void
|
|
27
|
+
/**
|
|
28
|
+
* 折叠前展示的数据条数,透传给 foldCard。
|
|
29
|
+
* 不传时默认 2;传 0 表示只显示标题、不展示任何字段数据。
|
|
30
|
+
*/
|
|
31
|
+
collapseNum?: number
|
|
32
|
+
/**
|
|
33
|
+
* 顶部操作按钮区(新增等)是否显示,默认显示。
|
|
34
|
+
*/
|
|
35
|
+
showTopButtons?: boolean
|
|
36
|
+
/**
|
|
37
|
+
* 标题旁标签(labelTag)是否展示,由父级读取控制,默认不展示。
|
|
38
|
+
*/
|
|
39
|
+
showLabel?: boolean
|
|
40
|
+
/**
|
|
41
|
+
* 自定义编辑按钮配置:动态文字 / 显隐 / 点击行为。
|
|
42
|
+
* 不传时走组件内置的「编辑」按钮逻辑。
|
|
43
|
+
*/
|
|
44
|
+
editButtonConfig?: EditButtonConfig
|
|
45
|
+
/**
|
|
46
|
+
* 是否显示搜索区域,默认显示。
|
|
47
|
+
*/
|
|
48
|
+
showSearch?: boolean
|
|
49
|
+
/**
|
|
50
|
+
* 是否显示详情弹窗(detailPopup)。默认 true。
|
|
51
|
+
* 为 true 时:字段配置了 detail 按钮时显示可点击的 detailPopup 弹窗
|
|
52
|
+
* 为 false 时:字段配置了 detail 按钮时仅显示「详情」文字,不可点击
|
|
53
|
+
*/
|
|
54
|
+
showDetailPopup?: boolean
|
|
55
|
+
}>(),
|
|
56
|
+
{
|
|
57
|
+
// 操作按钮区域(编辑/删除/morebutns)默认显示
|
|
58
|
+
isShowAction: true,
|
|
59
|
+
// 顶部操作按钮区默认显示
|
|
60
|
+
showTopButtons: true,
|
|
61
|
+
// 标题旁标签默认不展示
|
|
62
|
+
showLabel: false,
|
|
63
|
+
// 搜索区域默认显示
|
|
64
|
+
showSearch: true,
|
|
65
|
+
// 详情弹窗默认显示
|
|
66
|
+
showDetailPopup: true,
|
|
67
|
+
// 数据源 ID 默认为空
|
|
68
|
+
sourceId: '',
|
|
69
|
+
// 查询条件默认为空
|
|
70
|
+
query: '',
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
const Zpaging = ref<any>(null)
|
|
75
|
+
const config = ref<Config>({
|
|
76
|
+
buttons: [],
|
|
77
|
+
columns: [],
|
|
78
|
+
primaryColumn: {
|
|
79
|
+
sourceId: '',
|
|
80
|
+
controlType: '',
|
|
81
|
+
mstrucId: '',
|
|
82
|
+
extControlType: '',
|
|
83
|
+
},
|
|
84
|
+
primaryCriterion: {
|
|
85
|
+
hidden: false,
|
|
86
|
+
disabled: false,
|
|
87
|
+
defaultValue: '',
|
|
88
|
+
transDefaultValue: '',
|
|
89
|
+
required: false,
|
|
90
|
+
controlType: '',
|
|
91
|
+
sourceId: '',
|
|
92
|
+
mstrucId: '',
|
|
93
|
+
extControlType: '',
|
|
94
|
+
},
|
|
95
|
+
secondColumn: {
|
|
96
|
+
sourceId: '',
|
|
97
|
+
controlType: '',
|
|
98
|
+
mstrucId: '',
|
|
99
|
+
extControlType: '',
|
|
100
|
+
},
|
|
101
|
+
criteria: [],
|
|
102
|
+
id: '',
|
|
103
|
+
fields: [],
|
|
104
|
+
title: '',
|
|
105
|
+
type: '',
|
|
106
|
+
pointSourceId: '',
|
|
107
|
+
mstrucId: '',
|
|
108
|
+
relationNames: [],
|
|
109
|
+
readOnly: false,
|
|
110
|
+
displayConfig: [],
|
|
111
|
+
showType: 'table',
|
|
112
|
+
buttonDeleteAction: {},
|
|
113
|
+
buttonEditAction: {},
|
|
114
|
+
})
|
|
115
|
+
const { getEnums, enumColumn } = useEnums({ config })
|
|
116
|
+
const datas = ref<Entities[]>([])
|
|
117
|
+
const pageTitle = ref('')
|
|
118
|
+
const searchData = ref('')
|
|
119
|
+
const tabSearchData = ref('')
|
|
120
|
+
const pageType = ref('')
|
|
121
|
+
const mainCode = ref('')
|
|
122
|
+
const queryKey = ref('') // 用于导出接口的列表查询 key
|
|
123
|
+
const addEvent = generateHighResolutionID() // 全局事件名称
|
|
124
|
+
// 优先使用 props 传入的 sourceId,未传则走 onLoad 路由获取
|
|
125
|
+
const internalSourceId = ref(props.sourceId)
|
|
126
|
+
onLoad((option: any) => {
|
|
127
|
+
// 如果 props 没传 sourceId,则从路由参数获取
|
|
128
|
+
if (!internalSourceId.value) {
|
|
129
|
+
internalSourceId.value = option.sourceId
|
|
130
|
+
}
|
|
131
|
+
pageTitle.value = option.title
|
|
132
|
+
pageType.value = option.pageType
|
|
133
|
+
mainCode.value = option.mainCode || ''
|
|
134
|
+
uni.setNavigationBarTitle({
|
|
135
|
+
title: option.title,
|
|
136
|
+
})
|
|
137
|
+
getPageConfig()
|
|
138
|
+
})
|
|
139
|
+
onMounted(async () => {
|
|
140
|
+
console.log('mounted')
|
|
141
|
+
// 监听添加成功的事件
|
|
142
|
+
uni.$on(addEvent, async () => {
|
|
143
|
+
Zpaging.value.reload()
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
// 在组件卸载时解绑全局事件
|
|
147
|
+
onUnmounted(() => {
|
|
148
|
+
console.log(`${pageTitle.value}页面卸载`)
|
|
149
|
+
uni.$off(addEvent)
|
|
150
|
+
})
|
|
151
|
+
async function getPageConfig() {
|
|
152
|
+
try {
|
|
153
|
+
const res = await pageConfig(internalSourceId.value)
|
|
154
|
+
if (res.ltmplConfig) {
|
|
155
|
+
config.value = res.ltmplConfig
|
|
156
|
+
console.log('config', config.value)
|
|
157
|
+
getEnums()
|
|
158
|
+
}
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.log(error)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// @query所绑定的方法不要自己调用!!需要刷新列表数据时,只需要调用this.$refs.paging.reload()即可
|
|
165
|
+
async function queryList(pageNo: number, pageSize: number) {
|
|
166
|
+
// 此处请求仅为演示,请替换为自己项目中的请求
|
|
167
|
+
// request.queryList({ pageNo,pageSize }).then(res => {
|
|
168
|
+
// 将请求结果通过complete传给z-paging处理,同时也代表请求结束,这一行必须调用
|
|
169
|
+
// paging.value.complete(res.data.list);
|
|
170
|
+
// }).catch(res => {
|
|
171
|
+
// 如果请求失败写paging.value.complete(false);
|
|
172
|
+
// 注意,每次都需要在catch中写这句话很麻烦,z-paging提供了方案可以全局统一处理
|
|
173
|
+
// 在底层的网络请求抛出异常时,写uni.$emit('z-paging-error-emit');即可
|
|
174
|
+
// paging.value.complete(false);
|
|
175
|
+
// paging.value.reload() // 手动触发加载
|
|
176
|
+
// })
|
|
177
|
+
let qre = tabSearchData.value || searchData.value
|
|
178
|
+
// 合并 props.query(父级传入的查询条件)
|
|
179
|
+
if (props.query) {
|
|
180
|
+
qre = qre ? `${qre}&${props.query}` : props.query
|
|
181
|
+
}
|
|
182
|
+
if (config.value.defaultCriteriaValue) {
|
|
183
|
+
for (const key in config.value.defaultCriteriaValue) {
|
|
184
|
+
if (Object.prototype.hasOwnProperty.call(config.value.defaultCriteriaValue, key)) {
|
|
185
|
+
let element = config.value.defaultCriteriaValue[key]
|
|
186
|
+
// $$currentD 占位符转换为当日时间(年-月-日),没有值则传空字符串
|
|
187
|
+
if (element === '$$currentD') {
|
|
188
|
+
element = dayjs().format('YYYY-MM-DD')
|
|
189
|
+
} else if (element === undefined || element === null) {
|
|
190
|
+
element = ''
|
|
191
|
+
}
|
|
192
|
+
if (!qre.includes(key)) {
|
|
193
|
+
qre = `${qre}&${key}=${element}`
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
try {
|
|
200
|
+
console.log('qre', qre)
|
|
201
|
+
const res = await pageKey(internalSourceId.value, mainCode.value, qre) // 获取key
|
|
202
|
+
const data = await listData(res.key, pageNo, pageSize) // 获取数据
|
|
203
|
+
// 缓存最新一次的 queryKey,给顶部「导出」接口使用
|
|
204
|
+
queryKey.value = res.key || res.data?.key || ''
|
|
205
|
+
// const count = await getPageTotal(key.data?.key)// 获取总数
|
|
206
|
+
Zpaging.value.complete(data.entities)
|
|
207
|
+
|
|
208
|
+
// emits('loadData', data.data.entities)
|
|
209
|
+
} catch (error) {
|
|
210
|
+
if (Zpaging.value) {
|
|
211
|
+
Zpaging.value.complete(false)
|
|
212
|
+
}
|
|
213
|
+
console.error(error)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function submitSearch(data: any) {
|
|
218
|
+
searchData.value = data
|
|
219
|
+
// for (const key in data) {
|
|
220
|
+
// if (Object.prototype.hasOwnProperty.call(data, key)) {
|
|
221
|
+
// const element = data[key]
|
|
222
|
+
// searchData.value = `${searchData.value}&c_${key}=${element}`
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
Zpaging.value.reload()
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// tabSearch点击事件
|
|
229
|
+
function tabSearchClick(data: any) {
|
|
230
|
+
if (searchData.value) {
|
|
231
|
+
tabSearchData.value = `${searchData.value}&${data}`
|
|
232
|
+
} else {
|
|
233
|
+
tabSearchData.value = data
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
Zpaging.value.reload()
|
|
237
|
+
}
|
|
238
|
+
</script>
|
|
239
|
+
|
|
240
|
+
<template>
|
|
241
|
+
<z-paging
|
|
242
|
+
ref="Zpaging"
|
|
243
|
+
v-model="datas"
|
|
244
|
+
:default-page-size="5"
|
|
245
|
+
:show-loading-more-when-reload="true"
|
|
246
|
+
@query="queryList"
|
|
247
|
+
>
|
|
248
|
+
<template #top>
|
|
249
|
+
<slot name="top" />
|
|
250
|
+
<Search
|
|
251
|
+
v-if="showSearch"
|
|
252
|
+
:main-code="mainCode"
|
|
253
|
+
:enum-column="enumColumn"
|
|
254
|
+
:criteria="config.criteria"
|
|
255
|
+
:primary-criterion="config.primaryCriterion"
|
|
256
|
+
:split2-tab-criterias="config.split2TabCriterias"
|
|
257
|
+
@submit="submitSearch"
|
|
258
|
+
/>
|
|
259
|
+
<view>
|
|
260
|
+
<ListTopButtons
|
|
261
|
+
:add-event="addEvent"
|
|
262
|
+
:main-code="mainCode"
|
|
263
|
+
:buttons="config.buttons"
|
|
264
|
+
:source-id="internalSourceId"
|
|
265
|
+
:page-title="pageTitle"
|
|
266
|
+
:page-type="pageType"
|
|
267
|
+
:config="config"
|
|
268
|
+
:show-buttons="showTopButtons"
|
|
269
|
+
:query-key="queryKey"
|
|
270
|
+
/>
|
|
271
|
+
</view>
|
|
272
|
+
<!-- 自定义tab搜索 -->
|
|
273
|
+
<view v-if="config.split2TabCriterias">
|
|
274
|
+
<tabSearch :split2-tab-criterias="config.split2TabCriterias" :enums="enumColumn" @click="tabSearchClick" />
|
|
275
|
+
</view>
|
|
276
|
+
</template>
|
|
277
|
+
<view v-if="config.showType === 'cardList'">
|
|
278
|
+
<productCard
|
|
279
|
+
v-for="(item, index) in datas"
|
|
280
|
+
:key="item.code"
|
|
281
|
+
:index="index"
|
|
282
|
+
:enum-column="enumColumn"
|
|
283
|
+
:collapse-num="5"
|
|
284
|
+
:source-id="internalSourceId"
|
|
285
|
+
:groups="config"
|
|
286
|
+
:data="item"
|
|
287
|
+
:columns="config.columns"
|
|
288
|
+
:primary-column="config.primaryColumn"
|
|
289
|
+
:second-column="config.secondColumn"
|
|
290
|
+
:label-column="config.labelColumn"
|
|
291
|
+
model="complex"
|
|
292
|
+
:card-show-cols="config.cardShowCols"
|
|
293
|
+
:main-picture="config.mainPicture"
|
|
294
|
+
>
|
|
295
|
+
<template #buttons>
|
|
296
|
+
<slot name="cardBotomButtons" :data="item" />
|
|
297
|
+
<CardBotomButtons
|
|
298
|
+
:primary-column="config.primaryColumn"
|
|
299
|
+
:add-event="addEvent"
|
|
300
|
+
:detail-button-handle="detailButtonHandle"
|
|
301
|
+
:zpaging="Zpaging"
|
|
302
|
+
:enum-column="enumColumn"
|
|
303
|
+
:actions="config.actions"
|
|
304
|
+
:row-actions="config.rowActions"
|
|
305
|
+
:ractions="config.ractions"
|
|
306
|
+
:source-id="internalSourceId"
|
|
307
|
+
:item="config"
|
|
308
|
+
:code="item.code"
|
|
309
|
+
:page-type="pageType"
|
|
310
|
+
:data="item"
|
|
311
|
+
:is-show-action="isShowAction"
|
|
312
|
+
:copy-mode="config.copyMode"
|
|
313
|
+
:edit-button-config="editButtonConfig"
|
|
314
|
+
/>
|
|
315
|
+
</template>
|
|
316
|
+
</productCard>
|
|
317
|
+
</view>
|
|
318
|
+
<view v-else>
|
|
319
|
+
<foldCard2
|
|
320
|
+
v-for="(item, index) in datas"
|
|
321
|
+
:key="item.code"
|
|
322
|
+
:index="index"
|
|
323
|
+
:enum-column="enumColumn"
|
|
324
|
+
:collapse-num="collapseNum"
|
|
325
|
+
:source-id="internalSourceId"
|
|
326
|
+
:groups="config"
|
|
327
|
+
:data="item"
|
|
328
|
+
:columns="config.columns"
|
|
329
|
+
:primary-column="config.primaryColumn"
|
|
330
|
+
:second-column="config.secondColumn"
|
|
331
|
+
:label-column="config.labelColumn"
|
|
332
|
+
:show-label="showLabel"
|
|
333
|
+
:show-detail-popup="showDetailPopup"
|
|
334
|
+
:detail-button-handle="detailButtonHandle"
|
|
335
|
+
model="complex"
|
|
336
|
+
>
|
|
337
|
+
<template #buttons>
|
|
338
|
+
<slot name="cardBotomButtons" :data="item" />
|
|
339
|
+
<CardBotomButtons
|
|
340
|
+
:primary-column="config.primaryColumn"
|
|
341
|
+
:add-event="addEvent"
|
|
342
|
+
:detail-button-handle="detailButtonHandle"
|
|
343
|
+
:zpaging="Zpaging"
|
|
344
|
+
:enum-column="enumColumn"
|
|
345
|
+
:actions="config.actions"
|
|
346
|
+
:row-actions="config.rowActions"
|
|
347
|
+
:ractions="config.ractions"
|
|
348
|
+
:source-id="internalSourceId"
|
|
349
|
+
:item="config"
|
|
350
|
+
:code="item.code"
|
|
351
|
+
:page-type="pageType"
|
|
352
|
+
:data="item"
|
|
353
|
+
:button-delete-action="config.buttonDeleteAction"
|
|
354
|
+
:button-edit-action="config.buttonEditAction"
|
|
355
|
+
:is-show-action="isShowAction"
|
|
356
|
+
:copy-mode="config.copyMode"
|
|
357
|
+
:edit-button-config="editButtonConfig"
|
|
358
|
+
/>
|
|
359
|
+
</template>
|
|
360
|
+
</foldCard2>
|
|
361
|
+
</view>
|
|
362
|
+
|
|
363
|
+
<template #bottom>
|
|
364
|
+
<slot name="bottom" />
|
|
365
|
+
</template>
|
|
366
|
+
</z-paging>
|
|
367
|
+
</template>
|
|
@@ -443,7 +443,7 @@ onMounted(() => {
|
|
|
443
443
|
|
|
444
444
|
// 文本容器
|
|
445
445
|
.menu-text-wrapper {
|
|
446
|
-
|
|
446
|
+
margin-top: 20rpx;
|
|
447
447
|
text-align: center;
|
|
448
448
|
display: flex;
|
|
449
449
|
flex-direction: column;
|
|
@@ -673,4 +673,7 @@ onMounted(() => {
|
|
|
673
673
|
:deep(.wd-grid-item__content) {
|
|
674
674
|
background: transparent;
|
|
675
675
|
}
|
|
676
|
+
:deep(.wd-grid-item) {
|
|
677
|
+
height: auto !important;
|
|
678
|
+
}
|
|
676
679
|
</style>
|
package/package.json
CHANGED
package/type.ts
CHANGED
|
@@ -38,6 +38,7 @@ export interface rowActions {
|
|
|
38
38
|
title: string
|
|
39
39
|
writes: Fields[]
|
|
40
40
|
preposes: Fields[]
|
|
41
|
+
path?: string
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
// 列表页面配置
|
|
@@ -48,6 +49,7 @@ export interface Config extends Groups {
|
|
|
48
49
|
secondColumn: Columns
|
|
49
50
|
criteria: Fields[]
|
|
50
51
|
labelColumn?: Columns
|
|
52
|
+
customButtons?: rowActions[]
|
|
51
53
|
rowActions?: rowActions[]
|
|
52
54
|
ractions?: rowActions[]
|
|
53
55
|
actions?: rowActions[]
|