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.
Files changed (156) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -0
  3. package/dist/163.js +2 -0
  4. package/dist/163.js.LICENSE.txt +43 -0
  5. package/dist/41.js +1 -0
  6. package/dist/aldehyde.js +2 -0
  7. package/dist/aldehyde.js.LICENSE.txt +122 -0
  8. package/dist/chemstruc-graph.js +1 -0
  9. package/dist/css/163-24392163d3c7b54ea806.css +11 -0
  10. package/dist/css/290-5e8e152675ab7d201c00.css +886 -0
  11. package/dist/css/chemstruc-graph-87868f791bf92fb80db9.css +29 -0
  12. package/dist/css/main-2e6725ec1b56da516cee.css +256 -0
  13. package/dist/html-editor-draft.js +2 -0
  14. package/dist/html-editor-draft.js.LICENSE.txt +5 -0
  15. package/dist/images/logo-06f6a5d8.png +0 -0
  16. package/dist/index.html +4 -0
  17. package/dist/signature.js +2 -0
  18. package/dist/signature.js.LICENSE.txt +17 -0
  19. package/package.json +180 -0
  20. package/src/components/chart/antd/Chart.js +32 -0
  21. package/src/components/chart/antd/Chart10000.js +90 -0
  22. package/src/components/chart/antd/Max2DimLineChart.js +128 -0
  23. package/src/components/chart/antd/PieChart1.js +54 -0
  24. package/src/components/chart/antd/PieChart2.js +56 -0
  25. package/src/components/chart/antd/chart-utils.tsx +50 -0
  26. package/src/components/chart/antd/column-chart-sub.tsx +67 -0
  27. package/src/components/chart/antd/line-chart-sub.tsx +65 -0
  28. package/src/components/chart/antd/pie-chart-sub.tsx +54 -0
  29. package/src/components/chart/antd/statview-d2-chart.tsx +125 -0
  30. package/src/components/chart/statview-l2-chart.tsx +69 -0
  31. package/src/components/controls/action/index.css +9 -0
  32. package/src/components/controls/action/index.tsx +228 -0
  33. package/src/components/controls/action/utils.tsx +122 -0
  34. package/src/components/controls/auto-complete/index.tsx +80 -0
  35. package/src/components/controls/cascader/index.js +97 -0
  36. package/src/components/controls/chemstruc/graph.tsx +150 -0
  37. package/src/components/controls/chemstruc/index.css +28 -0
  38. package/src/components/controls/collapse-card/index.css +9 -0
  39. package/src/components/controls/collapse-card/index.tsx +59 -0
  40. package/src/components/controls/color-picker/index.css +27 -0
  41. package/src/components/controls/color-picker/index.tsx +88 -0
  42. package/src/components/controls/cquery/cquick-button.tsx +117 -0
  43. package/src/components/controls/date-picker/index.tsx +141 -0
  44. package/src/components/controls/entity-select/entity-select.tsx +277 -0
  45. package/src/components/controls/entity-select/index.css +6 -0
  46. package/src/components/controls/entity-select/popover-entity-select.tsx +112 -0
  47. package/src/components/controls/entry-control.tsx +240 -0
  48. package/src/components/controls/enum-badge/index.tsx +28 -0
  49. package/src/components/controls/enum-tag/index.tsx +30 -0
  50. package/src/components/controls/file-view/drawer-file-view.tsx +69 -0
  51. package/src/components/controls/file-view/index.tsx +145 -0
  52. package/src/components/controls/html-editor/draft.tsx +161 -0
  53. package/src/components/controls/html-editor/tinymce.js +55 -0
  54. package/src/components/controls/input-number/index.tsx +101 -0
  55. package/src/components/controls/input-range/index.tsx +48 -0
  56. package/src/components/controls/password-setter/index.css +3 -0
  57. package/src/components/controls/password-setter/index.js +70 -0
  58. package/src/components/controls/progress/index.tsx +61 -0
  59. package/src/components/controls/relation-existion/index.css +4 -0
  60. package/src/components/controls/relation-existion/index.tsx +108 -0
  61. package/src/components/controls/rfield/index.css +4 -0
  62. package/src/components/controls/rfield/index.tsx +161 -0
  63. package/src/components/controls/signature/index.tsx +162 -0
  64. package/src/components/controls/steps/index.tsx +58 -0
  65. package/src/components/controls/text/ellipsis-text.tsx +70 -0
  66. package/src/components/controls/upload/index.tsx +122 -0
  67. package/src/components/controls/view-control.tsx +177 -0
  68. package/src/components/detail/button/cquery-button-bar.tsx +112 -0
  69. package/src/components/detail/button/index.css +43 -0
  70. package/src/components/detail/button/submit-button-bar.tsx +151 -0
  71. package/src/components/detail/dtmpl.css +53 -0
  72. package/src/components/detail/edit/dtmpl-edit.tsx +218 -0
  73. package/src/components/detail/edit/fields-edit-card.tsx +103 -0
  74. package/src/components/detail/edit/modal-dtmpl-edit.tsx +198 -0
  75. package/src/components/detail/edit/modal-row-edit.tsx +72 -0
  76. package/src/components/detail/edit/post-result/index.tsx +52 -0
  77. package/src/components/detail/edit/row-edit-card.tsx +125 -0
  78. package/src/components/detail/edit/row-editor.tsx +71 -0
  79. package/src/components/detail/rightbar/index.css +35 -0
  80. package/src/components/detail/rightbar/index.tsx +76 -0
  81. package/src/components/detail/view/act-dtmpl-view.tsx +155 -0
  82. package/src/components/detail/view/dtmpl-view.tsx +143 -0
  83. package/src/components/detail/view/field-view-group.tsx +73 -0
  84. package/src/components/detail/view/modal-dtmpl-view.tsx +56 -0
  85. package/src/components/detail/view/snapshot-timeline.tsx +130 -0
  86. package/src/components/exportor/export-frame.css +3 -0
  87. package/src/components/exportor/export-frame.tsx +194 -0
  88. package/src/components/exportor/index.tsx +60 -0
  89. package/src/components/form/criteria-form.tsx +241 -0
  90. package/src/components/form/dtmpl-form.css +4 -0
  91. package/src/components/form/dtmpl-form.tsx +272 -0
  92. package/src/components/form/field-group-form.tsx +75 -0
  93. package/src/components/form/fields-form.tsx +51 -0
  94. package/src/components/form/form-Item-group.tsx +99 -0
  95. package/src/components/form/index.css +13 -0
  96. package/src/components/import/excel-import.tsx +316 -0
  97. package/src/components/import/index.css +54 -0
  98. package/src/components/import/template-builder.js +474 -0
  99. package/src/components/import/template.css +51 -0
  100. package/src/components/layout/MainPage.tsx +230 -0
  101. package/src/components/layout/footer/index.css +6 -0
  102. package/src/components/layout/footer/index.js +17 -0
  103. package/src/components/layout/header/index.css +86 -0
  104. package/src/components/layout/header/index.tsx +58 -0
  105. package/src/components/layout/menu/block.tsx +88 -0
  106. package/src/components/layout/menu/l2menu-message-bar.tsx +118 -0
  107. package/src/components/layout/menu/l2menu-quick-bar.tsx +132 -0
  108. package/src/components/layout/menu/menu-2layers.tsx +92 -0
  109. package/src/components/layout/menu/menu-render.tsx +49 -0
  110. package/src/components/layout/menu/reset-password.tsx +185 -0
  111. package/src/components/layout/menu/user-bar.tsx +97 -0
  112. package/src/components/layout/menu/userinfo-bar.tsx +70 -0
  113. package/src/components/layout/sidebar/index.css +26 -0
  114. package/src/components/layout/sidebar/index.tsx +38 -0
  115. package/src/components/login.js +137 -0
  116. package/src/components/module/criteria-page.tsx +175 -0
  117. package/src/components/module/dtmpl-page.tsx +70 -0
  118. package/src/components/module/ltmpl-page.tsx +181 -0
  119. package/src/components/routable/dtmpl-route.tsx +96 -0
  120. package/src/components/routable/import-route.tsx +28 -0
  121. package/src/components/routable/ltmpl-route.tsx +158 -0
  122. package/src/components/table/act-table.tsx +635 -0
  123. package/src/components/table/column/column-selector.tsx +79 -0
  124. package/src/components/table/column/index.css +14 -0
  125. package/src/components/table/index.css +45 -0
  126. package/src/components/table/l2-act-table.tsx +85 -0
  127. package/src/components/table/modal-select-table.tsx +248 -0
  128. package/src/components/table/pagination.css +15 -0
  129. package/src/components/table/pagination.tsx +72 -0
  130. package/src/components/table/query-table.tsx +331 -0
  131. package/src/components/table/relation-table.tsx +600 -0
  132. package/src/components/table/select-table.tsx +247 -0
  133. package/src/components/table/selected-rows-card.tsx +62 -0
  134. package/src/components/table/stat/restat.tsx +79 -0
  135. package/src/components/table/table-util.tsx +33 -0
  136. package/src/components/tmpl/control-type-supportor.tsx +97 -0
  137. package/src/components/tmpl/hc-data-source.tsx +230 -0
  138. package/src/components/tmpl/hcservice-v3.tsx +624 -0
  139. package/src/components/tmpl/interface.tsx +308 -0
  140. package/src/components/tmpl/superagent.js +93 -0
  141. package/src/components/tmpl/tmpl-config-analysis.tsx +111 -0
  142. package/src/components/units/EncryptUtils.js +38 -0
  143. package/src/components/units/image.d.ts +8 -0
  144. package/src/components/units/index.tsx +536 -0
  145. package/src/components/units/logo.png +0 -0
  146. package/src/components/units/storage.js +3 -0
  147. package/src/components/welcome/HCWelcome.js +232 -0
  148. package/src/components/welcome/index.css +13 -0
  149. package/src/components/welcome/logo.png +0 -0
  150. package/src/components/welcome/quick-entrance.tsx +77 -0
  151. package/src/components/welcome/workbench.tsx +76 -0
  152. package/src/index.js +4 -0
  153. package/src/style/common.css +79 -0
  154. package/src/style/coverstyle.css +49 -0
  155. package/src/style/transstyle.css +24 -0
  156. package/tsconfig.json +106 -0
@@ -0,0 +1,316 @@
1
+ import React from 'react'
2
+ import {Card,Button,Upload,message,Progress,List,Checkbox,Row,Col,Modal,Popover,InputNumber } from 'antd'
3
+ import {SyncOutlined,ReloadOutlined ,SnippetsOutlined,UploadOutlined,CopyOutlined,SettingOutlined} from '@ant-design/icons';
4
+ import Super from "../tmpl/superagent"
5
+ import Units from "../units"
6
+ import './index.css'
7
+ import {LtmplConfig, QueryKey, SelectedRow, SourceName, TmplBaseProps} from "../tmpl/interface";
8
+ import moment from "moment";
9
+ import HCDataSource from "../tmpl/hc-data-source";
10
+
11
+ const CheckboxGroup = Checkbox.Group;
12
+ const logLevelList: LogLevel[]= ['INFO', 'SUC', 'ERROR', 'WARN'];
13
+ let totalMSG=[]
14
+ type LogLevel = 'INFO'| 'SUC'|'ERROR'|'WARN';
15
+ type ImportStatus = 'waitingFile'| 'fileSelected' |'importing' | 'success'|'fail' |'stop';
16
+
17
+ interface ExcelImportProps {
18
+ sourceId:string,
19
+ };
20
+
21
+ interface ExcelImportStat {
22
+ inputMaxMsgCount:number;
23
+ maxMsgCount:number;
24
+ percent:number;
25
+ statusMsg:string;
26
+ importStatus:string,
27
+ showLogLevelList: LogLevel[],
28
+ logSetterVisible:boolean,
29
+ logs:any[];
30
+ importFile:any,
31
+ logSerialId:string,
32
+ ltmplConfig:LtmplConfig;
33
+ };
34
+
35
+ export default class ExcelImport extends React.PureComponent<ExcelImportProps, ExcelImportStat>{
36
+
37
+ state = {
38
+ maxMsgCount:100,
39
+ inputMaxMsgCount:100,
40
+ importStatus:'waitingFile',
41
+ importFile:undefined,
42
+ logs:[],
43
+ percent:0,
44
+ statusMsg:undefined,
45
+ logSetterVisible:false,
46
+ showLogLevelList:[...logLevelList],
47
+ logSerialId:undefined,
48
+ ltmplConfig:undefined,
49
+ }
50
+
51
+ timerId=undefined;
52
+
53
+ async componentDidMount(){
54
+ const {sourceId}=this.props;
55
+
56
+ let ltmplConfigRes = await HCDataSource.requestLtmplConfig(sourceId);
57
+
58
+ this.setState({
59
+ ltmplConfig:ltmplConfigRes.ltmplConfig,
60
+ })
61
+
62
+ }
63
+ componentWillUnmount(){
64
+ if(this.timerId){
65
+ clearInterval(this.timerId);
66
+ }
67
+ }
68
+
69
+
70
+
71
+ handleUpload = () => {
72
+ const {sourceId}=this.props;
73
+ const { importFile } = this.state;
74
+ const formData = new FormData();
75
+ formData.append('file', importFile);
76
+ formData.append('sourceId', sourceId.toString());
77
+
78
+ Super.super({
79
+ url:`/v3/ltmpl/importer`,
80
+ method:'POST',
81
+ data:formData,
82
+ },"formdata").then((res)=>{
83
+ //console.log(res)
84
+ if(res.status==="success"){
85
+ this.setState({
86
+ importStatus: 'importing',
87
+ });
88
+ this.timerId=setInterval(() =>this.handleStatus(res.importId),500);
89
+ }else{
90
+ message.error('失败!');
91
+ this.setState({
92
+ importStatus: 'fail',
93
+ });
94
+ }
95
+ })
96
+ }
97
+
98
+ handleStopImport=()=>{
99
+ this.setState({
100
+ importStatus: 'stop',
101
+ });
102
+ }
103
+
104
+ handleStatus=(importId)=>{
105
+ const {maxMsgCount,importStatus}=this.state
106
+ Super.super({
107
+ url:`/v3/importer/status`,
108
+ method:'GET',
109
+ query:{
110
+ importId:importId,
111
+ msgIndex:0,
112
+ maxMsgCount,
113
+ interrupted: importStatus=='stop',
114
+ }
115
+ },"","none").then((res)=>{
116
+ const MSG=[]
117
+ for(let item of res.messageSequence.messages){
118
+ let color="";
119
+ let logLevel="";
120
+ let createTime=Units.formateDate(item.createTime);
121
+ if(item.type==="SUC"){
122
+ color="green"
123
+ logLevel='成功';
124
+ }else if(item.type==="INFO"){
125
+ color="black"
126
+ logLevel='常规';
127
+ }else if(item.type==="ERROR"){
128
+ color="red"
129
+ logLevel='错误';
130
+ }else if(item.type==="WARN"){
131
+ color="rgb(250, 225, 4)"
132
+ logLevel='警告';
133
+ }
134
+ const msg=<div ><p>{createTime}</p><p style={{color:color}}>{`【${logLevel}】`+item.text}</p></div>
135
+ MSG.push({level:item.type,msg})
136
+ }
137
+
138
+ this.setState({
139
+ statusMsg:res.message,
140
+ percent:Math.floor((res.current/res.totalCount)*100),
141
+ logs:MSG,
142
+ })
143
+ if(res.completed===true){
144
+ clearInterval(this.timerId);
145
+ message.success('导入完成!');
146
+ this.setState({
147
+ importStatus:'success'
148
+ });
149
+ }
150
+ if(importStatus=='stop'){
151
+ clearInterval(this.timerId);
152
+ }
153
+
154
+ })
155
+ }
156
+ onChangeShowLogLevelList = (showLogLevelList) => { //日志checkbox选择
157
+ this.setState({
158
+ showLogLevelList,
159
+ });
160
+ }
161
+
162
+ fresh=()=>{
163
+ // this.setState({
164
+ // fileList:[],
165
+ // uploading: false,
166
+ // statusMsg:"",
167
+ // begin:true,
168
+ // importAgain:"none",
169
+ // importbtn:"block",
170
+ // percent:0,
171
+ // messages:[]
172
+ // })
173
+ // message.success("刷新成功!")
174
+ }
175
+
176
+ handleLogSetter=()=>{
177
+ const {inputMaxMsgCount}=this.state
178
+ this.setState({
179
+ maxMsgCount:inputMaxMsgCount,
180
+ logSetterVisible:false,
181
+ })
182
+ message.success("设置成功!")
183
+ }
184
+ changeLogSetterVisible = visible => {
185
+ this.setState({ logSetterVisible:visible });
186
+ };
187
+
188
+
189
+ render(){
190
+ const { ltmplConfig,importFile,maxMsgCount ,percent,importStatus,showLogLevelList,logSetterVisible,logs} = this.state;
191
+
192
+ let showLogs=[];
193
+
194
+ for(let log of logs){
195
+ if(showLogLevelList.includes(log.level) ){
196
+ showLogs.push(log.msg);
197
+ }
198
+ }
199
+
200
+ const props = {
201
+ accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,application/vnd.ms-excel",
202
+ onChange : () => {
203
+
204
+ },
205
+ onRemove : (file) => {
206
+ this.setState({
207
+ importFile: undefined,
208
+ importStatus:'waitingFile',
209
+ percent:0,
210
+ });
211
+ },
212
+ beforeUpload: (file) => {
213
+ this.setState({
214
+ percent:0,
215
+ importFile: file,
216
+ importStatus:'fileSelected',
217
+ });
218
+ return false;
219
+ },
220
+ fileList:importFile?[importFile]:undefined,
221
+ }
222
+ const content=(
223
+ <div>
224
+ <label>日志消息数上限:</label>
225
+ <InputNumber
226
+ defaultValue={maxMsgCount}
227
+ onChange={(value)=>this.setState({inputMaxMsgCount:value})}
228
+ />
229
+ <Button
230
+ type="primary"
231
+ style={{marginLeft:'10px'}}
232
+ onClick={this.handleLogSetter}
233
+ >确定</Button>
234
+ </div>
235
+ )
236
+ return(
237
+ <div className="importData">
238
+ <h3>
239
+ {'导入 -> '}{ ltmplConfig?ltmplConfig.title:""}
240
+ <p className="fr">
241
+ <Button
242
+ className="hoverbig"
243
+ title="刷新"
244
+ onClick={this.fresh}>
245
+ <ReloadOutlined />
246
+ </Button>
247
+ </p>
248
+ </h3>
249
+ <Row>
250
+ <Col span={14} offset={5}>
251
+ <Card style={{minWidth:600}}>
252
+ <Upload {...props}>
253
+ <Button>
254
+ <UploadOutlined />选择导入文件
255
+ </Button>
256
+ </Upload>
257
+ <Progress percent={percent} size="small" status="active" />
258
+ <div className="importBtns">
259
+ <Button
260
+ type="primary"
261
+ onClick={this.handleUpload}
262
+ disabled={!(['fileSelected','stop'].includes(importStatus))}
263
+ loading={importStatus=='importing'}
264
+ >
265
+ {importStatus=='importing' ? '正在导入' : importStatus=='stop'?'重新导入':'开始导入' }
266
+ </Button>
267
+ <Button
268
+ onClick={this.handleStopImport}
269
+ disabled={importStatus!='importing'}
270
+ >
271
+ {'停止导入'}
272
+ </Button>
273
+
274
+ </div>
275
+ <List
276
+ header={
277
+ <div className="listHeader">
278
+ <h4>导入日志</h4>
279
+ <div className="checks">
280
+ <CheckboxGroup value={showLogLevelList} onChange={this.onChangeShowLogLevelList}>
281
+ <Checkbox value="INFO" className="infoColor">常规</Checkbox>
282
+ <Checkbox value="SUC" className="sucColor">成功</Checkbox>
283
+ <Checkbox value="ERROR" className="errorColor">错误</Checkbox>
284
+ <Checkbox value="WARN" className="warnColor">警告</Checkbox>
285
+ </CheckboxGroup>
286
+ <div className="btns">
287
+ <Popover
288
+ content={content}
289
+ title="日志设置"
290
+ trigger="click"
291
+ placement="top"
292
+ visible={logSetterVisible}
293
+ overlayStyle={{width:350}}
294
+ onVisibleChange={this.changeLogSetterVisible}
295
+ >
296
+ <Button title="日志设置" type="primary" size="small">
297
+ <SettingOutlined />
298
+ </Button>
299
+ </Popover>
300
+ </div>
301
+ </div>
302
+ </div>
303
+ }
304
+ footer={<div>{importStatus}</div>}
305
+ bordered
306
+ dataSource={showLogs}
307
+ renderItem={item => (<List.Item>{item}</List.Item>)}
308
+ className="importList"
309
+ />
310
+ </Card>
311
+ </Col>
312
+ </Row>
313
+ </div>
314
+ )
315
+ }
316
+ }
@@ -0,0 +1,54 @@
1
+ .importBtns button{
2
+ margin:15px 0 10px 0
3
+ }
4
+ .importList .ant-spin-container{
5
+ height:300px;
6
+ overflow: auto
7
+ }
8
+ .ant-list-item-content p{
9
+ margin-bottom: 0;
10
+ }
11
+ .listHeader h4{
12
+ display: inline;
13
+ }
14
+ .listHeader .checks{
15
+ float:right;
16
+ position: relative;
17
+ padding-right: 62px
18
+ }
19
+ .listHeader .btns{
20
+ position: absolute;
21
+ right:-22px;
22
+ top:0;
23
+ }
24
+ .infoColor{
25
+ color:black;
26
+ }
27
+ .infoColor .ant-checkbox-checked .ant-checkbox-inner{
28
+ background-color:black;
29
+ border-color: black;
30
+ }
31
+ .sucColor{
32
+ color:green;
33
+ }
34
+ .sucColor .ant-checkbox-checked .ant-checkbox-inner{
35
+ background-color:green;
36
+ border-color: green;
37
+ }
38
+ .errorColor{
39
+ color:red;
40
+ }
41
+ .errorColor .ant-checkbox-checked .ant-checkbox-inner{
42
+ background-color:red;
43
+ border-color: red;
44
+ }
45
+ .warnColor{
46
+ color:rgb(250, 225, 4);
47
+ }
48
+ .warnColor .ant-checkbox-checked .ant-checkbox-inner{
49
+ background-color:rgb(250, 225, 4);
50
+ border-color: rgb(250, 225, 4);
51
+ }
52
+ .importData h3{
53
+ font-size: 18px
54
+ }