aldehyde 0.2.193 → 0.2.195
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/file-view/index.d.ts +0 -1
- package/lib/controls/file-view/index.d.ts.map +1 -1
- package/lib/controls/file-view/index.js +7 -54
- package/lib/controls/file-view/index.js.map +1 -1
- package/lib/controls/file-view/newin-file-view.d.ts +18 -0
- package/lib/controls/file-view/newin-file-view.d.ts.map +1 -0
- package/lib/controls/file-view/newin-file-view.js +28 -0
- package/lib/controls/file-view/newin-file-view.js.map +1 -0
- package/lib/layout/menu/reset-password.js +1 -1
- package/lib/layout/menu/reset-password.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +8 -2
- package/lib/login/login.js.map +1 -1
- package/lib/login2/LoginPage.d.ts.map +1 -1
- package/lib/login2/LoginPage.js +6 -1
- package/lib/login2/LoginPage.js.map +1 -1
- package/lib/routable/ltmpl-route.js +0 -2
- package/lib/routable/ltmpl-route.js.map +1 -1
- package/lib/table/act-table.d.ts.map +1 -1
- package/lib/table/act-table.js +22 -3
- package/lib/table/act-table.js.map +1 -1
- package/lib/tmpl/hcservice-v3.d.ts +7 -2
- package/lib/tmpl/hcservice-v3.d.ts.map +1 -1
- package/lib/tmpl/hcservice-v3.js +56 -5
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +7 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/interface.js.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.d.ts.map +1 -1
- package/lib/tmpl/tmpl-config-analysis.js +0 -1
- package/lib/tmpl/tmpl-config-analysis.js.map +1 -1
- package/package.json +2 -2
- package/src/aldehyde/controls/file-view/index.tsx +12 -59
- package/src/aldehyde/controls/file-view/newin-file-view.tsx +40 -0
- package/src/aldehyde/layout/menu/reset-password.tsx +3 -3
- package/src/aldehyde/login/login.tsx +237 -229
- package/src/aldehyde/login2/LoginPage.tsx +5 -0
- package/src/aldehyde/routable/ltmpl-route.tsx +2 -2
- package/src/aldehyde/table/act-table.tsx +33 -3
- package/src/aldehyde/tmpl/hcservice-v3.tsx +52 -5
- package/src/aldehyde/tmpl/interface.tsx +8 -1
- package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +0 -1
|
@@ -1,248 +1,256 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, {CSSProperties} from "react";
|
|
2
2
|
import "./index.css";
|
|
3
|
-
import {
|
|
3
|
+
import {Button, Col, Form, Input, Row, FormInstance} from "antd";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
LockOutlined,
|
|
6
|
+
SafetyCertificateOutlined,
|
|
7
|
+
UserOutlined,
|
|
8
8
|
} from "@ant-design/icons";
|
|
9
9
|
import HCserviceV3 from "../tmpl/hcservice-v3";
|
|
10
|
-
import {
|
|
10
|
+
import {LocaleContext} from "../locale/LocaleProvider";
|
|
11
11
|
import Vertify from "./vertify/index";
|
|
12
12
|
import Units from "../units";
|
|
13
|
+
import ResetPassword from "../layout/menu/reset-password";
|
|
13
14
|
|
|
14
15
|
interface LoginProps {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
onFinish: (token: string) => void;
|
|
17
|
+
title?: any;
|
|
18
|
+
programCode?: string;
|
|
19
|
+
autoSaveUser?: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
interface LoginState {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
username?: string;
|
|
24
|
+
password?: string;
|
|
25
|
+
loading?: boolean;
|
|
26
|
+
needKaptcha?: boolean;
|
|
27
|
+
kaptchaImg?: string;
|
|
28
|
+
kaptchaToken?: string;
|
|
29
|
+
pubkey?: string;
|
|
30
|
+
vertify: boolean;
|
|
31
|
+
showSlideVertify: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
class Login extends React.PureComponent<LoginProps, LoginState> {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
35
|
+
state = {
|
|
36
|
+
username: "",
|
|
37
|
+
password: "",
|
|
38
|
+
loading: true,
|
|
39
|
+
needKaptcha: false,
|
|
40
|
+
kaptchaImg: null,
|
|
41
|
+
kaptchaToken: null,
|
|
42
|
+
pubkey: undefined,
|
|
43
|
+
vertify: false,
|
|
44
|
+
showSlideVertify: false,
|
|
45
|
+
};
|
|
46
|
+
formRef = React.createRef<FormInstance>();
|
|
47
|
+
static contextType = LocaleContext;
|
|
48
|
+
context: React.ContextType<typeof LocaleContext>;
|
|
49
|
+
|
|
50
|
+
componentDidMount = async () => {
|
|
51
|
+
const {programCode} = this.props;
|
|
52
|
+
localStorage.setItem("version", "v1");
|
|
53
|
+
|
|
54
|
+
if (programCode) Units.setProgramCode(programCode);
|
|
55
|
+
window.removeEventListener("keydown", this.handleKeyDown);
|
|
56
|
+
let pubkey = await HCserviceV3.getRasPubkey(null, programCode);
|
|
57
|
+
this.setState({
|
|
58
|
+
pubkey,
|
|
59
|
+
loading: false,
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
getKaptchaToken = async () => {
|
|
64
|
+
const {programCode} = this.props;
|
|
65
|
+
let res = await HCserviceV3.getKaptchaToken(programCode);
|
|
66
|
+
if (res) {
|
|
67
|
+
let kaptchaImg;
|
|
68
|
+
if (res.img && res.img.indexOf("data:") == 0) {
|
|
69
|
+
kaptchaImg = res.img;
|
|
70
|
+
} else {
|
|
71
|
+
kaptchaImg = `data:image/png;base64,${res.img}`;
|
|
72
|
+
}
|
|
73
|
+
this.setState({
|
|
74
|
+
kaptchaImg,
|
|
75
|
+
kaptchaToken: res.kaptchaToken,
|
|
76
|
+
needKaptcha: true,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
handleSubmit = async () => {
|
|
82
|
+
this.setState({
|
|
83
|
+
loading: true,
|
|
84
|
+
});
|
|
85
|
+
let {kaptchaToken, pubkey, needKaptcha, vertify} = this.state;
|
|
86
|
+
|
|
87
|
+
await this.formRef.current
|
|
88
|
+
.validateFields()
|
|
89
|
+
.then(async (values) => {
|
|
90
|
+
// if (needKaptcha && !vertify)
|
|
91
|
+
// return this.setState({ showSlideVertify: false });
|
|
92
|
+
|
|
93
|
+
const {programCode} = this.props;
|
|
94
|
+
let json = {username: values.username, password: values.password};
|
|
95
|
+
let res = await HCserviceV3.login(
|
|
96
|
+
json,
|
|
97
|
+
kaptchaToken,
|
|
98
|
+
values.kaptchaText,
|
|
99
|
+
pubkey,
|
|
100
|
+
programCode
|
|
101
|
+
);
|
|
102
|
+
if (res.status === "success") {
|
|
103
|
+
this.props.onFinish(res.token);
|
|
104
|
+
} else if (res.status === "error") {
|
|
105
|
+
this.setState({needKaptcha: true, vertify: false});
|
|
106
|
+
await this.getKaptchaToken();
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
.catch((errorInfo) => {
|
|
110
|
+
});
|
|
111
|
+
this.setState({
|
|
112
|
+
loading: false,
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
handleKeyDown = (event) => {
|
|
117
|
+
//按下enter键,触发login事件
|
|
118
|
+
switch (event.keyCode) {
|
|
119
|
+
case 13:
|
|
120
|
+
this.handleSubmit();
|
|
121
|
+
break;
|
|
122
|
+
default:
|
|
123
|
+
break;
|
|
106
124
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
changeKaptcha = async (event) => {
|
|
128
|
+
//切换验证码
|
|
129
|
+
await this.getKaptchaToken();
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
render() {
|
|
133
|
+
const {loading, needKaptcha, kaptchaImg, showSlideVertify} = this.state;
|
|
134
|
+
|
|
135
|
+
const {autoSaveUser = true} = this.props;
|
|
136
|
+
|
|
137
|
+
const {translate} = this.context;
|
|
138
|
+
return (
|
|
139
|
+
<>
|
|
140
|
+
<Form
|
|
141
|
+
style={{width: 350}}
|
|
142
|
+
ref={this.formRef}
|
|
143
|
+
name="normal_login"
|
|
144
|
+
initialValues={{remember: true}}
|
|
145
|
+
>
|
|
146
|
+
{this.props.title}
|
|
147
|
+
<Form.Item
|
|
148
|
+
name="username"
|
|
149
|
+
rules={[
|
|
150
|
+
{required: true, message: translate("${请输入}${用户名}!")},
|
|
151
|
+
{
|
|
152
|
+
max: 30,
|
|
153
|
+
min: 0,
|
|
154
|
+
message: translate("${请输入}${0-30个字符}!"),
|
|
155
|
+
},
|
|
156
|
+
]}
|
|
157
|
+
>
|
|
158
|
+
<Input
|
|
159
|
+
prefix={<UserOutlined className="site-form-item-icon"/>}
|
|
160
|
+
placeholder={translate("${用户名}")}
|
|
161
|
+
autoComplete={autoSaveUser ? "on" : "off"}
|
|
162
|
+
/>
|
|
163
|
+
</Form.Item>
|
|
164
|
+
<Form.Item
|
|
165
|
+
name="password"
|
|
166
|
+
rules={[
|
|
167
|
+
{required: true, message: translate("${请输入}${密码}!")},
|
|
168
|
+
]}
|
|
169
|
+
>
|
|
170
|
+
<Input
|
|
171
|
+
style={
|
|
172
|
+
autoSaveUser
|
|
173
|
+
? {}
|
|
174
|
+
: ({"-webkit-text-security": "disc"} as CSSProperties)
|
|
175
|
+
}
|
|
176
|
+
type={autoSaveUser ? "password" : "text"}
|
|
177
|
+
placeholder={translate("${密码}")}
|
|
178
|
+
onKeyDown={this.handleKeyDown}
|
|
179
|
+
autoComplete={autoSaveUser ? "on" : "off"}
|
|
180
|
+
prefix={<LockOutlined className="site-form-item-icon"/>}
|
|
181
|
+
/>
|
|
182
|
+
</Form.Item>
|
|
183
|
+
{needKaptcha ? (
|
|
184
|
+
<Row gutter={8}>
|
|
185
|
+
<Col span={12}>
|
|
186
|
+
<Form.Item
|
|
187
|
+
name="kaptchaText"
|
|
188
|
+
rules={[
|
|
189
|
+
{
|
|
190
|
+
required: true,
|
|
191
|
+
message: translate("${请输入}${验证码}!"),
|
|
192
|
+
},
|
|
193
|
+
]}
|
|
194
|
+
>
|
|
195
|
+
<Input
|
|
196
|
+
prefix={
|
|
197
|
+
<SafetyCertificateOutlined className="site-form-item-icon"/>
|
|
198
|
+
}
|
|
199
|
+
placeholder={translate("${验证码}")}
|
|
200
|
+
onKeyDown={this.handleKeyDown}
|
|
201
|
+
/>
|
|
202
|
+
</Form.Item>
|
|
203
|
+
</Col>
|
|
204
|
+
<Col span={12}>
|
|
205
|
+
<img
|
|
206
|
+
style={{cursor: "pointer"}}
|
|
207
|
+
height={30}
|
|
208
|
+
width={90}
|
|
209
|
+
title={translate("${点击刷新}")}
|
|
210
|
+
onClick={this.changeKaptcha}
|
|
211
|
+
src={kaptchaImg}
|
|
212
|
+
></img>
|
|
213
|
+
</Col>
|
|
214
|
+
</Row>
|
|
215
|
+
) : (
|
|
216
|
+
""
|
|
217
|
+
)}
|
|
218
|
+
<Form.Item>
|
|
219
|
+
<Button
|
|
220
|
+
type="primary"
|
|
221
|
+
style={{width: "100%"}}
|
|
222
|
+
loading={loading}
|
|
223
|
+
onClick={this.handleSubmit}
|
|
224
|
+
>
|
|
225
|
+
{translate("${登录}")}
|
|
226
|
+
</Button>
|
|
227
|
+
</Form.Item>
|
|
228
|
+
<Form.Item style={{marginBottom:0}}>
|
|
229
|
+
<Row gutter={8}>
|
|
230
|
+
<Col span={6} offset={18}><ResetPassword></ResetPassword></Col>
|
|
231
|
+
</Row>
|
|
232
|
+
</Form.Item>
|
|
233
|
+
</Form>
|
|
234
|
+
|
|
235
|
+
{showSlideVertify ? (
|
|
236
|
+
<div style={{width: "100%", height: "100%", background: "white"}}>
|
|
237
|
+
<Vertify
|
|
238
|
+
onSuccess={() =>
|
|
239
|
+
this.setState({vertify: true, showSlideVertify: false}, () =>
|
|
240
|
+
this.handleSubmit()
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
onFail={() =>
|
|
244
|
+
this.setState({vertify: false, showSlideVertify: true})
|
|
245
|
+
}
|
|
246
|
+
></Vertify>
|
|
247
|
+
</div>
|
|
248
|
+
) : (
|
|
249
|
+
<></>
|
|
250
|
+
)}
|
|
251
|
+
</>
|
|
252
|
+
);
|
|
122
253
|
}
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
changeKaptcha = async (event) => {
|
|
126
|
-
//切换验证码
|
|
127
|
-
await this.getKaptchaToken();
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
render() {
|
|
131
|
-
const { loading, needKaptcha, kaptchaImg, showSlideVertify } = this.state;
|
|
132
|
-
|
|
133
|
-
const { autoSaveUser = true } = this.props;
|
|
134
|
-
|
|
135
|
-
const { translate } = this.context;
|
|
136
|
-
return (
|
|
137
|
-
<>
|
|
138
|
-
<Form
|
|
139
|
-
style={{ width: 350 }}
|
|
140
|
-
ref={this.formRef}
|
|
141
|
-
name="normal_login"
|
|
142
|
-
initialValues={{ remember: true }}
|
|
143
|
-
>
|
|
144
|
-
{this.props.title}
|
|
145
|
-
<Form.Item
|
|
146
|
-
name="username"
|
|
147
|
-
rules={[
|
|
148
|
-
{ required: true, message: translate("${请输入}${用户名}!") },
|
|
149
|
-
{
|
|
150
|
-
max: 30,
|
|
151
|
-
min: 0,
|
|
152
|
-
message: translate("${请输入}${0-30个字符}!"),
|
|
153
|
-
},
|
|
154
|
-
]}
|
|
155
|
-
>
|
|
156
|
-
<Input
|
|
157
|
-
prefix={<UserOutlined className="site-form-item-icon" />}
|
|
158
|
-
placeholder={translate("${用户名}")}
|
|
159
|
-
autoComplete={autoSaveUser ? "on" : "off"}
|
|
160
|
-
/>
|
|
161
|
-
</Form.Item>
|
|
162
|
-
<Form.Item
|
|
163
|
-
name="password"
|
|
164
|
-
rules={[
|
|
165
|
-
{ required: true, message: translate("${请输入}${密码}!") },
|
|
166
|
-
]}
|
|
167
|
-
>
|
|
168
|
-
<Input
|
|
169
|
-
style={
|
|
170
|
-
autoSaveUser
|
|
171
|
-
? {}
|
|
172
|
-
: ({ "-webkit-text-security": "disc" } as CSSProperties)
|
|
173
|
-
}
|
|
174
|
-
type={autoSaveUser ? "password" : "text"}
|
|
175
|
-
placeholder={translate("${密码}")}
|
|
176
|
-
onKeyDown={this.handleKeyDown}
|
|
177
|
-
autoComplete={autoSaveUser ? "on" : "off"}
|
|
178
|
-
prefix={<LockOutlined className="site-form-item-icon" />}
|
|
179
|
-
/>
|
|
180
|
-
</Form.Item>
|
|
181
|
-
{needKaptcha ? (
|
|
182
|
-
<Row gutter={8}>
|
|
183
|
-
<Col span={12}>
|
|
184
|
-
<Form.Item
|
|
185
|
-
name="kaptchaText"
|
|
186
|
-
rules={[
|
|
187
|
-
{
|
|
188
|
-
required: true,
|
|
189
|
-
message: translate("${请输入}${验证码}!"),
|
|
190
|
-
},
|
|
191
|
-
]}
|
|
192
|
-
>
|
|
193
|
-
<Input
|
|
194
|
-
prefix={
|
|
195
|
-
<SafetyCertificateOutlined className="site-form-item-icon" />
|
|
196
|
-
}
|
|
197
|
-
placeholder={translate("${验证码}")}
|
|
198
|
-
onKeyDown={this.handleKeyDown}
|
|
199
|
-
/>
|
|
200
|
-
</Form.Item>
|
|
201
|
-
</Col>
|
|
202
|
-
<Col span={12}>
|
|
203
|
-
<img
|
|
204
|
-
style={{ cursor: "pointer" }}
|
|
205
|
-
height={30}
|
|
206
|
-
width={90}
|
|
207
|
-
title={translate("${点击刷新}")}
|
|
208
|
-
onClick={this.changeKaptcha}
|
|
209
|
-
src={kaptchaImg}
|
|
210
|
-
></img>
|
|
211
|
-
</Col>
|
|
212
|
-
</Row>
|
|
213
|
-
) : (
|
|
214
|
-
""
|
|
215
|
-
)}
|
|
216
|
-
<Form.Item>
|
|
217
|
-
<Button
|
|
218
|
-
type="primary"
|
|
219
|
-
style={{ width: "100%" }}
|
|
220
|
-
loading={loading}
|
|
221
|
-
onClick={this.handleSubmit}
|
|
222
|
-
>
|
|
223
|
-
{translate("${登录}")}
|
|
224
|
-
</Button>
|
|
225
|
-
</Form.Item>
|
|
226
|
-
</Form>
|
|
227
|
-
{showSlideVertify ? (
|
|
228
|
-
<div style={{ width: "100%", height: "100%", background: "white" }}>
|
|
229
|
-
<Vertify
|
|
230
|
-
onSuccess={() =>
|
|
231
|
-
this.setState({ vertify: true, showSlideVertify: false }, () =>
|
|
232
|
-
this.handleSubmit()
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
onFail={() =>
|
|
236
|
-
this.setState({ vertify: false, showSlideVertify: true })
|
|
237
|
-
}
|
|
238
|
-
></Vertify>
|
|
239
|
-
</div>
|
|
240
|
-
) : (
|
|
241
|
-
<></>
|
|
242
|
-
)}
|
|
243
|
-
</>
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
254
|
}
|
|
247
255
|
|
|
248
256
|
export default Login;
|
|
@@ -4,6 +4,8 @@ import LoginBgPng from "./img/login-bg.png";
|
|
|
4
4
|
import { useLocale } from "../locale/useLocale";
|
|
5
5
|
import HCDataSource from "../tmpl/hc-data-source";
|
|
6
6
|
import Units from "../units";
|
|
7
|
+
import {Button, Col, Row} from "antd";
|
|
8
|
+
import ResetPassword from "../layout/menu/reset-password";
|
|
7
9
|
|
|
8
10
|
const LoginPage = () => {
|
|
9
11
|
const { translate } = useLocale();
|
|
@@ -51,6 +53,9 @@ const LoginPage = () => {
|
|
|
51
53
|
Units.setHydrocarbonToken(token);
|
|
52
54
|
}}
|
|
53
55
|
></Login>
|
|
56
|
+
<Row>
|
|
57
|
+
<Col span={6} offset={18}><ResetPassword></ResetPassword></Col>
|
|
58
|
+
</Row>
|
|
54
59
|
</div>
|
|
55
60
|
</div>
|
|
56
61
|
);
|
|
@@ -93,7 +93,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
93
93
|
loadData = async () => {
|
|
94
94
|
const {params} = this.props;
|
|
95
95
|
const {sourceId} = params;
|
|
96
|
-
|
|
96
|
+
|
|
97
97
|
let ltmplConfigRes: LtmplConfigRes = await HCDataSource.requestLtmplConfig(
|
|
98
98
|
null,
|
|
99
99
|
sourceId
|
|
@@ -298,7 +298,7 @@ class LtmplRoute extends React.PureComponent<LtmplRouteProps, LtmplRouteState> {
|
|
|
298
298
|
let params = Units.transQueryStrToParams(search, null);
|
|
299
299
|
params["pageNo"] = pageNo;
|
|
300
300
|
params["pageSize"] = pageSize;
|
|
301
|
-
|
|
301
|
+
|
|
302
302
|
this.doSearch(params);
|
|
303
303
|
};
|
|
304
304
|
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
Tooltip,
|
|
16
16
|
message,
|
|
17
17
|
} from "antd";
|
|
18
|
+
import HCService from "../tmpl/hcservice-v3";
|
|
18
19
|
import Table from "./control-table-x-axis-wrapper";
|
|
19
20
|
import {
|
|
20
21
|
AlignCenterOutlined,
|
|
@@ -82,6 +83,7 @@ import EditButton from "../detail/button/edit-button";
|
|
|
82
83
|
import ViewButton from "../detail/button/view-button";
|
|
83
84
|
import ProgramConfig from "../units";
|
|
84
85
|
import ModelSelectTable from "./../table/modal-select-table";
|
|
86
|
+
import NewinFileView from "../controls/file-view/newin-file-view";
|
|
85
87
|
|
|
86
88
|
const DragHandle = SortableHandle(() => (
|
|
87
89
|
<MenuOutlined style={{ cursor: "grab", color: "#999" }} />
|
|
@@ -424,7 +426,6 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
424
426
|
let itemType = SupportInputTypes.getSupportControlType(item);
|
|
425
427
|
if (s < 12 && item.title != "操作" && item.title != "序号") {
|
|
426
428
|
if (hiddenColIds.includes("10000")) {
|
|
427
|
-
// TableUnits.sort(column, itemType, "descend");
|
|
428
429
|
const order = this.handleColumnOrder(column["dataIndex"]);
|
|
429
430
|
|
|
430
431
|
if(item.sortable) {
|
|
@@ -695,6 +696,31 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
695
696
|
);
|
|
696
697
|
})
|
|
697
698
|
: ""}
|
|
699
|
+
{ltmplConfig.rowFileButtons &&
|
|
700
|
+
ltmplConfig.rowFileButtons.length > 0
|
|
701
|
+
? ltmplConfig.rowFileButtons.map((openFileButton) => {
|
|
702
|
+
let v= record[openFileButton.fieldId];
|
|
703
|
+
if(v){
|
|
704
|
+
if(v instanceof Array){
|
|
705
|
+
v=v[0];
|
|
706
|
+
}
|
|
707
|
+
if(v.includes("@R@")>0){
|
|
708
|
+
v=v.split("@R@")[1];
|
|
709
|
+
}
|
|
710
|
+
return (
|
|
711
|
+
<NewinFileView
|
|
712
|
+
title={openFileButton.title}
|
|
713
|
+
filePath={HCService.toFilePath(v, serverKey)}
|
|
714
|
+
serverKey={serverKey}
|
|
715
|
+
key={openFileButton.id}
|
|
716
|
+
//size={"small"}
|
|
717
|
+
/>
|
|
718
|
+
);
|
|
719
|
+
}else{
|
|
720
|
+
return "";
|
|
721
|
+
}
|
|
722
|
+
})
|
|
723
|
+
: ""}
|
|
698
724
|
{buttons.includes("singleDelete") &&
|
|
699
725
|
!readOnly &&
|
|
700
726
|
ActionUtils.isShow(
|
|
@@ -1366,11 +1392,11 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1366
1392
|
|
|
1367
1393
|
checkBoxUseful = () => {
|
|
1368
1394
|
const { ltmplConfig } = this.props;
|
|
1369
|
-
let { buttons, jumps, actions } = ltmplConfig;
|
|
1395
|
+
let { buttons, jumps, actions,fileExports } = ltmplConfig;
|
|
1370
1396
|
if (
|
|
1371
1397
|
buttons.includes("batchDelete") ||
|
|
1372
1398
|
(actions && actions.length > 0) ||
|
|
1373
|
-
(jumps && jumps.length > 0)
|
|
1399
|
+
(jumps && jumps.length > 0) || (fileExports && fileExports.length>0)
|
|
1374
1400
|
) {
|
|
1375
1401
|
return true;
|
|
1376
1402
|
} else {
|
|
@@ -1602,6 +1628,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1602
1628
|
return undefined;
|
|
1603
1629
|
}
|
|
1604
1630
|
|
|
1631
|
+
|
|
1632
|
+
|
|
1605
1633
|
render() {
|
|
1606
1634
|
let {
|
|
1607
1635
|
queryKey,
|
|
@@ -1697,6 +1725,8 @@ class ActTable extends React.PureComponent<ActTableProps, ActTableStat> {
|
|
|
1697
1725
|
</>
|
|
1698
1726
|
);
|
|
1699
1727
|
}
|
|
1728
|
+
|
|
1729
|
+
|
|
1700
1730
|
}
|
|
1701
1731
|
|
|
1702
1732
|
export default ActTable;
|
|
@@ -9,7 +9,7 @@ import utc from "dayjs/plugin/utc";
|
|
|
9
9
|
import timezone from "dayjs/plugin/timezone";
|
|
10
10
|
|
|
11
11
|
import {
|
|
12
|
-
CodeSource,
|
|
12
|
+
CodeSource, CommonFilePath,
|
|
13
13
|
DtmplConfig,
|
|
14
14
|
MenuConfigAPIType,
|
|
15
15
|
PageInfo,
|
|
@@ -31,6 +31,47 @@ export default class HcserviceV3 {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
static getJsonValue = (file) => {
|
|
35
|
+
let jsonFile = file;
|
|
36
|
+
if (!file) {
|
|
37
|
+
return undefined;
|
|
38
|
+
} else if (typeof (file) == 'string') {
|
|
39
|
+
jsonFile = JSON.parse(file);
|
|
40
|
+
}
|
|
41
|
+
return jsonFile;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static toFilePath(value,serverKey) {
|
|
45
|
+
if (!value) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
let filePath: CommonFilePath = {};
|
|
49
|
+
if (typeof (value) == 'string') {
|
|
50
|
+
if (value.toLowerCase().startsWith("http")) {
|
|
51
|
+
filePath.path = value;
|
|
52
|
+
filePath.fileName = this.getFileNameFrom(value);
|
|
53
|
+
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
54
|
+
} else if (value.toLowerCase().startsWith("/")) {
|
|
55
|
+
filePath.path = this.getFileUrl(serverKey, value);
|
|
56
|
+
filePath.fileName = this.getFileNameFrom(value);
|
|
57
|
+
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
58
|
+
} else {
|
|
59
|
+
let jsonValue = this.getJsonValue(value);
|
|
60
|
+
if (jsonValue) {
|
|
61
|
+
|
|
62
|
+
filePath.path = this.getFileUrl(serverKey, jsonValue.base?.path);
|
|
63
|
+
filePath.iconPath = jsonValue.icon?.path ? this.getFileUrl(serverKey, jsonValue.icon?.path) : null;
|
|
64
|
+
filePath.fileName = jsonValue.fileName ? jsonValue.fileName : this.getFileNameFrom(jsonValue.base?.path);
|
|
65
|
+
filePath.contentType = this.getFileSuffixFrom(filePath.fileName);
|
|
66
|
+
filePath.valid = jsonValue.valid;
|
|
67
|
+
filePath.baseType=jsonValue.base?.type;
|
|
68
|
+
filePath.basePath=jsonValue.base?.path;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return filePath;
|
|
73
|
+
}
|
|
74
|
+
|
|
34
75
|
static async requestEnumWithPath(serverKey: string, mstrucIds, path) {
|
|
35
76
|
if (mstrucIds.length > 0) {
|
|
36
77
|
let res = await Super.super({
|
|
@@ -992,10 +1033,16 @@ export default class HcserviceV3 {
|
|
|
992
1033
|
},
|
|
993
1034
|
method: "GET",
|
|
994
1035
|
});
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1036
|
+
if(res.passwordState){
|
|
1037
|
+
if(res.passwordState=="expiry"){
|
|
1038
|
+
message.warning(translate("${"+res.message+"}"), 10);
|
|
1039
|
+
}else if(res.passwordState=="expiried"){
|
|
1040
|
+
message.error(translate("${"+res.message+"}"), 10)
|
|
1041
|
+
}else if(res.passwordState=="restricted"){
|
|
1042
|
+
message.error(translate("${"+res.message+"}"), 15)
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
return {status:res.status,token:res.token};
|
|
999
1046
|
}
|
|
1000
1047
|
|
|
1001
1048
|
static async setContext(json) {
|