jobsys-explore 4.8.1 → 5.0.0

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 (135) hide show
  1. package/.github/workflows/npm-publish.yml +40 -0
  2. package/.oxfmtrc.json +29 -0
  3. package/.oxlintrc.json +57 -0
  4. package/DEVELOPMENT.md +289 -0
  5. package/components/form/ExAddress.jsx +2 -2
  6. package/components/form/ExForm.jsx +4 -3
  7. package/components/form/FormItem.jsx +21 -21
  8. package/components/pagination/ExPagination.jsx +15 -5
  9. package/components/search/ExSearch.jsx +14 -1
  10. package/components/uploader/ExUploader.jsx +1 -0
  11. package/hooks/index.js +1 -0
  12. package/hooks/regex.js +270 -0
  13. package/package.json +21 -38
  14. package/vite.config.js +2 -6
  15. package/.changeset/config.json +0 -11
  16. package/.eslintignore +0 -4
  17. package/.eslintrc.cjs +0 -38
  18. package/.prettierrc.cjs +0 -38
  19. package/CHANGELOG.md +0 -542
  20. package/TODOs.md +0 -8
  21. package/dist/__vite-browser-external-2447137e.js +0 -5
  22. package/dist/__vite-browser-external-2447137e.js.map +0 -1
  23. package/dist/__vite-browser-external-b3701507.cjs +0 -2
  24. package/dist/__vite-browser-external-b3701507.cjs.map +0 -1
  25. package/dist/cipher-98df1050.cjs +0 -2
  26. package/dist/cipher-98df1050.cjs.map +0 -1
  27. package/dist/cipher-f2ed5ee6.js +0 -2244
  28. package/dist/cipher-f2ed5ee6.js.map +0 -1
  29. package/dist/directives.cjs +0 -2
  30. package/dist/directives.cjs.map +0 -1
  31. package/dist/directives.js +0 -46
  32. package/dist/directives.js.map +0 -1
  33. package/dist/hooks.cjs +0 -2
  34. package/dist/hooks.cjs.map +0 -1
  35. package/dist/hooks.js +0 -45
  36. package/dist/hooks.js.map +0 -1
  37. package/dist/jobsys-explore.cjs +0 -12
  38. package/dist/jobsys-explore.cjs.map +0 -1
  39. package/dist/jobsys-explore.js +0 -20247
  40. package/dist/jobsys-explore.js.map +0 -1
  41. package/dist/style.css +0 -1
  42. package/docgen.config.js +0 -15
  43. package/docs/.vuepress/.cache/deps/@vue_devtools-api.js +0 -11
  44. package/docs/.vuepress/.cache/deps/@vue_devtools-api.js.map +0 -7
  45. package/docs/.vuepress/.cache/deps/@vuepress_shared.js +0 -110
  46. package/docs/.vuepress/.cache/deps/@vuepress_shared.js.map +0 -7
  47. package/docs/.vuepress/.cache/deps/@vueuse_core.js +0 -8758
  48. package/docs/.vuepress/.cache/deps/@vueuse_core.js.map +0 -7
  49. package/docs/.vuepress/.cache/deps/_metadata.json +0 -53
  50. package/docs/.vuepress/.cache/deps/chunk-37RBVGNF.js +0 -10577
  51. package/docs/.vuepress/.cache/deps/chunk-37RBVGNF.js.map +0 -7
  52. package/docs/.vuepress/.cache/deps/chunk-H2FJVFR5.js +0 -163
  53. package/docs/.vuepress/.cache/deps/chunk-H2FJVFR5.js.map +0 -7
  54. package/docs/.vuepress/.cache/deps/chunk-L7E56NPU.js +0 -306
  55. package/docs/.vuepress/.cache/deps/chunk-L7E56NPU.js.map +0 -7
  56. package/docs/.vuepress/.cache/deps/lodash-es.js +0 -8442
  57. package/docs/.vuepress/.cache/deps/lodash-es.js.map +0 -7
  58. package/docs/.vuepress/.cache/deps/package.json +0 -3
  59. package/docs/.vuepress/.cache/deps/vue-router.js +0 -2667
  60. package/docs/.vuepress/.cache/deps/vue-router.js.map +0 -7
  61. package/docs/.vuepress/.cache/deps/vue.js +0 -315
  62. package/docs/.vuepress/.cache/deps/vue.js.map +0 -7
  63. package/docs/.vuepress/.temp/internal/clientConfigs.js +0 -17
  64. package/docs/.vuepress/.temp/internal/pagesComponents.js +0 -24
  65. package/docs/.vuepress/.temp/internal/pagesData.js +0 -22
  66. package/docs/.vuepress/.temp/internal/pagesRoutes.js +0 -12
  67. package/docs/.vuepress/.temp/internal/siteData.js +0 -1
  68. package/docs/.vuepress/.temp/internal/themeData.js +0 -1
  69. package/docs/.vuepress/.temp/pages/404.html.js +0 -1
  70. package/docs/.vuepress/.temp/pages/404.html.vue +0 -3
  71. package/docs/.vuepress/.temp/pages/components/button/ExButton.html.js +0 -1
  72. package/docs/.vuepress/.temp/pages/components/button/ExButton.html.vue +0 -111
  73. package/docs/.vuepress/.temp/pages/components/decorator/ExDecorator.html.js +0 -1
  74. package/docs/.vuepress/.temp/pages/components/decorator/ExDecorator.html.vue +0 -37
  75. package/docs/.vuepress/.temp/pages/components/form/ExForm.html.js +0 -1
  76. package/docs/.vuepress/.temp/pages/components/form/ExForm.html.vue +0 -187
  77. package/docs/.vuepress/.temp/pages/components/provider/ExProvider.html.js +0 -1
  78. package/docs/.vuepress/.temp/pages/components/provider/ExProvider.html.vue +0 -51
  79. package/docs/.vuepress/.temp/pages/components/search/ExSearch.html.js +0 -1
  80. package/docs/.vuepress/.temp/pages/components/search/ExSearch.html.vue +0 -108
  81. package/docs/.vuepress/.temp/pages/components/sector/ExSector.html.js +0 -1
  82. package/docs/.vuepress/.temp/pages/components/sector/ExSector.html.vue +0 -72
  83. package/docs/.vuepress/.temp/pages/components/uploader/ExUploader.html.js +0 -1
  84. package/docs/.vuepress/.temp/pages/components/uploader/ExUploader.html.vue +0 -162
  85. package/docs/.vuepress/.temp/pages/hooks.html.js +0 -1
  86. package/docs/.vuepress/.temp/pages/hooks.html.vue +0 -697
  87. package/docs/.vuepress/.temp/pages/index.html.js +0 -1
  88. package/docs/.vuepress/.temp/pages/index.html.vue +0 -56
  89. package/docs/.vuepress/.temp/styles/index.scss +0 -1
  90. package/docs/.vuepress/.temp/styles/palette.scss +0 -0
  91. package/docs/.vuepress/.temp/vite-root/index.html +0 -13
  92. package/docs/.vuepress/config.js +0 -61
  93. package/docs/.vuepress/dist/404.html +0 -33
  94. package/docs/.vuepress/dist/assets/404.html-a0ce2184.js +0 -1
  95. package/docs/.vuepress/dist/assets/404.html-f9875e7b.js +0 -1
  96. package/docs/.vuepress/dist/assets/ExButton.html-ad283101.js +0 -1
  97. package/docs/.vuepress/dist/assets/ExButton.html-b975c5b2.js +0 -1
  98. package/docs/.vuepress/dist/assets/ExDecorator.html-42d09114.js +0 -1
  99. package/docs/.vuepress/dist/assets/ExDecorator.html-c82c5fe8.js +0 -1
  100. package/docs/.vuepress/dist/assets/ExForm.html-24f42bf7.js +0 -1
  101. package/docs/.vuepress/dist/assets/ExForm.html-9e3f8000.js +0 -1
  102. package/docs/.vuepress/dist/assets/ExProvider.html-50d01930.js +0 -1
  103. package/docs/.vuepress/dist/assets/ExProvider.html-78fdc6cd.js +0 -1
  104. package/docs/.vuepress/dist/assets/ExSearch.html-103f6f34.js +0 -1
  105. package/docs/.vuepress/dist/assets/ExSearch.html-635a618b.js +0 -1
  106. package/docs/.vuepress/dist/assets/ExSector.html-a1e24c3a.js +0 -7
  107. package/docs/.vuepress/dist/assets/ExSector.html-cff3fefd.js +0 -1
  108. package/docs/.vuepress/dist/assets/ExUploader.html-8310e424.js +0 -1
  109. package/docs/.vuepress/dist/assets/ExUploader.html-f059c617.js +0 -1
  110. package/docs/.vuepress/dist/assets/app-29fe8d1e.js +0 -10
  111. package/docs/.vuepress/dist/assets/back-to-top-8efcbe56.svg +0 -1
  112. package/docs/.vuepress/dist/assets/hooks.html-90ccbc1a.js +0 -1
  113. package/docs/.vuepress/dist/assets/hooks.html-ddb4f378.js +0 -1
  114. package/docs/.vuepress/dist/assets/index.html-85b79c97.js +0 -43
  115. package/docs/.vuepress/dist/assets/index.html-e18a38b1.js +0 -1
  116. package/docs/.vuepress/dist/assets/style-46d7e227.css +0 -1
  117. package/docs/.vuepress/dist/components/button/ExButton.html +0 -33
  118. package/docs/.vuepress/dist/components/decorator/ExDecorator.html +0 -33
  119. package/docs/.vuepress/dist/components/form/ExForm.html +0 -33
  120. package/docs/.vuepress/dist/components/provider/ExProvider.html +0 -33
  121. package/docs/.vuepress/dist/components/search/ExSearch.html +0 -33
  122. package/docs/.vuepress/dist/components/sector/ExSector.html +0 -39
  123. package/docs/.vuepress/dist/components/uploader/ExUploader.html +0 -33
  124. package/docs/.vuepress/dist/hooks.html +0 -33
  125. package/docs/.vuepress/dist/index.html +0 -75
  126. package/docs/.vuepress/styles/index.scss +0 -7
  127. package/docs/components/button/ExButton.md +0 -30
  128. package/docs/components/decorator/ExDecorator.md +0 -14
  129. package/docs/components/form/ExForm.md +0 -39
  130. package/docs/components/provider/ExProvider.md +0 -16
  131. package/docs/components/search/ExSearch.md +0 -28
  132. package/docs/components/sector/ExSector.md +0 -43
  133. package/docs/components/uploader/ExUploader.md +0 -36
  134. package/docs/hooks.md +0 -373
  135. package/docs/index.md +0 -83
@@ -0,0 +1,40 @@
1
+ name: NPM Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ publish:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Enable Corepack
22
+ run: corepack enable
23
+
24
+ - name: Setup Node.js
25
+ uses: actions/setup-node@v4
26
+ with:
27
+ node-version: '20'
28
+ registry-url: 'https://registry.npmjs.org'
29
+ cache: 'pnpm'
30
+
31
+ - name: Install dependencies
32
+ run: pnpm install --frozen-lockfile
33
+
34
+ - name: Build
35
+ run: pnpm run build
36
+
37
+ - name: Publish to npm
38
+ run: pnpm publish --access public --no-git-checks
39
+ env:
40
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.oxfmtrc.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "include": [
3
+ "**/*.js",
4
+ "**/*.jsx",
5
+ "**/*.ts",
6
+ "**/*.tsx",
7
+ "**/*.vue",
8
+ "**/*.json",
9
+ "**/*.md"
10
+ ],
11
+ "exclude": [
12
+ "node_modules/**",
13
+ "dist/**",
14
+ ".git/**",
15
+ ".github/**",
16
+ "coverage/**",
17
+ ".vite/**",
18
+ ".rolldown/**",
19
+ ".cache/**",
20
+ "playground/**"
21
+ ],
22
+ "lineWidth": 100,
23
+ "indentWidth": 4,
24
+ "useTabs": false,
25
+ "quoteStyle": "double",
26
+ "trailingComma": "es5",
27
+ "bracketSpacing": true,
28
+ "arrowParens": "avoid"
29
+ }
package/.oxlintrc.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "node": true,
5
+ "es2024": true
6
+ },
7
+ "rules": {
8
+ "import/no-unused-modules": "warn",
9
+ "no-console": "off",
10
+ "no-debugger": "warn"
11
+ },
12
+ "categories": {
13
+ "correctness": "error",
14
+ "perf": "warn",
15
+ "style": "off",
16
+ "suspicious": "warn"
17
+ },
18
+ "ignorePatterns": [
19
+ "node_modules/",
20
+ "dist/",
21
+ ".git/",
22
+ ".github/",
23
+ "coverage/",
24
+ ".vite/",
25
+ ".rolldown/",
26
+ ".cache/",
27
+ "playground/"
28
+ ],
29
+ "plugins": [
30
+ "import",
31
+ "node",
32
+ "unicorn"
33
+ ],
34
+ "settings": {
35
+ "import/resolver": {
36
+ "node": {
37
+ "extensions": [
38
+ ".js",
39
+ ".jsx",
40
+ ".ts",
41
+ ".tsx",
42
+ ".vue"
43
+ ]
44
+ }
45
+ }
46
+ },
47
+ "overrides": [
48
+ {
49
+ "files": [
50
+ "**/*.vue"
51
+ ],
52
+ "rules": {
53
+ "vue/no-unused-vars": "warn"
54
+ }
55
+ }
56
+ ]
57
+ }
package/DEVELOPMENT.md ADDED
@@ -0,0 +1,289 @@
1
+ # Explore UI 开发和发布指南
2
+
3
+ ## 目录
4
+
5
+ - [环境准备](#环境准备)
6
+ - [开发流程](#开发流程)
7
+ - [代码规范](#代码规范)
8
+ - [构建和发布](#构建和发布)
9
+ - [版本管理](#版本管理)
10
+ - [故障排除](#故障排除)
11
+
12
+ ---
13
+
14
+ ## 环境准备
15
+
16
+ ### 前置要求
17
+
18
+ - **Node.js**: >= 20.x
19
+ - **pnpm**: >= 8.x
20
+
21
+ ```bash
22
+ # 检查 Node.js 版本
23
+ node -v
24
+
25
+ # 检查 pnpm 版本
26
+ pnpm -v
27
+
28
+ # 如果未安装 pnpm
29
+ npm install -g pnpm
30
+ ```
31
+
32
+ ### 安装依赖
33
+
34
+ ```bash
35
+ # 安装项目依赖
36
+ pnpm install
37
+ ```
38
+
39
+ ### Git 配置(可选)
40
+
41
+ ```bash
42
+ # 配置 Git 远程仓库
43
+ git remote add origin https://github.com/jobsys/explore-ui.git
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 开发流程
49
+
50
+ ### 启动开发服务器
51
+
52
+ ```bash
53
+ pnpm run dev
54
+ ```
55
+
56
+ - 默认端口:3000
57
+ - 自动开启 HMR(热模块替换)
58
+ - 支持本地 network 访问
59
+
60
+ ### 创建新组件
61
+
62
+ 1. 在 `components/` 目录下创建新组件文件夹
63
+ 2. 编写组件代码和样式
64
+ 3. 确保导出组件
65
+
66
+ ### 创建新 Hook
67
+
68
+ 1. 在 `hooks/` 目录下创建新的 hook 文件
69
+ 2. 遵循 `useXxx` 命名规范
70
+ 3. 在 `hooks/index.js` 中导出
71
+
72
+ ### 创建新指令
73
+
74
+ 1. 在 `directives/` 目录下创建新的指令文件
75
+ 2. 在 `directives/index.js` 中导出
76
+
77
+ ---
78
+
79
+ ## 代码规范
80
+
81
+ ### 代码检查
82
+
83
+ ```bash
84
+ # 运行 oxlint 检查
85
+ pnpm run lint
86
+ ```
87
+
88
+ ### 代码格式化
89
+
90
+ ```bash
91
+ # 格式化所有文件
92
+ pnpm run fmt
93
+
94
+ # 或使用 oxfmt 直接命令
95
+ oxfmt write
96
+ ```
97
+
98
+ ### 格式化配置 (.oxfmtrc.json)
99
+
100
+ | 配置项 | 值 | 说明 |
101
+ |--------|-----|------|
102
+ | lineWidth | 100 | 最大行宽 |
103
+ | indentWidth | 4 | 缩进空格数 |
104
+ | useTabs | false | 使用空格缩进 |
105
+ | quoteStyle | double | 双引号 |
106
+ | trailingComma | es5 | ES5 风格尾随逗号 |
107
+
108
+ ### Lint 配置 (.oxlintrc.json)
109
+
110
+ - **correctness**: error - 正确性问题必须修复
111
+ - **perf**: warn - 性能问题警告
112
+ - **suspicious**: warn - 可疑代码警告
113
+ - **style**: off - 风格问题由格式化器处理
114
+
115
+ ---
116
+
117
+ ## 构建和发布
118
+
119
+ ### 构建
120
+
121
+ ```bash
122
+ # 生产环境构建
123
+ pnpm run build
124
+ ```
125
+
126
+ 构建输出:
127
+ - `dist/jobsys-explore.js` - ESM 格式
128
+ - `dist/jobsys-explore.cjs` - CommonJS 格式
129
+ - `dist/hooks.js` - Hooks 导出
130
+ - `dist/directives.js` - 指令导出
131
+
132
+ ### 发布到 npm
133
+
134
+ #### 方式一:手动发布
135
+
136
+ ```bash
137
+ # 1. 更新 package.json 中的 version
138
+ # 2. 提交并打标签
139
+ git add .
140
+ git commit -m "chore: release v1.0.0"
141
+ git tag v1.0.0
142
+
143
+ # 3. 推送代码和标签
144
+ git push origin main
145
+ git push origin v1.0.0
146
+
147
+ # 4. 发布到 npm
148
+ pnpm publish --no-git-checks
149
+ ```
150
+
151
+ #### 方式二:GitHub Actions 自动发布
152
+
153
+ 推送版本标签后自动发布:
154
+
155
+ ```bash
156
+ # 打版本标签
157
+ git tag v1.0.0
158
+ git push origin v1.0.0
159
+ ```
160
+
161
+ > **注意**: 需要在 GitHub 仓库的 Settings → Secrets and variables 中配置 `NPM_TOKEN`
162
+
163
+ ### 获取 NPM Token
164
+
165
+ 1. 登录 [npmjs.com](https://www.npmjs.com/)
166
+ 2. 进入 Account Settings → Access Tokens
167
+ 3. 创建新令牌(Automation 类型)
168
+ 4. 将令牌添加到 GitHub Secrets
169
+
170
+ ---
171
+
172
+ ## 版本管理
173
+
174
+ ### 版本号规范
175
+
176
+ 遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/):
177
+
178
+ - **MAJOR.MINOR.PATCH** (例如:1.0.0)
179
+ - **Major**: 破坏性变更
180
+ - **Minor**: 新功能(向后兼容)
181
+ - **Patch**: Bug 修复(向后兼容)
182
+
183
+ ### 发布流程
184
+
185
+ 1. **开发阶段**: `x.x.x-alpha.0`, `x.x.x-beta.0`
186
+ 2. **候选版本**: `x.x.x-rc.0`
187
+ 3. **正式版本**: `x.x.x`
188
+
189
+ ### 更新 peerDependencies
190
+
191
+ 当 Vue 或其他核心依赖发布新版本时:
192
+
193
+ ```bash
194
+ # 检查最新版本
195
+ npm view vue version
196
+ npm view vant version
197
+
198
+ # 更新 package.json
199
+ pnpm add -D vue@latest
200
+ ```
201
+
202
+ ---
203
+
204
+ ## 故障排除
205
+
206
+ ### pnpm install 失败
207
+
208
+ ```bash
209
+ # 清除缓存
210
+ pnpm store prune
211
+
212
+ # 删除 node_modules 和 lock 文件
213
+ rm -rf node_modules pnpm-lock.yaml
214
+ pnpm install
215
+ ```
216
+
217
+ ### 构建失败
218
+
219
+ ```bash
220
+ # 检查 Node.js 版本(需要 >= 20)
221
+ node -v
222
+
223
+ # 清除缓存重新构建
224
+ rm -rf dist
225
+ pnpm run build
226
+ ```
227
+
228
+ ### Lint 报错
229
+
230
+ ```bash
231
+ # 查看详细错误信息
232
+ pnpm run lint
233
+
234
+ # 自动修复(如果支持)
235
+ oxlint --fix
236
+ ```
237
+
238
+ ### 发布失败
239
+
240
+ ```bash
241
+ # 检查 npm 登录状态
242
+ npm whoami
243
+
244
+ # 如果未登录
245
+ npm login
246
+
247
+ # 手动发布
248
+ pnpm publish --no-git-checks --access public
249
+ ```
250
+
251
+ ---
252
+
253
+ ## 项目结构
254
+
255
+ ```
256
+ explore-ui/
257
+ ├── components/ # Vue 组件
258
+ ├── business-components/ # 业务组件
259
+ ├── hooks/ # Composable hooks
260
+ ├── directives/ # Vue 指令
261
+ ├── utils/ # 工具函数
262
+ ├── playground/ # 开发测试目录
263
+ ├── dist/ # 构建输出
264
+ ├── .github/workflows/ # GitHub Actions
265
+ └── package.json # 项目配置
266
+ ```
267
+
268
+ ---
269
+
270
+ ## 常用命令速查
271
+
272
+ | 命令 | 说明 |
273
+ |------|------|
274
+ | `pnpm run dev` | 启动开发服务器 |
275
+ | `pnpm run build` | 生产构建 |
276
+ | `pnpm run lint` | 代码检查 |
277
+ | `pnpm run fmt` | 代码格式化 |
278
+ | `pnpm install` | 安装依赖 |
279
+ | `pnpm publish --no-git-checks` | 发布到 npm |
280
+
281
+ ---
282
+
283
+ ## 相关资源
284
+
285
+ - [Vite 文档](https://vite.dev/)
286
+ - [Vue 3 文档](https://vuejs.org/)
287
+ - [Oxlint 文档](https://oxc.rs/docs/guide/linter)
288
+ - [Oxfmt 文档](https://oxc.rs/docs/guide/formatter)
289
+ - [npm 发布指南](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry)
@@ -158,9 +158,9 @@ export function useAddressFullCode(code, level) {
158
158
  code += ""
159
159
  if (code && code.length === 6) {
160
160
  if (!level) {
161
- if (/0000$/.test(code)) {
161
+ if (code.endsWith('0000')) {
162
162
  level = 1
163
- } else if (/00$/.test(code)) {
163
+ } else if (code.endsWith('00')) {
164
164
  level = 2
165
165
  } else {
166
166
  level = 3
@@ -1,5 +1,5 @@
1
1
  import { computed, defineComponent, inject, nextTick, onMounted, reactive, ref, watch } from "vue"
2
- import { EX_UPLOADER, EX_FORM } from "../provider/ExProvider.jsx"
2
+ import { EX_FORM, EX_UPLOADER } from "../provider/ExProvider.jsx"
3
3
  import { cloneDeep, every, isArray, isEqual, isFunction, isObject, isString, pick } from "lodash-es"
4
4
  import { initItemDefaultValue } from "./utils"
5
5
  import { useCache, useFetch, useFormFail, useFormFormat, useProcessStatusSuccess } from "../../hooks"
@@ -162,7 +162,7 @@ export default defineComponent({
162
162
  * 表单配置,[见下表](#form-表单配置)
163
163
  */
164
164
  form: {
165
- type: Array,
165
+ type: [Array, Function],
166
166
  default() {
167
167
  return []
168
168
  },
@@ -214,7 +214,7 @@ export default defineComponent({
214
214
  submitFormBackup: {}, //初始化后的表单数据备份,用于重置表单以及脏数据判断
215
215
  })
216
216
 
217
- const formItems = computed(() => props.form)
217
+ const formItems = computed(() => (isFunction(props.form) ? props.form() : props.form))
218
218
 
219
219
  const uploaderProvider = inject(EX_UPLOADER, () => ({}))
220
220
  const formProvider = inject(EX_FORM, () => ({}))
@@ -355,6 +355,7 @@ export default defineComponent({
355
355
  try {
356
356
  await showConfirmDialog({ message: props.submitConfirmText })
357
357
  } catch (e) {
358
+ console.error(e)
358
359
  return
359
360
  }
360
361
  }
@@ -56,9 +56,9 @@ const render = (item, submitForm, { props, slots }) => {
56
56
  ? {
57
57
  ...rule,
58
58
  pattern: new RegExp(rule.pattern),
59
- }
59
+ }
60
60
  : { ...rule },
61
- )
61
+ )
62
62
  : []
63
63
 
64
64
  // 具体组件的 props
@@ -103,91 +103,91 @@ const render = (item, submitForm, { props, slots }) => {
103
103
  switch (item.type) {
104
104
  case "select":
105
105
  renderItem = (
106
- <ExSelect v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
106
+ <ExSelect key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
107
107
  {componentSlots}
108
108
  </ExSelect>
109
109
  )
110
110
  break
111
111
  case "date":
112
112
  renderItem = (
113
- <ExDate v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
113
+ <ExDate key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
114
114
  {componentSlots}
115
115
  </ExDate>
116
116
  )
117
117
  break
118
118
  case "datetime":
119
119
  renderItem = (
120
- <ExDatetime v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
120
+ <ExDatetime key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
121
121
  {componentSlots}
122
122
  </ExDatetime>
123
123
  )
124
124
  break
125
125
  case "time":
126
126
  renderItem = (
127
- <ExTime v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
127
+ <ExTime key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
128
128
  {componentSlots}
129
129
  </ExTime>
130
130
  )
131
131
  break
132
132
  case "switch":
133
133
  renderItem = (
134
- <ExSwitch v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
134
+ <ExSwitch key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
135
135
  {componentSlots}
136
136
  </ExSwitch>
137
137
  )
138
138
  break
139
139
  case "radio":
140
140
  renderItem = (
141
- <ExRadio v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
141
+ <ExRadio key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
142
142
  {componentSlots}
143
143
  </ExRadio>
144
144
  )
145
145
  break
146
146
  case "checkbox":
147
147
  renderItem = (
148
- <ExCheckbox v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
148
+ <ExCheckbox key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
149
149
  {componentSlots}
150
150
  </ExCheckbox>
151
151
  )
152
152
  break
153
153
  case "address":
154
154
  renderItem = (
155
- <ExAddress v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
155
+ <ExAddress key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
156
156
  {componentSlots}
157
157
  </ExAddress>
158
158
  )
159
159
  break
160
160
  case "cascade":
161
161
  renderItem = (
162
- <ExCascader v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
162
+ <ExCascader key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
163
163
  {componentSlots}
164
164
  </ExCascader>
165
165
  )
166
166
  break
167
167
  case "number":
168
168
  renderItem = (
169
- <ExNumber v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
169
+ <ExNumber key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
170
170
  {componentSlots}
171
171
  </ExNumber>
172
172
  )
173
173
  break
174
174
  case "rate":
175
175
  renderItem = (
176
- <ExRate v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
176
+ <ExRate key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
177
177
  {componentSlots}
178
178
  </ExRate>
179
179
  )
180
180
  break
181
181
  case "slider":
182
182
  renderItem = (
183
- <ExSlider v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
183
+ <ExSlider key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
184
184
  {componentSlots}
185
185
  </ExSlider>
186
186
  )
187
187
  break
188
188
  case "uploader":
189
189
  renderItem = (
190
- <ExFieldUploader v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
190
+ <ExFieldUploader key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps}>
191
191
  {componentSlots}
192
192
  </ExFieldUploader>
193
193
  )
@@ -230,7 +230,7 @@ const render = (item, submitForm, { props, slots }) => {
230
230
  case "textarea":
231
231
  fieldProps.type = "textarea"
232
232
  renderItem = (
233
- <ExField v-model={submitForm[item.key]} {...fieldProps}>
233
+ <ExField key={item.key} v-model={submitForm[item.key]} {...fieldProps}>
234
234
  {componentSlots}
235
235
  </ExField>
236
236
  )
@@ -238,7 +238,7 @@ const render = (item, submitForm, { props, slots }) => {
238
238
  case "password":
239
239
  fieldProps.type = "password"
240
240
  renderItem = (
241
- <ExField v-model={submitForm[item.key]} {...fieldProps}>
241
+ <ExField key={item.key} v-model={submitForm[item.key]} {...fieldProps}>
242
242
  {componentSlots}
243
243
  </ExField>
244
244
  )
@@ -254,7 +254,7 @@ const render = (item, submitForm, { props, slots }) => {
254
254
  return true
255
255
  }
256
256
  }
257
- renderItem = <ExMatrixRadio v-model={submitForm[item.key]} {...componentProps} {...fieldProps} />
257
+ renderItem = <ExMatrixRadio key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps} />
258
258
  break
259
259
  }
260
260
  case "matrix-scale": {
@@ -268,7 +268,7 @@ const render = (item, submitForm, { props, slots }) => {
268
268
  return true
269
269
  }
270
270
  }
271
- renderItem = <ExMatrixScale v-model={submitForm[item.key]} {...componentProps} {...fieldProps} />
271
+ renderItem = <ExMatrixScale key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps} />
272
272
  break
273
273
  }
274
274
  case "matrix-checkbox": {
@@ -282,12 +282,12 @@ const render = (item, submitForm, { props, slots }) => {
282
282
  return true
283
283
  }
284
284
  }
285
- renderItem = <ExMatrixCheckbox v-model={submitForm[item.key]} {...componentProps} {...fieldProps} />
285
+ renderItem = <ExMatrixCheckbox key={item.key} v-model={submitForm[item.key]} {...componentProps} {...fieldProps} />
286
286
  break
287
287
  }
288
288
  default:
289
289
  renderItem = (
290
- <ExField v-model={submitForm[item.key]} {...fieldProps}>
290
+ <ExField key={item.key} v-model={submitForm[item.key]} {...fieldProps}>
291
291
  {componentSlots}
292
292
  </ExField>
293
293
  )
@@ -1,6 +1,6 @@
1
- import { defineComponent, inject, reactive, nextTick, ref, onMounted, onUnmounted } from "vue"
2
- import { useFetch, useCache, useSm3 } from "../../hooks"
3
- import { closeToast, Empty, List, Pagination, PullRefresh, showLoadingToast, Sticky } from "vant"
1
+ import { defineComponent, inject, nextTick, onMounted, onUnmounted, reactive, ref } from "vue"
2
+ import { useCache, useFetch, useSm3 } from "../../hooks"
3
+ import { closeToast, Empty, List, Pagination, PullRefresh, showLoadingToast, showToast, Sticky } from "vant"
4
4
  import ExSearch from "../search/ExSearch.jsx"
5
5
  import "./index.less"
6
6
  import { EX_PAGINATION } from "../provider/ExProvider.jsx"
@@ -206,6 +206,7 @@ export default defineComponent({
206
206
  data = {}
207
207
  try {
208
208
  state.loading = true
209
+ state.refreshLoading = true
209
210
 
210
211
  const method = props.method
211
212
 
@@ -224,6 +225,7 @@ export default defineComponent({
224
225
 
225
226
  res = await useFetch()[method](props.url, data)
226
227
  } catch (e) {
228
+ console.error(e)
227
229
  state.error = true
228
230
  state.errorMessage = "加载失败"
229
231
  if (props.persistence) {
@@ -281,6 +283,14 @@ export default defineComponent({
281
283
  }
282
284
 
283
285
  const onSearch = (searchData) => {
286
+ if (state.loading || state.refreshLoading) {
287
+ showToast({
288
+ message: "加载中,请稍后",
289
+ forbidClick: true,
290
+ })
291
+ return
292
+ }
293
+
284
294
  const isPersistence = !isUndefined(searchData.persistence) && searchData.persistence
285
295
 
286
296
  if (isPersistence) {
@@ -387,9 +397,9 @@ export default defineComponent({
387
397
  ? slots.renderItem({
388
398
  item,
389
399
  index,
390
- })
400
+ })
391
401
  : null,
392
- )
402
+ )
393
403
  : null
394
404
 
395
405
  nextTick(() => {