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,137 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Button, Col, Form, Image, Input, message, Row} from 'antd'
|
|
3
|
+
import {LockOutlined, SafetyCertificateOutlined, UserOutlined} from '@ant-design/icons';
|
|
4
|
+
import HCserviceV3 from "./tmpl/hcservice-v3"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default class Loginit extends React.Component {
|
|
8
|
+
state = {
|
|
9
|
+
username: "",
|
|
10
|
+
password: "",
|
|
11
|
+
loading: true,
|
|
12
|
+
needKaptcha:false,
|
|
13
|
+
kaptchaImg:null,
|
|
14
|
+
kaptchaToken:null
|
|
15
|
+
}
|
|
16
|
+
formRef = React.createRef();
|
|
17
|
+
|
|
18
|
+
componentDidMount=async ()=> {
|
|
19
|
+
|
|
20
|
+
let pubkey = await HCserviceV3.getRasPubkey();
|
|
21
|
+
this.setState({
|
|
22
|
+
pubkey,
|
|
23
|
+
loading: false
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
getKaptchaToken=async ()=>{
|
|
29
|
+
let res= await HCserviceV3.getKaptchaToken();
|
|
30
|
+
if(res){
|
|
31
|
+
let kaptchaImg=`data:image/png;base64,${res.img}`;
|
|
32
|
+
this.setState({
|
|
33
|
+
kaptchaImg,
|
|
34
|
+
kaptchaToken:res.kaptchaToken,
|
|
35
|
+
needKaptcha:true
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
handleSubmit = async () => {
|
|
41
|
+
|
|
42
|
+
this.setState({
|
|
43
|
+
loading: true
|
|
44
|
+
})
|
|
45
|
+
let {kaptchaToken,pubkey}=this.state
|
|
46
|
+
|
|
47
|
+
await this.formRef.current.validateFields().then(async (values) => {
|
|
48
|
+
let res = await HCserviceV3.login(values.username, values.password,kaptchaToken,values.kaptchaText,pubkey);
|
|
49
|
+
if (res.status === 'error') {
|
|
50
|
+
//message.info(res.message);
|
|
51
|
+
await this.getKaptchaToken();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
).catch(errorInfo => {
|
|
55
|
+
})
|
|
56
|
+
this.setState({
|
|
57
|
+
loading: false
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
handleKeyDown = (event) => { //按下enter键,触发login事件
|
|
62
|
+
switch (event.keyCode) {
|
|
63
|
+
case 13:
|
|
64
|
+
this.handleSubmit();
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
changeKaptcha =async (event) => { //切换验证码
|
|
72
|
+
await this.getKaptchaToken();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
componentDidMount() {
|
|
76
|
+
window.removeEventListener('keydown', this.handleKeyDown)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
render() {
|
|
80
|
+
const {username, password, loading,needKaptcha,kaptchaImg} = this.state
|
|
81
|
+
|
|
82
|
+
return (<Row type="flex" justify="center" align="middle" className="login">
|
|
83
|
+
<Col>
|
|
84
|
+
<Form style={{width: 350}} ref={this.formRef}
|
|
85
|
+
name="normal_login"
|
|
86
|
+
className="login-form"
|
|
87
|
+
initialValues={{remember: true}}
|
|
88
|
+
><h3>欢迎登录</h3>
|
|
89
|
+
<Form.Item
|
|
90
|
+
name="username"
|
|
91
|
+
rules={[{required: true, message: '请输入用户名!'}, {max: 20, min: 0, message: '输入0-20个字符'},]}
|
|
92
|
+
>
|
|
93
|
+
<Input prefix={<UserOutlined className="site-form-item-icon"/>} placeholder="用户名"
|
|
94
|
+
/>
|
|
95
|
+
</Form.Item>
|
|
96
|
+
<Form.Item
|
|
97
|
+
name="password"
|
|
98
|
+
rules={[{required: true, message: '请输入密码!'}]}
|
|
99
|
+
>
|
|
100
|
+
<Input.Password
|
|
101
|
+
placeholder="密码"
|
|
102
|
+
onKeyDown={this.handleKeyDown}
|
|
103
|
+
prefix={<LockOutlined className="site-form-item-icon"/>}
|
|
104
|
+
/>
|
|
105
|
+
</Form.Item>
|
|
106
|
+
{
|
|
107
|
+
needKaptcha?<Row gutter={8} >
|
|
108
|
+
<Col span={12}>
|
|
109
|
+
<Form.Item
|
|
110
|
+
name="kaptchaText"
|
|
111
|
+
rules={[{required: true, message: '请输入验证码!'}]}
|
|
112
|
+
>
|
|
113
|
+
<Input prefix={<SafetyCertificateOutlined className="site-form-item-icon"/>}
|
|
114
|
+
placeholder="验证码"
|
|
115
|
+
onKeyDown={this.handleKeyDown}
|
|
116
|
+
/>
|
|
117
|
+
</Form.Item>
|
|
118
|
+
</Col>
|
|
119
|
+
<Col span={12}>
|
|
120
|
+
<img style={{"cursor":"pointer"}} height={30} width={90} title={'点击刷新'} onClick={this.changeKaptcha}
|
|
121
|
+
src={kaptchaImg}></img>
|
|
122
|
+
</Col>
|
|
123
|
+
</Row>:""
|
|
124
|
+
}
|
|
125
|
+
<Form.Item>
|
|
126
|
+
<Button type="primary" style={{width: '100%'}} loading={loading} onClick={this.handleSubmit}
|
|
127
|
+
className="login-form-button">
|
|
128
|
+
登录
|
|
129
|
+
</Button>
|
|
130
|
+
</Form.Item>
|
|
131
|
+
</Form>
|
|
132
|
+
</Col>
|
|
133
|
+
</Row>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {DtmplData, LtmplConfigRes} from '../tmpl/interface';
|
|
3
|
+
import Units from "../units";
|
|
4
|
+
import ActTable from '../table/act-table'
|
|
5
|
+
// import StatActTable from '../table/stat-act-table'
|
|
6
|
+
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
|
+
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
8
|
+
import ModalDtmplEdit from "../detail/edit/modal-dtmpl-edit";
|
|
9
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
+
|
|
11
|
+
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
12
|
+
|
|
13
|
+
export interface CriteriaPageProps {
|
|
14
|
+
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export interface CriteriaPageState {
|
|
18
|
+
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
class CriteriaPage extends React.PureComponent<CriteriaPageProps, CriteriaPageState> {
|
|
22
|
+
|
|
23
|
+
state = {
|
|
24
|
+
ltmplConfigRes: undefined,
|
|
25
|
+
criteriaData:undefined,
|
|
26
|
+
showDtmplView:false,
|
|
27
|
+
showDtmplEdit:false,
|
|
28
|
+
selectedCode:undefined,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async componentDidMount() {
|
|
32
|
+
this.loadLtmplConfig();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async componentDidUpdate(prevProps) {
|
|
36
|
+
const { sourceId,mainCode} = this.props;
|
|
37
|
+
if(!prevProps || prevProps.sourceId!=sourceId){
|
|
38
|
+
this.loadLtmplConfig();
|
|
39
|
+
}else if(mainCode && prevProps.mainCode!=mainCode){//此处处理有效,但不高效
|
|
40
|
+
this.loadLtmplConfig();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
loadLtmplConfig = async () => {
|
|
45
|
+
const {sourceId} = this.props;
|
|
46
|
+
let ltmplConfigRes:LtmplConfigRes = await HCDataSource.requestLtmplConfig(sourceId);
|
|
47
|
+
let criteriaData;
|
|
48
|
+
//提取 过滤条件的默认值
|
|
49
|
+
if(ltmplConfigRes){
|
|
50
|
+
let defaultCriteriaValue=ltmplConfigRes.ltmplConfig.defaultCriteriaValue;
|
|
51
|
+
if(defaultCriteriaValue){
|
|
52
|
+
criteriaData=this.toCriteriaData(defaultCriteriaValue);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
this.setState({
|
|
56
|
+
ltmplConfigRes,criteriaData
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
toCriteriaData = (values:object) => {
|
|
60
|
+
let criteriaData={};
|
|
61
|
+
if(values){
|
|
62
|
+
for (let key in values) {
|
|
63
|
+
criteriaData[key]=Units.configParamTrans(values[key]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
criteriaData['sequence']=Units.getRandomNum(6);
|
|
67
|
+
return criteriaData;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
// async componentDidUpdate(prevProps) {
|
|
72
|
+
// const {location} = this.props;
|
|
73
|
+
// const { sourceId} = this.props.match.params;
|
|
74
|
+
// let { sourceId: preSourceId} = prevProps.match.params;
|
|
75
|
+
// let {location: preLocation} = prevProps;
|
|
76
|
+
//
|
|
77
|
+
// if ( !sourceId ||
|
|
78
|
+
// ( !preSourceId && this.state.ltmplConfigRes)
|
|
79
|
+
// || (location.pathname == preLocation.pathname && location.search == preLocation.search)
|
|
80
|
+
// ) {
|
|
81
|
+
// return;
|
|
82
|
+
// }
|
|
83
|
+
// this.loadData();
|
|
84
|
+
// }
|
|
85
|
+
|
|
86
|
+
showView = (code: string) => {
|
|
87
|
+
// const { sourceId} = this.props.match.params;
|
|
88
|
+
// this.onRoute(`/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`);
|
|
89
|
+
this.setState({
|
|
90
|
+
selectedCode:code,
|
|
91
|
+
showDtmplView:true,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
doEdit = (code: string,mode:string) => {
|
|
96
|
+
this.setState({
|
|
97
|
+
selectedCode:code,
|
|
98
|
+
showDtmplEdit:true,
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
doCreate = () => {
|
|
105
|
+
this.setState({
|
|
106
|
+
selectedCode:null,
|
|
107
|
+
showDtmplEdit:true,
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
doSearch = (params_) => {
|
|
112
|
+
const { sourceId,mainCode} = this.props;
|
|
113
|
+
//const oldfliter = history.location.search.slice(1);
|
|
114
|
+
|
|
115
|
+
let params = {...params_}
|
|
116
|
+
//追加过滤条件,hiddenColIds,innerQueryKey
|
|
117
|
+
if (mainCode) {
|
|
118
|
+
params['mainCode'] = mainCode;
|
|
119
|
+
}
|
|
120
|
+
params['sourceId'] = sourceId;
|
|
121
|
+
// const criteriaData = Units.transQueryParamsToStr(params);
|
|
122
|
+
// let flag = true;
|
|
123
|
+
//if (newfliter && oldfliter != newfliter) { //查询条件更新时
|
|
124
|
+
this.setState({
|
|
125
|
+
criteriaData:this.toCriteriaData(params)
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
handleDtmplEdit = (code: string) => {
|
|
131
|
+
this.doSearch(this.state.criteriaData);
|
|
132
|
+
this.setState({
|
|
133
|
+
showDtmplEdit:false,
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
render() {
|
|
139
|
+
const {ltmplConfigRes,criteriaData,showDtmplView,selectedCode,showDtmplEdit} = this.state;
|
|
140
|
+
const { sourceId,mainCode} = this.props;
|
|
141
|
+
|
|
142
|
+
if (!ltmplConfigRes) {
|
|
143
|
+
return <></>;
|
|
144
|
+
} else {
|
|
145
|
+
const {buttons}=ltmplConfigRes.ltmplConfig
|
|
146
|
+
return <>
|
|
147
|
+
<ActTable mainCode={mainCode} showView={this.showView}
|
|
148
|
+
doSearch={this.doSearch} doEdit={this.doEdit} doCreate={this.doCreate}
|
|
149
|
+
sourceId={sourceId} criteriaData={criteriaData}
|
|
150
|
+
ltmplConfig={ltmplConfigRes.ltmplConfig}/>
|
|
151
|
+
{buttons.includes('detail') ?
|
|
152
|
+
<ModalDtmplView visible={showDtmplView} onCancel={()=>{
|
|
153
|
+
this.setState({
|
|
154
|
+
showDtmplView:false,
|
|
155
|
+
})}
|
|
156
|
+
}
|
|
157
|
+
sourceId={sourceId}
|
|
158
|
+
code={selectedCode}> </ModalDtmplView> : ""}
|
|
159
|
+
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
160
|
+
<ModalDtmplEdit visible={showDtmplEdit} onCancel={()=>{
|
|
161
|
+
this.setState({
|
|
162
|
+
showDtmplEdit:false,
|
|
163
|
+
})}}
|
|
164
|
+
sourceId={sourceId}
|
|
165
|
+
code={selectedCode}
|
|
166
|
+
onOk={this.handleDtmplEdit}> </ModalDtmplEdit>
|
|
167
|
+
: ""}
|
|
168
|
+
</>
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export default CriteriaPage;
|
|
175
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {DtmplConfig, DtmplData, LtmplConfigRes} from '../tmpl/interface';
|
|
3
|
+
import Units from "../units";
|
|
4
|
+
import ActTable from '../table/act-table'
|
|
5
|
+
// import StatActTable from '../table/stat-act-table'
|
|
6
|
+
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
|
+
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
8
|
+
import ModalDtmplEdit from "../detail/edit/modal-dtmpl-edit";
|
|
9
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
+
import ActDtmplView from "../detail/view/act-dtmpl-view";
|
|
11
|
+
|
|
12
|
+
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
13
|
+
|
|
14
|
+
export interface DtmplPageProps {
|
|
15
|
+
sourceId?:string,
|
|
16
|
+
code?:string;
|
|
17
|
+
mainCode?:string;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export interface DtmplPageState {
|
|
21
|
+
showDtmplEdit:boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
class DtmplPage extends React.PureComponent<DtmplPageProps, DtmplPageState> {
|
|
25
|
+
|
|
26
|
+
state = {
|
|
27
|
+
showDtmplEdit:false,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// async componentDidMount() {
|
|
31
|
+
// this.loadDtmplConfig();
|
|
32
|
+
// }
|
|
33
|
+
//
|
|
34
|
+
// async componentDidUpdate(prevProps) {
|
|
35
|
+
// const { sourceId} = this.props;
|
|
36
|
+
// if(!prevProps || prevProps.sourceId!=sourceId){
|
|
37
|
+
// this.loadDtmplConfig();
|
|
38
|
+
// }
|
|
39
|
+
// }
|
|
40
|
+
|
|
41
|
+
goDtmpl=()=>{
|
|
42
|
+
this.setState({
|
|
43
|
+
showDtmplEdit:true,
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
handleDtmplEdit = (code: string) => {
|
|
48
|
+
this.setState({
|
|
49
|
+
showDtmplEdit:false,
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
render() {
|
|
54
|
+
const {showDtmplEdit} = this.state;
|
|
55
|
+
const { sourceId,code,mainCode} = this.props;
|
|
56
|
+
return <>
|
|
57
|
+
<ActDtmplView goDtmpl={this.goDtmpl} sourceId={sourceId} code={code} mainCode={mainCode}></ActDtmplView>
|
|
58
|
+
<ModalDtmplEdit visible={showDtmplEdit} onCancel={()=>{
|
|
59
|
+
this.setState({
|
|
60
|
+
showDtmplEdit:false,
|
|
61
|
+
})}}
|
|
62
|
+
sourceId={sourceId}
|
|
63
|
+
code={code}
|
|
64
|
+
onOk={this.handleDtmplEdit}> </ModalDtmplEdit>
|
|
65
|
+
</>
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export default DtmplPage;
|
|
70
|
+
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {DtmplData, LtmplConfigRes} from '../tmpl/interface';
|
|
3
|
+
import Units from "../units";
|
|
4
|
+
import ActTable from '../table/act-table'
|
|
5
|
+
// import StatActTable from '../table/stat-act-table'
|
|
6
|
+
import HCDataSource from "../tmpl/hc-data-source";
|
|
7
|
+
import ModalDtmplView from "../detail/view/modal-dtmpl-view";
|
|
8
|
+
import ModalDtmplEdit from "../detail/edit/modal-dtmpl-edit";
|
|
9
|
+
import HcserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
+
|
|
11
|
+
//以列表为入口的,页面内列表,基本原则是所有交互在页面内完成,不会触发路由。
|
|
12
|
+
|
|
13
|
+
export interface LtmplPageProps {
|
|
14
|
+
sourceId:string,
|
|
15
|
+
mainCode?:string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface LtmplPageState {
|
|
19
|
+
ltmplConfigRes:LtmplConfigRes;
|
|
20
|
+
criteriaData:object;
|
|
21
|
+
showDtmplView:boolean;
|
|
22
|
+
selectedCode:string;
|
|
23
|
+
showDtmplEdit:boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
27
|
+
|
|
28
|
+
state = {
|
|
29
|
+
ltmplConfigRes: undefined,
|
|
30
|
+
criteriaData:undefined,
|
|
31
|
+
showDtmplView:false,
|
|
32
|
+
showDtmplEdit:false,
|
|
33
|
+
selectedCode:undefined,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async componentDidMount() {
|
|
37
|
+
this.loadLtmplConfig();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async componentDidUpdate(prevProps) {
|
|
41
|
+
const { sourceId,mainCode} = this.props;
|
|
42
|
+
if(!prevProps || prevProps.sourceId!=sourceId){
|
|
43
|
+
this.loadLtmplConfig();
|
|
44
|
+
}else if(mainCode && prevProps.mainCode!=mainCode){//此处处理有效,但不高效
|
|
45
|
+
this.loadLtmplConfig();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
loadLtmplConfig = async () => {
|
|
50
|
+
const {sourceId} = this.props;
|
|
51
|
+
let ltmplConfigRes:LtmplConfigRes = await HCDataSource.requestLtmplConfig(sourceId);
|
|
52
|
+
let criteriaData;
|
|
53
|
+
//提取 过滤条件的默认值
|
|
54
|
+
if(ltmplConfigRes){
|
|
55
|
+
let defaultCriteriaValue=ltmplConfigRes.ltmplConfig.defaultCriteriaValue;
|
|
56
|
+
if(defaultCriteriaValue){
|
|
57
|
+
criteriaData=this.toCriteriaData(defaultCriteriaValue);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
this.setState({
|
|
62
|
+
ltmplConfigRes,criteriaData
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
toCriteriaData = (values:object) => {
|
|
66
|
+
let criteriaData={};
|
|
67
|
+
if(values){
|
|
68
|
+
for (let key in values) {
|
|
69
|
+
criteriaData[key]=Units.configParamTrans(values[key]);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
criteriaData['sequence']=Units.getRandomNum(6);
|
|
73
|
+
return criteriaData;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
// async componentDidUpdate(prevProps) {
|
|
78
|
+
// const {location} = this.props;
|
|
79
|
+
// const { sourceId} = this.props.match.params;
|
|
80
|
+
// let { sourceId: preSourceId} = prevProps.match.params;
|
|
81
|
+
// let {location: preLocation} = prevProps;
|
|
82
|
+
//
|
|
83
|
+
// if ( !sourceId ||
|
|
84
|
+
// ( !preSourceId && this.state.ltmplConfigRes)
|
|
85
|
+
// || (location.pathname == preLocation.pathname && location.search == preLocation.search)
|
|
86
|
+
// ) {
|
|
87
|
+
// return;
|
|
88
|
+
// }
|
|
89
|
+
// this.loadData();
|
|
90
|
+
// }
|
|
91
|
+
|
|
92
|
+
showView = (code: string) => {
|
|
93
|
+
// const { sourceId} = this.props.match.params;
|
|
94
|
+
// this.onRoute(`/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`);
|
|
95
|
+
this.setState({
|
|
96
|
+
selectedCode:code,
|
|
97
|
+
showDtmplView:true,
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
doEdit = (code: string,mode:string) => {
|
|
102
|
+
this.setState({
|
|
103
|
+
selectedCode:code,
|
|
104
|
+
showDtmplEdit:true,
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
doCreate = () => {
|
|
111
|
+
this.setState({
|
|
112
|
+
selectedCode:null,
|
|
113
|
+
showDtmplEdit:true,
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
doSearch = (params_) => {
|
|
118
|
+
const { sourceId,mainCode} = this.props;
|
|
119
|
+
//const oldfliter = history.location.search.slice(1);
|
|
120
|
+
|
|
121
|
+
let params = {...params_}
|
|
122
|
+
//追加过滤条件,hiddenColIds,innerQueryKey
|
|
123
|
+
if (mainCode) {
|
|
124
|
+
params['mainCode'] = mainCode;
|
|
125
|
+
}
|
|
126
|
+
params['sourceId'] = sourceId;
|
|
127
|
+
// const criteriaData = Units.transQueryParamsToStr(params);
|
|
128
|
+
// let flag = true;
|
|
129
|
+
//if (newfliter && oldfliter != newfliter) { //查询条件更新时
|
|
130
|
+
this.setState({
|
|
131
|
+
criteriaData:this.toCriteriaData(params)
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
handleDtmplEdit = (code: string) => {
|
|
137
|
+
this.doSearch(this.state.criteriaData);
|
|
138
|
+
this.setState({
|
|
139
|
+
showDtmplEdit:false,
|
|
140
|
+
})
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
render() {
|
|
145
|
+
const {ltmplConfigRes,criteriaData,showDtmplView,selectedCode,showDtmplEdit} = this.state;
|
|
146
|
+
const { sourceId,mainCode} = this.props;
|
|
147
|
+
|
|
148
|
+
if (!ltmplConfigRes) {
|
|
149
|
+
return <></>;
|
|
150
|
+
} else {
|
|
151
|
+
const {buttons}=ltmplConfigRes.ltmplConfig
|
|
152
|
+
return <>
|
|
153
|
+
<ActTable mainCode={mainCode} showView={this.showView}
|
|
154
|
+
doSearch={this.doSearch} doEdit={this.doEdit} doCreate={this.doCreate}
|
|
155
|
+
sourceId={sourceId} criteriaData={criteriaData}
|
|
156
|
+
ltmplConfig={ltmplConfigRes.ltmplConfig}/>
|
|
157
|
+
{buttons.includes('detail') ?
|
|
158
|
+
<ModalDtmplView visible={showDtmplView} onCancel={()=>{
|
|
159
|
+
this.setState({
|
|
160
|
+
showDtmplView:false,
|
|
161
|
+
})}
|
|
162
|
+
}
|
|
163
|
+
sourceId={sourceId}
|
|
164
|
+
code={selectedCode}> </ModalDtmplView> : ""}
|
|
165
|
+
{buttons.includes('dtmplEdit') || buttons.includes('dtmplAdd') ?
|
|
166
|
+
<ModalDtmplEdit visible={showDtmplEdit} onCancel={()=>{
|
|
167
|
+
this.setState({
|
|
168
|
+
showDtmplEdit:false,
|
|
169
|
+
})}}
|
|
170
|
+
sourceId={sourceId}
|
|
171
|
+
code={selectedCode}
|
|
172
|
+
onOk={this.handleDtmplEdit}> </ModalDtmplEdit>
|
|
173
|
+
: ""}
|
|
174
|
+
</>
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export default LtmplPage;
|
|
181
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Button, Card, Form as AntdForm, Modal} from 'antd';
|
|
3
|
+
import {RouterCompProps} from '../tmpl/interface';
|
|
4
|
+
import Units from "../units";
|
|
5
|
+
import DtmplEdit from "../detail/edit/dtmpl-edit";
|
|
6
|
+
import ActDtmplView from '../detail/view/act-dtmpl-view'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export interface DtmplRouteProps extends RouterCompProps {
|
|
10
|
+
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export interface DtmplRoutePropsStat {
|
|
14
|
+
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
class DtmplRoute extends React.PureComponent<DtmplRouteProps, DtmplRoutePropsStat> {
|
|
18
|
+
|
|
19
|
+
getMenuId=()=>{
|
|
20
|
+
const {location} = this.props;
|
|
21
|
+
console.log("this.props.match.params",this.props);
|
|
22
|
+
var searchParams = new URLSearchParams( location.search);
|
|
23
|
+
let menuId = searchParams.get('menuId');
|
|
24
|
+
return menuId;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
goBackToLtmpl=()=>{
|
|
28
|
+
const { sourceId,} = this.props.match.params;
|
|
29
|
+
|
|
30
|
+
let url=`/${sourceId}/act-table?menuId=${this.getMenuId()}`;
|
|
31
|
+
let mainCode=this.getMainCode();
|
|
32
|
+
if(mainCode){
|
|
33
|
+
url=url+`&mainCode=${mainCode}`;
|
|
34
|
+
}
|
|
35
|
+
this.props.history.push(url);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
goDtmpl=(code:string)=>{
|
|
39
|
+
const { sourceId,} = this.props.match.params;
|
|
40
|
+
let url=`/${sourceId}/detail-edit?menuId=${this.getMenuId()}`;
|
|
41
|
+
if(code){
|
|
42
|
+
url=url+`&code=${code}`;
|
|
43
|
+
}
|
|
44
|
+
let mainCode=this.getMainCode();
|
|
45
|
+
if(mainCode){
|
|
46
|
+
url=url+`&mainCode=${mainCode}`;
|
|
47
|
+
}
|
|
48
|
+
this.props.history.push(url);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getMainCode=()=>{
|
|
52
|
+
const {location}=this.props;
|
|
53
|
+
let params=Units.transQueryStrToParams(location.search);
|
|
54
|
+
if('mainCode' in params){
|
|
55
|
+
return params['mainCode'];
|
|
56
|
+
}else{
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getCode=()=>{
|
|
62
|
+
const {location}=this.props;
|
|
63
|
+
let params=Units.transQueryStrToParams(location.search);
|
|
64
|
+
return params['code'];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
getMode=()=>{
|
|
68
|
+
const {location}=this.props;
|
|
69
|
+
let params=Units.transQueryStrToParams(location.search);
|
|
70
|
+
return this.getCode()?params['mode']:"add";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
render() {
|
|
74
|
+
const {location,match}=this.props;
|
|
75
|
+
const {sourceId,} = match.params;
|
|
76
|
+
// console.log("this.props.match.params",match);
|
|
77
|
+
if(!location){
|
|
78
|
+
return <></>;
|
|
79
|
+
}
|
|
80
|
+
let params=Units.transQueryStrToParams(location.search);
|
|
81
|
+
let versionId=params['versionId'];
|
|
82
|
+
if(location.pathname.endsWith("detail-view")){
|
|
83
|
+
return (
|
|
84
|
+
<ActDtmplView goDtmpl={this.goDtmpl} sourceId={sourceId} versionId={versionId} code={this.getCode()} mainCode={this.getMainCode()}></ActDtmplView>
|
|
85
|
+
);
|
|
86
|
+
}else{
|
|
87
|
+
return (
|
|
88
|
+
<DtmplEdit addOrUpdate={this.getMode()} sourceId={sourceId} code={this.getCode()} mainCode={this.getMainCode()} goBackToLtmpl={this.goBackToLtmpl} goDtmpl={this.goDtmpl}></DtmplEdit>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export default DtmplRoute;
|
|
96
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {RouterCompProps} from '../tmpl/interface';
|
|
3
|
+
import ExcelImport from '../import/excel-import'
|
|
4
|
+
|
|
5
|
+
export interface ImportRouteProps extends RouterCompProps {
|
|
6
|
+
|
|
7
|
+
};
|
|
8
|
+
interface ImportRoutePropsStat{
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class ExcelImportRoute extends React.PureComponent<ImportRouteProps, ImportRoutePropsStat> {
|
|
13
|
+
|
|
14
|
+
state = {}
|
|
15
|
+
|
|
16
|
+
async componentDidMount() {
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
render() {
|
|
22
|
+
const {location, match, history} = this.props;
|
|
23
|
+
const { sourceId} = match.params;
|
|
24
|
+
return <ExcelImport sourceId={sourceId}></ExcelImport>
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export default ExcelImportRoute;
|
|
28
|
+
|