vue2-client 1.8.78 → 1.8.79

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.8.79 -2024-3-6 @江超**
5
+ - 增加实体保存的方法
6
+
4
7
  **1.8.78 -2024-3-6 @江超**
5
8
  - 修复json列在`XAddNativeForm`中的错误行为
6
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.78",
3
+ "version": "1.8.79",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -0,0 +1,18 @@
1
+ import { post } from '@vue2-client/services/api/restTools'
2
+
3
+ const entityApi = {
4
+ // 根据ID查询数据
5
+ getById: (entityName, id, data = {}, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
6
+ return post(`/api/${serviceName}/entity/query/${entityName}/${id}`, data)
7
+ },
8
+ // 根据ID集合查询所有数据
9
+ findAllByIds: (entityName, data, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
10
+ return post(`/api/${serviceName}/entity/query/${entityName}`, data)
11
+ },
12
+ // 查询实体的总数量
13
+ getCount: (entityName, serviceName = process.env.VUE_APP_SYSTEM_NAME) => {
14
+ return post(`/api/${serviceName}/entity/queryCount/${entityName}`, {})
15
+ }
16
+ }
17
+
18
+ export { entityApi }
@@ -21,4 +21,26 @@ function post (url, parameter, config = {}) {
21
21
  return request(url, METHOD.POST, parameter, config)
22
22
  }
23
23
 
24
- export { get, post }
24
+ /**
25
+ * DELETE请求
26
+ * @param url 请求地址
27
+ * @param parameter 请求参数
28
+ * @param config
29
+ * @returns {Promise<AxiosResponse<T>>}
30
+ */
31
+ function del (url, parameter, config = {}) {
32
+ return request(url, METHOD.DELETE, parameter, config)
33
+ }
34
+
35
+ /**
36
+ * PUT请求
37
+ * @param url 请求地址
38
+ * @param parameter 请求参数
39
+ * @param config
40
+ * @returns {Promise<AxiosResponse<T>>}
41
+ */
42
+ function put (url, parameter, config = {}) {
43
+ return request(url, METHOD.PUT, parameter, config)
44
+ }
45
+
46
+ export { get, post, del, put }