@skyfox2000/webui 1.2.8 → 1.2.10

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 (148) hide show
  1. package/package.json +1 -1
  2. package/scripts/userInput.py +2 -0
  3. package/src/components/common/index.ts +3 -0
  4. package/src/components/common/loading/index.vue +11 -0
  5. package/src/components/content/dialog/index.vue +15 -8
  6. package/src/components/content/dialog/uploadForm.vue +38 -79
  7. package/src/components/content/drawer/index.vue +26 -6
  8. package/src/components/content/form/formItem.vue +21 -5
  9. package/src/components/content/form/index.vue +4 -2
  10. package/src/components/content/search/searchItem.vue +1 -1
  11. package/src/components/form/autoComplete/index.vue +12 -4
  12. package/src/components/form/cascader/index.vue +1 -1
  13. package/src/components/form/datePicker/index.vue +1 -1
  14. package/src/components/form/index.ts +1 -0
  15. package/src/components/form/input/inputIcon.vue +1 -1
  16. package/src/components/form/propEditor/index.vue +113 -33
  17. package/src/components/form/select/index.vue +27 -17
  18. package/src/components/form/upload/uploadList.vue +174 -34
  19. package/src/components/index.ts +13 -1
  20. package/src/directives/permission.ts +2 -2
  21. package/src/index.ts +3 -1
  22. package/src/stores/userInfo.ts +28 -2
  23. package/src/typings/form.d.ts +18 -2
  24. package/src/typings/option.d.ts +16 -2
  25. package/src/typings/page.d.ts +1 -0
  26. package/src/utils/download.ts +1 -1
  27. package/src/utils/eventbus.ts +1 -1
  28. package/src/utils/file-upload.ts +75 -14
  29. package/src/utils/form-excel.ts +50 -1
  30. package/src/utils/form-validate.ts +18 -1
  31. package/src/utils/form.ts +3 -1
  32. package/src/utils/options.ts +38 -12
  33. package/lib/AceEditor.d.ts +0 -1
  34. package/lib/BasicLayout.d.ts +0 -1
  35. package/lib/Error403.d.ts +0 -1
  36. package/lib/Error404.d.ts +0 -1
  37. package/lib/ExcelForm.d.ts +0 -1
  38. package/lib/UploadForm.d.ts +0 -1
  39. package/lib/assets/modules/file-upload-CZO-pMJd.js +0 -176
  40. package/lib/assets/modules/form-excel-N-2OYqKv.js +0 -211
  41. package/lib/assets/modules/index-BnHnS9ug.js +0 -111
  42. package/lib/assets/modules/index-CTVMLeDF.js +0 -109
  43. package/lib/assets/modules/index-D9kzQ23e.js +0 -2213
  44. package/lib/assets/modules/menuTabs-BtOiocOC.js +0 -676
  45. package/lib/assets/modules/toolIcon-B9Mw9Ktm.js +0 -50
  46. package/lib/assets/modules/uploadList-B4LxzsC6.js +0 -210
  47. package/lib/components/common/button/index.vue.d.ts +0 -41
  48. package/lib/components/common/icon/appicon.vue.d.ts +0 -11
  49. package/lib/components/common/icon/fullscreen.vue.d.ts +0 -3
  50. package/lib/components/common/icon/helper.vue.d.ts +0 -22
  51. package/lib/components/common/icon/index.vue.d.ts +0 -243
  52. package/lib/components/common/icon/layoutIcon.vue.d.ts +0 -43
  53. package/lib/components/common/icon/projectIcon.vue.d.ts +0 -59
  54. package/lib/components/common/icon/toolIcon.vue.d.ts +0 -43
  55. package/lib/components/common/index.d.ts +0 -18
  56. package/lib/components/common/tooltip/index.vue.d.ts +0 -21
  57. package/lib/components/content/dialog/index.vue.d.ts +0 -34
  58. package/lib/components/content/drawer/index.vue.d.ts +0 -26
  59. package/lib/components/content/form/formItem.vue.d.ts +0 -25
  60. package/lib/components/content/form/index.vue.d.ts +0 -25
  61. package/lib/components/content/index.d.ts +0 -22
  62. package/lib/components/content/search/index.vue.d.ts +0 -30
  63. package/lib/components/content/search/searchItem.vue.d.ts +0 -23
  64. package/lib/components/content/table/index.vue.d.ts +0 -36
  65. package/lib/components/content/table/tableOperate.vue.d.ts +0 -18
  66. package/lib/components/content/toolbar/icontool.vue.d.ts +0 -7
  67. package/lib/components/content/toolbar/index.vue.d.ts +0 -18
  68. package/lib/components/content/tree/index.vue.d.ts +0 -46
  69. package/lib/components/form/aceEditor/aceConfig.d.ts +0 -8
  70. package/lib/components/form/autoComplete/index.vue.d.ts +0 -139
  71. package/lib/components/form/cascader/index.vue.d.ts +0 -109
  72. package/lib/components/form/checkbox/index.vue.d.ts +0 -128
  73. package/lib/components/form/datePicker/index.vue.d.ts +0 -6
  74. package/lib/components/form/index.d.ts +0 -38
  75. package/lib/components/form/input/index.vue.d.ts +0 -26
  76. package/lib/components/form/input/inputIcon.vue.d.ts +0 -10
  77. package/lib/components/form/input/inputNumber.vue.d.ts +0 -3
  78. package/lib/components/form/input/inputPassword.vue.d.ts +0 -3
  79. package/lib/components/form/propEditor/index.vue.d.ts +0 -12
  80. package/lib/components/form/radio/index.vue.d.ts +0 -133
  81. package/lib/components/form/radio/radioStatus.vue.d.ts +0 -31
  82. package/lib/components/form/rangePicker/index.vue.d.ts +0 -16
  83. package/lib/components/form/select/index.vue.d.ts +0 -142
  84. package/lib/components/form/switch/index.vue.d.ts +0 -43
  85. package/lib/components/form/textarea/index.vue.d.ts +0 -3
  86. package/lib/components/form/transfer/index.vue.d.ts +0 -38
  87. package/lib/components/form/transfer/transferTable.vue.d.ts +0 -38
  88. package/lib/components/form/treeSelect/index.vue.d.ts +0 -38
  89. package/lib/components/form/upload/uploadList.vue.d.ts +0 -476
  90. package/lib/components/index.d.ts +0 -4
  91. package/lib/components/layout/breadcrumb/index.vue.d.ts +0 -3
  92. package/lib/components/layout/content/index.vue.d.ts +0 -22
  93. package/lib/components/layout/datetime/index.vue.d.ts +0 -3
  94. package/lib/components/layout/header/headerExits.vue.d.ts +0 -3
  95. package/lib/components/layout/header/index.vue.d.ts +0 -3
  96. package/lib/components/layout/header/user.vue.d.ts +0 -3
  97. package/lib/components/layout/index.d.ts +0 -14
  98. package/lib/components/layout/menu/index.vue.d.ts +0 -6
  99. package/lib/components/layout/menu/menuTabs.vue.d.ts +0 -3
  100. package/lib/const/options.d.ts +0 -32
  101. package/lib/directives/enter-submit.d.ts +0 -4
  102. package/lib/directives/index.d.ts +0 -2
  103. package/lib/directives/permission.d.ts +0 -5
  104. package/lib/es/AceEditor/index.js +0 -167
  105. package/lib/es/BasicLayout/index.js +0 -101
  106. package/lib/es/Error403/index.js +0 -39
  107. package/lib/es/Error404/index.js +0 -39
  108. package/lib/es/ExcelForm/index.js +0 -321
  109. package/lib/es/UploadForm/index.js +0 -137
  110. package/lib/index.d.ts +0 -45
  111. package/lib/router/index.d.ts +0 -15
  112. package/lib/stores/appInfo.d.ts +0 -31
  113. package/lib/stores/hostInfo.d.ts +0 -9
  114. package/lib/stores/pageInfo.d.ts +0 -18
  115. package/lib/stores/pinia.d.ts +0 -3
  116. package/lib/stores/settingInfo.d.ts +0 -8
  117. package/lib/stores/userInfo.d.ts +0 -24
  118. package/lib/typings/data.d.ts +0 -80
  119. package/lib/typings/form.d.ts +0 -171
  120. package/lib/typings/menu.d.ts +0 -7
  121. package/lib/typings/option.d.ts +0 -175
  122. package/lib/typings/page.d.ts +0 -69
  123. package/lib/typings/table.d.ts +0 -181
  124. package/lib/typings/tools.d.ts +0 -130
  125. package/lib/typings/tree.d.ts +0 -72
  126. package/lib/typings/upload.d.ts +0 -161
  127. package/lib/typings/urls.d.ts +0 -69
  128. package/lib/utils/cache.d.ts +0 -23
  129. package/lib/utils/data.d.ts +0 -6
  130. package/lib/utils/download.d.ts +0 -4
  131. package/lib/utils/eventbus.d.ts +0 -16
  132. package/lib/utils/export-table.d.ts +0 -12
  133. package/lib/utils/file-upload.d.ts +0 -15
  134. package/lib/utils/form-excel.d.ts +0 -30
  135. package/lib/utils/form-validate.d.ts +0 -29
  136. package/lib/utils/form.d.ts +0 -9
  137. package/lib/utils/icon-loader.d.ts +0 -125
  138. package/lib/utils/isEmpty.d.ts +0 -1
  139. package/lib/utils/main-openapis.d.ts +0 -8
  140. package/lib/utils/menu.d.ts +0 -6
  141. package/lib/utils/options.d.ts +0 -10
  142. package/lib/utils/page.d.ts +0 -25
  143. package/lib/utils/table.d.ts +0 -21
  144. package/lib/utils/tools.d.ts +0 -18
  145. package/lib/utils/tree.d.ts +0 -3
  146. package/lib/vite-env.d.ts +0 -8
  147. package/lib/webui.css +0 -1
  148. package/lib/webui.es.js +0 -2240
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyfox2000/webui",
3
- "version": "1.2.8",
3
+ "version": "1.2.10",
4
4
  "description": "后台前端通用组件定义",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -0,0 +1,2 @@
1
+ # userInput.py
2
+ user_input=input("Enter Prompt:")
@@ -17,3 +17,6 @@ import ProjectIcon from './icon/projectIcon.vue';
17
17
  export { ProjectIcon };
18
18
  import ToolIcon from './icon/toolIcon.vue';
19
19
  export { ToolIcon };
20
+
21
+ import Loading from './loading/index.vue';
22
+ export { Loading };
@@ -0,0 +1,11 @@
1
+ <script setup lang="ts">
2
+ import { Spin } from 'ant-design-vue';
3
+ import { useAttrs } from 'vue';
4
+ const attrs = useAttrs()
5
+ </script>
6
+ <template>
7
+ <div class="absolute z-999 w-full h-full top-0 flex flex-flow row items-center justify-center">
8
+ <Spin style="margin-top: -10%" v-bind="attrs">
9
+ </Spin>
10
+ </div>
11
+ </template>
@@ -26,6 +26,10 @@ const props = defineProps<{
26
26
  * 自定义存储方法
27
27
  */
28
28
  dialogSave?: () => void;
29
+ /**
30
+ * 自定义另存为方法
31
+ */
32
+ dialogSaveAs?: () => void;
29
33
  /**
30
34
  * 宽度
31
35
  */
@@ -65,7 +69,7 @@ watch(
65
69
  (newVal) => {
66
70
  emit('update:open', newVal);
67
71
  if (!newVal) {
68
- dialogClose();
72
+ doDialogClose();
69
73
  }
70
74
  },
71
75
  );
@@ -74,14 +78,17 @@ onMounted(() => {
74
78
  open.value = editorCtrl?.visible.value ?? false;
75
79
  });
76
80
 
77
- const dialogSave = () => {
81
+ const doDialogSave = () => {
78
82
  if (props.dialogSave) {
83
+ props.dialogSave();
79
84
  } else if (editorCtrl) onFormSave(editorCtrl);
80
85
  };
81
- const dialogSaveAs = () => {
82
- if (editorCtrl) onFormSaveAs(editorCtrl);
86
+ const doDialogSaveAs = () => {
87
+ if (props.dialogSaveAs) {
88
+ props.dialogSaveAs();
89
+ } else if (editorCtrl) onFormSaveAs(editorCtrl);
83
90
  };
84
- const dialogClose = () => {
91
+ const doDialogClose = () => {
85
92
  if (editorCtrl) onFormClose(editorCtrl);
86
93
  else open.value = false;
87
94
  };
@@ -97,11 +104,11 @@ const dialogClose = () => {
97
104
  </div>
98
105
  <template #footer>
99
106
  <Space>
100
- <Button @click="dialogClose" v-if="cancelText !== ''">
107
+ <Button @click="doDialogClose" v-if="cancelText !== ''">
101
108
  {{ cancelText ?? '取消' }}
102
109
  </Button>
103
110
  <Button
104
- @click="dialogSaveAs"
111
+ @click="doDialogSaveAs"
105
112
  v-if="saveAsText !== '' && editorCtrl?.saveAsBtnVisible !== false"
106
113
  type="primary"
107
114
  :loading="editorCtrl?.isFormSaving.value"
@@ -109,7 +116,7 @@ const dialogClose = () => {
109
116
  {{ saveAsText ?? '另存为' }}
110
117
  </Button>
111
118
  <Button
112
- @click="dialogSave"
119
+ @click="doDialogSave"
113
120
  v-if="saveText !== '' && editorCtrl?.saveBtnVisible !== false"
114
121
  type="primary"
115
122
  :loading="editorCtrl?.isFormSaving.value"
@@ -2,18 +2,13 @@
2
2
  import { watch, ref, onMounted } from 'vue';
3
3
  import { Button } from '../../common';
4
4
  import { Modal, Space } from 'ant-design-vue';
5
- import { AsyncUploader, EditorControl, GridControl, gridRowUpdate, UploadStatus, UploadFile } from '@/index';
5
+ import { EditorControl, GridControl, gridRowUpdate, UploadFile } from '@/index';
6
6
  import { AnyData, ApiResponse, IUrlInfo, ResStatus } from '@skyfox2000/fapi';
7
- import { UploadList } from '../../form';
7
+ import UploadList from '../../form/upload/uploadList.vue';
8
8
  import message from 'vue-m-message';
9
+ import { AsyncUploader } from '@/utils/file-upload';
9
10
 
10
11
  const props = defineProps<{
11
- /**
12
- * #### 使用模式
13
- * - Row 数据行
14
- * - Page 页面
15
- */
16
- mode: 'Row' | 'Page';
17
12
  /**
18
13
  * 文件后缀限制
19
14
  */
@@ -69,7 +64,11 @@ const emit = defineEmits<{
69
64
  /**
70
65
  * 上传结束,处理上传后的文件
71
66
  */
72
- 'after:upload': [UploadFile[]];
67
+ 'after:upload': [boolean, UploadFile[]];
68
+ /**
69
+ * 上传进度
70
+ */
71
+ 'on:progress': [UploadFile];
73
72
  }>();
74
73
 
75
74
  watch(
@@ -81,73 +80,29 @@ watch(
81
80
  const uploadUrl = ref(props.uploadUrl);
82
81
  const downloadUrl = ref(props.downloadUrl);
83
82
 
84
- const dialogUpload = async () => {
85
- const url = uploadUrl.value;
86
- if (!url) {
87
- message.error('未配置文件上传地址!');
88
- return;
89
- }
90
-
83
+ const dialogSave = async () => {
91
84
  emit('before:upload', fileList.value);
92
- const uploader = new AsyncUploader(url, maxConcurrent);
93
-
94
- uploadFormCtrl.isFormLoading.value = true;
95
- try {
96
- if (fileList.value.length === 0) {
97
- message.warning('请选择上传的文件!');
98
- return;
99
- }
100
-
101
- // 开始上传文件
102
- await uploader.uploadFiles(
103
- fileList.value,
104
- (_) => {},
105
- (files) => {
106
- uploadFormCtrl.isFormLoading.value = false;
107
- let err_count = 0;
108
- for (const file of files) {
109
- if (file.status === UploadStatus.Error) {
110
- err_count++;
85
+ const uploader = new AsyncUploader(uploadUrl.value!, maxConcurrent);
86
+ await uploader.doUpload(
87
+ fileList.value,
88
+ uploadFormCtrl.isFormLoading,
89
+ props.continueOnError,
90
+ async (result, files) => {
91
+ emit('after:upload', result, files);
92
+ if (result) {
93
+ if (uploadFormCtrl.formData.value) {
94
+ // 仅修改上传相关字段
95
+ const res: ApiResponse<any> = await gridRowUpdate(props.gridCtrl, uploadFormCtrl.formData.value);
96
+ if (res.status === ResStatus.SUCCESS) {
97
+ uploadFormCtrl.visible.value = false;
111
98
  }
112
99
  }
113
- if (!err_count) {
114
- message.success('全部文件上传成功!');
115
- emit('after:upload', files);
116
- dialogSave();
117
- } else if (err_count < files.length) {
118
- if (props.continueOnError) {
119
- message.error('上传结束,部分文件上传失败!');
120
- message.warning('保存上传成功的文件!');
121
- emit('after:upload', files);
122
- dialogSave();
123
- } else {
124
- message.error('上传结束,部分文件上传失败,取消保存!');
125
- }
126
- } else message.error('上传结束,所有文件上传失败!');
127
- },
128
- );
129
- } catch (error) {
130
- uploadFormCtrl.isFormLoading.value = false;
131
- console.error('上传错误:', error);
132
- message.error('上传错误,请稍后再试!');
133
- emit('after:upload', fileList.value);
134
- }
135
- };
136
-
137
- const dialogSave = async () => {
138
- switch (props.mode) {
139
- case 'Row':
140
- if (uploadFormCtrl.formData.value) {
141
- // 仅修改上传相关字段
142
- const result: ApiResponse<any> = await gridRowUpdate(props.gridCtrl, uploadFormCtrl.formData.value);
143
- if (result.status === ResStatus.SUCCESS) {
144
- uploadFormCtrl.visible.value = false;
145
- }
146
100
  }
147
- break;
148
- case 'Page':
149
- break;
150
- }
101
+ },
102
+ (file) => {
103
+ emit('on:progress', file);
104
+ },
105
+ );
151
106
  };
152
107
 
153
108
  onMounted(() => {
@@ -161,12 +116,10 @@ onMounted(() => {
161
116
  if (!uploadUrl.value.api) uploadUrl.value.api = pageCtrl.api;
162
117
  if (uploadUrl.value.authorize === undefined) uploadUrl.value.authorize = pageCtrl.authorize;
163
118
 
164
- if (!downloadUrl.value) {
165
- message.error('未配置文件下载地址!');
166
- return;
119
+ if (downloadUrl.value) {
120
+ if (!downloadUrl.value.api) downloadUrl.value.api = pageCtrl.api;
121
+ if (downloadUrl.value.authorize === undefined) downloadUrl.value.authorize = pageCtrl.authorize;
167
122
  }
168
- if (!downloadUrl.value.api) downloadUrl.value.api = pageCtrl.api;
169
- if (downloadUrl.value.authorize === undefined) downloadUrl.value.authorize = pageCtrl.authorize;
170
123
 
171
124
  for (const key in uploadFormCtrl.formData.value) {
172
125
  if (props.gridCtrl.rowData.value) uploadFormCtrl.formData.value[key] = props.gridCtrl.rowData.value[key];
@@ -189,11 +142,17 @@ const dialogClose = () => {
189
142
  :wrapClassName="'modal mx-auto ' + ($attrs.width ? 'w-[' + $attrs.width + ']' : 'w-[430px]')"
190
143
  @close="dialogClose"
191
144
  >
192
- <UploadList v-model:file-list="fileList" :download-url="downloadUrl!" :max-count="maxCount" :file-ext="fileExt" />
145
+ <UploadList
146
+ v-model:file-list="fileList"
147
+ :upload-url="uploadUrl!"
148
+ :download-url="downloadUrl"
149
+ :max-count="maxCount"
150
+ :file-ext="fileExt"
151
+ />
193
152
  <template #footer>
194
153
  <Space>
195
154
  <Button @click="dialogClose">取消</Button>
196
- <Button @click="dialogUpload" type="primary" :loading="uploadFormCtrl.isFormSaving.value">
155
+ <Button @click="dialogSave" type="primary" :loading="uploadFormCtrl.isFormSaving.value">
197
156
  上传文件并保存
198
157
  </Button>
199
158
  </Space>
@@ -33,6 +33,14 @@ const props = defineProps<{
33
33
  * 保存数据请求配置
34
34
  */
35
35
  editorCtrl: EditorControl<AnyData>;
36
+ /**
37
+ * 自定义保存方法
38
+ */
39
+ drawerSave?: () => void;
40
+ /**
41
+ * 自定义另存为方法
42
+ */
43
+ drawerSaveAs?: () => void;
36
44
  }>();
37
45
 
38
46
  const editorCtrl = props.editorCtrl;
@@ -49,7 +57,19 @@ onMounted(() => {
49
57
  open.value = editorCtrl.visible.value ?? false;
50
58
  });
51
59
 
52
- const drawerClose = () => {
60
+ const doDrawerSave = () => {
61
+ if (props.drawerSave) {
62
+ props.drawerSave();
63
+ } else if (editorCtrl) onFormSave(editorCtrl);
64
+ };
65
+
66
+ const doDrawerSaveAs = () => {
67
+ if (props.drawerSaveAs) {
68
+ props.drawerSaveAs();
69
+ } else if (editorCtrl) onFormSaveAs(editorCtrl);
70
+ };
71
+
72
+ const doDrawerClose = () => {
53
73
  onFormClose(editorCtrl);
54
74
  };
55
75
  </script>
@@ -74,7 +94,7 @@ const drawerClose = () => {
74
94
  boxShadow: 'rgba(0, 0, 0, 0.3) -2px 0px 8px',
75
95
  }"
76
96
  width="420px"
77
- @close="drawerClose"
97
+ @close="doDrawerClose"
78
98
  >
79
99
  <template #extra>
80
100
  <div class="hover:bg-gray-200 w-[24px] h-[24px] rounded-md">
@@ -86,7 +106,7 @@ const drawerClose = () => {
86
106
  clickable
87
107
  color="#666"
88
108
  :position="[0, 0]"
89
- @click="() => onFormClose(editorCtrl)"
109
+ @click="doDrawerClose"
90
110
  />
91
111
  </div>
92
112
  </template>
@@ -95,9 +115,9 @@ const drawerClose = () => {
95
115
  </template>
96
116
  <template #footer>
97
117
  <Space>
98
- <Button @click="() => onFormClose(editorCtrl)" v-if="cancelText !== ''">{{ cancelText ?? '取消' }}</Button>
118
+ <Button @click="doDrawerClose" v-if="cancelText !== ''">{{ cancelText ?? '取消' }}</Button>
99
119
  <Button
100
- @click="() => onFormSaveAs(editorCtrl)"
120
+ @click="doDrawerSaveAs"
101
121
  v-if="saveAsText !== '' && editorCtrl.saveAsBtnVisible !== false"
102
122
  type="primary"
103
123
  :loading="editorCtrl.isFormSaving.value"
@@ -105,7 +125,7 @@ const drawerClose = () => {
105
125
  {{ saveAsText ?? '另存为' }}
106
126
  </Button>
107
127
  <Button
108
- @click="() => onFormSave(editorCtrl)"
128
+ @click="doDrawerSave"
109
129
  v-if="saveText !== '' && editorCtrl.saveBtnVisible !== false"
110
130
  type="primary"
111
131
  :loading="editorCtrl.isFormSaving.value"
@@ -22,6 +22,10 @@ const props = defineProps<{
22
22
  * 宽度
23
23
  */
24
24
  width?: string;
25
+ /**
26
+ * 是否显示在独立行
27
+ */
28
+ nextLine?: boolean;
25
29
  }>();
26
30
 
27
31
  // 关闭自动继承属性到根元素
@@ -31,6 +35,7 @@ defineOptions({
31
35
  const attrs = useAttrs(); // 手动获取 $attrs
32
36
 
33
37
  const editorCtrl = inject(ProviderKeys.EditorControl, undefined) as EditorControl<AnyData> | undefined;
38
+ const labelWidth = inject(ProviderKeys.LabelWidth, '85px');
34
39
  const errInfo = useFormItemFactory(props, editorCtrl);
35
40
 
36
41
  const visible = ref(false);
@@ -82,18 +87,18 @@ const required = computed(() => {
82
87
  // });
83
88
  </script>
84
89
  <template>
85
- <div :class="['w-full relative mb-1', width]">
90
+ <div :class="['relative mb-1']">
86
91
  <FormItem
87
92
  v-if="visible"
88
93
  :required="required"
89
- class="!w-[95%] relative"
94
+ class="relative"
90
95
  v-bind="attrs"
91
- :class="[rule ? '' : 'mb-3']"
96
+ :class="[nextLine ? 'mb-0' : rule ? '' : 'mb-3']"
92
97
  >
93
98
  <template #label>
94
99
  <span :class="[errInfo.errClass ? 'text-[#ff4d4f]' : '', 'w-full']"> {{ label }}</span>
95
100
  </template>
96
- <div class="w-full flex items-center">
101
+ <div class="flex items-center" :class="width ? width : 'w-full'" v-if="!nextLine">
97
102
  <div class="flex-grow">
98
103
  <slot></slot>
99
104
  </div>
@@ -104,7 +109,18 @@ const required = computed(() => {
104
109
  </div>
105
110
  </div>
106
111
  </FormItem>
107
- <span class="absolute bottom-[3px] left-[85px] text-[12px] text-[#ff4d4fcc] block" v-if="errInfo.errClass">
112
+ <div
113
+ v-if="nextLine"
114
+ class="w-[95%] flex items-center relative"
115
+ :class="[nextLine ? (rule ? 'mb-7' : 'mb-3') : '']"
116
+ >
117
+ <slot></slot>
118
+ </div>
119
+ <span
120
+ :style="{ left: labelWidth }"
121
+ class="absolute bottom-[3px] text-[12px] text-[#ff4d4fcc]"
122
+ v-if="errInfo.errClass"
123
+ >
108
124
  {{ errInfo.msg }}
109
125
  </span>
110
126
  </div>
@@ -2,7 +2,7 @@
2
2
  import { EditorControl, ProviderKeys, onFormSave } from '@/index';
3
3
  import { AnyData } from '@skyfox2000/fapi';
4
4
  import { Form } from 'ant-design-vue';
5
- import { inject } from 'vue';
5
+ import { inject, provide } from 'vue';
6
6
  // 使用以下统一控制表单显示
7
7
  // :label-col="{ flex: '60px' }"
8
8
  // :wrapper-col="{ flex: '200px' }"
@@ -24,12 +24,14 @@ const props = defineProps<{
24
24
 
25
25
  const editorCtrl =
26
26
  props.editorCtrl ?? (inject(ProviderKeys.EditorControl, undefined) as EditorControl<AnyData> | undefined);
27
+
28
+ provide(ProviderKeys.LabelWidth, props.labelWidth);
27
29
  </script>
28
30
  <template>
29
31
  <Form
30
32
  :label-col="{ flex: props.labelWidth ?? '85px' }"
31
33
  :wrapper-col="{
32
- flex: props.wrapperWidth ?? '1',
34
+ flex: props.wrapperWidth ?? '1 0 280px',
33
35
  }"
34
36
  :style="{
35
37
  display: 'flex',
@@ -39,7 +39,7 @@ const errInfo = useFormItemFactory(props, editorCtrl);
39
39
  <template #label v-if="label">
40
40
  <span :class="[errInfo.errClass ? 'text-[#ff4d4f]' : '', 'w-full']"> {{ label }}</span>
41
41
  </template>
42
- <div class="flex items-center">
42
+ <div class="flex items-center w-[90%]">
43
43
  <div class="flex-grow pl-1">
44
44
  <slot></slot>
45
45
  </div>
@@ -30,7 +30,7 @@ const props = defineProps({
30
30
  * - 模糊查询
31
31
  */
32
32
  searchField: {
33
- type: String,
33
+ type: [String, Array<string>],
34
34
  },
35
35
  /**
36
36
  * 自定义查询参数
@@ -105,9 +105,17 @@ const onSearch = (value: string) => {
105
105
  },
106
106
  };
107
107
  if (props.searchField) {
108
- query.Query![props.searchField] = {
109
- $like: '%' + search_value + '%',
110
- };
108
+ if (Array.isArray(props.searchField)) {
109
+ props.searchField.forEach((field) => {
110
+ query.Query![field] = {
111
+ $like: '%' + search_value + '%',
112
+ };
113
+ });
114
+ } else {
115
+ query.Query![props.searchField] = {
116
+ $like: '%' + search_value + '%',
117
+ };
118
+ }
111
119
  }
112
120
  if (props.onsearch) {
113
121
  props.onsearch(search_value, query);
@@ -85,7 +85,7 @@ onUnmounted(() => {
85
85
  });
86
86
  </script>
87
87
  <template>
88
- <div>
88
+ <div class="relative w-[248px] max-w-[248px]">
89
89
  <div v-if="!selectOptions.length" class="absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center">
90
90
  <circleLoading class="text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" />
91
91
  <span>数据加载中...</span>
@@ -19,8 +19,8 @@ const dateFormat = ref<string>(props.valueFormat ?? 'YYYY-MM-DD');
19
19
  </script>
20
20
  <template>
21
21
  <DatePicker
22
- :class="[errInfo?.errClass === 'error' ? 'error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]' : '']"
23
22
  class="w-full"
23
+ :class="[errInfo?.errClass === 'error' ? 'error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]' : '']"
24
24
  :placeholder="'请选择' + labelText"
25
25
  :locale="locale"
26
26
  :valueFormat="dateFormat"
@@ -23,6 +23,7 @@ import InputNumber from './input/inputNumber.vue';
23
23
  export { InputNumber };
24
24
 
25
25
  import PropEditor from './propEditor/index.vue';
26
+ export type { PropConfigItem } from './propEditor/index.vue';
26
27
  export { PropEditor };
27
28
 
28
29
  import Radio from './radio/index.vue';
@@ -24,7 +24,7 @@ watch(
24
24
  );
25
25
  </script>
26
26
  <template>
27
- <Input :class="['w-[80%]']" v-model:value="innerValue" v-bind="$attrs">
27
+ <Input v-model:value="innerValue" v-bind="$attrs">
28
28
  <template #addonBefore>
29
29
  <ToolIcon class="!w-4 !h-4" :icon="innerValue" />
30
30
  </template>