@skyfox2000/webui 1.3.19 → 1.3.21

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.
Files changed (136) hide show
  1. package/lib/AceEditor.d.ts +1 -0
  2. package/lib/BasicLayout.d.ts +1 -0
  3. package/lib/Error403.d.ts +1 -0
  4. package/lib/Error404.d.ts +1 -0
  5. package/lib/ExcelForm.d.ts +1 -0
  6. package/lib/MenuLayout.d.ts +1 -0
  7. package/lib/UploadForm.d.ts +1 -0
  8. package/lib/assets/modules/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  9. package/lib/assets/modules/baseLayout-Bz3oRE5o.js +79 -0
  10. package/lib/assets/modules/file-upload-CmnCEJze.js +204 -0
  11. package/lib/assets/modules/index-CAqiqqdd.js +380 -0
  12. package/lib/assets/modules/index-CvQ24Mzh.js +112 -0
  13. package/lib/assets/modules/index-D0njzOzQ.js +109 -0
  14. package/lib/assets/modules/menuTabs-NVgroqVO.js +671 -0
  15. package/lib/assets/modules/toolIcon-BuqRfX4F.js +50 -0
  16. package/lib/assets/modules/uploadList-B6MIYOtN.js +2411 -0
  17. package/lib/assets/modules/uploadList-KG6kpOaY.js +382 -0
  18. package/lib/components/common/alert/index.vue.d.ts +13 -0
  19. package/lib/components/common/button/index.vue.d.ts +41 -0
  20. package/lib/components/common/icon/appicon.vue.d.ts +11 -0
  21. package/lib/components/common/icon/fullscreen.vue.d.ts +3 -0
  22. package/lib/components/common/icon/helper.vue.d.ts +23 -0
  23. package/lib/components/common/icon/index.vue.d.ts +243 -0
  24. package/lib/components/common/icon/layoutIcon.vue.d.ts +43 -0
  25. package/lib/components/common/icon/projectIcon.vue.d.ts +59 -0
  26. package/lib/components/common/icon/toolIcon.vue.d.ts +43 -0
  27. package/lib/components/common/index.d.ts +22 -0
  28. package/lib/components/common/loading/index.vue.d.ts +3 -0
  29. package/lib/components/common/tooltip/index.vue.d.ts +21 -0
  30. package/lib/components/content/dialog/index.vue.d.ts +35 -0
  31. package/lib/components/content/drawer/index.vue.d.ts +28 -0
  32. package/lib/components/content/form/formItem.vue.d.ts +28 -0
  33. package/lib/components/content/form/index.vue.d.ts +25 -0
  34. package/lib/components/content/index.d.ts +22 -0
  35. package/lib/components/content/search/index.vue.d.ts +32 -0
  36. package/lib/components/content/search/searchItem.vue.d.ts +23 -0
  37. package/lib/components/content/table/index.vue.d.ts +127 -0
  38. package/lib/components/content/table/tableOperate.vue.d.ts +18 -0
  39. package/lib/components/content/toolbar/icontool.vue.d.ts +7 -0
  40. package/lib/components/content/toolbar/index.vue.d.ts +18 -0
  41. package/lib/components/content/tree/index.vue.d.ts +46 -0
  42. package/lib/components/form/aceEditor/aceConfig.d.ts +8 -0
  43. package/lib/components/form/autoComplete/index.vue.d.ts +101 -0
  44. package/lib/components/form/cascader/index.vue.d.ts +80 -0
  45. package/lib/components/form/checkbox/index.vue.d.ts +100 -0
  46. package/lib/components/form/datePicker/index.vue.d.ts +6 -0
  47. package/lib/components/form/index.d.ts +41 -0
  48. package/lib/components/form/input/index.vue.d.ts +29 -0
  49. package/lib/components/form/input/inputIcon.vue.d.ts +10 -0
  50. package/lib/components/form/input/inputNumber.vue.d.ts +3 -0
  51. package/lib/components/form/input/inputPassword.vue.d.ts +3 -0
  52. package/lib/components/form/propEditor/index.vue.d.ts +15 -0
  53. package/lib/components/form/radio/index.vue.d.ts +105 -0
  54. package/lib/components/form/radio/radioStatus.vue.d.ts +31 -0
  55. package/lib/components/form/rangePicker/index.vue.d.ts +16 -0
  56. package/lib/components/form/select/index.vue.d.ts +119 -0
  57. package/lib/components/form/switch/index.vue.d.ts +76 -0
  58. package/lib/components/form/textarea/index.vue.d.ts +3 -0
  59. package/lib/components/form/timePicker/index.vue.d.ts +6 -0
  60. package/lib/components/form/transfer/index.vue.d.ts +38 -0
  61. package/lib/components/form/transfer/transferTable.vue.d.ts +38 -0
  62. package/lib/components/form/treeSelect/index.vue.d.ts +47 -0
  63. package/lib/components/form/upload/uploadList.vue.d.ts +488 -0
  64. package/lib/components/index.d.ts +4 -0
  65. package/lib/components/layout/breadcrumb/index.vue.d.ts +3 -0
  66. package/lib/components/layout/content/index.vue.d.ts +22 -0
  67. package/lib/components/layout/datetime/index.vue.d.ts +3 -0
  68. package/lib/components/layout/header/headerExits.vue.d.ts +3 -0
  69. package/lib/components/layout/header/index.vue.d.ts +3 -0
  70. package/lib/components/layout/header/user.vue.d.ts +3 -0
  71. package/lib/components/layout/index.d.ts +14 -0
  72. package/lib/components/layout/menu/index.vue.d.ts +6 -0
  73. package/lib/components/layout/menu/menuTabs.vue.d.ts +3 -0
  74. package/lib/const/options.d.ts +32 -0
  75. package/lib/directives/enter-submit.d.ts +4 -0
  76. package/lib/directives/index.d.ts +2 -0
  77. package/lib/directives/permission.d.ts +5 -0
  78. package/lib/es/AceEditor/index.js +167 -0
  79. package/lib/es/BasicLayout/index.js +54 -0
  80. package/lib/es/Error403/index.js +39 -0
  81. package/lib/es/Error404/index.js +39 -0
  82. package/lib/es/ExcelForm/index.js +491 -0
  83. package/lib/es/MenuLayout/index.js +54 -0
  84. package/lib/es/UploadForm/index.js +110 -0
  85. package/lib/index.d.ts +46 -0
  86. package/lib/router/index.d.ts +15 -0
  87. package/lib/stores/appInfo.d.ts +31 -0
  88. package/lib/stores/hostInfo.d.ts +11 -0
  89. package/lib/stores/pageInfo.d.ts +18 -0
  90. package/lib/stores/pinia.d.ts +3 -0
  91. package/lib/stores/settingInfo.d.ts +8 -0
  92. package/lib/stores/userInfo.d.ts +25 -0
  93. package/lib/typings/data.d.ts +80 -0
  94. package/lib/typings/form.d.ts +206 -0
  95. package/lib/typings/menu.d.ts +7 -0
  96. package/lib/typings/option.d.ts +209 -0
  97. package/lib/typings/page.d.ts +70 -0
  98. package/lib/typings/table.d.ts +181 -0
  99. package/lib/typings/tools.d.ts +130 -0
  100. package/lib/typings/tree.d.ts +76 -0
  101. package/lib/typings/upload.d.ts +161 -0
  102. package/lib/typings/urls.d.ts +69 -0
  103. package/lib/utils/cache.d.ts +23 -0
  104. package/lib/utils/data.d.ts +6 -0
  105. package/lib/utils/download.d.ts +6 -0
  106. package/lib/utils/eventbus.d.ts +16 -0
  107. package/lib/utils/excel-preview.d.ts +24 -0
  108. package/lib/utils/excel-view.d.ts +25 -0
  109. package/lib/utils/export-table.d.ts +12 -0
  110. package/lib/utils/file-upload.d.ts +17 -0
  111. package/lib/utils/form-csv.d.ts +18 -0
  112. package/lib/utils/form-excel.d.ts +36 -0
  113. package/lib/utils/form-validate.d.ts +29 -0
  114. package/lib/utils/form.d.ts +9 -0
  115. package/lib/utils/icon-loader.d.ts +125 -0
  116. package/lib/utils/isEmpty.d.ts +1 -0
  117. package/lib/utils/main-openapis.d.ts +8 -0
  118. package/lib/utils/menu.d.ts +6 -0
  119. package/lib/utils/options.d.ts +7 -0
  120. package/lib/utils/page.d.ts +30 -0
  121. package/lib/utils/table.d.ts +21 -0
  122. package/lib/utils/tools.d.ts +18 -0
  123. package/lib/utils/tree.d.ts +3 -0
  124. package/lib/vite-env.d.ts +8 -0
  125. package/lib/webui.css +1 -0
  126. package/lib/webui.es.js +2345 -0
  127. package/package.json +1 -1
  128. package/src/components/content/dialog/excelForm.vue +1 -1
  129. package/src/components/content/form/formItem.vue +5 -0
  130. package/src/typings/form.d.ts +1 -1
  131. package/src/typings/tree.d.ts +4 -0
  132. package/src/utils/form.ts +7 -1
  133. package/src/utils/table.ts +7 -2
  134. package/src/utils/tree.ts +4 -2
  135. package/.cursorignore +0 -8
  136. package/scripts/userInput.py +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.3.19",
3
+ "version": "1.3.21",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -413,7 +413,7 @@ const dialogSave = async (uploadFile: UploadFile) => {
413
413
 
414
414
  if (result?.status === ResStatus.SUCCESS) {
415
415
  if (excelCtrl.afterSave) {
416
- excelCtrl.afterSave();
416
+ excelCtrl.afterSave(result);
417
417
  }
418
418
  excelCtrl.visible.value = false;
419
419
  }
@@ -81,6 +81,11 @@ const required = computed(() => {
81
81
  errInfo.value.msg = `规则 \`${props.rule}\` 不存在,请检查代码!`;
82
82
  return true;
83
83
  }
84
+ if (!rule.required) {
85
+ // 如果rule.required为false,则表示该字段是可选字段,不需要验证
86
+ errInfo.value.errClass = '';
87
+ errInfo.value.msg = '';
88
+ }
84
89
  return rule.required ?? true;
85
90
  });
86
91
 
@@ -77,7 +77,7 @@ export type EditorControl<T> = EditorControlOption & {
77
77
  * @param editorCtrl 表单配置数据
78
78
  * @param pageCtrl 页面控制器
79
79
  */
80
- afterSave?: () => void | undefined;
80
+ afterSave?: (result: ApiResponse<any>) => void | undefined;
81
81
  /**
82
82
  * 表单数据
83
83
  * - Model对象
@@ -70,4 +70,8 @@ export type TreeControl = TreeControlOption & {
70
70
  * 是否正在加载中
71
71
  */
72
72
  isTreeLoading: Ref<boolean>;
73
+ /**
74
+ * 表格数据加载后回调
75
+ */
76
+ afterLoad?: (result: TreeNode[] | null) => void;
73
77
  };
package/src/utils/form.ts CHANGED
@@ -95,7 +95,7 @@ export const saveForm = async <T>(editorCtrl: EditorControl<T>): Promise<void> =
95
95
  }
96
96
 
97
97
  if (editorCtrl.afterSave) {
98
- editorCtrl.afterSave();
98
+ editorCtrl.afterSave(result);
99
99
  }
100
100
  if (editorCtrl!.autoClose !== false) {
101
101
  editorCtrl!.visible.value = false;
@@ -128,8 +128,14 @@ export const saveForm = async <T>(editorCtrl: EditorControl<T>): Promise<void> =
128
128
  }
129
129
  message.error(`保存失败!数据 \`${fieldValue}\` 已存在!`);
130
130
  } else message.error(result?.msg ?? '保存失败!');
131
+ if (editorCtrl.afterSave) {
132
+ editorCtrl.afterSave(result);
133
+ }
131
134
  } else {
132
135
  message.error(result?.msg ?? '保存失败!');
136
+ if (editorCtrl.afterSave) {
137
+ editorCtrl.afterSave(result);
138
+ }
133
139
  }
134
140
  });
135
141
  };
@@ -140,14 +140,19 @@ export const gridQueryFind = <T>(gridCtrl: GridControl<T>): Promise<FindResult>
140
140
  total: gridCtrl.total.value,
141
141
  rows: result.data as unknown as Record<string, any>[],
142
142
  };
143
-
144
- if (gridCtrl.afterLoad) gridCtrl.afterLoad(findResult);
145
143
  }
144
+ if (gridCtrl.afterLoad) gridCtrl.afterLoad(findResult);
146
145
  return findResult;
147
146
  }
148
147
 
149
148
  gridCtrl.tableData.value = [];
150
149
  gridCtrl.total.value = 0;
150
+ if (gridCtrl.afterLoad) {
151
+ gridCtrl.afterLoad({
152
+ total: 0,
153
+ rows: [],
154
+ });
155
+ }
151
156
  return {
152
157
  total: 0,
153
158
  rows: [],
package/src/utils/tree.ts CHANGED
@@ -20,9 +20,11 @@ export const queryTree = (treeCtrl: TreeControl, params?: ReqParams): Promise<Tr
20
20
  },
21
21
  }).then((result: ApiResponse<TreeNode> | null) => {
22
22
  if (result?.status === ResStatus.SUCCESS) {
23
- treeCtrl.data.value = result.data as unknown as TreeNode[];
24
- return treeCtrl.data.value as unknown as TreeNode[];
23
+ treeCtrl.data.value = (result.data as unknown as TreeNode[]) || [];
24
+ if (treeCtrl.afterLoad) treeCtrl.afterLoad(treeCtrl.data.value);
25
+ return treeCtrl.data.value;
25
26
  }
27
+ if (treeCtrl.afterLoad) treeCtrl.afterLoad((result?.data as unknown as TreeNode[]) || []);
26
28
  return [];
27
29
  });
28
30
  };
package/.cursorignore DELETED
@@ -1,8 +0,0 @@
1
- # Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
2
- target/
3
- dist/
4
- lib/
5
- demo/
6
- mock
7
- node_modules/
8
- .vscode/
@@ -1,2 +0,0 @@
1
- # userInput.py
2
- user_input=input("Enter Prompt:")