aldehyde 0.2.161 → 0.2.164
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 -1
- package/lib/controls/action/utils.d.ts.map +1 -1
- package/lib/controls/action/utils.js +6 -1
- package/lib/controls/action/utils.js.map +1 -1
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +3 -0
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/field-history/index.d.ts +7 -0
- package/lib/controls/field-history/index.d.ts.map +1 -0
- package/lib/controls/field-history/index.js +9 -0
- package/lib/controls/field-history/index.js.map +1 -0
- package/lib/controls/steps/index.d.ts.map +1 -1
- package/lib/controls/steps/index.js +4 -1
- package/lib/controls/steps/index.js.map +1 -1
- package/lib/controls/view-control.d.ts.map +1 -1
- package/lib/controls/view-control.js +3 -1
- package/lib/controls/view-control.js.map +1 -1
- package/lib/detail/button/edit-button.d.ts.map +1 -1
- package/lib/detail/button/edit-button.js +12 -6
- package/lib/detail/button/edit-button.js.map +1 -1
- package/lib/detail/button/view-button.d.ts +11 -0
- package/lib/detail/button/view-button.d.ts.map +1 -0
- package/lib/detail/button/view-button.js +29 -0
- package/lib/detail/button/view-button.js.map +1 -0
- package/lib/layout/menu/user-bar.d.ts +3 -2
- package/lib/layout/menu/user-bar.d.ts.map +1 -1
- package/lib/layout/menu/user-bar.js +4 -10
- package/lib/layout/menu/user-bar.js.map +1 -1
- package/lib/layout2/header.d.ts.map +1 -1
- package/lib/layout2/header.js +9 -2
- package/lib/layout2/header.js.map +1 -1
- package/lib/locale/LocaleButton.d.ts.map +1 -1
- package/lib/locale/LocaleButton.js +4 -10
- package/lib/locale/LocaleButton.js.map +1 -1
- package/lib/locale/langMp.d.ts +7 -1
- package/lib/locale/langMp.d.ts.map +1 -1
- package/lib/locale/langMp.js +8 -0
- package/lib/locale/langMp.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +3 -0
- package/lib/login/login.js.map +1 -1
- package/lib/login2/Login.d.ts.map +1 -1
- package/lib/login2/Login.js +11 -3
- package/lib/login2/Login.js.map +1 -1
- package/lib/login2/LoginPage.d.ts.map +1 -1
- package/lib/login2/LoginPage.js +3 -2
- package/lib/login2/LoginPage.js.map +1 -1
- package/lib/login2/img/login-bg.png +0 -0
- package/lib/module/ltmpl-table.d.ts +3 -3
- package/lib/module/ltmpl-table.d.ts.map +1 -1
- package/lib/module/ltmpl-table.js +5 -3
- package/lib/module/ltmpl-table.js.map +1 -1
- package/lib/routable/ltmpl-route.d.ts.map +1 -1
- package/lib/routable/ltmpl-route.js +5 -3
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts +2 -2
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +6 -3
- package/lib/table/act-table.js.map +1 -1
- package/lib/tmpl/control-type-supportor.d.ts.map +1 -1
- package/lib/tmpl/control-type-supportor.js +1 -0
- package/lib/tmpl/control-type-supportor.js.map +1 -1
- package/lib/tmpl/interface.d.ts +7 -2
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/units/index.d.ts +1 -0
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +9 -2
- package/lib/units/index.js.map +1 -1
- package/lib/welcome/HCWelcome.d.ts.map +1 -1
- package/lib/welcome/HCWelcome.js +248 -229
- package/lib/welcome/HCWelcome.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/action/utils.tsx +6 -1
- package/src/aldehyde/controls/entry-control.tsx +3 -0
- package/src/aldehyde/controls/field-history/index.tsx +22 -0
- package/src/aldehyde/controls/steps/index.tsx +6 -1
- package/src/aldehyde/controls/view-control.tsx +3 -2
- package/src/aldehyde/detail/button/edit-button.tsx +48 -37
- package/src/aldehyde/detail/button/view-button.tsx +62 -0
- package/src/aldehyde/layout/menu/user-bar.tsx +9 -24
- package/src/aldehyde/layout2/header.tsx +22 -8
- package/src/aldehyde/locale/LocaleButton.tsx +9 -18
- package/src/aldehyde/locale/langMp.ts +9 -1
- package/src/aldehyde/login/login.tsx +2 -0
- package/src/aldehyde/login2/Login.tsx +15 -3
- package/src/aldehyde/login2/LoginPage.tsx +3 -2
- package/src/aldehyde/login2/img/login-bg.png +0 -0
- package/src/aldehyde/module/ltmpl-table.tsx +7 -5
- package/src/aldehyde/routable/ltmpl-route.tsx +7 -4
- package/src/aldehyde/table/act-table.tsx +12 -19
- package/src/aldehyde/tmpl/control-type-supportor.tsx +1 -0
- package/src/aldehyde/tmpl/interface.tsx +12 -2
- package/src/aldehyde/units/index.tsx +9 -2
- package/src/aldehyde/welcome/HCWelcome.js +251 -233
- package/lib/layout2/imgs/1.png +0 -0
- package/lib/layout2/imgs/2.png +0 -0
- package/lib/layout2/imgs/3.png +0 -0
- package/lib/layout2/imgs/4.png +0 -0
- package/lib/layout2/imgs/5.png +0 -0
- package/lib/layout2/imgs/6.png +0 -0
- package/src/aldehyde/layout2/imgs/1.png +0 -0
- package/src/aldehyde/layout2/imgs/2.png +0 -0
- package/src/aldehyde/layout2/imgs/3.png +0 -0
- package/src/aldehyde/layout2/imgs/4.png +0 -0
- package/src/aldehyde/layout2/imgs/5.png +0 -0
- package/src/aldehyde/layout2/imgs/6.png +0 -0
- package/src/aldehyde/layout2/imgs/s.svg +0 -3
|
@@ -1,51 +1,62 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Button } from "antd";
|
|
3
|
-
import { DoEditParam, DtmplData, LtmplConfig} from "../../tmpl/interface";
|
|
4
|
-
import {EditOutlined} from "@ant-design/icons";
|
|
3
|
+
import { DoEditParam, DtmplData, LtmplConfig } from "../../tmpl/interface";
|
|
4
|
+
import { EditOutlined } from "@ant-design/icons";
|
|
5
5
|
import ActionUtils from "../../controls/action/utils";
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
interface EditButtonProps {
|
|
9
8
|
serverKey?: string;
|
|
10
|
-
doEdit: (doEditParam:DoEditParam) => void;
|
|
9
|
+
doEdit: (doEditParam: DoEditParam) => void;
|
|
11
10
|
data: DtmplData;
|
|
12
|
-
ltmplConfig:LtmplConfig
|
|
11
|
+
ltmplConfig: LtmplConfig;
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
const EditButton: React.FC<EditButtonProps> = (props) => {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { doEdit, data, ltmplConfig } = props;
|
|
16
|
+
let button = undefined;
|
|
18
17
|
if (ltmplConfig.classEditConfigs) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
ltmplConfig.classEditConfigs.forEach((classEditConfig) => {
|
|
19
|
+
if (
|
|
20
|
+
!button &&
|
|
21
|
+
ActionUtils.isShow(classEditConfig.preposes, [data], undefined)
|
|
22
|
+
) {
|
|
23
|
+
button = (
|
|
24
|
+
<Button
|
|
25
|
+
size="small"
|
|
26
|
+
type="dashed"
|
|
27
|
+
icon={<EditOutlined />}
|
|
28
|
+
onClick={() =>
|
|
29
|
+
doEdit({
|
|
30
|
+
code: data.code,
|
|
31
|
+
mode: "update",
|
|
32
|
+
dtmplSourceId: classEditConfig.id,
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
></Button>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
33
39
|
}
|
|
34
40
|
|
|
35
|
-
debugger
|
|
36
|
-
if
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
// debugger
|
|
42
|
+
if (
|
|
43
|
+
!button &&
|
|
44
|
+
ActionUtils.isShow(
|
|
45
|
+
ltmplConfig.buttonEditAction?.preposes,
|
|
46
|
+
[data],
|
|
47
|
+
undefined
|
|
48
|
+
)
|
|
49
|
+
) {
|
|
50
|
+
button = (
|
|
51
|
+
<Button
|
|
52
|
+
size="small"
|
|
53
|
+
type="dashed"
|
|
54
|
+
icon={<EditOutlined />}
|
|
55
|
+
onClick={() => doEdit({ code: data.code, mode: "update" })}
|
|
56
|
+
></Button>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
48
59
|
|
|
49
|
-
return button?button
|
|
50
|
-
}
|
|
51
|
-
export default EditButton;
|
|
60
|
+
return button ? button : <></>;
|
|
61
|
+
};
|
|
62
|
+
export default EditButton;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "antd";
|
|
3
|
+
import {DtmplData, LtmplConfig, ShowViewParam} from "../../tmpl/interface";
|
|
4
|
+
import { AlignCenterOutlined } from "@ant-design/icons";
|
|
5
|
+
import ActionUtils from "../../controls/action/utils";
|
|
6
|
+
|
|
7
|
+
interface ViewButtonProps {
|
|
8
|
+
serverKey?: string;
|
|
9
|
+
showView: (showViewParam: ShowViewParam) => void;
|
|
10
|
+
data: DtmplData;
|
|
11
|
+
ltmplConfig: LtmplConfig;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const ViewButton: React.FC<ViewButtonProps> = (props) => {
|
|
15
|
+
const { showView, data, ltmplConfig } = props;
|
|
16
|
+
let button = undefined;
|
|
17
|
+
if (ltmplConfig.classViewConfigs) {
|
|
18
|
+
debugger
|
|
19
|
+
ltmplConfig.classViewConfigs.forEach((classViewConfig) => {
|
|
20
|
+
if (
|
|
21
|
+
!button &&
|
|
22
|
+
ActionUtils.isShow(classViewConfig.preposes, [data], undefined)
|
|
23
|
+
) {
|
|
24
|
+
button = (
|
|
25
|
+
<Button
|
|
26
|
+
size="small"
|
|
27
|
+
type="primary"
|
|
28
|
+
icon={<AlignCenterOutlined />}
|
|
29
|
+
onClick={() =>
|
|
30
|
+
showView({
|
|
31
|
+
code: data.code,
|
|
32
|
+
dtmplSourceId: classViewConfig.id,
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
></Button>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// debugger
|
|
42
|
+
if (
|
|
43
|
+
!button &&
|
|
44
|
+
ActionUtils.isShow(
|
|
45
|
+
ltmplConfig.buttonViewAction?.preposes,
|
|
46
|
+
[data],
|
|
47
|
+
undefined
|
|
48
|
+
)
|
|
49
|
+
) {
|
|
50
|
+
button = (
|
|
51
|
+
<Button
|
|
52
|
+
size="small"
|
|
53
|
+
type="primary"
|
|
54
|
+
icon={<AlignCenterOutlined />}
|
|
55
|
+
onClick={() => showView({ code: data.code})}
|
|
56
|
+
></Button>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return button ? button : <></>;
|
|
61
|
+
};
|
|
62
|
+
export default ViewButton;
|
|
@@ -7,6 +7,7 @@ import HCDataSource from "../../tmpl/hc-data-source";
|
|
|
7
7
|
import UserInfoBar from "./userinfo-bar";
|
|
8
8
|
import ResetPassword from "./reset-password";
|
|
9
9
|
import { LocaleContext } from "../../locale/LocaleProvider";
|
|
10
|
+
import { LocaleType } from "../../locale/langMp";
|
|
10
11
|
|
|
11
12
|
//const confirm = Modal.confirm;
|
|
12
13
|
|
|
@@ -128,30 +129,14 @@ class UserBar extends React.PureComponent<UserBarProps, UserBarState> {
|
|
|
128
129
|
|
|
129
130
|
const items: MenuProps["items"] = [];
|
|
130
131
|
|
|
131
|
-
const langItems =
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</span>
|
|
140
|
-
),
|
|
141
|
-
key: "fr",
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
label: (
|
|
145
|
-
<span
|
|
146
|
-
onClick={() => changeLocale("en")}
|
|
147
|
-
style={locale === "en" ? { color: backgroudColor } : {}}
|
|
148
|
-
>
|
|
149
|
-
en
|
|
150
|
-
</span>
|
|
151
|
-
),
|
|
152
|
-
key: "en",
|
|
153
|
-
},
|
|
154
|
-
].filter(({ key }) => availableLang.findIndex((i) => key === i) > -1);
|
|
132
|
+
const langItems = availableLang.map((lang) => ({
|
|
133
|
+
label: (
|
|
134
|
+
<span onClick={() => changeLocale(lang as LocaleType)} style={locale === lang ? { color: backgroudColor } : {}}>
|
|
135
|
+
{ lang }
|
|
136
|
+
</span>
|
|
137
|
+
),
|
|
138
|
+
key: lang,
|
|
139
|
+
}))
|
|
155
140
|
|
|
156
141
|
langItems.unshift({
|
|
157
142
|
label: (
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ConfigProvider,
|
|
3
|
+
Flex,
|
|
4
|
+
Layout,
|
|
5
|
+
Menu,
|
|
6
|
+
MenuProps,
|
|
7
|
+
theme,
|
|
8
|
+
Tooltip,
|
|
9
|
+
} from "antd";
|
|
2
10
|
import React, { useEffect, useState } from "react";
|
|
3
11
|
import "./css/header.css";
|
|
4
12
|
import L2MenuQuickBar from "../layout/menu/l2menu-quick-bar";
|
|
@@ -7,12 +15,6 @@ import LocaleButton from "../locale/LocaleButton";
|
|
|
7
15
|
import UserBar from "../layout/menu/user-bar";
|
|
8
16
|
import UserButton from "./components/userButton";
|
|
9
17
|
import homePng from "./imgs/home.png";
|
|
10
|
-
import png1 from "./imgs/1.png";
|
|
11
|
-
import png2 from "./imgs/2.png";
|
|
12
|
-
import png3 from "./imgs/3.png";
|
|
13
|
-
import png4 from "./imgs/4.png";
|
|
14
|
-
import png5 from "./imgs/5.png";
|
|
15
|
-
import png6 from "./imgs/6.png";
|
|
16
18
|
import { MenuType } from "./type/layout.type";
|
|
17
19
|
import { NavLink, useParams } from "react-router-dom";
|
|
18
20
|
import {
|
|
@@ -221,7 +223,19 @@ const Header: React.FC<HeaderPropsType> = ({ systemName, menuList, style }) => {
|
|
|
221
223
|
marginRight: 5,
|
|
222
224
|
}}
|
|
223
225
|
/>
|
|
224
|
-
{systemName}
|
|
226
|
+
<Tooltip title={systemName}>
|
|
227
|
+
<span
|
|
228
|
+
style={{
|
|
229
|
+
width: "100%",
|
|
230
|
+
height: "100%",
|
|
231
|
+
overflow: "hidden",
|
|
232
|
+
textOverflow: "ellipsis",
|
|
233
|
+
whiteSpace: "nowrap",
|
|
234
|
+
}}
|
|
235
|
+
>
|
|
236
|
+
{systemName}
|
|
237
|
+
</span>
|
|
238
|
+
</Tooltip>
|
|
225
239
|
</NavLink>
|
|
226
240
|
<div
|
|
227
241
|
style={{
|
|
@@ -15,24 +15,15 @@ const LocaleButton = (props: ButtonProps) => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
console.log(availableLang);
|
|
18
|
-
const items: MenuProps["items"] =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
label: (
|
|
29
|
-
<span style={getLocale() === "fr" ? { color: token.colorPrimary } : {}}>
|
|
30
|
-
fr
|
|
31
|
-
</span>
|
|
32
|
-
),
|
|
33
|
-
key: "fr",
|
|
34
|
-
},
|
|
35
|
-
].filter(({ key }) => availableLang.findIndex((i) => key === i) > -1);
|
|
18
|
+
const items: MenuProps["items"] = availableLang.map((lang) => ({
|
|
19
|
+
label: (
|
|
20
|
+
<span style={getLocale() === lang ? { color: token.colorPrimary } : {}}>
|
|
21
|
+
{ lang }
|
|
22
|
+
</span>
|
|
23
|
+
),
|
|
24
|
+
key: lang,
|
|
25
|
+
}))
|
|
26
|
+
|
|
36
27
|
items.unshift({
|
|
37
28
|
label: (
|
|
38
29
|
<span style={getLocale() === "zh" ? { color: token.colorPrimary } : {}}>
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import frFr from "antd/locale/fr_FR";
|
|
2
2
|
import zhCN from "antd/locale/zh_CN";
|
|
3
3
|
import enUS from "antd/locale/en_US";
|
|
4
|
+
import ptPT from 'antd/locale/pt_PT';
|
|
5
|
+
import ruRU from 'antd/locale/ru_RU';
|
|
4
6
|
|
|
5
|
-
export type LocaleType = "zh" | "en" | "fr";
|
|
7
|
+
export type LocaleType = "zh" | "en" | "fr" | "pt" | "ru";
|
|
6
8
|
|
|
7
9
|
export const langMp = {
|
|
8
10
|
fr: ["fra", "fr-FR"],
|
|
9
11
|
zh: ["zh", "zh-CN"],
|
|
10
12
|
en: ["en"],
|
|
13
|
+
pt: ["pt"],
|
|
14
|
+
ru: ["ru"],
|
|
11
15
|
};
|
|
12
16
|
|
|
13
17
|
export const langApiMp = {
|
|
14
18
|
fra: ["fr", "fr-FR"],
|
|
15
19
|
zh: ["zh", "zh-CN"],
|
|
16
20
|
en: ["en"],
|
|
21
|
+
pt: ["pt"],
|
|
22
|
+
ru: ["ru"],
|
|
17
23
|
};
|
|
18
24
|
|
|
19
25
|
export const getLangWithLangMp: (lang: any) => LocaleType = (lang) => {
|
|
@@ -34,4 +40,6 @@ export const antdLangMp = {
|
|
|
34
40
|
zh: zhCN,
|
|
35
41
|
fr: frFr,
|
|
36
42
|
en: enUS,
|
|
43
|
+
pt: ptPT,
|
|
44
|
+
ru: ruRU
|
|
37
45
|
};
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
import HCserviceV3 from "../tmpl/hcservice-v3";
|
|
10
10
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
11
11
|
import Vertify from "./vertify/index";
|
|
12
|
+
import Units from "../units";
|
|
12
13
|
|
|
13
14
|
interface LoginProps {
|
|
14
15
|
onFinish: (token: string) => void;
|
|
@@ -47,6 +48,7 @@ class Login extends React.PureComponent<LoginProps, LoginState> {
|
|
|
47
48
|
|
|
48
49
|
componentDidMount = async () => {
|
|
49
50
|
const { programCode } = this.props;
|
|
51
|
+
if (programCode) Units.setProgramCode(programCode);
|
|
50
52
|
window.removeEventListener("keydown", this.handleKeyDown);
|
|
51
53
|
let pubkey = await HCserviceV3.getRasPubkey(null, programCode);
|
|
52
54
|
this.setState({
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Button, Form, Input } from "antd";
|
|
2
|
-
import React, { useState } from "react";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
3
|
import HCserviceV3 from "../tmpl/hcservice-v3";
|
|
4
4
|
import { useLocale } from "../locale/useLocale";
|
|
5
|
+
import { useParams } from "react-router-dom";
|
|
6
|
+
import Units from "../units";
|
|
5
7
|
|
|
6
8
|
type LoginPropType = {
|
|
7
9
|
onFinish?: (token: string) => void;
|
|
@@ -19,6 +21,13 @@ const Login = (props: LoginPropType) => {
|
|
|
19
21
|
// locale
|
|
20
22
|
const { translate } = useLocale();
|
|
21
23
|
|
|
24
|
+
const { programCode: routeProgramCode } = useParams();
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (routeProgramCode === undefined) return;
|
|
27
|
+
|
|
28
|
+
Units.setProgramCode(routeProgramCode);
|
|
29
|
+
}, [routeProgramCode]);
|
|
30
|
+
|
|
22
31
|
// form
|
|
23
32
|
const [form] = Form.useForm<FormType>();
|
|
24
33
|
const submit = async () => {
|
|
@@ -27,13 +36,16 @@ const Login = (props: LoginPropType) => {
|
|
|
27
36
|
|
|
28
37
|
setLoading(true);
|
|
29
38
|
const { programCode, onFinish } = props;
|
|
30
|
-
const pubkey = await HCserviceV3.getRasPubkey(
|
|
39
|
+
const pubkey = await HCserviceV3.getRasPubkey(
|
|
40
|
+
null,
|
|
41
|
+
programCode ? programCode : routeProgramCode
|
|
42
|
+
);
|
|
31
43
|
const res = await HCserviceV3.login(
|
|
32
44
|
{ username, password },
|
|
33
45
|
"",
|
|
34
46
|
"",
|
|
35
47
|
pubkey,
|
|
36
|
-
programCode
|
|
48
|
+
programCode ? programCode : routeProgramCode
|
|
37
49
|
);
|
|
38
50
|
if (res.status === "success") {
|
|
39
51
|
onFinish(res.token);
|
|
@@ -13,7 +13,7 @@ const LoginPage = () => {
|
|
|
13
13
|
style={{
|
|
14
14
|
width: "100%",
|
|
15
15
|
height: "100%",
|
|
16
|
-
minWidth: "1600px",
|
|
16
|
+
// minWidth: "1600px",
|
|
17
17
|
position: "absolute",
|
|
18
18
|
background: `url(${LoginBgPng})`,
|
|
19
19
|
backgroundSize: "cover",
|
|
@@ -26,11 +26,12 @@ const LoginPage = () => {
|
|
|
26
26
|
<div
|
|
27
27
|
style={{
|
|
28
28
|
width: "500px",
|
|
29
|
-
height: "500px",
|
|
29
|
+
// height: "500px",
|
|
30
30
|
background: "linear-gradient(0deg, #FFFFFF 65%, #DFEDFF)",
|
|
31
31
|
boxShadow: "0px 10px 15px -3px rgba(0,0,0,0.1)",
|
|
32
32
|
marginRight: "10%",
|
|
33
33
|
padding: "60px",
|
|
34
|
+
aspectRatio: "1/1",
|
|
34
35
|
}}
|
|
35
36
|
>
|
|
36
37
|
<div
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from "react";
|
|
2
|
-
import {AddOrUpdate, LtmplConfigRes, ActTableMode, DoEditParam} from "../tmpl/interface";
|
|
2
|
+
import {AddOrUpdate, LtmplConfigRes, ActTableMode, DoEditParam, ShowViewParam} from "../tmpl/interface";
|
|
3
3
|
import Units from "../units";
|
|
4
4
|
import ActTable from "../table/act-table";
|
|
5
5
|
// import StatActTable from '../table/stat-act-table'
|
|
@@ -16,7 +16,7 @@ export interface LtmplTableProps {
|
|
|
16
16
|
serverKey?: string;
|
|
17
17
|
sourceId: string;
|
|
18
18
|
mainCode?: string;
|
|
19
|
-
showView?: (
|
|
19
|
+
showView?: (showViewParam: ShowViewParam) => void;
|
|
20
20
|
doCustomCreate?: (handleOk: () => void) => void;
|
|
21
21
|
doCustomEdit?: (
|
|
22
22
|
code: string,
|
|
@@ -125,9 +125,11 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
125
125
|
return criteriaData;
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
showView = (
|
|
128
|
+
showView = (showViewParam: ShowViewParam) => {
|
|
129
|
+
const {sourceId } = this.props;
|
|
129
130
|
this.setState({
|
|
130
|
-
selectedCode: code,
|
|
131
|
+
selectedCode: showViewParam.code,
|
|
132
|
+
dtmplSourceId:showViewParam.dtmplSourceId?showViewParam.dtmplSourceId:sourceId,
|
|
131
133
|
showDtmplView: true,
|
|
132
134
|
});
|
|
133
135
|
};
|
|
@@ -291,7 +293,7 @@ class LtmplTable extends React.PureComponent<LtmplTableProps, LtmplTableState> {
|
|
|
291
293
|
});
|
|
292
294
|
}}
|
|
293
295
|
mainCode={mainCode}
|
|
294
|
-
sourceId={sourceId}
|
|
296
|
+
sourceId={dtmplSourceId?dtmplSourceId:sourceId}
|
|
295
297
|
code={selectedCode}
|
|
296
298
|
>
|
|
297
299
|
{" "}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AddOrUpdate,
|
|
4
4
|
DoEditParam,
|
|
5
5
|
LtmplConfigRes,
|
|
6
|
-
RouterCompProps,
|
|
6
|
+
RouterCompProps, ShowViewParam,
|
|
7
7
|
} from "../tmpl/interface";
|
|
8
8
|
import Units from "../units";
|
|
9
9
|
import ActTable from "../table/act-table";
|
|
@@ -92,14 +92,17 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
92
92
|
await this.loadData();
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
showView = (
|
|
95
|
+
showView = (showViewParam: ShowViewParam) => {
|
|
96
96
|
const { basePath } = this.props;
|
|
97
97
|
const { sourceId } = this.props.params;
|
|
98
98
|
const { ltmplConfigRes } = this.state;
|
|
99
|
+
debugger
|
|
100
|
+
let dtmplSourceId = showViewParam.dtmplSourceId ? showViewParam.dtmplSourceId : sourceId;
|
|
101
|
+
|
|
99
102
|
let path = `${basePath}${
|
|
100
103
|
this.computedLayoutPath
|
|
101
|
-
}/${
|
|
102
|
-
if (toCustomPage && ltmplConfigRes.ltmplConfig.customViewPagePath) {
|
|
104
|
+
}/${dtmplSourceId}/detail-view?code=${showViewParam.code}&menuId=${this.getMenuId()}`;
|
|
105
|
+
if (showViewParam.toCustomPage && ltmplConfigRes.ltmplConfig.customViewPagePath) {
|
|
103
106
|
path = `${basePath}${this.computedLayoutPath}${
|
|
104
107
|
ltmplConfigRes.ltmplConfig.customViewPagePath
|
|
105
108
|
}?menuId=${this.getMenuId()}&sourceId=${sourceId}`;
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
JumpConfig,
|
|
48
48
|
LtmplConfig,
|
|
49
49
|
QueryKey,
|
|
50
|
-
SelectedRow,
|
|
50
|
+
SelectedRow, ShowViewParam,
|
|
51
51
|
TmplBaseProps,
|
|
52
52
|
} from "../tmpl/interface";
|
|
53
53
|
import TableUnits from "./table-util";
|
|
@@ -71,6 +71,7 @@ import ToolTipBar from "../detail/tooltipbar";
|
|
|
71
71
|
import { LocaleContext } from "../locale/LocaleProvider";
|
|
72
72
|
import BlockMenuTreeDrawer from "../module/block-menu-tree-drawer";
|
|
73
73
|
import EditButton from "../detail/button/edit-button";
|
|
74
|
+
import ViewButton from "../detail/button/view-button";
|
|
74
75
|
|
|
75
76
|
const DragHandle = SortableHandle(() => (
|
|
76
77
|
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
@@ -88,7 +89,7 @@ interface ActTableProps extends TmplBaseProps {
|
|
|
88
89
|
onChangePage: (pageNo: number, pageSize: number) => void;
|
|
89
90
|
ltmplConfig: LtmplConfig;
|
|
90
91
|
menuId?: string;
|
|
91
|
-
showView?: (
|
|
92
|
+
showView?: (showVievParam:ShowViewParam) => void;
|
|
92
93
|
doCreate?: (addtmplId: string, toCustomPage: boolean) => void;
|
|
93
94
|
customCreatable?: boolean;
|
|
94
95
|
doEdit?: (doEditParam:DoEditParam) => void;
|
|
@@ -362,13 +363,7 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
362
363
|
ltmplConfig.buttonViewAction?.preposes,
|
|
363
364
|
[record],
|
|
364
365
|
undefined
|
|
365
|
-
)) ? (
|
|
366
|
-
<Button
|
|
367
|
-
size="small"
|
|
368
|
-
type="primary"
|
|
369
|
-
icon={<AlignLeftOutlined />}
|
|
370
|
-
onClick={() => showView(record.code)}
|
|
371
|
-
></Button>
|
|
366
|
+
)) ? (<ViewButton showView={showView} data={record} ltmplConfig={ltmplConfig} ></ViewButton>
|
|
372
367
|
) : (
|
|
373
368
|
""
|
|
374
369
|
)}
|
|
@@ -377,16 +372,14 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
377
372
|
ltmplConfig.buttonViewAction?.preposes,
|
|
378
373
|
[record],
|
|
379
374
|
undefined
|
|
380
|
-
)) ?
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
""
|
|
389
|
-
)}
|
|
375
|
+
)) ?
|
|
376
|
+
<Button
|
|
377
|
+
size="small"
|
|
378
|
+
type="primary"
|
|
379
|
+
icon={<AlignLeftOutlined />}
|
|
380
|
+
onClick={() => showView({code:record.code})}
|
|
381
|
+
></Button> :
|
|
382
|
+
""}
|
|
390
383
|
{buttons.includes("dtmplEdit") &&
|
|
391
384
|
doEdit &&
|
|
392
385
|
!readOnly ?
|
|
@@ -64,9 +64,14 @@ export interface ActionConfig extends ButtonConfig {
|
|
|
64
64
|
writes: FieldConfig[];
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
export interface DoEditParam
|
|
68
|
-
|
|
67
|
+
export interface DoEditParam extends ShowViewParam {
|
|
68
|
+
|
|
69
69
|
mode: AddOrUpdate;
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ShowViewParam {
|
|
74
|
+
code: string;
|
|
70
75
|
toCustomPage?: boolean;
|
|
71
76
|
dtmplSourceId?:string;
|
|
72
77
|
}
|
|
@@ -102,6 +107,10 @@ export interface ClassEditConfig extends OrderableTmplBase {
|
|
|
102
107
|
preposes: FieldConfig[],
|
|
103
108
|
}
|
|
104
109
|
|
|
110
|
+
export interface ClassViewConfig extends ClassEditConfig {
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
105
114
|
export interface ProgramAuth extends OrderableTmplBase {}
|
|
106
115
|
|
|
107
116
|
export interface Level2Menu extends MenuBase {
|
|
@@ -356,6 +365,7 @@ export interface LtmplConfig extends SelectConfig {
|
|
|
356
365
|
customViewPagePath?: string;
|
|
357
366
|
classAddConfigs?: ClassAddConfig[];
|
|
358
367
|
classEditConfigs?: ClassEditConfig[];
|
|
368
|
+
classViewConfigs?: ClassViewConfig[];
|
|
359
369
|
drillingParams?: CriteriaConfig[];
|
|
360
370
|
footer?: string;
|
|
361
371
|
header?: string;
|
|
@@ -230,11 +230,14 @@ export default {
|
|
|
230
230
|
},
|
|
231
231
|
setHydrocarbonToken(token:string,serverkey?:string){
|
|
232
232
|
let programCode=this.programCode(serverkey);
|
|
233
|
+
this.setLocalHydrocarbonToken(token,programCode);
|
|
234
|
+
this.setSessionHydrocarbonToken(token,programCode);
|
|
235
|
+
},
|
|
236
|
+
setLocalHydrocarbonToken(token:string,programCode_?:string){
|
|
237
|
+
let programCode=programCode_?programCode_:this.programCode();
|
|
233
238
|
if(programCode){
|
|
234
|
-
window.sessionStorage.setItem(programCode+'hydrocarbonToken',token) ;
|
|
235
239
|
window.localStorage.setItem(programCode+'hydrocarbonToken',token);
|
|
236
240
|
}else{
|
|
237
|
-
window.sessionStorage.setItem('hydrocarbonToken',token) ;
|
|
238
241
|
window.localStorage.setItem('hydrocarbonToken',token);
|
|
239
242
|
}
|
|
240
243
|
},
|
|
@@ -242,6 +245,10 @@ export default {
|
|
|
242
245
|
let programCode=programCode_?programCode_:this.programCode();
|
|
243
246
|
if(programCode){
|
|
244
247
|
window.sessionStorage.setItem(programCode+'hydrocarbonToken',token) ;
|
|
248
|
+
//初次设为默认
|
|
249
|
+
if(!window.sessionStorage.getItem('hydrocarbonToken')){
|
|
250
|
+
window.sessionStorage.setItem('hydrocarbonToken',token) ;
|
|
251
|
+
}
|
|
245
252
|
}else{
|
|
246
253
|
window.sessionStorage.setItem('hydrocarbonToken',token) ;
|
|
247
254
|
}
|