@xizs/nuxt-antui 0.0.48 → 0.0.50

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]??''
@@ -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)}
@@ -254,7 +259,10 @@ export default defineComponent({
254
259
  })}
255
260
  <div class="flex gap-2">
256
261
  {props.form?.option?.search !== false && <AButton type="primary" onClick={()=>tableData.load()}>{$t('搜索')}</AButton>}
257
- {props.form?.option?.reset !== false && <AButton onClick={() => patch(metaForm,form.value,true)}>{$t('重置')}</AButton>}
262
+ {props.form?.option?.reset !== false && <AButton onClick={() =>{
263
+ patch(metaForm,form.value,true)
264
+ tableData.load()
265
+ }}>{$t('重置')}</AButton>}
258
266
  {props.form?.option?.export === true && <AButton type="primary" loading={exportLoading.value} onClick={()=>{
259
267
  exportLoading.value=true
260
268
  exportExcel(props.title??'导出', props.table.columns,async (page,pageSize)=>{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xizs/nuxt-antui",
3
3
  "type": "module",
4
- "version": "0.0.48",
4
+ "version": "0.0.50",
5
5
  "main": "./nuxt.config.ts",
6
6
  "scripts": {
7
7
  "dev": "nuxi dev .playground",