@xizs/nuxt-antui 0.0.47 → 0.0.49
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.
|
@@ -15,7 +15,7 @@ type TableFormLabelsItemType = {
|
|
|
15
15
|
|
|
16
16
|
export type TableParamsType = {
|
|
17
17
|
form?: {
|
|
18
|
-
labels?: TableFormLabelsItemType[],
|
|
18
|
+
labels?: (TableFormLabelsItemType|(()=>any))[],
|
|
19
19
|
'v-slots'?: Record<string, ()=>any>,
|
|
20
20
|
option?: {
|
|
21
21
|
search?: boolean,
|
|
@@ -170,7 +170,9 @@ export default defineComponent({
|
|
|
170
170
|
//form 初始化
|
|
171
171
|
const form = ref<any>({})
|
|
172
172
|
props.form?.labels?.filter(item=>item.filter==null||item.filter(item)).forEach((item) => {
|
|
173
|
-
|
|
173
|
+
if(typeof item =="function"){
|
|
174
|
+
item(form.value)
|
|
175
|
+
}
|
|
174
176
|
if (Array.isArray(item.key)) {
|
|
175
177
|
item.key.forEach((key,index) => {
|
|
176
178
|
form.value[key] = item.value?.[index]??''
|
|
@@ -217,9 +219,9 @@ export default defineComponent({
|
|
|
217
219
|
}
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
|
-
pagination.total = res.meta?.pagination?.total
|
|
221
|
-
pagination.pageSize = res.meta?.pagination?.per_page
|
|
222
|
-
pagination.page = res.meta?.pagination?.current_page
|
|
222
|
+
pagination.total = res.meta?.pagination?.total??0
|
|
223
|
+
pagination.pageSize = res.meta?.pagination?.per_page??res.meta?.pagination?.perPage??0
|
|
224
|
+
pagination.page = res.meta?.pagination?.current_page??res.meta?.pagination?.currentPage??1
|
|
223
225
|
props.attribute.reqData = res
|
|
224
226
|
props.attribute.metaTableData = JSON.parse(JSON.stringify(res.list))
|
|
225
227
|
props.attribute.tableData = res.list
|
|
@@ -246,6 +248,9 @@ export default defineComponent({
|
|
|
246
248
|
{/* {JSON.stringify(form.value)} */}
|
|
247
249
|
{props.form?.labels&&<AForm layout="inline gap-2">
|
|
248
250
|
{props.form?.labels?.map((item: TableFormLabelsItemType) => {
|
|
251
|
+
if(typeof item =="function"){
|
|
252
|
+
return item(form.value)
|
|
253
|
+
}
|
|
249
254
|
return (
|
|
250
255
|
<AFormItem label={$t(item.label)}>
|
|
251
256
|
{FormItems[item.is]?.(form.value,item)}
|