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,230 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockMenu,
|
|
3
|
+
ColumnConfig,
|
|
4
|
+
DtmplConfig,
|
|
5
|
+
EnumItem,
|
|
6
|
+
FieldBase, Level1Menu,
|
|
7
|
+
LtmplConfig, LtmplConfigRes,
|
|
8
|
+
SelectConfig,
|
|
9
|
+
SourceName,Level2Menu
|
|
10
|
+
} from "../tmpl/interface";
|
|
11
|
+
import HcserviceV3 from './hcservice-v3';
|
|
12
|
+
import ControlTypeSupportor from './control-type-supportor'
|
|
13
|
+
import {message} from "antd";
|
|
14
|
+
|
|
15
|
+
const blocksCache: BlockMenu[] = [];
|
|
16
|
+
const quickEntranceCache: Level2Menu[] = [];
|
|
17
|
+
const messageCache: Level2Menu[] = [];
|
|
18
|
+
const workbenchCache: Level2Menu[] = [];
|
|
19
|
+
const enumMap: Map<string, EnumItem[]> = new Map<string, EnumItem[]>();
|
|
20
|
+
const selectConfigMap: Map<string, SelectConfig> = new Map<string, SelectConfig>();
|
|
21
|
+
const ltmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
22
|
+
const l2LtmplConfigMap: Map<string, LtmplConfigRes> = new Map<string, LtmplConfigRes>();
|
|
23
|
+
const dtmplConfigMap: Map<string, DtmplConfig> = new Map<string, DtmplConfig>();
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
function findUnloadEnumMstrucIdOfFields(fields:FieldBase[]) {
|
|
27
|
+
const mstrucIdArray = [];
|
|
28
|
+
if (fields) {
|
|
29
|
+
fields.forEach((item) => {
|
|
30
|
+
let controlType= ControlTypeSupportor.getSupportControlType(item)
|
|
31
|
+
if (controlType == "select" || controlType == "multiselect" || controlType == "steps" || controlType == "preselect" || controlType == "checkbox" || controlType == "radio") {
|
|
32
|
+
if(!enumMap.has(item.mstrucId)){
|
|
33
|
+
mstrucIdArray.push(item.mstrucId);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return mstrucIdArray;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function loadEnumOfDtmplConfig(selectConfig:DtmplConfig){
|
|
42
|
+
const mstrucIds = [];
|
|
43
|
+
if(selectConfig.groups){
|
|
44
|
+
selectConfig.groups.forEach(group=>{
|
|
45
|
+
let subs= findUnloadEnumMstrucIdOfFields(group.fields);
|
|
46
|
+
concat(mstrucIds,subs);
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
await loadEnum(mstrucIds);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function concat(mstrucIds,sub){
|
|
53
|
+
if(sub){
|
|
54
|
+
sub.forEach((id)=>{
|
|
55
|
+
if(!mstrucIds.includes(id)){
|
|
56
|
+
mstrucIds.push(id);
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
return mstrucIds;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function loadEnumOfSelectConfig(selectConfig:SelectConfig){
|
|
64
|
+
const mstrucIds = [];
|
|
65
|
+
let subs= findUnloadEnumMstrucIdOfFields(selectConfig.columns);
|
|
66
|
+
concat(mstrucIds,subs);
|
|
67
|
+
subs= findUnloadEnumMstrucIdOfFields(selectConfig.criterias);
|
|
68
|
+
concat(mstrucIds,subs);
|
|
69
|
+
await loadEnum(mstrucIds);
|
|
70
|
+
}
|
|
71
|
+
async function loadEnum(mstrucIds:string[]){
|
|
72
|
+
if(mstrucIds.length>0){
|
|
73
|
+
let reqEnum= await HcserviceV3.requestEnum(mstrucIds);
|
|
74
|
+
for(let key in reqEnum){
|
|
75
|
+
let em= reqEnum[key];
|
|
76
|
+
if(em['css']){
|
|
77
|
+
em['color']=em['css'].color;
|
|
78
|
+
}
|
|
79
|
+
enumMap.set(key,em);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
function HCDataSource() {
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
HCDataSource.requestLtmplConfig = async function ( sourceId: string) {
|
|
90
|
+
if (!ltmplConfigMap.has(sourceId)) {
|
|
91
|
+
ltmplConfigMap.set(sourceId, await HcserviceV3.requestLtmplConfig(sourceId));
|
|
92
|
+
//加载枚举
|
|
93
|
+
let res:LtmplConfigRes=ltmplConfigMap.get(sourceId);
|
|
94
|
+
await loadEnumOfSelectConfig(res.ltmplConfig);
|
|
95
|
+
}
|
|
96
|
+
return ltmplConfigMap.get(sourceId);
|
|
97
|
+
};
|
|
98
|
+
HCDataSource.requestL2LtmplConfig = async function (sourceId: string) {
|
|
99
|
+
if (!l2LtmplConfigMap.has(sourceId)) {
|
|
100
|
+
l2LtmplConfigMap.set(sourceId, await HcserviceV3.requestL2LtmplConfig(sourceId));
|
|
101
|
+
//加载枚举
|
|
102
|
+
let res:LtmplConfigRes=l2LtmplConfigMap.get(sourceId);
|
|
103
|
+
await loadEnumOfSelectConfig(res.ltmplConfig);
|
|
104
|
+
}
|
|
105
|
+
return l2LtmplConfigMap.get(sourceId);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
HCDataSource.requestSelectConfig = async function (sourceId: string) {
|
|
110
|
+
if (!selectConfigMap.has(sourceId)) {
|
|
111
|
+
selectConfigMap.set(sourceId, await HcserviceV3.requestSelectConfig( sourceId));
|
|
112
|
+
//加载枚举
|
|
113
|
+
await loadEnumOfSelectConfig(selectConfigMap.get(sourceId));
|
|
114
|
+
}
|
|
115
|
+
return selectConfigMap.get(sourceId);
|
|
116
|
+
};
|
|
117
|
+
HCDataSource.requestDtmplConfig = async function ( sourceId: string) {
|
|
118
|
+
if (!dtmplConfigMap.has(sourceId)) {
|
|
119
|
+
dtmplConfigMap.set(sourceId, await HcserviceV3.requestDtmplConfig(sourceId));
|
|
120
|
+
//加载枚举
|
|
121
|
+
await loadEnumOfDtmplConfig(dtmplConfigMap.get(sourceId));
|
|
122
|
+
}
|
|
123
|
+
return dtmplConfigMap.get(sourceId);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
HCDataSource.getEnums = function (mstrucId:string): EnumItem[] {
|
|
127
|
+
//这里是不是后续可以考虑防止串改
|
|
128
|
+
return enumMap.get(mstrucId);
|
|
129
|
+
};
|
|
130
|
+
HCDataSource.getEnumOption=function(mstrucId:string, enumValue:string) :EnumItem{
|
|
131
|
+
if(!enumValue){
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
let options=this.getEnums(mstrucId);
|
|
135
|
+
let enumItem:EnumItem=undefined;
|
|
136
|
+
if (options) {
|
|
137
|
+
options.forEach((option) => {
|
|
138
|
+
if (option.value === enumValue) {
|
|
139
|
+
enumItem=option;
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return enumItem;
|
|
145
|
+
}
|
|
146
|
+
HCDataSource.getEnumValueColor = (mstrucId:string,enumValue: string): string =>{
|
|
147
|
+
let enumItem: EnumItem = HCDataSource.getEnumOption(mstrucId, enumValue);
|
|
148
|
+
if (enumItem) {
|
|
149
|
+
return enumItem.color;
|
|
150
|
+
} else {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
HCDataSource.requestBlocks =async (l2MenuId:string,blockId:string)=>{
|
|
156
|
+
let result;
|
|
157
|
+
if(blocksCache.length<1){
|
|
158
|
+
let blockRes = await HcserviceV3.requestBlocks(l2MenuId?l2MenuId:undefined,blockId? blockId:undefined);
|
|
159
|
+
|
|
160
|
+
for(let block of blockRes.blocks){
|
|
161
|
+
blocksCache.push(block);
|
|
162
|
+
}
|
|
163
|
+
result={
|
|
164
|
+
blocks: blockRes.blocks,
|
|
165
|
+
l2MenuId: blockRes.l2MenuId,
|
|
166
|
+
blockId: blockRes.blockId,
|
|
167
|
+
};
|
|
168
|
+
}else{
|
|
169
|
+
result={
|
|
170
|
+
blocks:blocksCache,
|
|
171
|
+
blockId,l2MenuId
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
HCDataSource.quickEntranceMenus =async ()=>{
|
|
179
|
+
let result:Level2Menu[];
|
|
180
|
+
if(quickEntranceCache.length<1){
|
|
181
|
+
let quicks= await HcserviceV3.requestFaceplate_menu();
|
|
182
|
+
quickEntranceCache.splice(0,quickEntranceCache.length);;
|
|
183
|
+
quickEntranceCache.push(...quicks);
|
|
184
|
+
}
|
|
185
|
+
return [...quickEntranceCache];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
HCDataSource.messageMenus =async ()=>{
|
|
189
|
+
let result:Level2Menu[];
|
|
190
|
+
if(messageCache.length<1){
|
|
191
|
+
messageCache.push(...await HcserviceV3.requestMessagebar());
|
|
192
|
+
}
|
|
193
|
+
return [...messageCache];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
HCDataSource.workbenchMenus =async ()=>{
|
|
197
|
+
if(workbenchCache.length<1){
|
|
198
|
+
workbenchCache.push(...await HcserviceV3.requestFaceplateStatistic_menu());
|
|
199
|
+
}
|
|
200
|
+
return [...workbenchCache];
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
HCDataSource.clear =async function (roles:string[]) {
|
|
204
|
+
if(roles.includes("admin")){
|
|
205
|
+
let res= await HcserviceV3.reload();
|
|
206
|
+
if (res.status != 'success') {
|
|
207
|
+
message.error(res.message);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this.clearOnly();
|
|
211
|
+
message.success("执行成功");
|
|
212
|
+
}else{
|
|
213
|
+
this.clearOnly();
|
|
214
|
+
message.success("执行成功");
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
HCDataSource.clearOnly =async function () {
|
|
219
|
+
enumMap.clear();
|
|
220
|
+
ltmplConfigMap.clear();
|
|
221
|
+
dtmplConfigMap.clear();
|
|
222
|
+
selectConfigMap.clear();
|
|
223
|
+
l2LtmplConfigMap.clear();
|
|
224
|
+
blocksCache.splice(0,blocksCache.length);
|
|
225
|
+
quickEntranceCache.splice(0,quickEntranceCache.length);
|
|
226
|
+
messageCache.splice(0,quickEntranceCache.length);
|
|
227
|
+
workbenchCache.splice(0,workbenchCache.length);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export default HCDataSource;
|