aldehyde 0.0.1
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/LICENSE +201 -0
- package/README.md +1 -0
- package/dist/163.js +2 -0
- package/dist/163.js.LICENSE.txt +43 -0
- package/dist/41.js +1 -0
- package/dist/aldehyde.js +2 -0
- package/dist/aldehyde.js.LICENSE.txt +122 -0
- package/dist/chemstruc-graph.js +1 -0
- package/dist/css/163-24392163d3c7b54ea806.css +11 -0
- package/dist/css/290-5e8e152675ab7d201c00.css +886 -0
- package/dist/css/chemstruc-graph-87868f791bf92fb80db9.css +29 -0
- package/dist/css/main-2e6725ec1b56da516cee.css +256 -0
- package/dist/html-editor-draft.js +2 -0
- package/dist/html-editor-draft.js.LICENSE.txt +5 -0
- package/dist/images/logo-06f6a5d8.png +0 -0
- package/dist/index.html +4 -0
- package/dist/signature.js +2 -0
- package/dist/signature.js.LICENSE.txt +17 -0
- package/package.json +180 -0
- package/src/components/chart/antd/Chart.js +32 -0
- package/src/components/chart/antd/Chart10000.js +90 -0
- package/src/components/chart/antd/Max2DimLineChart.js +128 -0
- package/src/components/chart/antd/PieChart1.js +54 -0
- package/src/components/chart/antd/PieChart2.js +56 -0
- package/src/components/chart/antd/chart-utils.tsx +50 -0
- package/src/components/chart/antd/column-chart-sub.tsx +67 -0
- package/src/components/chart/antd/line-chart-sub.tsx +65 -0
- package/src/components/chart/antd/pie-chart-sub.tsx +54 -0
- package/src/components/chart/antd/statview-d2-chart.tsx +125 -0
- package/src/components/chart/statview-l2-chart.tsx +69 -0
- package/src/components/controls/action/index.css +9 -0
- package/src/components/controls/action/index.tsx +228 -0
- package/src/components/controls/action/utils.tsx +122 -0
- package/src/components/controls/auto-complete/index.tsx +80 -0
- package/src/components/controls/cascader/index.js +97 -0
- package/src/components/controls/chemstruc/graph.tsx +150 -0
- package/src/components/controls/chemstruc/index.css +28 -0
- package/src/components/controls/collapse-card/index.css +9 -0
- package/src/components/controls/collapse-card/index.tsx +59 -0
- package/src/components/controls/color-picker/index.css +27 -0
- package/src/components/controls/color-picker/index.tsx +88 -0
- package/src/components/controls/cquery/cquick-button.tsx +117 -0
- package/src/components/controls/date-picker/index.tsx +141 -0
- package/src/components/controls/entity-select/entity-select.tsx +277 -0
- package/src/components/controls/entity-select/index.css +6 -0
- package/src/components/controls/entity-select/popover-entity-select.tsx +112 -0
- package/src/components/controls/entry-control.tsx +240 -0
- package/src/components/controls/enum-badge/index.tsx +28 -0
- package/src/components/controls/enum-tag/index.tsx +30 -0
- package/src/components/controls/file-view/drawer-file-view.tsx +69 -0
- package/src/components/controls/file-view/index.tsx +145 -0
- package/src/components/controls/html-editor/draft.tsx +161 -0
- package/src/components/controls/html-editor/tinymce.js +55 -0
- package/src/components/controls/input-number/index.tsx +101 -0
- package/src/components/controls/input-range/index.tsx +48 -0
- package/src/components/controls/password-setter/index.css +3 -0
- package/src/components/controls/password-setter/index.js +70 -0
- package/src/components/controls/progress/index.tsx +61 -0
- package/src/components/controls/relation-existion/index.css +4 -0
- package/src/components/controls/relation-existion/index.tsx +108 -0
- package/src/components/controls/rfield/index.css +4 -0
- package/src/components/controls/rfield/index.tsx +161 -0
- package/src/components/controls/signature/index.tsx +162 -0
- package/src/components/controls/steps/index.tsx +58 -0
- package/src/components/controls/text/ellipsis-text.tsx +70 -0
- package/src/components/controls/upload/index.tsx +122 -0
- package/src/components/controls/view-control.tsx +177 -0
- package/src/components/detail/button/cquery-button-bar.tsx +112 -0
- package/src/components/detail/button/index.css +43 -0
- package/src/components/detail/button/submit-button-bar.tsx +151 -0
- package/src/components/detail/dtmpl.css +53 -0
- package/src/components/detail/edit/dtmpl-edit.tsx +218 -0
- package/src/components/detail/edit/fields-edit-card.tsx +103 -0
- package/src/components/detail/edit/modal-dtmpl-edit.tsx +198 -0
- package/src/components/detail/edit/modal-row-edit.tsx +72 -0
- package/src/components/detail/edit/post-result/index.tsx +52 -0
- package/src/components/detail/edit/row-edit-card.tsx +125 -0
- package/src/components/detail/edit/row-editor.tsx +71 -0
- package/src/components/detail/rightbar/index.css +35 -0
- package/src/components/detail/rightbar/index.tsx +76 -0
- package/src/components/detail/view/act-dtmpl-view.tsx +155 -0
- package/src/components/detail/view/dtmpl-view.tsx +143 -0
- package/src/components/detail/view/field-view-group.tsx +73 -0
- package/src/components/detail/view/modal-dtmpl-view.tsx +56 -0
- package/src/components/detail/view/snapshot-timeline.tsx +130 -0
- package/src/components/exportor/export-frame.css +3 -0
- package/src/components/exportor/export-frame.tsx +194 -0
- package/src/components/exportor/index.tsx +60 -0
- package/src/components/form/criteria-form.tsx +241 -0
- package/src/components/form/dtmpl-form.css +4 -0
- package/src/components/form/dtmpl-form.tsx +272 -0
- package/src/components/form/field-group-form.tsx +75 -0
- package/src/components/form/fields-form.tsx +51 -0
- package/src/components/form/form-Item-group.tsx +99 -0
- package/src/components/form/index.css +13 -0
- package/src/components/import/excel-import.tsx +316 -0
- package/src/components/import/index.css +54 -0
- package/src/components/import/template-builder.js +474 -0
- package/src/components/import/template.css +51 -0
- package/src/components/layout/MainPage.tsx +230 -0
- package/src/components/layout/footer/index.css +6 -0
- package/src/components/layout/footer/index.js +17 -0
- package/src/components/layout/header/index.css +86 -0
- package/src/components/layout/header/index.tsx +58 -0
- package/src/components/layout/menu/block.tsx +88 -0
- package/src/components/layout/menu/l2menu-message-bar.tsx +118 -0
- package/src/components/layout/menu/l2menu-quick-bar.tsx +132 -0
- package/src/components/layout/menu/menu-2layers.tsx +92 -0
- package/src/components/layout/menu/menu-render.tsx +49 -0
- package/src/components/layout/menu/reset-password.tsx +185 -0
- package/src/components/layout/menu/user-bar.tsx +97 -0
- package/src/components/layout/menu/userinfo-bar.tsx +70 -0
- package/src/components/layout/sidebar/index.css +26 -0
- package/src/components/layout/sidebar/index.tsx +38 -0
- package/src/components/login.js +137 -0
- package/src/components/module/criteria-page.tsx +175 -0
- package/src/components/module/dtmpl-page.tsx +70 -0
- package/src/components/module/ltmpl-page.tsx +181 -0
- package/src/components/routable/dtmpl-route.tsx +96 -0
- package/src/components/routable/import-route.tsx +28 -0
- package/src/components/routable/ltmpl-route.tsx +158 -0
- package/src/components/table/act-table.tsx +635 -0
- package/src/components/table/column/column-selector.tsx +79 -0
- package/src/components/table/column/index.css +14 -0
- package/src/components/table/index.css +45 -0
- package/src/components/table/l2-act-table.tsx +85 -0
- package/src/components/table/modal-select-table.tsx +248 -0
- package/src/components/table/pagination.css +15 -0
- package/src/components/table/pagination.tsx +72 -0
- package/src/components/table/query-table.tsx +331 -0
- package/src/components/table/relation-table.tsx +600 -0
- package/src/components/table/select-table.tsx +247 -0
- package/src/components/table/selected-rows-card.tsx +62 -0
- package/src/components/table/stat/restat.tsx +79 -0
- package/src/components/table/table-util.tsx +33 -0
- package/src/components/tmpl/control-type-supportor.tsx +97 -0
- package/src/components/tmpl/hc-data-source.tsx +230 -0
- package/src/components/tmpl/hcservice-v3.tsx +624 -0
- package/src/components/tmpl/interface.tsx +308 -0
- package/src/components/tmpl/superagent.js +93 -0
- package/src/components/tmpl/tmpl-config-analysis.tsx +111 -0
- package/src/components/units/EncryptUtils.js +38 -0
- package/src/components/units/image.d.ts +8 -0
- package/src/components/units/index.tsx +536 -0
- package/src/components/units/logo.png +0 -0
- package/src/components/units/storage.js +3 -0
- package/src/components/welcome/HCWelcome.js +232 -0
- package/src/components/welcome/index.css +13 -0
- package/src/components/welcome/logo.png +0 -0
- package/src/components/welcome/quick-entrance.tsx +77 -0
- package/src/components/welcome/workbench.tsx +76 -0
- package/src/index.js +4 -0
- package/src/style/common.css +79 -0
- package/src/style/coverstyle.css +49 -0
- package/src/style/transstyle.css +24 -0
- package/tsconfig.json +106 -0
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
import Units from '../units'
|
|
2
|
+
import Super from "./superagent";
|
|
3
|
+
import {message} from 'antd'
|
|
4
|
+
import EncryptUtils from '../units/EncryptUtils'
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import {Level2Menu, PageInfo, SourceName,SelectedRow} from "./interface";
|
|
7
|
+
|
|
8
|
+
export default class HcserviceV3 {
|
|
9
|
+
|
|
10
|
+
static async requestEnum(mstrucIds) { //有下拉菜单时,请求下拉选项操作
|
|
11
|
+
if (mstrucIds.length > 0) {
|
|
12
|
+
let res = await Super.super({
|
|
13
|
+
url: `/v3/field/enum`,
|
|
14
|
+
query: {
|
|
15
|
+
mstrucIds
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return res.enumMap;
|
|
19
|
+
} else {
|
|
20
|
+
return {};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// static async requestSelect(requestedMap, selectMSFieldIdArray) {
|
|
25
|
+
// //先从当前状态从中找,没有的才去查
|
|
26
|
+
// //后续可以放在缓存里,但需要一些策略和技巧
|
|
27
|
+
// if (!requestedMap) {
|
|
28
|
+
// requestedMap = await this.requestSelectS(selectMSFieldIdArray);
|
|
29
|
+
// } else {
|
|
30
|
+
// let needRequest = []
|
|
31
|
+
// selectMSFieldIdArray.forEach(function (item, index, arr) {
|
|
32
|
+
// if (!requestedMap[item]) {
|
|
33
|
+
// needRequest.push(item);
|
|
34
|
+
// }
|
|
35
|
+
// });
|
|
36
|
+
// let subOptionsMap = await HcserviceV3.requestSelectS(needRequest);
|
|
37
|
+
// for (let key in subOptionsMap) {
|
|
38
|
+
// requestedMap[key] = subOptionsMap[key];
|
|
39
|
+
// }
|
|
40
|
+
// }
|
|
41
|
+
// return requestedMap;
|
|
42
|
+
// }
|
|
43
|
+
|
|
44
|
+
static async requestDtmplConfig(sourceId:string) {
|
|
45
|
+
|
|
46
|
+
// if(sourceId=='user'){
|
|
47
|
+
// return this.requestUserDtmplConfig();
|
|
48
|
+
// }
|
|
49
|
+
|
|
50
|
+
let url = `/v3/dtmpl/config`
|
|
51
|
+
let res = await Super.super({
|
|
52
|
+
url,
|
|
53
|
+
method: "GET",
|
|
54
|
+
query:{sourceId}
|
|
55
|
+
});
|
|
56
|
+
return res.dtmplConfig;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// static async requestUserDtmplConfig() {
|
|
60
|
+
// let url = `/v3/user/dtmpl/config`
|
|
61
|
+
// let res = await Super.super({
|
|
62
|
+
// url,
|
|
63
|
+
// method: "GET",
|
|
64
|
+
// });
|
|
65
|
+
// return res.dtmplConfig;
|
|
66
|
+
// }
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
static async requestSelectConfig(sourceId) {
|
|
70
|
+
//let url = `/v3/${sourceName}/select/config`
|
|
71
|
+
let url = `/v3/select/config`
|
|
72
|
+
let res = await Super.super({
|
|
73
|
+
url,
|
|
74
|
+
method: "GET",
|
|
75
|
+
query:{sourceId}
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
return res.selectConfig;
|
|
79
|
+
}
|
|
80
|
+
// static async requestSelectConfig(sourceName:SourceName,sourceId) {
|
|
81
|
+
// //let url = `/v3/${sourceName}/select/config`
|
|
82
|
+
// let url = `/v3/relation-select/config`
|
|
83
|
+
// let res = await Super.super({
|
|
84
|
+
// url,
|
|
85
|
+
// method: "GET",
|
|
86
|
+
// query:{sourceId}
|
|
87
|
+
// });
|
|
88
|
+
//
|
|
89
|
+
// return res.selectConfig;
|
|
90
|
+
// }
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
static async requestLtmplConfig(sourceId) {
|
|
94
|
+
let url = `/v3/ltmpl/config`
|
|
95
|
+
let res = await Super.super({
|
|
96
|
+
url,
|
|
97
|
+
method: "GET",
|
|
98
|
+
query:{sourceId}
|
|
99
|
+
});
|
|
100
|
+
return res;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
static async requestL2LtmplConfig(sourceId) {
|
|
104
|
+
let url = `/v3/l2/ltmpl/config`
|
|
105
|
+
let res = await Super.super({
|
|
106
|
+
url,
|
|
107
|
+
method: "GET",
|
|
108
|
+
query:{sourceId}
|
|
109
|
+
});
|
|
110
|
+
return res;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
static async requestLtmplQueryKey(sourceId, condition) {
|
|
114
|
+
console.log('condition:',condition);
|
|
115
|
+
let url = `/v3/ltmpl/query/key`
|
|
116
|
+
let res = await Super.super({
|
|
117
|
+
url: url,
|
|
118
|
+
method: 'GET',
|
|
119
|
+
query: {...condition,sourceId}
|
|
120
|
+
});
|
|
121
|
+
return res;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static async requestSelectedData(sourceId, codes) {
|
|
125
|
+
if (!codes) {
|
|
126
|
+
message.warn("没有选择实体")
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
let url = `/v3/field-group/data/selected`
|
|
130
|
+
|
|
131
|
+
let res = await Super.super({
|
|
132
|
+
url: url,
|
|
133
|
+
query: {codes,sourceId},
|
|
134
|
+
method: 'GET'
|
|
135
|
+
});
|
|
136
|
+
if (res.status === "success") {
|
|
137
|
+
return res.entities;
|
|
138
|
+
} else {
|
|
139
|
+
message.error("没有找到实体!")
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static async requestVersionList(sourceId, code) {
|
|
145
|
+
let res = await Super.super({
|
|
146
|
+
url: `/v3/dtmpl/data/versions`,
|
|
147
|
+
query: {
|
|
148
|
+
pageNo: 1,
|
|
149
|
+
sourceId,
|
|
150
|
+
code
|
|
151
|
+
},
|
|
152
|
+
method: 'GET'
|
|
153
|
+
});
|
|
154
|
+
return res.versions;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
static async requestDtmplData(sourceId, code,versionId) {
|
|
159
|
+
// if(sourceId=="user"){
|
|
160
|
+
// return this.requestUserDtmplData();
|
|
161
|
+
// }
|
|
162
|
+
let url = `/v3/dtmpl/data`;
|
|
163
|
+
let res = await Super.super({
|
|
164
|
+
url: url,
|
|
165
|
+
query: {
|
|
166
|
+
code,versionId,sourceId
|
|
167
|
+
},
|
|
168
|
+
method: 'GET'
|
|
169
|
+
});
|
|
170
|
+
if (res.status === "success") {
|
|
171
|
+
return res.entity;
|
|
172
|
+
} else {
|
|
173
|
+
message.error("实体不存在!")
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// static async requestUserDtmplData() {
|
|
179
|
+
// let url = `/v3/user/dtmpl/data`;
|
|
180
|
+
// let res = await Super.super({
|
|
181
|
+
// url: url,
|
|
182
|
+
// method: 'GET'
|
|
183
|
+
// });
|
|
184
|
+
// if (res.status === "success") {
|
|
185
|
+
// return res.entity;
|
|
186
|
+
// } else {
|
|
187
|
+
// message.error("实体不存在!")
|
|
188
|
+
// return null;
|
|
189
|
+
// }
|
|
190
|
+
// }
|
|
191
|
+
|
|
192
|
+
static async postDtmplData(sourceId:string, formDataObj, message) {
|
|
193
|
+
let url = `/v3/dtmpl/data`;
|
|
194
|
+
const formData = new FormData();
|
|
195
|
+
for (let k in formDataObj) {
|
|
196
|
+
formData.append(k, formDataObj[k] || formDataObj[k]==0 ? formDataObj[k]:"");
|
|
197
|
+
}
|
|
198
|
+
formData.append('sourceId',sourceId.toString())
|
|
199
|
+
let res = await Super.super({
|
|
200
|
+
url: url,
|
|
201
|
+
data: formData,
|
|
202
|
+
method: 'POST'
|
|
203
|
+
}, 'formdata')
|
|
204
|
+
let code = null;
|
|
205
|
+
if (res) {
|
|
206
|
+
if (res.status === "success") {
|
|
207
|
+
let msg = ""
|
|
208
|
+
if (res.message) {
|
|
209
|
+
msg = res.message;
|
|
210
|
+
}
|
|
211
|
+
message.success("保存成功! " + msg)
|
|
212
|
+
code = res.entityCode ? res.entityCode : res.code;
|
|
213
|
+
} else {
|
|
214
|
+
message.error("保存失败");
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
message.error("保存失败!")
|
|
218
|
+
}
|
|
219
|
+
return {code,status:res.status};
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
static postFileAction(file) {
|
|
223
|
+
return Units.api()+`/v3/upload`;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static async postFile(formData, message) {
|
|
227
|
+
let res = await Super.super({
|
|
228
|
+
url: `/v3/upload`,
|
|
229
|
+
data: formData,
|
|
230
|
+
method: 'POST'
|
|
231
|
+
}, 'formdata')
|
|
232
|
+
let fileKey = null;
|
|
233
|
+
if (res) {
|
|
234
|
+
if (res.status === "success") {
|
|
235
|
+
if (message) {
|
|
236
|
+
message.success("上传成功! ")
|
|
237
|
+
}
|
|
238
|
+
fileKey = res.fileKey;
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
if (message) {
|
|
242
|
+
message.error("上传失败!");
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return fileKey;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
static async requestL2LtmplQueryKey(sourceId, condition) {
|
|
251
|
+
let url = `v3/l2/ltmpl/query/key`
|
|
252
|
+
let res = await Super.super({
|
|
253
|
+
url: url,
|
|
254
|
+
method: 'GET',
|
|
255
|
+
query: {...condition,sourceId}
|
|
256
|
+
});
|
|
257
|
+
return res;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
static async requestLtmplCount(sourceId) {
|
|
261
|
+
|
|
262
|
+
let url = `/v3/ltmpl/data/count`;
|
|
263
|
+
let res = await Super.super({
|
|
264
|
+
url: url,
|
|
265
|
+
query:{sourceId},
|
|
266
|
+
method: 'GET',
|
|
267
|
+
});
|
|
268
|
+
return res.count;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
// static setCriteriasValue(criterias, criteriaValueMap) {
|
|
273
|
+
// criterias.forEach((item) => {
|
|
274
|
+
// for (let k in criteriaValueMap) {
|
|
275
|
+
// if (k === item.id) {
|
|
276
|
+
// item.value = criteriaValueMap[k]
|
|
277
|
+
// }
|
|
278
|
+
// }
|
|
279
|
+
// });
|
|
280
|
+
// return criterias;
|
|
281
|
+
// }
|
|
282
|
+
//
|
|
283
|
+
// static setCriteriasValueCondition(criterias, condition) {
|
|
284
|
+
// criterias.forEach((item) => {
|
|
285
|
+
// for (let k of Object.keys(condition)) {
|
|
286
|
+
// if (k == "c_" + item.id) {
|
|
287
|
+
// item.value = condition[k]
|
|
288
|
+
// }
|
|
289
|
+
// }
|
|
290
|
+
// });
|
|
291
|
+
// return criterias;
|
|
292
|
+
// }
|
|
293
|
+
|
|
294
|
+
static async requestQueryData(queryKey:string, pageInfo:PageInfo) {
|
|
295
|
+
let res = await Super.super({
|
|
296
|
+
url: `/v3/ltmpl/query/data`,
|
|
297
|
+
method: 'GET',
|
|
298
|
+
query:
|
|
299
|
+
{queryKey,...pageInfo}
|
|
300
|
+
});
|
|
301
|
+
return res;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
static getCodesOfSelectedRows(selectedRows:SelectedRow[]){
|
|
305
|
+
let codes:string[]=[];
|
|
306
|
+
if(!selectedRows || selectedRows.length<1){
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
for(let item of selectedRows){
|
|
311
|
+
if(item.code){
|
|
312
|
+
codes.push(item.code);
|
|
313
|
+
}else{
|
|
314
|
+
message.error("没找到所选数据的Code!!");
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
if(codes.length<1){
|
|
319
|
+
message.error("没找到所选数据的Code!!");
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return codes;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
static async deleteData(sourceId, selectedRows:SelectedRow[]) {
|
|
327
|
+
const codes= this.getCodesOfSelectedRows(selectedRows);
|
|
328
|
+
let res = await Super.super({
|
|
329
|
+
url: `/v3/ltmpl/data`,
|
|
330
|
+
data: {
|
|
331
|
+
codes,sourceId
|
|
332
|
+
},
|
|
333
|
+
method: 'DELETE',
|
|
334
|
+
});
|
|
335
|
+
if(res.status=='success'){
|
|
336
|
+
message.success("删除成功");
|
|
337
|
+
return true;
|
|
338
|
+
}else{
|
|
339
|
+
message.error("删除失败");
|
|
340
|
+
console.log("删除失败消息",res.message);
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
static async requestQueryCount(queryKey) {
|
|
346
|
+
let res = await Super.super({
|
|
347
|
+
url: `/v3/ltmpl/query/count`,
|
|
348
|
+
method: "GET",
|
|
349
|
+
query:{queryKey}
|
|
350
|
+
});
|
|
351
|
+
return res.count;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
static async requestFile(path) {
|
|
357
|
+
let res = await Super.super({
|
|
358
|
+
url: "/v3/files/" + path,
|
|
359
|
+
method: "GET"
|
|
360
|
+
});
|
|
361
|
+
return res;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
static async postActions(actionId, selectedRows:SelectedRow[],actionDataObj?:Object) {
|
|
365
|
+
const codes= this.getCodesOfSelectedRows(selectedRows);
|
|
366
|
+
const formData = new FormData();
|
|
367
|
+
for (let k in actionDataObj) {
|
|
368
|
+
formData.append(k, actionDataObj[k]?actionDataObj[k]:"");
|
|
369
|
+
}
|
|
370
|
+
formData.append('sourceId',actionId.toString())
|
|
371
|
+
formData.append('codes',codes.join(","));
|
|
372
|
+
let res = await Super.super({
|
|
373
|
+
url: `/v3/action`,
|
|
374
|
+
data: formData,
|
|
375
|
+
method: 'POST'
|
|
376
|
+
}, 'formdata');
|
|
377
|
+
return res;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
static async postJumps(sourceId, jumpId, selectedRows:SelectedRow[]) {
|
|
381
|
+
const codes= this.getCodesOfSelectedRows(selectedRows);
|
|
382
|
+
let res = await Super.super({
|
|
383
|
+
url: `/v3/jump`,
|
|
384
|
+
query: {
|
|
385
|
+
codes: codes,
|
|
386
|
+
jumpId,
|
|
387
|
+
},
|
|
388
|
+
method: "GET",
|
|
389
|
+
});
|
|
390
|
+
return res;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
static async increCalc(sourceId, params={}) {
|
|
394
|
+
let res = await Super.super({
|
|
395
|
+
url: `/v3/stat/increcalc`,
|
|
396
|
+
method: "POST",
|
|
397
|
+
data: {...params,sourceId}
|
|
398
|
+
});
|
|
399
|
+
if (res.status === 'success') {
|
|
400
|
+
message.success("统计成功")
|
|
401
|
+
} else {
|
|
402
|
+
message.error("统计失败")
|
|
403
|
+
}
|
|
404
|
+
return res;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
static downloadDetailExcel(sourceId, entityCode) {
|
|
408
|
+
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken")
|
|
409
|
+
let url = Units.api() + `/v3/dtmpl/excel?sourceId=${sourceId}&code=${entityCode}&@token=${hydrocarbonToken}`
|
|
410
|
+
Units.downloadFile(url,"详情");
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
static download(path) {
|
|
414
|
+
let vars = path.split("/");
|
|
415
|
+
let fileName = vars[vars.length - 1]
|
|
416
|
+
Units.downloadFile(this.getFileUrl(path)+`&disposition=attachment`, fileName)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
static openfile(path) {
|
|
420
|
+
let vars = path.split("/");
|
|
421
|
+
let fileName = vars[vars.length - 1]
|
|
422
|
+
Units.openFile(this.getFileUrl(path), fileName)
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
static getFileUrl(path) {
|
|
426
|
+
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken")
|
|
427
|
+
let url = Units.api() + Units.joinPath("/v3/files",path)+ `?@token=${hydrocarbonToken}`;
|
|
428
|
+
return url;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
static getFileTxtUrl(path) {
|
|
432
|
+
const hydrocarbonToken = Units.getLocalStorge("hydrocarbonToken")
|
|
433
|
+
let url = Units.api() + "/v3/files/text" + path + `?@token=${hydrocarbonToken}`;
|
|
434
|
+
return url;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
static async loadFileTxt(path) {
|
|
438
|
+
let res = await Super.super({
|
|
439
|
+
url: "/v3/files/text" + path,
|
|
440
|
+
method: "GET",
|
|
441
|
+
});
|
|
442
|
+
return res.text;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
static async requestFaceplate_menu() {
|
|
446
|
+
let url = `/v3/menu/faceplate`
|
|
447
|
+
let res = await Super.super({
|
|
448
|
+
url: url,
|
|
449
|
+
method: "GET",
|
|
450
|
+
});
|
|
451
|
+
return res.l2Menus;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
static async requestFaceplateStatistic_menu() {
|
|
455
|
+
let url = `/v3/menu/faceplate-statistic`
|
|
456
|
+
let res = await Super.super({
|
|
457
|
+
url: url,
|
|
458
|
+
method: "GET",
|
|
459
|
+
});
|
|
460
|
+
return res.l2Menus;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
static async requestBlocks(l2MenuId:string,blockId:string) {
|
|
464
|
+
let url = `/v3/menu/blocks`
|
|
465
|
+
let res = await Super.super({
|
|
466
|
+
url: url,
|
|
467
|
+
method: "GET",
|
|
468
|
+
query:{
|
|
469
|
+
l2MenuId, blockId
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
return res;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
static async logout() {
|
|
476
|
+
Super.super({
|
|
477
|
+
url: '/v3/auth/token',
|
|
478
|
+
method: 'DELETE'
|
|
479
|
+
}).then((res) => {
|
|
480
|
+
window.location.hash = "#/login";
|
|
481
|
+
})
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
static async resetPassword(oPassword, nPassword,pubkey){
|
|
485
|
+
let oldPassword= EncryptUtils.rsaEncrypt(oPassword,pubkey);
|
|
486
|
+
let newPassword= EncryptUtils.rsaEncrypt(nPassword,pubkey);
|
|
487
|
+
let res = await Super.super({
|
|
488
|
+
url: '/v3/auth/password',
|
|
489
|
+
query: {
|
|
490
|
+
oldPassword,newPassword
|
|
491
|
+
},
|
|
492
|
+
method: "POST"
|
|
493
|
+
})
|
|
494
|
+
|
|
495
|
+
return res;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
static async login(username, password,kaptchaToken,kaptchaText,pubkey) {
|
|
499
|
+
|
|
500
|
+
let datetime= moment(new Date()).format("YYYY-MM-DD HH:mm:ss")
|
|
501
|
+
let json={username,password,datetime}
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
let userInfo= EncryptUtils.rsaEncrypt(JSON.stringify(json),pubkey);
|
|
505
|
+
|
|
506
|
+
let res = await Super.super({
|
|
507
|
+
url: '/v3/auth/hctoken',
|
|
508
|
+
query: {
|
|
509
|
+
userInfo,kaptchaToken,kaptchaText
|
|
510
|
+
},
|
|
511
|
+
method: "GET"
|
|
512
|
+
})
|
|
513
|
+
if (res.status === 'success') {
|
|
514
|
+
window.location.hash = "#/home";
|
|
515
|
+
Units.setLocalStorge("hydrocarbonToken", res.token)
|
|
516
|
+
}
|
|
517
|
+
return res;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
static async getKaptchaToken() {
|
|
521
|
+
let res = await Super.super({
|
|
522
|
+
url: '/v3/auth/kaptcha',
|
|
523
|
+
method: "POST"
|
|
524
|
+
})
|
|
525
|
+
if (res.status === 'success') {
|
|
526
|
+
return res
|
|
527
|
+
} else {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
static async getRasPubkey() {
|
|
533
|
+
let res = await Super.super({
|
|
534
|
+
url: '/v3/auth/ras-pubkey',
|
|
535
|
+
method: "GET"
|
|
536
|
+
})
|
|
537
|
+
if (res.status === 'success') {
|
|
538
|
+
return res.rasPubkey;
|
|
539
|
+
} else {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
static async getUser() {
|
|
545
|
+
let res = await Super.super({
|
|
546
|
+
url: '/v3/current-user',
|
|
547
|
+
});
|
|
548
|
+
return res.user;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
static async requestMessagebar() {
|
|
552
|
+
let url = `/v3/menu/messagebar`
|
|
553
|
+
let res = await Super.super({
|
|
554
|
+
url: url,
|
|
555
|
+
method: "GET",
|
|
556
|
+
})
|
|
557
|
+
return res.l2Menus;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
static async requestSimpleCharts() {
|
|
561
|
+
let url = `/v3/menu/simple-charts`
|
|
562
|
+
let res = await Super.super({
|
|
563
|
+
url: url,
|
|
564
|
+
method: "GET",
|
|
565
|
+
})
|
|
566
|
+
return res.l2Menus;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
static async requestKsList(path, params,depth=1, pageinfo={pageNo:1,pageSize : 100}) {
|
|
570
|
+
let url = Units.joinPath("/v3/ks/list",path)
|
|
571
|
+
let res = await Super.super({
|
|
572
|
+
url: url,
|
|
573
|
+
method: "GET",
|
|
574
|
+
query: {
|
|
575
|
+
depth,
|
|
576
|
+
...params,
|
|
577
|
+
pageNo: pageinfo.pageNo ,
|
|
578
|
+
pageSize: pageinfo.pageSize
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
console.log("ks list:", res);
|
|
582
|
+
if(res.status=='error'){
|
|
583
|
+
return null;
|
|
584
|
+
}else{
|
|
585
|
+
return res.result;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
static async requestKsListToPage(queryKey, pageNo, pageSize) {
|
|
591
|
+
let url = `/v3/ks/query/data`
|
|
592
|
+
let res = await Super.super({
|
|
593
|
+
url: url,
|
|
594
|
+
method: "GET",
|
|
595
|
+
query: {
|
|
596
|
+
pageNo,
|
|
597
|
+
pageSize,queryKey
|
|
598
|
+
}
|
|
599
|
+
});
|
|
600
|
+
console.log("requestKsListToPage:", res);
|
|
601
|
+
return res.result;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
static async requestKsUnique(path:string,depth=1) {
|
|
605
|
+
let url = Units.joinPath("/v3/ks/unique",path)
|
|
606
|
+
let res = await Super.super({
|
|
607
|
+
url: url,
|
|
608
|
+
depth,
|
|
609
|
+
method: "GET",
|
|
610
|
+
});
|
|
611
|
+
console.log("ks unique:", res);
|
|
612
|
+
return res.result;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
static async reload() {
|
|
616
|
+
let url = `/v3/tmpl/reload`
|
|
617
|
+
let res = await Super.super({
|
|
618
|
+
url: url,
|
|
619
|
+
method: "GET",
|
|
620
|
+
});
|
|
621
|
+
return res;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
}
|