@jiangood/springboot-admin-starter 0.0.8 → 0.0.9
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/package.json +1 -1
- package/src/framework/field-components/FieldDateRange.jsx +4 -2
- package/src/framework/field-components/FieldNumberRange.d.ts +13 -0
- package/src/framework/field-components/FieldNumberRange.jsx +59 -0
- package/src/framework/field-components/index.ts +1 -0
- package/src/framework/utils/StringUtils.ts +2 -0
- package/src/pages/flowable/InstanceInfo.jsx +6 -4
package/package.json
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
import React from "react";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import {DatePicker, TimePicker} from "antd";
|
|
7
|
+
import {StringUtils} from "../utils";
|
|
7
8
|
|
|
9
|
+
const SP = StringUtils.ISO_SPLITTER;
|
|
8
10
|
|
|
9
11
|
export class FieldDateRange extends React.Component {
|
|
10
12
|
static defaultProps = {
|
|
@@ -82,7 +84,7 @@ export class FieldDateRange extends React.Component {
|
|
|
82
84
|
return null;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
const arr = v.split(
|
|
87
|
+
const arr = v.split(SP)
|
|
86
88
|
let s1 = arr[0];
|
|
87
89
|
let s2 = arr[1];
|
|
88
90
|
return [dayjs(s1), dayjs(s2)]
|
|
@@ -95,7 +97,7 @@ export class FieldDateRange extends React.Component {
|
|
|
95
97
|
const s1 = d1 ? d1.format(fmt) : ""
|
|
96
98
|
const s2 = d2 ? d2.format(fmt) : "";
|
|
97
99
|
|
|
98
|
-
return s1 +
|
|
100
|
+
return s1 + SP + s2
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {InputNumber} from "antd";
|
|
3
|
+
import {StringUtils} from "../utils";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const SP = StringUtils.ISO_SPLITTER;
|
|
7
|
+
|
|
8
|
+
export class FieldNumberRange extends React.Component {
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
onChangeA = (a) => {
|
|
12
|
+
const {b} = this.parse(this.props.value)
|
|
13
|
+
this.props.onChange && this.props.onChange(this.merge(a, b))
|
|
14
|
+
}
|
|
15
|
+
onChangeB = (b) => {
|
|
16
|
+
const {a} = this.parse(this.props.value)
|
|
17
|
+
this.props.onChange && this.props.onChange(this.merge(a, b))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
merge(a, b) {
|
|
21
|
+
if (a == null) {
|
|
22
|
+
a = ''
|
|
23
|
+
}
|
|
24
|
+
if (b == null) {
|
|
25
|
+
b = ''
|
|
26
|
+
}
|
|
27
|
+
return a + SP + b;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
parse(v) {
|
|
31
|
+
if (v == null) {
|
|
32
|
+
return {a: null, b: null}
|
|
33
|
+
}
|
|
34
|
+
const arr = v.split(SP);
|
|
35
|
+
return {a: arr[0], b: arr[1]}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
componentDidMount() {
|
|
39
|
+
let {value, defaultValue} = this.props
|
|
40
|
+
if (value == null) {
|
|
41
|
+
this.props.onChange && this.props.onChange(defaultValue)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
render() {
|
|
48
|
+
let {value, defaultValue} = this.props
|
|
49
|
+
if (value == null) {
|
|
50
|
+
value = defaultValue
|
|
51
|
+
}
|
|
52
|
+
const {a, b} = this.parse(value)
|
|
53
|
+
|
|
54
|
+
return <div style={{display: 'flex', alignItems: 'center'}}>
|
|
55
|
+
<InputNumber value={a} onChange={this.onChangeA}/> - <InputNumber value={b} onChange={this.onChangeB}/>
|
|
56
|
+
</div>
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
@@ -11,6 +11,7 @@ export * from './FieldRemoteTreeSelectMultiple'
|
|
|
11
11
|
export * from './FieldBoolean';
|
|
12
12
|
export * from './FieldDate';
|
|
13
13
|
export * from './FieldDateRange';
|
|
14
|
+
export * from './FieldNumberRange';
|
|
14
15
|
export * from './FieldTable'
|
|
15
16
|
export * from './FieldTableSelect'
|
|
16
17
|
export * from './FieldSysOrgTreeSelect'
|
|
@@ -117,16 +117,18 @@ export default class InstanceInfo extends React.Component {
|
|
|
117
117
|
renderForm = () => {
|
|
118
118
|
const {data} = this.state
|
|
119
119
|
const {processDefinitionKey, businessKey} = data
|
|
120
|
+
const formKey = this.props.formKey || processDefinitionKey;
|
|
121
|
+
const formName = formKey + 'Form'
|
|
120
122
|
|
|
121
|
-
let formKey = this.props.formKey || processDefinitionKey + 'Form';
|
|
122
|
-
let ExForm = FormRegistryUtils.get(
|
|
123
|
+
// let formKey = this.props.formKey || processDefinitionKey + 'Form';
|
|
124
|
+
let ExForm = FormRegistryUtils.get(formName);
|
|
123
125
|
if (!ExForm) {
|
|
124
126
|
return <div>
|
|
125
127
|
<p>
|
|
126
|
-
|
|
128
|
+
未创建表单 {formName}。
|
|
127
129
|
</p>
|
|
128
130
|
<Typography.Text>
|
|
129
|
-
表单路径:src/forms/{
|
|
131
|
+
表单路径:src/forms/{formName}.jsx
|
|
130
132
|
</Typography.Text>
|
|
131
133
|
</div>
|
|
132
134
|
}
|