aldehyde 0.2.2 → 0.2.3
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/lib/controls/code-editor/sql-code-editor.js +1 -1
- package/lib/controls/code-editor/sql-code-editor.js.map +1 -1
- package/lib/controls/collapse-card/index.js +1 -1
- package/lib/controls/collapse-card/index.js.map +1 -1
- package/lib/controls/color-picker/index.js +1 -1
- package/lib/controls/color-picker/index.js.map +1 -1
- package/lib/controls/entity-select/entity-select.d.ts +15 -2
- package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
- package/lib/controls/entity-select/entity-select.js +88 -17
- package/lib/controls/entity-select/entity-select.js.map +1 -1
- package/lib/controls/html-editor/draft.js +1 -1
- package/lib/controls/html-editor/draft.js.map +1 -1
- package/lib/detail/edit/dtmpl-edit-page.d.ts +2 -1
- package/lib/detail/edit/dtmpl-edit-page.d.ts.map +1 -1
- package/lib/detail/edit/dtmpl-edit-page.js +8 -6
- package/lib/detail/edit/dtmpl-edit-page.js.map +1 -1
- package/lib/detail/edit/fields-edit-card.js +1 -1
- package/lib/detail/edit/fields-edit-card.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +1 -1
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/{module/dtmpl-view-page.d.ts → detail/view/dtmpl-view-card.d.ts} +5 -5
- package/lib/detail/view/dtmpl-view-card.d.ts.map +1 -0
- package/lib/{module/dtmpl-view-page.js → detail/view/dtmpl-view-card.js} +7 -7
- package/lib/detail/view/dtmpl-view-card.js.map +1 -0
- package/lib/detail/view/dtmpl-view-page.d.ts +33 -0
- package/lib/detail/view/dtmpl-view-page.d.ts.map +1 -0
- package/lib/detail/view/dtmpl-view-page.js +46 -0
- package/lib/detail/view/dtmpl-view-page.js.map +1 -0
- package/lib/import/excel-import.js +1 -1
- package/lib/import/excel-import.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/layout/coverstyle.css +3 -0
- package/lib/layout/menu/user-bar.d.ts +2 -0
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.js +21 -8
- package/lib/layout/menu/user-bar.js.map +1 -1
- package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
- package/lib/layout/menu/userinfo-bar.js +2 -7
- package/lib/layout/menu/userinfo-bar.js.map +1 -1
- package/lib/login/context-setter.d.ts.map +1 -1
- package/lib/login/context-setter.js.map +1 -1
- package/lib/table/query-table.js +2 -2
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.js +1 -1
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/welcome/workbench.js +2 -2
- package/lib/welcome/workbench.js.map +1 -1
- package/package.json +2 -2
- package/src/aldehyde/controls/code-editor/sql-code-editor.tsx +1 -1
- package/src/aldehyde/controls/collapse-card/index.tsx +1 -1
- package/src/aldehyde/controls/color-picker/index.tsx +1 -1
- package/src/aldehyde/controls/entity-select/entity-select.tsx +171 -63
- package/src/aldehyde/controls/html-editor/draft.tsx +1 -1
- package/src/aldehyde/detail/edit/dtmpl-edit-page.tsx +16 -7
- package/src/aldehyde/detail/edit/fields-edit-card.tsx +1 -1
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +1 -1
- package/src/aldehyde/{module/dtmpl-view-page.tsx → detail/view/dtmpl-view-card.tsx} +8 -8
- package/src/aldehyde/detail/view/dtmpl-view-page.tsx +79 -0
- package/src/aldehyde/import/excel-import.tsx +1 -1
- package/src/aldehyde/index.tsx +3 -3
- package/src/aldehyde/layout/coverstyle.css +3 -0
- package/src/aldehyde/layout/menu/user-bar.tsx +29 -14
- package/src/aldehyde/layout/menu/userinfo-bar.tsx +3 -20
- package/src/aldehyde/login/context-setter.tsx +1 -1
- package/src/aldehyde/table/query-table.tsx +2 -2
- package/src/aldehyde/table/relation-table.tsx +1 -1
- package/src/aldehyde/tmpl/hcservice-v3.tsx +107 -113
- package/src/aldehyde/welcome/workbench.tsx +2 -2
- package/lib/module/dtmpl-view-page.d.ts.map +0 -1
- package/lib/module/dtmpl-view-page.js.map +0 -1
|
@@ -4,20 +4,20 @@ import {message} from 'antd'
|
|
|
4
4
|
import EncryptUtils from '../units/EncryptUtils'
|
|
5
5
|
// import moment from 'moment';
|
|
6
6
|
import format from 'dayjs';
|
|
7
|
-
import {
|
|
7
|
+
import {PageInfo, SelectedRow} from "./interface";
|
|
8
8
|
import HCDataSource from "./hc-data-source";
|
|
9
9
|
|
|
10
10
|
export default class HcserviceV3 {
|
|
11
11
|
|
|
12
|
-
static async requestEnum(mstrucIds,path?:string) { //有下拉菜单时,请求下拉选项操作
|
|
13
|
-
if(!path){
|
|
14
|
-
|
|
15
|
-
}else{
|
|
16
|
-
return await this.requestEnumWithPath(mstrucIds,path);
|
|
12
|
+
static async requestEnum(mstrucIds, path?: string) { //有下拉菜单时,请求下拉选项操作
|
|
13
|
+
if (!path) {
|
|
14
|
+
return await this.requestEnumWithPath(mstrucIds, "/enum");
|
|
15
|
+
} else {
|
|
16
|
+
return await this.requestEnumWithPath(mstrucIds, path);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
static async requestEnumWithPath(mstrucIds,path) {
|
|
20
|
+
static async requestEnumWithPath(mstrucIds, path) {
|
|
21
21
|
if (mstrucIds.length > 0) {
|
|
22
22
|
let res = await Super.super({
|
|
23
23
|
url: `/v3${path}`,
|
|
@@ -32,7 +32,7 @@ export default class HcserviceV3 {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
static async requestOptions(mstrucId) { //有下拉菜单时,请求下拉选项操作
|
|
35
|
-
|
|
35
|
+
return await this.requestEnum([mstrucId]);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// static async requestSelect(requestedMap, selectMSFieldIdArray) {
|
|
@@ -55,35 +55,35 @@ export default class HcserviceV3 {
|
|
|
55
55
|
// return requestedMap;
|
|
56
56
|
// }
|
|
57
57
|
|
|
58
|
-
static async requestDtmplConfig(sourceId:string) {
|
|
58
|
+
static async requestDtmplConfig(sourceId: string) {
|
|
59
59
|
|
|
60
60
|
let url = `/v3/dtmpl/config`
|
|
61
61
|
let res = await Super.super({
|
|
62
62
|
url,
|
|
63
63
|
method: "GET",
|
|
64
|
-
query:{sourceId}
|
|
64
|
+
query: {sourceId}
|
|
65
65
|
});
|
|
66
66
|
return res.dtmplConfig;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
static async requestViewDtmplConfig(sourceId:string) {
|
|
69
|
+
static async requestViewDtmplConfig(sourceId: string) {
|
|
70
70
|
|
|
71
71
|
let url = `/v3/view-dtmpl/config`
|
|
72
72
|
let res = await Super.super({
|
|
73
73
|
url,
|
|
74
74
|
method: "GET",
|
|
75
|
-
query:{sourceId}
|
|
75
|
+
query: {sourceId}
|
|
76
76
|
});
|
|
77
77
|
return res.dtmplConfig;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
static async requestAddDtmplConfig(sourceId:string) {
|
|
80
|
+
static async requestAddDtmplConfig(sourceId: string) {
|
|
81
81
|
|
|
82
82
|
let url = `/v3/add-dtmpl/config`
|
|
83
83
|
let res = await Super.super({
|
|
84
84
|
url,
|
|
85
85
|
method: "GET",
|
|
86
|
-
query:{sourceId}
|
|
86
|
+
query: {sourceId}
|
|
87
87
|
});
|
|
88
88
|
return res.dtmplConfig;
|
|
89
89
|
}
|
|
@@ -103,7 +103,7 @@ export default class HcserviceV3 {
|
|
|
103
103
|
let res = await Super.super({
|
|
104
104
|
url,
|
|
105
105
|
method: "GET",
|
|
106
|
-
query:{sourceId}
|
|
106
|
+
query: {sourceId}
|
|
107
107
|
});
|
|
108
108
|
return res.selectConfig;
|
|
109
109
|
}
|
|
@@ -113,7 +113,7 @@ export default class HcserviceV3 {
|
|
|
113
113
|
let res = await Super.super({
|
|
114
114
|
url,
|
|
115
115
|
method: "GET",
|
|
116
|
-
query:{sourceId}
|
|
116
|
+
query: {sourceId}
|
|
117
117
|
});
|
|
118
118
|
return res;
|
|
119
119
|
}
|
|
@@ -123,7 +123,7 @@ export default class HcserviceV3 {
|
|
|
123
123
|
let res = await Super.super({
|
|
124
124
|
url,
|
|
125
125
|
method: "GET",
|
|
126
|
-
query:{sourceId}
|
|
126
|
+
query: {sourceId}
|
|
127
127
|
});
|
|
128
128
|
return res;
|
|
129
129
|
}
|
|
@@ -134,29 +134,29 @@ export default class HcserviceV3 {
|
|
|
134
134
|
let res = await Super.super({
|
|
135
135
|
url: url,
|
|
136
136
|
method: 'GET',
|
|
137
|
-
query: {...condition,sourceId}
|
|
137
|
+
query: {...condition, sourceId}
|
|
138
138
|
});
|
|
139
139
|
return res;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
static async requestLtmplQueryTop(sourceId, condition) {
|
|
143
|
-
|
|
143
|
+
// console.log('condition:',condition);
|
|
144
144
|
let url = `/v3/ltmpl/top-data`
|
|
145
|
-
return await this.requestCommonLtmplQueryTop(sourceId,condition,url);
|
|
145
|
+
return await this.requestCommonLtmplQueryTop(sourceId, condition, url);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
static async requestMstrucLtmplQueryTop(sourceId, condition) {
|
|
149
149
|
//console.log('condition:',condition);
|
|
150
150
|
let url = `/v3/mstruc/ltmpl/top-data`
|
|
151
|
-
return await this.requestCommonLtmplQueryTop(sourceId,condition,url);
|
|
151
|
+
return await this.requestCommonLtmplQueryTop(sourceId, condition, url);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
static async requestCommonLtmplQueryTop(sourceId, condition,url) {
|
|
154
|
+
static async requestCommonLtmplQueryTop(sourceId, condition, url) {
|
|
155
155
|
|
|
156
156
|
let res = await Super.super({
|
|
157
157
|
url: url,
|
|
158
158
|
method: 'GET',
|
|
159
|
-
query: {...condition,sourceId}
|
|
159
|
+
query: {...condition, sourceId}
|
|
160
160
|
});
|
|
161
161
|
return res;
|
|
162
162
|
}
|
|
@@ -170,7 +170,7 @@ export default class HcserviceV3 {
|
|
|
170
170
|
|
|
171
171
|
let res = await Super.super({
|
|
172
172
|
url: url,
|
|
173
|
-
query: {codes,sourceId},
|
|
173
|
+
query: {codes, sourceId},
|
|
174
174
|
method: 'GET'
|
|
175
175
|
});
|
|
176
176
|
if (res.status === "success") {
|
|
@@ -195,14 +195,14 @@ export default class HcserviceV3 {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
|
|
198
|
-
static async requestCommonDtmplData(sourceId, code,versionId,url) {
|
|
198
|
+
static async requestCommonDtmplData(sourceId, code, versionId, url) {
|
|
199
199
|
// if(sourceId=="user"){
|
|
200
200
|
// return this.requestUserDtmplData();
|
|
201
201
|
// }
|
|
202
202
|
let res = await Super.super({
|
|
203
203
|
url: url,
|
|
204
204
|
query: {
|
|
205
|
-
code,versionId,sourceId
|
|
205
|
+
code, versionId, sourceId
|
|
206
206
|
},
|
|
207
207
|
method: 'GET'
|
|
208
208
|
});
|
|
@@ -214,36 +214,35 @@ export default class HcserviceV3 {
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
static async requestDtmplData(sourceId, code,versionId) {
|
|
217
|
+
static async requestDtmplData(sourceId, code, versionId) {
|
|
218
218
|
let url = `/v3/dtmpl/data`;
|
|
219
|
-
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
219
|
+
return await this.requestCommonDtmplData(sourceId, code, versionId, url)
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
static async requestMstrucDtmplData(sourceId, code,versionId) {
|
|
222
|
+
static async requestMstrucDtmplData(sourceId, code, versionId) {
|
|
223
223
|
let url = `/v3/mstruc/dtmpl/data`;
|
|
224
|
-
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
224
|
+
return await this.requestCommonDtmplData(sourceId, code, versionId, url)
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
static async requestViewDtmplData(sourceId, code,versionId) {
|
|
227
|
+
static async requestViewDtmplData(sourceId, code, versionId) {
|
|
228
228
|
let url = `/v3/view-dtmpl/data`;
|
|
229
|
-
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
229
|
+
return await this.requestCommonDtmplData(sourceId, code, versionId, url)
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
static async requestMstrucViewDtmplData(sourceId, code,versionId) {
|
|
232
|
+
static async requestMstrucViewDtmplData(sourceId, code, versionId) {
|
|
233
233
|
let url = `/v3/mstruc/view-dtmpl/data`;
|
|
234
|
-
return await this.requestCommonDtmplData(sourceId, code,versionId,url)
|
|
234
|
+
return await this.requestCommonDtmplData(sourceId, code, versionId, url)
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
|
|
238
|
-
|
|
239
|
-
static async postCommonDtmplData(sourceId:string, formDataObj, message,url) {
|
|
238
|
+
static async postCommonDtmplData(sourceId: string, formDataObj, message, url) {
|
|
240
239
|
const formData = new FormData();
|
|
241
240
|
for (let k in formDataObj) {
|
|
242
|
-
if(!k.startsWith("$virtual")){
|
|
243
|
-
formData.append(k, formDataObj[k] || formDataObj[k]==0 ? formDataObj[k]:"");
|
|
241
|
+
if (!k.startsWith("$virtual")) {
|
|
242
|
+
formData.append(k, formDataObj[k] || formDataObj[k] == 0 ? formDataObj[k] : "");
|
|
244
243
|
}
|
|
245
244
|
}
|
|
246
|
-
formData.append('sourceId',sourceId.toString())
|
|
245
|
+
formData.append('sourceId', sourceId.toString())
|
|
247
246
|
let res = await Super.super({
|
|
248
247
|
url: url,
|
|
249
248
|
data: formData,
|
|
@@ -256,35 +255,35 @@ export default class HcserviceV3 {
|
|
|
256
255
|
if (res.message) {
|
|
257
256
|
msg = res.message;
|
|
258
257
|
}
|
|
259
|
-
if(message){
|
|
258
|
+
if (message) {
|
|
260
259
|
message.success("保存成功! " + msg)
|
|
261
260
|
}
|
|
262
261
|
code = res.entityCode ? res.entityCode : res.code;
|
|
263
262
|
} else {
|
|
264
|
-
if(message){
|
|
263
|
+
if (message) {
|
|
265
264
|
message.error("保存失败");
|
|
266
265
|
}
|
|
267
266
|
}
|
|
268
267
|
} else {
|
|
269
|
-
if(message){
|
|
268
|
+
if (message) {
|
|
270
269
|
message.error("保存成功");
|
|
271
270
|
}
|
|
272
271
|
}
|
|
273
|
-
return {code,status:res.status};
|
|
272
|
+
return {code, status: res.status};
|
|
274
273
|
}
|
|
275
274
|
|
|
276
|
-
static async postDtmplData(sourceId:string, formDataObj, message) {
|
|
275
|
+
static async postDtmplData(sourceId: string, formDataObj, message) {
|
|
277
276
|
let url = `/v3/dtmpl/data`;
|
|
278
|
-
return await this.postCommonDtmplData(sourceId,formDataObj, message,url);
|
|
277
|
+
return await this.postCommonDtmplData(sourceId, formDataObj, message, url);
|
|
279
278
|
}
|
|
280
279
|
|
|
281
|
-
static async postMstrucDtmplData(sourceId:string, formDataObj, message) {
|
|
280
|
+
static async postMstrucDtmplData(sourceId: string, formDataObj, message) {
|
|
282
281
|
let url = `/v3/mstruc/dtmpl/data`;
|
|
283
|
-
return await this.postCommonDtmplData(sourceId,formDataObj, message,url);
|
|
282
|
+
return await this.postCommonDtmplData(sourceId, formDataObj, message, url);
|
|
284
283
|
}
|
|
285
284
|
|
|
286
|
-
static
|
|
287
|
-
|
|
285
|
+
static postFileAction(file) {
|
|
286
|
+
return Units.api() + `/v3/upload`;
|
|
288
287
|
}
|
|
289
288
|
|
|
290
289
|
static async postFile(formData, message) {
|
|
@@ -310,24 +309,22 @@ export default class HcserviceV3 {
|
|
|
310
309
|
}
|
|
311
310
|
|
|
312
311
|
|
|
313
|
-
|
|
314
312
|
static async requestL2LtmplQueryKey(sourceId, condition) {
|
|
315
313
|
let url = `v3/l2/ltmpl/query/key`
|
|
316
314
|
let res = await Super.super({
|
|
317
315
|
url: url,
|
|
318
316
|
method: 'GET',
|
|
319
|
-
query: {...condition,sourceId}
|
|
317
|
+
query: {...condition, sourceId}
|
|
320
318
|
});
|
|
321
319
|
return res;
|
|
322
320
|
}
|
|
323
321
|
|
|
324
322
|
|
|
325
|
-
|
|
326
323
|
static async requestLtmplCount(sourceId) {
|
|
327
324
|
let url = `/v3/ltmpl/data/count`;
|
|
328
325
|
let res = await Super.super({
|
|
329
326
|
url: url,
|
|
330
|
-
query:{sourceId},
|
|
327
|
+
query: {sourceId},
|
|
331
328
|
method: 'GET',
|
|
332
329
|
});
|
|
333
330
|
return res.count;
|
|
@@ -357,32 +354,31 @@ export default class HcserviceV3 {
|
|
|
357
354
|
// }
|
|
358
355
|
|
|
359
356
|
|
|
360
|
-
|
|
361
|
-
static async requestQueryData(queryKey:string, pageInfo:PageInfo) {
|
|
357
|
+
static async requestQueryData(queryKey: string, pageInfo: PageInfo) {
|
|
362
358
|
let res = await Super.super({
|
|
363
359
|
url: `/v3/ltmpl/query/data`,
|
|
364
360
|
method: 'GET',
|
|
365
361
|
query:
|
|
366
|
-
{queryKey
|
|
362
|
+
{queryKey, ...pageInfo}
|
|
367
363
|
});
|
|
368
364
|
return res;
|
|
369
365
|
}
|
|
370
366
|
|
|
371
|
-
static getCodesOfSelectedRows(selectedRows:SelectedRow[]){
|
|
372
|
-
let codes:string[]=[];
|
|
373
|
-
if(!selectedRows || selectedRows.length<1){
|
|
367
|
+
static getCodesOfSelectedRows(selectedRows: SelectedRow[]) {
|
|
368
|
+
let codes: string[] = [];
|
|
369
|
+
if (!selectedRows || selectedRows.length < 1) {
|
|
374
370
|
return;
|
|
375
371
|
}
|
|
376
372
|
|
|
377
|
-
for(let item of selectedRows){
|
|
378
|
-
if(item.code){
|
|
373
|
+
for (let item of selectedRows) {
|
|
374
|
+
if (item.code) {
|
|
379
375
|
codes.push(item.code);
|
|
380
|
-
}else{
|
|
376
|
+
} else {
|
|
381
377
|
message.error("没找到所选数据的Code!!");
|
|
382
378
|
}
|
|
383
379
|
}
|
|
384
380
|
|
|
385
|
-
if(codes.length<1){
|
|
381
|
+
if (codes.length < 1) {
|
|
386
382
|
message.error("没找到所选数据的Code!!");
|
|
387
383
|
}
|
|
388
384
|
|
|
@@ -390,23 +386,23 @@ export default class HcserviceV3 {
|
|
|
390
386
|
}
|
|
391
387
|
|
|
392
388
|
|
|
393
|
-
static async deleteData(sourceId, selectedRows:SelectedRow[]) {
|
|
394
|
-
|
|
395
|
-
|
|
389
|
+
static async deleteData(sourceId, selectedRows: SelectedRow[]) {
|
|
390
|
+
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
391
|
+
return await this.deleteByCode(sourceId, codes);
|
|
396
392
|
}
|
|
397
393
|
|
|
398
|
-
static async deleteByCode(sourceId, codes:string[]) {
|
|
394
|
+
static async deleteByCode(sourceId, codes: string[]) {
|
|
399
395
|
let res = await Super.super({
|
|
400
396
|
url: `/v3/ltmpl/data`,
|
|
401
397
|
data: {
|
|
402
|
-
codes,sourceId
|
|
398
|
+
codes, sourceId
|
|
403
399
|
},
|
|
404
400
|
method: 'DELETE',
|
|
405
401
|
});
|
|
406
|
-
if(res.status=='success'){
|
|
402
|
+
if (res.status == 'success') {
|
|
407
403
|
message.success("删除成功");
|
|
408
404
|
return true;
|
|
409
|
-
}else{
|
|
405
|
+
} else {
|
|
410
406
|
message.error("删除失败");
|
|
411
407
|
//console.log("删除失败消息",res.message);
|
|
412
408
|
return false;
|
|
@@ -417,13 +413,12 @@ export default class HcserviceV3 {
|
|
|
417
413
|
let res = await Super.super({
|
|
418
414
|
url: `/v3/ltmpl/query/count`,
|
|
419
415
|
method: "GET",
|
|
420
|
-
query:{queryKey}
|
|
416
|
+
query: {queryKey}
|
|
421
417
|
});
|
|
422
418
|
return res.count;
|
|
423
419
|
}
|
|
424
420
|
|
|
425
421
|
|
|
426
|
-
|
|
427
422
|
static async requestFile(path) {
|
|
428
423
|
let res = await Super.super({
|
|
429
424
|
url: "/v3/files/" + path,
|
|
@@ -432,14 +427,14 @@ export default class HcserviceV3 {
|
|
|
432
427
|
return res;
|
|
433
428
|
}
|
|
434
429
|
|
|
435
|
-
static async postActions(actionId, selectedRows:SelectedRow[],actionDataObj?:Object) {
|
|
436
|
-
const codes= this.getCodesOfSelectedRows(selectedRows);
|
|
430
|
+
static async postActions(actionId, selectedRows: SelectedRow[], actionDataObj?: Object) {
|
|
431
|
+
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
437
432
|
const formData = new FormData();
|
|
438
433
|
for (let k in actionDataObj) {
|
|
439
|
-
formData.append(k, actionDataObj[k]?actionDataObj[k]:"");
|
|
434
|
+
formData.append(k, actionDataObj[k] ? actionDataObj[k] : "");
|
|
440
435
|
}
|
|
441
|
-
formData.append('sourceId',actionId.toString())
|
|
442
|
-
formData.append('codes',codes.join(","));
|
|
436
|
+
formData.append('sourceId', actionId.toString())
|
|
437
|
+
formData.append('codes', codes.join(","));
|
|
443
438
|
let res = await Super.super({
|
|
444
439
|
url: `/v3/action`,
|
|
445
440
|
data: formData,
|
|
@@ -448,26 +443,26 @@ export default class HcserviceV3 {
|
|
|
448
443
|
return res;
|
|
449
444
|
}
|
|
450
445
|
|
|
451
|
-
static async postJumps(jumpId, code:string) {
|
|
446
|
+
static async postJumps(jumpId, code: string) {
|
|
452
447
|
let res = await Super.super({
|
|
453
448
|
url: `/v3/jump`,
|
|
454
449
|
query: {
|
|
455
450
|
code,
|
|
456
|
-
sourceId:jumpId,
|
|
451
|
+
sourceId: jumpId,
|
|
457
452
|
},
|
|
458
453
|
method: "GET",
|
|
459
454
|
});
|
|
460
455
|
return res;
|
|
461
456
|
}
|
|
462
457
|
|
|
463
|
-
static async increCalc(sourceId,
|
|
458
|
+
static async increCalc(sourceId, params = {}) {
|
|
464
459
|
let res = await Super.super({
|
|
465
460
|
url: `/v3/stat/increcalc`,
|
|
466
461
|
method: "POST",
|
|
467
|
-
data: {...params,sourceId}
|
|
462
|
+
data: {...params, sourceId}
|
|
468
463
|
});
|
|
469
464
|
if (res.status === 'success') {
|
|
470
|
-
|
|
465
|
+
message.success("统计成功")
|
|
471
466
|
} else {
|
|
472
467
|
message.error("统计失败")
|
|
473
468
|
}
|
|
@@ -477,24 +472,24 @@ export default class HcserviceV3 {
|
|
|
477
472
|
static downloadDetailExcel(sourceId, entityCode) {
|
|
478
473
|
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken")
|
|
479
474
|
let url = Units.api() + `/v3/dtmpl/excel?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`
|
|
480
|
-
Units.downloadFile(url,"详情");
|
|
475
|
+
Units.downloadFile(url, "详情");
|
|
481
476
|
}
|
|
482
477
|
|
|
483
478
|
static download(path) {
|
|
484
479
|
let vars = path.split("/");
|
|
485
480
|
let fileName = vars[vars.length - 1]
|
|
486
|
-
Units.downloadFile(this.getFileUrl(path)
|
|
481
|
+
Units.downloadFile(this.getFileUrl(path) + `&disposition=attachment`, fileName)
|
|
487
482
|
}
|
|
488
483
|
|
|
489
|
-
static openfile(path,toolbar) {
|
|
484
|
+
static openfile(path, toolbar) {
|
|
490
485
|
let vars = path.split("/");
|
|
491
486
|
let fileName = vars[vars.length - 1]
|
|
492
|
-
Units.openFile(this.getFileUrl(path), fileName,toolbar)
|
|
487
|
+
Units.openFile(this.getFileUrl(path), fileName, toolbar)
|
|
493
488
|
}
|
|
494
489
|
|
|
495
490
|
static getFileUrl(path) {
|
|
496
491
|
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken")
|
|
497
|
-
let url = Units.api() + Units.joinPath("/v3/files",path)+ `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
|
|
492
|
+
let url = Units.api() + Units.joinPath("/v3/files", path) + `?@token=${hydrocarbonToken}&@programToken=${Units.programCode()}`;
|
|
498
493
|
return url;
|
|
499
494
|
}
|
|
500
495
|
|
|
@@ -530,13 +525,13 @@ export default class HcserviceV3 {
|
|
|
530
525
|
return res.l2Menus;
|
|
531
526
|
}
|
|
532
527
|
|
|
533
|
-
static async requestBlocks(l2MenuId:string,blockId:string) {
|
|
528
|
+
static async requestBlocks(l2MenuId: string, blockId: string) {
|
|
534
529
|
let url = `/v3/menu/blocks`
|
|
535
530
|
let res = await Super.super({
|
|
536
531
|
url: url,
|
|
537
532
|
method: "GET",
|
|
538
|
-
query:{
|
|
539
|
-
|
|
533
|
+
query: {
|
|
534
|
+
l2MenuId, blockId
|
|
540
535
|
}
|
|
541
536
|
});
|
|
542
537
|
return res;
|
|
@@ -552,14 +547,13 @@ export default class HcserviceV3 {
|
|
|
552
547
|
}
|
|
553
548
|
|
|
554
549
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
let
|
|
558
|
-
let newPassword= EncryptUtils.rsaEncrypt(nPassword,pubkey);
|
|
550
|
+
static async resetPassword(oPassword, nPassword, pubkey) {
|
|
551
|
+
let oldPassword = EncryptUtils.rsaEncrypt(oPassword, pubkey);
|
|
552
|
+
let newPassword = EncryptUtils.rsaEncrypt(nPassword, pubkey);
|
|
559
553
|
let res = await Super.super({
|
|
560
554
|
url: '/v3/auth/password',
|
|
561
555
|
query: {
|
|
562
|
-
oldPassword,newPassword
|
|
556
|
+
oldPassword, newPassword
|
|
563
557
|
},
|
|
564
558
|
method: "POST"
|
|
565
559
|
})
|
|
@@ -567,20 +561,20 @@ export default class HcserviceV3 {
|
|
|
567
561
|
return res;
|
|
568
562
|
}
|
|
569
563
|
|
|
570
|
-
static async
|
|
564
|
+
static async getContextSourceConfig() {
|
|
571
565
|
let res = await Super.super({
|
|
572
566
|
url: '/v3/context-source-config',
|
|
573
567
|
method: "GET"
|
|
574
568
|
})
|
|
575
|
-
if(res){
|
|
569
|
+
if (res) {
|
|
576
570
|
return res.config;
|
|
577
|
-
}else{
|
|
571
|
+
} else {
|
|
578
572
|
return null
|
|
579
573
|
}
|
|
580
574
|
|
|
581
575
|
}
|
|
582
576
|
|
|
583
|
-
static async
|
|
577
|
+
static async getContextSourceValue() {
|
|
584
578
|
let res = await Super.super({
|
|
585
579
|
url: '/v3/auth/context-source-value',
|
|
586
580
|
method: "GET"
|
|
@@ -588,18 +582,18 @@ export default class HcserviceV3 {
|
|
|
588
582
|
return res.value;
|
|
589
583
|
}
|
|
590
584
|
|
|
591
|
-
static async login(json,kaptchaToken,kaptchaText,pubkey) {
|
|
585
|
+
static async login(json, kaptchaToken, kaptchaText, pubkey) {
|
|
592
586
|
|
|
593
|
-
|
|
587
|
+
let datetime = format(new Date()).format("YYYY-MM-DD HH:mm:ss")
|
|
594
588
|
let programCode
|
|
595
|
-
json['datetime']=datetime;
|
|
589
|
+
json['datetime'] = datetime;
|
|
596
590
|
|
|
597
|
-
let userInfo=
|
|
591
|
+
let userInfo = EncryptUtils.rsaEncrypt(JSON.stringify(json), pubkey);
|
|
598
592
|
|
|
599
593
|
let res = await Super.super({
|
|
600
594
|
url: '/v3/auth/hctoken',
|
|
601
595
|
query: {
|
|
602
|
-
userInfo,kaptchaToken,kaptchaText
|
|
596
|
+
userInfo, kaptchaToken, kaptchaText
|
|
603
597
|
},
|
|
604
598
|
method: "GET"
|
|
605
599
|
})
|
|
@@ -614,7 +608,7 @@ export default class HcserviceV3 {
|
|
|
614
608
|
|
|
615
609
|
static async setContext(json) {
|
|
616
610
|
const formData = new FormData();
|
|
617
|
-
formData.append("context",JSON.stringify(json));
|
|
611
|
+
formData.append("context", JSON.stringify(json));
|
|
618
612
|
let res = await Super.super({
|
|
619
613
|
url: '/v3/auth/context',
|
|
620
614
|
data: formData,
|
|
@@ -676,22 +670,22 @@ export default class HcserviceV3 {
|
|
|
676
670
|
return res.l2Menus;
|
|
677
671
|
}
|
|
678
672
|
|
|
679
|
-
static async requestKsList(path, params,depth=1, pageinfo={pageNo:1,pageSize
|
|
680
|
-
let url =
|
|
673
|
+
static async requestKsList(path, params, depth = 1, pageinfo = {pageNo: 1, pageSize: 100}) {
|
|
674
|
+
let url = Units.joinPath("/v3/ks/list", path)
|
|
681
675
|
let res = await Super.super({
|
|
682
676
|
url: url,
|
|
683
677
|
method: "GET",
|
|
684
678
|
query: {
|
|
685
679
|
depth,
|
|
686
680
|
...params,
|
|
687
|
-
pageNo:
|
|
681
|
+
pageNo: pageinfo.pageNo,
|
|
688
682
|
pageSize: pageinfo.pageSize
|
|
689
683
|
}
|
|
690
684
|
});
|
|
691
685
|
//console.log("ks list:", res);
|
|
692
|
-
if(res.status=='error'){
|
|
686
|
+
if (res.status == 'error') {
|
|
693
687
|
return null;
|
|
694
|
-
}else{
|
|
688
|
+
} else {
|
|
695
689
|
return res.result;
|
|
696
690
|
}
|
|
697
691
|
|
|
@@ -704,15 +698,15 @@ export default class HcserviceV3 {
|
|
|
704
698
|
method: "GET",
|
|
705
699
|
query: {
|
|
706
700
|
pageNo,
|
|
707
|
-
pageSize,queryKey
|
|
701
|
+
pageSize, queryKey
|
|
708
702
|
}
|
|
709
703
|
});
|
|
710
704
|
//console.log("requestKsListToPage:", res);
|
|
711
705
|
return res.result;
|
|
712
706
|
}
|
|
713
707
|
|
|
714
|
-
static async requestKsUnique(path:string,depth=1) {
|
|
715
|
-
let url =
|
|
708
|
+
static async requestKsUnique(path: string, depth = 1) {
|
|
709
|
+
let url = Units.joinPath("/v3/ks/unique", path)
|
|
716
710
|
let res = await Super.super({
|
|
717
711
|
url: url,
|
|
718
712
|
depth,
|
|
@@ -55,7 +55,7 @@ class Workbench extends React.PureComponent<WorkbenchProps, WorkbenchState> {
|
|
|
55
55
|
let faceplateStatisticL2MenusComp = [];
|
|
56
56
|
l2Menus && l2Menus.forEach((l2Menu) => {
|
|
57
57
|
let comp =
|
|
58
|
-
(<Card key={l2Menu.id}><Statistic prefix={<RocketTwoTone />} title={l2Menu.title} value={l2Menu.count}/>
|
|
58
|
+
(<Card size={'small'} key={l2Menu.id}><Statistic prefix={<RocketTwoTone />} title={l2Menu.title} value={l2Menu.count}/>
|
|
59
59
|
<Button style={{marginTop: 12}} href={`#/${l2Menu.id}/act-table?menuId=${l2Menu.id}`} >
|
|
60
60
|
查看
|
|
61
61
|
</Button>
|
|
@@ -64,7 +64,7 @@ class Workbench extends React.PureComponent<WorkbenchProps, WorkbenchState> {
|
|
|
64
64
|
})
|
|
65
65
|
|
|
66
66
|
return (
|
|
67
|
-
<Card {...other}
|
|
67
|
+
<Card size={'small'} {...other} title={title ? title : '工作台'}>
|
|
68
68
|
<Space size={[16, 16]} wrap>
|
|
69
69
|
{faceplateStatisticL2MenusComp}
|
|
70
70
|
</Space>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dtmpl-view-page.d.ts","sourceRoot":"","sources":["../../../../src/aldehyde/module/dtmpl-view-page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,EAAC,MAAM,CAAC;IACjB,IAAI,CAAC,EAAC,MAAM,CAAC;IACb,QAAQ,CAAC,EAAC,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IAC/B,aAAa,EAAC,OAAO,CAAC;CACzB;AAED,cAAM,aAAc,SAAQ,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAEnF,KAAK;;MAEJ;IAaD,OAAO,aAIN;IAED,eAAe,SAAW,MAAM,UAI/B;IAED,MAAM;CAcT;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dtmpl-view-page.js","sourceRoot":"","sources":["../../../../src/aldehyde/module/dtmpl-view-page.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAQxD,CAAC;AAID,CAAC;AAEF,MAAM,aAAc,SAAQ,KAAK,CAAC,aAAqD;IAAvF;;QAEI,UAAK,GAAG;YACJ,aAAa,EAAC,KAAK;SACtB,CAAA;QAED,8BAA8B;QAC9B,8BAA8B;QAC9B,IAAI;QACJ,EAAE;QACF,wCAAwC;QACxC,sCAAsC;QACtC,sDAAsD;QACtD,kCAAkC;QAClC,QAAQ;QACR,IAAI;QAEJ,YAAO,GAAC,GAAE,EAAE;YACR,IAAI,CAAC,QAAQ,CAAC;gBACV,aAAa,EAAC,IAAI;aACrB,CAAC,CAAA;QACN,CAAC,CAAA;QAED,oBAAe,GAAI,CAAC,IAAY,EAAE,EAAE;YAChC,IAAI,CAAC,QAAQ,CAAC;gBACV,aAAa,EAAC,KAAK;aACtB,CAAC,CAAA;QACN,CAAC,CAAA;IAgBL,CAAC;IAdG,MAAM;QACF,MAAM,EAAC,aAAa,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACnC,MAAM,EAAE,QAAQ,EAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACzC,OAAO;YACH,oBAAC,YAAY,IAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAiB;YACpG,oBAAC,aAAa,IAAC,IAAI,EAAE,aAAa,EAAE,QAAQ,EAAE,GAAE,EAAE;oBAC9C,IAAI,CAAC,QAAQ,CAAC;wBACV,aAAa,EAAC,KAAK;qBACtB,CAAC,CAAA;gBAAA,CAAC,EACQ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,IAAI,EAAE,IAAI,CAAC,eAAe,GAAI,CAChD,CAAA;IACb,CAAC;CACJ;AAED,eAAe,aAAa,CAAC"}
|