aldehyde 0.1.61 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +1 -4
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/relation-existion/index.d.ts.map +1 -1
- package/lib/controls/relation-existion/index.js.map +1 -1
- package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/act-dtmpl-view.js +0 -12
- package/lib/detail/view/act-dtmpl-view.js.map +1 -1
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +2 -20
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +0 -6
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/module/ltmpl-page.d.ts +6 -5
- package/lib/module/ltmpl-page.d.ts.map +1 -1
- package/lib/module/ltmpl-page.js +28 -32
- package/lib/module/ltmpl-page.js.map +1 -1
- package/lib/table/act-table.d.ts +7 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +59 -28
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/modal-select-table.js +1 -1
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/query-table.d.ts.map +1 -1
- package/lib/table/query-table.js +1 -4
- package/lib/table/query-table.js.map +1 -1
- package/lib/table/relation-table.js +1 -1
- package/lib/table/relation-table.js.map +1 -1
- package/lib/table/select-table.d.ts.map +1 -1
- package/lib/table/select-table.js +1 -4
- package/lib/table/select-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +3 -15
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +1 -2
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/superagent.d.ts.map +1 -1
- package/lib/tmpl/superagent.js +4 -2
- package/lib/tmpl/superagent.js.map +1 -1
- package/lib/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entry-control.tsx +1 -4
- package/src/aldehyde/controls/relation-existion/index.tsx +1 -7
- package/src/aldehyde/detail/view/act-dtmpl-view.tsx +0 -15
- package/src/aldehyde/form/criteria-form.tsx +25 -39
- package/src/aldehyde/form/dtmpl-form.tsx +0 -7
- package/src/aldehyde/module/ltmpl-page.tsx +32 -42
- package/src/aldehyde/table/act-table.tsx +157 -114
- package/src/aldehyde/table/modal-select-table.tsx +1 -1
- package/src/aldehyde/table/query-table.tsx +1 -4
- package/src/aldehyde/table/relation-table.tsx +1 -1
- package/src/aldehyde/table/select-table.tsx +1 -4
- package/src/aldehyde/tmpl/hcservice-v3.tsx +3 -19
- package/src/aldehyde/tmpl/interface.tsx +1 -3
- package/src/aldehyde/tmpl/superagent.js +4 -2
- package/src/aldehyde/welcome/HCWelcome.js +10 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React,{ReactNode} from 'react'
|
|
2
2
|
import {AddOrUpdate, DtmplData, LtmplConfigRes} from '../tmpl/interface';
|
|
3
3
|
import Units from "../units";
|
|
4
4
|
import ActTable,{Mode} from '../table/act-table'
|
|
@@ -15,11 +15,12 @@ export interface LtmplPageProps {
|
|
|
15
15
|
sourceId:string,
|
|
16
16
|
mainCode?:string;
|
|
17
17
|
showView?: (code: string,toCustomPage?:boolean) => void,
|
|
18
|
-
doCreate?: (
|
|
19
|
-
doEdit?: (code: string,mode:AddOrUpdate,
|
|
18
|
+
doCreate?: (handleOk:()=>void) => void,
|
|
19
|
+
doEdit?: (code: string,mode:AddOrUpdate,handleOk:()=>void) => void,
|
|
20
20
|
doSearch?: (params: object) => void,
|
|
21
21
|
doRAction?:(ractionId:string,mainCode:string)=>void,
|
|
22
|
-
funcMode?:Mode
|
|
22
|
+
funcMode?:Mode,
|
|
23
|
+
title?:ReactNode,
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export interface LtmplPageState {
|
|
@@ -68,7 +69,6 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
68
69
|
criteriaData=this.toCriteriaData(defaultCriteriaValue);
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
|
|
72
72
|
this.setState({
|
|
73
73
|
ltmplConfigRes,criteriaData
|
|
74
74
|
})
|
|
@@ -84,36 +84,25 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
84
84
|
return criteriaData;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
// async componentDidUpdate(prevProps) {
|
|
89
|
-
// const {location} = this.props;
|
|
90
|
-
// const { sourceId} = this.props.match.params;
|
|
91
|
-
// let { sourceId: preSourceId} = prevProps.match.params;
|
|
92
|
-
// let {location: preLocation} = prevProps;
|
|
93
|
-
//
|
|
94
|
-
// if ( !sourceId ||
|
|
95
|
-
// ( !preSourceId && this.state.ltmplConfigRes)
|
|
96
|
-
// || (location.pathname == preLocation.pathname && location.search == preLocation.search)
|
|
97
|
-
// ) {
|
|
98
|
-
// return;
|
|
99
|
-
// }
|
|
100
|
-
// this.loadData();
|
|
101
|
-
// }
|
|
102
|
-
|
|
103
87
|
showView = (code: string) => {
|
|
104
|
-
// const { sourceId} = this.props.match.params;
|
|
105
|
-
// this.onRoute(`/${sourceId}/detail-view?code=${code}&menuId=${this.getMenuId()}`);
|
|
106
88
|
this.setState({
|
|
107
89
|
selectedCode:code,
|
|
108
90
|
showDtmplView:true,
|
|
109
91
|
})
|
|
110
92
|
}
|
|
111
93
|
|
|
112
|
-
doEdit = (code: string,mode:
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
94
|
+
doEdit = (code: string,mode:AddOrUpdate,toCustomPage?:boolean) => {
|
|
95
|
+
const {doEdit}=this.props
|
|
96
|
+
if(toCustomPage && doEdit){
|
|
97
|
+
doEdit(code,mode,()=>{
|
|
98
|
+
this.doSearch(this.state.criteriaData);
|
|
99
|
+
});
|
|
100
|
+
}else{
|
|
101
|
+
this.setState({
|
|
102
|
+
selectedCode:code,
|
|
103
|
+
showDtmplEdit:true,
|
|
104
|
+
})
|
|
105
|
+
}
|
|
117
106
|
}
|
|
118
107
|
doRAction = (ractionId:string,mainCode:string) => {
|
|
119
108
|
this.setState({
|
|
@@ -122,11 +111,18 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
122
111
|
ractionId
|
|
123
112
|
})
|
|
124
113
|
}
|
|
125
|
-
doCreate = () => {
|
|
126
|
-
this.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
114
|
+
doCreate = (toCustomPage) => {
|
|
115
|
+
const {doCreate}=this.props
|
|
116
|
+
if(toCustomPage && doCreate){
|
|
117
|
+
doCreate(()=>{
|
|
118
|
+
this.doSearch(this.state.criteriaData);
|
|
119
|
+
});
|
|
120
|
+
}else{
|
|
121
|
+
this.setState({
|
|
122
|
+
selectedCode:null,
|
|
123
|
+
showDtmplEdit:true,
|
|
124
|
+
})
|
|
125
|
+
}
|
|
130
126
|
}
|
|
131
127
|
closeDrawer=()=>{
|
|
132
128
|
this.setState({
|
|
@@ -136,21 +132,15 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
136
132
|
|
|
137
133
|
doSearch = (params_) => {
|
|
138
134
|
const { sourceId,mainCode} = this.props;
|
|
139
|
-
//const oldfliter = history.location.search.slice(1);
|
|
140
|
-
|
|
141
135
|
let params = {...params_}
|
|
142
136
|
//追加过滤条件,hiddenColIds,innerQueryKey
|
|
143
137
|
if (mainCode) {
|
|
144
138
|
params['mainCode'] = mainCode;
|
|
145
139
|
}
|
|
146
140
|
params['sourceId'] = sourceId;
|
|
147
|
-
// const criteriaData = Units.transQueryParamsToStr(params);
|
|
148
|
-
// let flag = true;
|
|
149
|
-
//if (newfliter && oldfliter != newfliter) { //查询条件更新时
|
|
150
141
|
this.setState({
|
|
151
142
|
criteriaData:this.toCriteriaData(params)
|
|
152
143
|
});
|
|
153
|
-
|
|
154
144
|
}
|
|
155
145
|
|
|
156
146
|
handleDtmplEdit = (code: string) => {
|
|
@@ -163,15 +153,15 @@ class LtmplPage extends React.PureComponent<LtmplPageProps, LtmplPageState> {
|
|
|
163
153
|
|
|
164
154
|
render() {
|
|
165
155
|
const {ltmplConfigRes,criteriaData,showDtmplView,selectedCode,showDtmplEdit,ractionId,showDraw} = this.state;
|
|
166
|
-
const { sourceId,mainCode,showView,
|
|
156
|
+
const { sourceId,mainCode,showView,doSearch,doRAction,funcMode,title} = this.props;
|
|
167
157
|
|
|
168
158
|
if (!ltmplConfigRes) {
|
|
169
159
|
return <></>;
|
|
170
160
|
} else {
|
|
171
161
|
const {buttons}=ltmplConfigRes.ltmplConfig
|
|
172
162
|
return <>
|
|
173
|
-
<ActTable funcMode={funcMode} mainCode={mainCode} showView={showView?showView:this.showView} doRAction={doRAction?doRAction:this.doRAction}
|
|
174
|
-
doSearch={doSearch?doSearch:this.doSearch} doEdit={
|
|
163
|
+
<ActTable title={title} funcMode={funcMode} mainCode={mainCode} showView={showView?showView:this.showView} doRAction={doRAction?doRAction:this.doRAction}
|
|
164
|
+
doSearch={doSearch?doSearch:this.doSearch} doEdit={this.doEdit} doCreate={this.doCreate}
|
|
175
165
|
sourceId={sourceId} criteriaData={criteriaData}
|
|
176
166
|
ltmplConfig={ltmplConfigRes.ltmplConfig} />
|
|
177
167
|
{buttons.includes('detail') ?
|