vue2-client 1.8.78 → 1.8.80
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
package/package.json
CHANGED
|
@@ -42,7 +42,6 @@ export default {
|
|
|
42
42
|
pieChart: null,
|
|
43
43
|
columnChart: null,
|
|
44
44
|
lineChart: null,
|
|
45
|
-
intervalId: null,
|
|
46
45
|
componentKey: 0,
|
|
47
46
|
commonOptions: {
|
|
48
47
|
tooltip: {
|
|
@@ -63,14 +62,6 @@ export default {
|
|
|
63
62
|
},
|
|
64
63
|
mounted () {
|
|
65
64
|
this.initData()
|
|
66
|
-
// 定时刷新图表
|
|
67
|
-
this.intervalId = setInterval(() => {
|
|
68
|
-
this.renderLineChart()
|
|
69
|
-
}, 3000)
|
|
70
|
-
},
|
|
71
|
-
beforeDestroy () {
|
|
72
|
-
// 组件销毁时清除定时器
|
|
73
|
-
clearInterval(this.intervalId)
|
|
74
65
|
},
|
|
75
66
|
props: {
|
|
76
67
|
rawData: {
|
|
@@ -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
|
-
|
|
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 }
|