kz-ui-base 1.0.25 → 1.0.26

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.
@@ -1,8 +1,6 @@
1
1
  import Vue from "vue";
2
2
  import request from "../../utils/request";
3
- import dict from "../../utils/dict";
4
3
  let that = new Vue();
5
- //import * as cache from '../..plugins/cache'
6
4
 
7
5
  //公共接口
8
6
 
@@ -49,118 +47,131 @@ export function ajaxUrl(options) {
49
47
  }
50
48
 
51
49
  // 查询数据列表
52
- export function listEntity(moduleName, serviceName, query, action) {
50
+ export function listEntity(moduleName, serviceName, query, action,option) {
53
51
  if (!action) action = "list";
54
52
  return request({
55
53
  url: `${moduleName}/${serviceName}/${action}`,
56
- method: "get",
54
+ method: option&&option.method || "get",
57
55
  params: query,
56
+ timeout: option&&option.timeout || null,
58
57
  });
59
58
  }
60
59
 
61
60
  // 查询数据详细
62
- export function getEntity(moduleName, serviceName, query) {
61
+ export function getEntity(moduleName, serviceName, query,option) {
63
62
  return request({
64
63
  url: `${moduleName}/${serviceName}/byId`,
65
- method: "get",
64
+ method: option&&option.method || "get",
66
65
  params: query,
66
+ timeout: option&&option.timeout || null,
67
67
  });
68
68
  }
69
69
 
70
70
  // 新增数据
71
- export function addEntity(moduleName, serviceName, data) {
71
+ export function addEntity(moduleName, serviceName, data,option) {
72
72
  return request({
73
73
  url: `${moduleName}/${serviceName}`,
74
- method: "post",
74
+ method: option&&option.method ||"post",
75
75
  data: data,
76
+ timeout: option&&option.timeout || null,
76
77
  });
77
78
  }
78
79
 
79
80
  // 修改数据
80
- export function updateEntity(moduleName, serviceName, data) {
81
+ export function updateEntity(moduleName, serviceName, data,option) {
81
82
  return request({
82
83
  url: `${moduleName}/${serviceName}`,
83
- method: "put",
84
+ method: option&&option.method ||"put",
84
85
  data: data,
86
+ timeout: option&&option.timeout || null,
85
87
  });
86
88
  }
87
89
 
88
90
  // 删除数据
89
- export function delEntity(moduleName, serviceName, data) {
91
+ export function delEntity(moduleName, serviceName, data,option) {
90
92
  return request({
91
93
  url: `${moduleName}/${serviceName}`,
92
- method: "delete",
94
+ method: option&&option.method ||"delete",
93
95
  data: data,
96
+ timeout: option&&option.timeout || null,
94
97
  });
95
98
  }
96
99
 
97
100
  // 指定方法提交数据
98
- export function postEntity(moduleName, serviceName, action, data) {
101
+ export function postEntity(moduleName, serviceName, action, data,option) {
99
102
  if (!action) action = "post";
100
103
  return request({
101
104
  url: `${moduleName}/${serviceName}/${action}`,
102
- method: "post",
105
+ method: option&&option.method ||"post",
103
106
  data: data,
107
+ timeout: option&&option.timeout || null,
108
+
104
109
  });
105
110
  }
106
111
 
107
112
  // 指定方法提交数据
108
- export function startWorkflow(moduleName, serviceName, data, wfKey) {
113
+ export function startWorkflow(moduleName, serviceName, data, wfKey,option) {
109
114
  let action = "startAndSaveDraft";
110
115
  if (!wfKey) wfKey = serviceName;
111
116
  data["AppCode"] = "ruoyi";
112
117
  return request({
113
118
  url: `${moduleName}/${serviceName}/${action}/${wfKey}`,
114
- method: "post",
119
+ method:option&&option.method || "post",
115
120
  data: data,
121
+ timeout: option&&option.timeout || null,
116
122
  });
117
123
  }
118
124
 
119
125
  // 根据Url查询数据
120
- export function getUrl(url, query, async) {
126
+ export function getUrl(url, query, async,option) {
121
127
  if (async == "false") async = false;
122
128
  else async = true;
123
129
  return request({
124
130
  url: url,
125
- method: "get",
131
+ method: option&&option.method ||"get",
126
132
  async: async,
127
133
  params: query,
134
+ timeout: option&&option.timeout || null,
128
135
  });
129
136
  }
130
137
 
131
138
  // 根据Url查询数据
132
- export function postUrl(url, data, async) {
139
+ export function postUrl(url, data, async,option) {
133
140
  if (async == "false") async = false;
134
141
  else async = true;
135
142
  return request({
136
143
  url: url,
137
- method: "post",
144
+ method: option&&option.method ||"post",
138
145
  async: async,
139
146
  data: data,
147
+ timeout: option&&option.timeout || null,
140
148
  });
141
149
  }
142
150
  // 查询下拉树结构
143
- export function treeSelect(moduleName, treeShapeName) {
151
+ export function treeSelect(moduleName, treeShapeName,option) {
144
152
  return request({
145
153
  url: `${moduleName}/interfaceSetting/treeSelect`,
146
- method: "get",
154
+ method: option&&option.method ||"get",
147
155
  params: treeShapeName,
156
+ timeout: option&&option.timeout || null,
148
157
  });
149
158
  }
150
159
  // 初始化字段
151
- export function initField(moduleName, data) {
160
+ export function initField(moduleName, data,option) {
152
161
  return request({
153
162
  url: `${moduleName}/fieldDefinition/initField`,
154
- method: "post",
163
+ method: option&&option.method ||"post",
155
164
  data: data,
165
+ timeout: option&&option.timeout || null,
156
166
  });
157
167
  }
158
168
  //初始化列表字段
159
- export function initTableField(data) {
169
+ export function initTableField(data,option) {
160
170
  return request({
161
171
  url: `lowcode/listSetting/initTableField`,
162
- method: "get",
172
+ method: option&&option.method ||"get",
163
173
  params: data,
174
+ timeout: option&&option.timeout || null,
164
175
  });
165
176
  }
166
177
  //根据entityName和moduleName 定位界面设置
@@ -172,19 +183,21 @@ export function selectInterfaceSetting(data) {
172
183
  });
173
184
  }
174
185
  //初始化编辑列表字段(查询列表编辑数据)
175
- export function initEditListColumns(data) {
186
+ export function initEditListColumns(data,option) {
176
187
  return request({
177
188
  url: `lowcode/dataEditing/initEditListColumns`,
178
- method: "get",
189
+ method: option&&option.method ||"get",
179
190
  params: data,
191
+ timeout: option&&option.timeout || null,
180
192
  });
181
193
  }
182
194
  //初始化搜素列表
183
- export function initSearchRules(data) {
195
+ export function initSearchRules(data,option) {
184
196
  return request({
185
197
  url: `lowcode/search/initSearchRules`,
186
- method: "get",
198
+ method: ption&&option.method ||"get",
187
199
  params: data,
200
+ timeout: option&&option.timeout || null,
188
201
  });
189
202
  }
190
203
 
@@ -1,71 +1,79 @@
1
1
  import request from '../../utils/request'
2
2
 
3
3
  // 素材上传
4
- export function uploadMaterial(data) {
4
+ export function uploadMaterial(data,option) {
5
5
  return request({
6
6
  url: '/system/material/upload',
7
- method: 'post',
8
- data: data
7
+ method: option&&option.method ||'post',
8
+ data: data,
9
+ timeout: option&&option.timeout || null,
9
10
  })
10
11
  }
11
12
 
12
13
  // 查询素材信息列表
13
- export function listMaterial(query) {
14
+ export function listMaterial(query,option) {
14
15
  return request({
15
16
  url: '/system/material/list',
16
- method: 'get',
17
- params: query
17
+ method: option&&option.method ||'get',
18
+ params: query,
19
+ timeout: option&&option.timeout || null,
18
20
  })
19
21
  }
20
22
 
21
23
  // 修改素材信息
22
- export function updateMaterial(data) {
24
+ export function updateMaterial(data,option) {
23
25
  return request({
24
26
  url: '/system/material',
25
- method: 'put',
26
- data: data
27
+ method: option&&option.method ||'put',
28
+ data: data,
29
+ timeout: option&&option.timeout || null,
27
30
  })
28
31
  }
29
32
 
30
33
  // 删除素材信息
31
- export function delMaterial(materialId) {
34
+ export function delMaterial(materialId,option) {
32
35
  return request({
33
36
  url: '/system/material/' + materialId,
34
- method: 'delete'
37
+ method: option&&option.method ||'delete',
38
+ timeout: option&&option.timeout || null,
35
39
  })
36
40
  }
37
41
 
38
42
  // 查询父级分类信息
39
- export function parentFolder(query) {
43
+ export function parentFolder(query,option) {
40
44
  return request({
41
45
  url: '/system/folder/parent',
42
- method: 'get',
43
- params: query
46
+ method: option&&option.method ||'get',
47
+ params: query,
48
+ timeout: option&&option.timeout || null,
44
49
  })
45
50
  }
46
51
 
47
52
  // 新增素材分类
48
- export function addFolder(data) {
53
+ export function addFolder(data,option) {
49
54
  return request({
50
55
  url: '/system/folder',
51
- method: 'post',
52
- data: data
56
+ method: option&&option.method ||'post',
57
+ data: data,
58
+ timeout: option&&option.timeout || null,
53
59
  })
54
60
  }
55
61
 
56
62
  // 修改素材分类
57
- export function updateFolder(data) {
63
+ export function updateFolder(data,option) {
58
64
  return request({
59
65
  url: '/system/folder',
60
- method: 'put',
61
- data: data
66
+ method: option&&option.method ||'put',
67
+ data: data,
68
+ timeout: option&&option.timeout || null,
62
69
  })
63
70
  }
64
71
 
65
72
  // 删除素材分类
66
- export function delFolder(folderId) {
73
+ export function delFolder(folderId,option) {
67
74
  return request({
68
75
  url: '/system/folder/' + folderId,
69
- method: 'delete'
76
+ method: option&&option.method ||'delete',
77
+ timeout: option&&option.timeout || null,
70
78
  })
71
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {