aldehyde 0.2.175 → 0.2.178
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/action/utils.d.ts +1 -0
- package/lib/controls/action/utils.d.ts.map +1 -1
- package/lib/controls/action/utils.js +35 -9
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/entry-control.d.ts +1 -0
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +2 -1
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/field-history/index.d.ts +1 -0
- package/lib/controls/field-history/index.d.ts.map +1 -1
- package/lib/controls/field-history/index.js +61 -3
- package/lib/controls/field-history/index.js.map +1 -1
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +0 -1
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/controls/select/index.d.ts.map +1 -1
- package/lib/controls/select/index.js +2 -1
- package/lib/controls/select/index.js.map +1 -1
- package/lib/controls/view-control.d.ts +1 -0
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +2 -1
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/dtmpl.css +35 -31
- package/lib/detail/view/dtmpl-view.d.ts.map +1 -1
- package/lib/detail/view/dtmpl-view.js +1 -1
- package/lib/detail/view/dtmpl-view.js.map +1 -1
- package/lib/detail/view/field-view-group.d.ts +1 -0
- package/lib/detail/view/field-view-group.d.ts.map +1 -1
- package/lib/detail/view/field-view-group.js +5 -2
- package/lib/detail/view/field-view-group.js.map +1 -1
- package/lib/form/dtmpl-form.d.ts.map +1 -1
- package/lib/form/dtmpl-form.js +1 -1
- package/lib/form/dtmpl-form.js.map +1 -1
- package/lib/form/field-group-form.d.ts.map +1 -1
- package/lib/form/field-group-form.js +1 -1
- package/lib/form/field-group-form.js.map +1 -1
- package/lib/form/form-Item-group.d.ts +1 -0
- package/lib/form/form-Item-group.d.ts.map +1 -1
- package/lib/form/form-Item-group.js +3 -3
- package/lib/form/form-Item-group.js.map +1 -1
- package/lib/layout/MainPage.d.ts.map +1 -1
- package/lib/layout/MainPage.js +1 -0
- package/lib/layout/MainPage.js.map +1 -1
- package/lib/layout2/page.d.ts.map +1 -1
- package/lib/layout2/page.js +3 -0
- package/lib/layout2/page.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +1 -0
- package/lib/login/login.js.map +1 -1
- package/lib/login2/Login.d.ts.map +1 -1
- package/lib/login2/Login.js +3 -0
- package/lib/login2/Login.js.map +1 -1
- package/lib/table/act-table.d.ts +3 -0
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +34 -10
- package/lib/table/act-table.js.map +1 -1
- package/lib/table/modal-select-table.d.ts +2 -1
- package/lib/table/modal-select-table.d.ts.map +1 -1
- package/lib/table/modal-select-table.js +2 -2
- package/lib/table/modal-select-table.js.map +1 -1
- package/lib/table/relation-table.d.ts.map +1 -1
- package/lib/table/relation-table.js +11 -4
- package/lib/table/relation-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +4 -2
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +35 -4
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +1 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +4 -2
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/utils.tsx +33 -10
- package/src/aldehyde/controls/entry-control.tsx +3 -5
- package/src/aldehyde/controls/field-history/index.tsx +67 -8
- package/src/aldehyde/controls/file-view/index.tsx +0 -1
- package/src/aldehyde/controls/select/index.tsx +2 -5
- package/src/aldehyde/controls/view-control.tsx +4 -1
- package/src/aldehyde/detail/dtmpl.css +35 -31
- package/src/aldehyde/detail/view/dtmpl-view.tsx +3 -2
- package/src/aldehyde/detail/view/field-view-group.tsx +17 -8
- package/src/aldehyde/form/dtmpl-form.tsx +1 -0
- package/src/aldehyde/form/field-group-form.tsx +1 -0
- package/src/aldehyde/form/form-Item-group.tsx +4 -3
- package/src/aldehyde/layout/MainPage.tsx +1 -0
- package/src/aldehyde/layout2/page.tsx +4 -0
- package/src/aldehyde/login/login.tsx +2 -0
- package/src/aldehyde/login2/Login.tsx +4 -0
- package/src/aldehyde/table/act-table.tsx +56 -9
- package/src/aldehyde/table/modal-select-table.tsx +4 -3
- package/src/aldehyde/table/relation-table.tsx +23 -7
- package/src/aldehyde/tmpl/hcservice-v3.tsx +33 -4
- package/src/aldehyde/tmpl/interface.tsx +2 -1
- package/src/aldehyde/units/index.tsx +4 -2
|
@@ -13,6 +13,7 @@ import Progress from "./progress";
|
|
|
13
13
|
|
|
14
14
|
import EllipsisText from "./text/ellipsis-text";
|
|
15
15
|
import { ProgramConfig, useLocale } from "../index";
|
|
16
|
+
import FieldHistory from "./field-history";
|
|
16
17
|
|
|
17
18
|
// const Loading = (() => {
|
|
18
19
|
// const { translate } = useLocale();
|
|
@@ -51,6 +52,7 @@ interface FieldViewControlProps {
|
|
|
51
52
|
fieldConfig: FieldConfig;
|
|
52
53
|
holderType: ControlHolderType;
|
|
53
54
|
style?: any;
|
|
55
|
+
dataCode?:string;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
function renderControl(
|
|
@@ -85,6 +87,7 @@ function renderControl(
|
|
|
85
87
|
? fieldConfig.defaultValue
|
|
86
88
|
: "";
|
|
87
89
|
let viewOrEdit: ViewOrEdit = "view";
|
|
90
|
+
|
|
88
91
|
let controlProps = {
|
|
89
92
|
fieldConfig,
|
|
90
93
|
itemType,
|
|
@@ -263,7 +266,7 @@ function renderControl(
|
|
|
263
266
|
);
|
|
264
267
|
break;
|
|
265
268
|
case "field-history": //
|
|
266
|
-
viewControl =
|
|
269
|
+
viewControl = <FieldHistory {...controlProps} ></FieldHistory>;
|
|
267
270
|
break;
|
|
268
271
|
default:
|
|
269
272
|
viewControl = unSupportControl;
|
|
@@ -4,50 +4,54 @@
|
|
|
4
4
|
/* width:120px;*/
|
|
5
5
|
/*}*/
|
|
6
6
|
|
|
7
|
-
.downEditPic{
|
|
8
|
-
|
|
7
|
+
.downEditPic {
|
|
8
|
+
display: inline-block;
|
|
9
9
|
}
|
|
10
|
-
.downEditPic a{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
.downEditPic a {
|
|
11
|
+
visibility: hidden;
|
|
12
|
+
color: #1890ff;
|
|
13
|
+
cursor: pointer;
|
|
14
14
|
}
|
|
15
|
-
.downEditPic:hover a{
|
|
16
|
-
|
|
15
|
+
.downEditPic:hover a {
|
|
16
|
+
visibility: visible;
|
|
17
17
|
}
|
|
18
|
-
.editPic .ant-upload-list{
|
|
19
|
-
|
|
18
|
+
.editPic .ant-upload-list {
|
|
19
|
+
width: 150px;
|
|
20
20
|
}
|
|
21
|
-
.buttonGroup{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
.buttonGroup {
|
|
22
|
+
position: fixed;
|
|
23
|
+
width: 100px;
|
|
24
|
+
bottom: 30px;
|
|
25
|
+
right: 20px;
|
|
26
|
+
z-index: 99;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.buttonGroup button{
|
|
30
|
-
|
|
29
|
+
.buttonGroup button {
|
|
30
|
+
margin-bottom: 10px;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.detailPage h3{
|
|
34
|
-
|
|
33
|
+
.detailPage h3 {
|
|
34
|
+
font-size: 18px;
|
|
35
35
|
}
|
|
36
|
-
.detailPage.showRightNav .ant-card{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
.detailPage.showRightNav .ant-card {
|
|
37
|
+
min-width: 740px;
|
|
38
|
+
max-width: 1440px;
|
|
39
|
+
width: 90%;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.detailPage.noRightNav .ant-card{
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
.detailPage.noRightNav .ant-card {
|
|
43
|
+
min-width: 740px;
|
|
44
|
+
width: 100%;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
.actionbtn button{
|
|
48
|
-
|
|
47
|
+
.actionbtn button {
|
|
48
|
+
margin-right: 5px;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.detailPage .pad{
|
|
52
|
-
|
|
51
|
+
.detailPage .pad {
|
|
52
|
+
margin-right: 100px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.ant-descriptions-item-content:has(.description-content) {
|
|
56
|
+
overflow: hidden;
|
|
53
57
|
}
|
|
@@ -113,11 +113,11 @@ class DtmplView extends React.PureComponent<DtmplViewProps, DtmplViewStat> {
|
|
|
113
113
|
parentId,
|
|
114
114
|
} = this.props;
|
|
115
115
|
const { dtmplData, loading, id } = this.state;
|
|
116
|
-
|
|
117
116
|
let groups: FieldGroupConfig[] = [];
|
|
118
117
|
if (dtmplConfig) {
|
|
119
118
|
groups = dtmplConfig.groups;
|
|
120
119
|
}
|
|
120
|
+
|
|
121
121
|
return groups.map((item) => {
|
|
122
122
|
if (item.type == "embed") {
|
|
123
123
|
if (!dtmplData) {
|
|
@@ -234,6 +234,7 @@ class DtmplView extends React.PureComponent<DtmplViewProps, DtmplViewStat> {
|
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
236
|
} else {
|
|
237
|
+
|
|
237
238
|
//字段组
|
|
238
239
|
return (
|
|
239
240
|
<CollapseCard
|
|
@@ -245,7 +246,7 @@ class DtmplView extends React.PureComponent<DtmplViewProps, DtmplViewStat> {
|
|
|
245
246
|
headStyle={{ background: "#f2f4f5" }}
|
|
246
247
|
loading={loading}
|
|
247
248
|
>
|
|
248
|
-
<FieldViewGroup
|
|
249
|
+
<FieldViewGroup dataCode={dtmplData ? dtmplData.code:null}
|
|
249
250
|
serverKey={serverKey}
|
|
250
251
|
fields={item.fields}
|
|
251
252
|
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
@@ -9,6 +9,7 @@ interface FieldViewGroupProps {
|
|
|
9
9
|
fields: FieldConfig[];
|
|
10
10
|
valueMap?: object;
|
|
11
11
|
width?: number;
|
|
12
|
+
dataCode?: string;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
interface FieldViewGroupState {
|
|
@@ -29,7 +30,7 @@ export default class FieldViewGroup extends React.PureComponent<
|
|
|
29
30
|
context: React.ContextType<typeof LocaleContext>;
|
|
30
31
|
|
|
31
32
|
initViewList = () => {
|
|
32
|
-
const { fields, valueMap, serverKey } = this.props;
|
|
33
|
+
const { fields, valueMap, serverKey, dataCode } = this.props;
|
|
33
34
|
const { translate } = this.context;
|
|
34
35
|
const formItemList = [];
|
|
35
36
|
|
|
@@ -53,12 +54,20 @@ export default class FieldViewGroup extends React.PureComponent<
|
|
|
53
54
|
key={index}
|
|
54
55
|
className="labelcss"
|
|
55
56
|
>
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
<div
|
|
58
|
+
className="description-content"
|
|
59
|
+
style={{
|
|
60
|
+
width: "100%",
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<ViewControl
|
|
64
|
+
dataCode={dataCode}
|
|
65
|
+
serverKey={serverKey}
|
|
66
|
+
holderType={"descriptions"}
|
|
67
|
+
value={fieldValue}
|
|
68
|
+
fieldConfig={item}
|
|
69
|
+
/>
|
|
70
|
+
</div>
|
|
62
71
|
</Descriptions.Item>
|
|
63
72
|
);
|
|
64
73
|
formItemList.push(formItem);
|
|
@@ -69,6 +78,6 @@ export default class FieldViewGroup extends React.PureComponent<
|
|
|
69
78
|
};
|
|
70
79
|
|
|
71
80
|
render() {
|
|
72
|
-
return <Descriptions column={2}
|
|
81
|
+
return <Descriptions column={2}>{this.initViewList()}</Descriptions>;
|
|
73
82
|
}
|
|
74
83
|
}
|
|
@@ -384,6 +384,7 @@ export default class DtmplForm extends React.PureComponent<
|
|
|
384
384
|
mainCode={mainCode}
|
|
385
385
|
maxColsOnRow={maxColsOnRow}
|
|
386
386
|
fields={item ? item.fields : undefined}
|
|
387
|
+
dataCode={dtmplData ? dtmplData.code : undefined}
|
|
387
388
|
valueMap={dtmplData ? dtmplData.fieldMap : undefined}
|
|
388
389
|
></FormItemGroup>
|
|
389
390
|
</CollapseCard>
|
|
@@ -18,6 +18,7 @@ export interface FieldGroupProps {
|
|
|
18
18
|
maxColsOnRow?: number;
|
|
19
19
|
mainCode?: string;
|
|
20
20
|
formRef?: RefObject<FormInstance>;
|
|
21
|
+
dataCode?:string,
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
interface FieldGroupState {
|
|
@@ -76,7 +77,7 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
76
77
|
return fieldConfig;
|
|
77
78
|
};
|
|
78
79
|
initFormItem = (fieldConfig: FieldConfig, fieldValue) => {
|
|
79
|
-
const { nameAttr, maxColsOnRow, mainCode, serverKey } = this.props;
|
|
80
|
+
const { nameAttr, maxColsOnRow, mainCode, serverKey,dataCode } = this.props;
|
|
80
81
|
const { translate } = this.context;
|
|
81
82
|
let item = this.getFieldConfig(fieldConfig);
|
|
82
83
|
const title = item.title;
|
|
@@ -85,7 +86,7 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
85
86
|
<FormItem
|
|
86
87
|
label={translate("${" + item.title + "}")}
|
|
87
88
|
hidden={item.hidden}
|
|
88
|
-
name={item[nameAttr]}
|
|
89
|
+
name={fieldConfig.controlType=="field-history" ?undefined:item[nameAttr]}
|
|
89
90
|
key={item.id}
|
|
90
91
|
labelCol={
|
|
91
92
|
maxColsOnRow == 1
|
|
@@ -115,7 +116,7 @@ export default class FormItemGroup extends React.PureComponent<
|
|
|
115
116
|
: undefined
|
|
116
117
|
}
|
|
117
118
|
>
|
|
118
|
-
<EntryControl
|
|
119
|
+
<EntryControl dataCode={dataCode}
|
|
119
120
|
serverKey={serverKey}
|
|
120
121
|
mainCode={this.getMainCode(item, mainCode)}
|
|
121
122
|
value={fieldValue}
|
|
@@ -52,6 +52,7 @@ class MainPage extends React.PureComponent<MainPageProps, MainPageState> {
|
|
|
52
52
|
|
|
53
53
|
async componentDidMount() {
|
|
54
54
|
useVarCssColor(generate("rgb(22, 119, 255)"));
|
|
55
|
+
localStorage.setItem("version", "v1");
|
|
55
56
|
|
|
56
57
|
var currentURL = new URL(window.location.href);
|
|
57
58
|
//console.log('main page currentURL:',currentURL);
|
|
@@ -125,6 +125,10 @@ const Page: React.FC<PagePropsType> = (props: PagePropsType) => {
|
|
|
125
125
|
token: { colorPrimary },
|
|
126
126
|
} = useToken();
|
|
127
127
|
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
localStorage.setItem("version", "v2");
|
|
130
|
+
}, []);
|
|
131
|
+
|
|
128
132
|
const [systemName, setSystemName] = useState("");
|
|
129
133
|
|
|
130
134
|
const [menu, SetMenu] = useState<MenuType[]>([]);
|
|
@@ -48,6 +48,8 @@ class Login extends React.PureComponent<LoginProps, LoginState> {
|
|
|
48
48
|
|
|
49
49
|
componentDidMount = async () => {
|
|
50
50
|
const { programCode } = this.props;
|
|
51
|
+
localStorage.setItem("version", "v1");
|
|
52
|
+
|
|
51
53
|
if (programCode) Units.setProgramCode(programCode);
|
|
52
54
|
window.removeEventListener("keydown", this.handleKeyDown);
|
|
53
55
|
let pubkey = await HCserviceV3.getRasPubkey(null, programCode);
|
|
@@ -21,6 +21,10 @@ const Login = (props: LoginPropType) => {
|
|
|
21
21
|
// locale
|
|
22
22
|
const { translate } = useLocale();
|
|
23
23
|
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
localStorage.setItem("version", "v2");
|
|
26
|
+
}, []);
|
|
27
|
+
|
|
24
28
|
const { programCode: routeProgramCode } = useParams();
|
|
25
29
|
useEffect(() => {
|
|
26
30
|
if (routeProgramCode === undefined) return;
|
|
@@ -79,6 +79,7 @@ import BlockMenuTreeDrawer from "../module/block-menu-tree-drawer";
|
|
|
79
79
|
import EditButton from "../detail/button/edit-button";
|
|
80
80
|
import ViewButton from "../detail/button/view-button";
|
|
81
81
|
import ProgramConfig from "../units";
|
|
82
|
+
import ModelSelectTable from "./../table/modal-select-table";
|
|
82
83
|
|
|
83
84
|
const DragHandle = SortableHandle(() => (
|
|
84
85
|
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
@@ -133,6 +134,7 @@ interface ActTableStat {
|
|
|
133
134
|
showCustomCard?: boolean;
|
|
134
135
|
customButton?: CustomButton;
|
|
135
136
|
customButtonData?: DtmplData[];
|
|
137
|
+
showRatmplSelector?:boolean;
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
@@ -156,6 +158,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
156
158
|
showCustomCard: false,
|
|
157
159
|
customButtonData: undefined,
|
|
158
160
|
customButton: undefined,
|
|
161
|
+
showRatmplSelector:false,
|
|
159
162
|
};
|
|
160
163
|
|
|
161
164
|
static contextType = LocaleContext;
|
|
@@ -889,7 +892,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
889
892
|
};
|
|
890
893
|
|
|
891
894
|
doDelete = async () => {
|
|
892
|
-
const { sourceId, serverKey } = this.props;
|
|
895
|
+
const { sourceId, serverKey,mainCode } = this.props;
|
|
893
896
|
const {
|
|
894
897
|
selectedRows,
|
|
895
898
|
hiddenColIds,
|
|
@@ -902,7 +905,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
902
905
|
let result: boolean = await HcserviceV3.deleteData(
|
|
903
906
|
serverKey,
|
|
904
907
|
sourceId,
|
|
905
|
-
selectedRows
|
|
908
|
+
selectedRows,mainCode
|
|
906
909
|
);
|
|
907
910
|
if (result) {
|
|
908
911
|
//重新加载数据
|
|
@@ -915,14 +918,13 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
915
918
|
};
|
|
916
919
|
|
|
917
920
|
doDeleteByCode = async (code: string) => {
|
|
918
|
-
const { sourceId, serverKey } = this.props;
|
|
921
|
+
const { sourceId, serverKey,mainCode } = this.props;
|
|
919
922
|
const { hiddenColIds, hiddenRowCodes, sortedColConfigs } = this.state;
|
|
920
923
|
this.setState({
|
|
921
924
|
loading: true,
|
|
922
925
|
});
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
]);
|
|
926
|
+
debugger
|
|
927
|
+
let result: boolean = await HcserviceV3.deleteByCode(serverKey, sourceId, [code],mainCode);
|
|
926
928
|
if (result) {
|
|
927
929
|
//重新加载数据
|
|
928
930
|
this.loadData(hiddenColIds, hiddenRowCodes, sortedColConfigs);
|
|
@@ -1090,6 +1092,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1090
1092
|
}
|
|
1091
1093
|
};
|
|
1092
1094
|
|
|
1095
|
+
|
|
1096
|
+
|
|
1093
1097
|
changeRowSelection = (
|
|
1094
1098
|
selectedRows: SelectedRow[],
|
|
1095
1099
|
selectedDatas: DtmplData[]
|
|
@@ -1165,6 +1169,12 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1165
1169
|
</Button>
|
|
1166
1170
|
</Popover>
|
|
1167
1171
|
) : null}
|
|
1172
|
+
{buttons.includes("ratmplSelect") ? (
|
|
1173
|
+
<Button onClick={() => this.setState({showRatmplSelector:true})}>{translate("${选择}")}
|
|
1174
|
+
</Button>
|
|
1175
|
+
) : (
|
|
1176
|
+
""
|
|
1177
|
+
)}
|
|
1168
1178
|
{buttons.includes("dtmplAdd") && doCreate && !readOnly ? (
|
|
1169
1179
|
ltmplConfig.classAddConfigs &&
|
|
1170
1180
|
ltmplConfig.classAddConfigs.length > 0 ? (
|
|
@@ -1204,7 +1214,9 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1204
1214
|
<Tooltip title={translate("${导入}")}>
|
|
1205
1215
|
{" "}
|
|
1206
1216
|
<Button
|
|
1207
|
-
href={
|
|
1217
|
+
href={`#${
|
|
1218
|
+
localStorage.getItem("version") === "v2" ? "/v2" : ""
|
|
1219
|
+
}/${sourceId}/importer?menuId=${menuId}`}
|
|
1208
1220
|
target={"_blank"}
|
|
1209
1221
|
>
|
|
1210
1222
|
<UploadOutlined />
|
|
@@ -1527,6 +1539,24 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1527
1539
|
);
|
|
1528
1540
|
};
|
|
1529
1541
|
|
|
1542
|
+
saveRatmplSelect = async (selectedRows: SelectedRow[]) => {
|
|
1543
|
+
this.setState({
|
|
1544
|
+
showRatmplSelector: false,
|
|
1545
|
+
});
|
|
1546
|
+
const {serverKey,sourceId,mainCode,doSearch}=this.props;
|
|
1547
|
+
if (!selectedRows || selectedRows.length <= 0) {
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
//查询
|
|
1552
|
+
const codes: string[] = [];
|
|
1553
|
+
for (let row of selectedRows) {
|
|
1554
|
+
codes.push(row.code);
|
|
1555
|
+
}
|
|
1556
|
+
await HcserviceV3.saveRatmplSelectCodes(serverKey,sourceId,mainCode,codes);
|
|
1557
|
+
doSearch(null);
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1530
1560
|
render() {
|
|
1531
1561
|
let {
|
|
1532
1562
|
queryKey,
|
|
@@ -1535,7 +1565,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1535
1565
|
recordCode,
|
|
1536
1566
|
showCustomCard,
|
|
1537
1567
|
customButton,
|
|
1538
|
-
customButtonData,
|
|
1568
|
+
customButtonData,showRatmplSelector
|
|
1539
1569
|
} = this.state;
|
|
1540
1570
|
let {
|
|
1541
1571
|
sourceId,
|
|
@@ -1543,7 +1573,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1543
1573
|
title,
|
|
1544
1574
|
collapsible,
|
|
1545
1575
|
initCollapse,
|
|
1546
|
-
tip,
|
|
1576
|
+
tip,serverKey,mainCode
|
|
1547
1577
|
} = this.props;
|
|
1548
1578
|
const { translate } = this.context;
|
|
1549
1579
|
|
|
@@ -1599,6 +1629,23 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1599
1629
|
open={blockMenuTreeDrawerOpen}
|
|
1600
1630
|
roleCode={recordCode}
|
|
1601
1631
|
/>
|
|
1632
|
+
{showRatmplSelector ? (
|
|
1633
|
+
<ModelSelectTable
|
|
1634
|
+
serverKey={serverKey}
|
|
1635
|
+
// defaultCriteriaValue={fieldGroupConfig.defaultCriteriaValue}
|
|
1636
|
+
// maxSelectedRows={fieldGroupConfig.max}
|
|
1637
|
+
open={showRatmplSelector}
|
|
1638
|
+
onOK={this.saveRatmplSelect}
|
|
1639
|
+
onCancel={() => {
|
|
1640
|
+
this.setState({ showRatmplSelector: false });
|
|
1641
|
+
}}
|
|
1642
|
+
mainCode={mainCode}
|
|
1643
|
+
sourceId={sourceId}
|
|
1644
|
+
existRelation={"false"}
|
|
1645
|
+
></ModelSelectTable>
|
|
1646
|
+
) : (
|
|
1647
|
+
""
|
|
1648
|
+
)}
|
|
1602
1649
|
</>
|
|
1603
1650
|
);
|
|
1604
1651
|
}
|
|
@@ -13,11 +13,12 @@ import SelectedRowsCard from './selected-rows-card'
|
|
|
13
13
|
import Scrollbars from 'react-custom-scrollbars';
|
|
14
14
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
15
15
|
interface ModelSelectTableProps {
|
|
16
|
-
maxSelectedRows
|
|
16
|
+
maxSelectedRows?: number,
|
|
17
17
|
open: boolean,
|
|
18
18
|
serverKey?:string,
|
|
19
19
|
sourceId: string,
|
|
20
20
|
mainCode:string,
|
|
21
|
+
existRelation?:string,
|
|
21
22
|
exceptCodes?: string[],
|
|
22
23
|
onCancel: () => void,
|
|
23
24
|
defaultCriteriaValue?:object,
|
|
@@ -66,10 +67,10 @@ class ModelSelectTable extends React.PureComponent<ModelSelectTableProps, ModelS
|
|
|
66
67
|
pageSize:pageSize?pageSize: defaultPageSize,
|
|
67
68
|
virtualEndPageNo: undefined,
|
|
68
69
|
}
|
|
69
|
-
const {sourceId, exceptCodes,serverKey,mainCode} = this.props;
|
|
70
|
+
const {sourceId, exceptCodes,serverKey,mainCode,existRelation} = this.props;
|
|
70
71
|
/** 构建 dataSource **/
|
|
71
72
|
//构建过滤条件
|
|
72
|
-
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(serverKey,sourceId, {exceptCodes, ...criteriaData, ...pageInfo,mainCode});
|
|
73
|
+
let queryKey: QueryKey = await HcserviceV3.requestLtmplQueryKey(serverKey,sourceId, {exceptCodes, ...criteriaData, ...pageInfo,mainCode,existRelation});
|
|
73
74
|
this.setState({
|
|
74
75
|
queryKey,
|
|
75
76
|
criteriaData,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Row,
|
|
9
9
|
Space,
|
|
10
10
|
Tooltip,
|
|
11
|
-
Typography,
|
|
11
|
+
Typography,Popconfirm,
|
|
12
12
|
} from "antd";
|
|
13
13
|
import Table from "./control-table-x-axis-wrapper";
|
|
14
14
|
import {
|
|
@@ -158,6 +158,7 @@ class RelationTable extends React.PureComponent<
|
|
|
158
158
|
relationNames,
|
|
159
159
|
showRowNum,
|
|
160
160
|
disabled,
|
|
161
|
+
deleteData,
|
|
161
162
|
} = fieldGroupConfig;
|
|
162
163
|
const { translate } = this.context;
|
|
163
164
|
let columns = [];
|
|
@@ -277,18 +278,33 @@ class RelationTable extends React.PureComponent<
|
|
|
277
278
|
""
|
|
278
279
|
)}
|
|
279
280
|
{/*删除*/}
|
|
280
|
-
{deletable ?
|
|
281
|
-
|
|
281
|
+
{deletable ?
|
|
282
|
+
deleteData? <Popconfirm
|
|
283
|
+
placement="leftBottom"
|
|
284
|
+
title={translate("${确定要[删除]选中数据吗}?")}
|
|
285
|
+
onConfirm={() => {
|
|
286
|
+
this.delete(record);
|
|
287
|
+
}}
|
|
288
|
+
okText={translate("${确定}")}
|
|
289
|
+
cancelText={translate("${取消}")}
|
|
290
|
+
okType={"danger"}
|
|
291
|
+
> <Button
|
|
292
|
+
disabled={disabled}
|
|
293
|
+
danger
|
|
294
|
+
type="primary"
|
|
295
|
+
icon={<DeleteOutlined />}
|
|
296
|
+
size="small" ></Button>
|
|
297
|
+
</Popconfirm> :
|
|
298
|
+
<Tooltip placement="right" title={translate("${删除}${当前行}")}>
|
|
282
299
|
<Button
|
|
283
300
|
disabled={disabled}
|
|
284
301
|
danger
|
|
285
302
|
type="primary"
|
|
286
303
|
icon={<DeleteOutlined />}
|
|
287
304
|
size="small"
|
|
288
|
-
onClick={() => this.delete(record)}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
) : (
|
|
305
|
+
onClick={() => this.delete(record)}></Button></Tooltip>
|
|
306
|
+
|
|
307
|
+
: (
|
|
292
308
|
""
|
|
293
309
|
)}
|
|
294
310
|
</div>
|
|
@@ -261,6 +261,20 @@ export default class HcserviceV3 {
|
|
|
261
261
|
return res.versions;
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
+
static async requestFieldVersionList(serverKey: string, sourceId: string, code) {
|
|
265
|
+
let res = await Super.super({
|
|
266
|
+
url: `/v3/dtmpl/field-data/versions`,
|
|
267
|
+
serverKey,
|
|
268
|
+
query: {
|
|
269
|
+
pageNo: 1,
|
|
270
|
+
sourceId,
|
|
271
|
+
code,
|
|
272
|
+
},
|
|
273
|
+
method: "GET",
|
|
274
|
+
});
|
|
275
|
+
return res.versions;
|
|
276
|
+
}
|
|
277
|
+
|
|
264
278
|
static async requestCommonDtmplData(
|
|
265
279
|
serverKey: string,
|
|
266
280
|
sourceId: string,
|
|
@@ -561,22 +575,24 @@ export default class HcserviceV3 {
|
|
|
561
575
|
static async deleteData(
|
|
562
576
|
serverKey: string,
|
|
563
577
|
sourceId,
|
|
564
|
-
selectedRows: SelectedRow[]
|
|
578
|
+
selectedRows: SelectedRow[],mainCode?
|
|
565
579
|
) {
|
|
566
580
|
const codes = this.getCodesOfSelectedRows(selectedRows);
|
|
567
|
-
|
|
581
|
+
debugger
|
|
582
|
+
return await this.deleteByCode(serverKey, sourceId, codes,mainCode);
|
|
568
583
|
}
|
|
569
584
|
|
|
570
|
-
static async deleteByCode(serverKey: string, sourceId, codes: string[]) {
|
|
585
|
+
static async deleteByCode(serverKey: string, sourceId, codes: string[],mainCode?) {
|
|
571
586
|
let res = await Super.super({
|
|
572
587
|
url: `/v3/ltmpl/data`,
|
|
573
588
|
serverKey,
|
|
574
589
|
data: {
|
|
575
590
|
codes,
|
|
576
|
-
sourceId,
|
|
591
|
+
sourceId,mainCode
|
|
577
592
|
},
|
|
578
593
|
method: "DELETE",
|
|
579
594
|
});
|
|
595
|
+
debugger
|
|
580
596
|
if (res && res.status == "success") {
|
|
581
597
|
message.success(translate("${删除成功}"), 1);
|
|
582
598
|
return true;
|
|
@@ -658,6 +674,19 @@ export default class HcserviceV3 {
|
|
|
658
674
|
return res;
|
|
659
675
|
}
|
|
660
676
|
|
|
677
|
+
static async saveRatmplSelectCodes(serverKey: string, sourceId: string,mainCode, codes:string[] ) {
|
|
678
|
+
let res = await Super.super({
|
|
679
|
+
url: `/v3/ratmpl-select/data`,
|
|
680
|
+
serverKey,
|
|
681
|
+
method: "POST",
|
|
682
|
+
data: { codes,mainCode, sourceId },
|
|
683
|
+
});
|
|
684
|
+
if (res && res.status != "success") {
|
|
685
|
+
message.error(translate("${"+res.message+"}"));
|
|
686
|
+
}
|
|
687
|
+
return res;
|
|
688
|
+
}
|
|
689
|
+
|
|
661
690
|
static async doCopy(
|
|
662
691
|
serverKey: string,
|
|
663
692
|
sourceId: string,
|
|
@@ -447,10 +447,12 @@ export default {
|
|
|
447
447
|
},
|
|
448
448
|
toLogin() {
|
|
449
449
|
let programCode = this.programCode();
|
|
450
|
+
const version = localStorage.getItem("version");
|
|
450
451
|
if (programCode && programCode != "null" && programCode != "undefined") {
|
|
451
|
-
window.location.hash =
|
|
452
|
+
window.location.hash =
|
|
453
|
+
version === "v2" ? "#/login2/" + programCode : "#/login/" + programCode;
|
|
452
454
|
} else {
|
|
453
|
-
window.location.hash = "#/login2";
|
|
455
|
+
window.location.hash = version === "v2" ? "#/login2/" : "#/login/";
|
|
454
456
|
}
|
|
455
457
|
},
|
|
456
458
|
downloadFile(url, fileName) {
|