Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
ems3.3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wuhao
ems3.3
Commits
355184c3
Commit
355184c3
authored
Aug 31, 2023
by
左玲玲
😬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1725
parent
7fc08338
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
62 deletions
+62
-62
FormItems.jsx
src/components/InitForm/FormItems.jsx
+62
-62
No files found.
src/components/InitForm/FormItems.jsx
View file @
355184c3
...
@@ -186,15 +186,15 @@ function Input({ item, colProps }) {
...
@@ -186,15 +186,15 @@ function Input({ item, colProps }) {
const
defaultrule
=
const
defaultrule
=
keys
.
indexOf
(
'phone'
)
!=
-
1
keys
.
indexOf
(
'phone'
)
!=
-
1
?
{
?
{
pattern
:
/^
(((\d{3,4}
-
)?[
0-9
]{7,8})
|
(
1
(
3|4|5|6|7|8|9
)\d{9}))
$/
,
pattern
:
/^
(((\d{3,4}
-
)?[
0-9
]{7,8})
|
(
1
(
3|4|5|6|7|8|9
)\d{9}))
$/
,
message
:
item
.
title
+
'格式不正确'
,
message
:
item
.
title
+
'格式不正确'
,
}
}
:
keys
.
indexOf
(
'mail'
)
!=
-
1
:
keys
.
indexOf
(
'mail'
)
!=
-
1
?
{
?
{
pattern
:
/^
[
a-z0-9A-Z
]
+
[
- | a-z0-9A-Z . _
]
+@
([
a-z0-9A-Z
]
+
(
-
[
a-z0-9A-Z
]
+
)?\.)
+
[
a-z
]{2,}
$/
,
pattern
:
/^
[
a-z0-9A-Z
]
+
[
- | a-z0-9A-Z . _
]
+@
([
a-z0-9A-Z
]
+
(
-
[
a-z0-9A-Z
]
+
)?\.)
+
[
a-z
]{2,}
$/
,
message
:
'邮箱格式不正确'
,
message
:
'邮箱格式不正确'
,
}
}
:
{};
:
{};
return
(
return
(
<>
<>
...
@@ -585,7 +585,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -585,7 +585,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
formRef?.current?.setFieldsValue({ [curkey]: ifclean });
formRef?.current?.setFieldsValue({ [curkey]: ifclean });
}
}
return
res?.data?.dataList ??
[];
return
item.showAll && res?.data?.dataList?.length > 0 ? [{ label: '全部', key: 'all' }, ...res?.data?.dataList] :
[];
}}
}}
showSearch
showSearch
/>
/>
...
@@ -598,19 +598,19 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -598,19 +598,19 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
function NolinkSelect({ item, colProps }) {
function NolinkSelect({ item, colProps }) {
let options = {
let options = {
options: [],
options: [],
},
},
curoption = item.options ?? null;
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
if (Array.isArray(curoption)) {
options = {
options = {
options: [...curoption],
options:
item.showAll && curoption?.length > 0 ? [{ label: '全部', key: 'all' }] :
[...curoption],
};
};
} else if (curoption) {
} else if (curoption) {
options = {
options = {
request: async (params) => {
request: async (params) => {
let list = await doFetch({ url: curoption?.path, params: curoption?.params });
let list = await doFetch({ url: curoption?.path, params: curoption?.params });
return
list.data.dataList
;
return
item.showAll && list?.data?.dataList?.length > 0 ? [{ label: '全部', key: 'all' }, ...list?.data?.dataList] : []
;
},
},
};
};
}
}
...
@@ -720,8 +720,8 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
...
@@ -720,8 +720,8 @@ function LinkTreeSelect({ item, colProps, formRef, name, curindex }) {
function NolinkTreeSelect({ item, colProps }) {
function NolinkTreeSelect({ item, colProps }) {
let options = {
let options = {
options: [],
options: [],
},
},
curoption = item.options ?? null;
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
if (Array.isArray(curoption)) {
...
@@ -845,8 +845,8 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
...
@@ -845,8 +845,8 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
function NolinkCheckbox({ item, colProps }) {
function NolinkCheckbox({ item, colProps }) {
let options = {
let options = {
options: [],
options: [],
},
},
curoption = item.options ?? null;
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
if (Array.isArray(curoption)) {
...
@@ -965,8 +965,8 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
...
@@ -965,8 +965,8 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
function NolinkRadio({ item, colProps }) {
function NolinkRadio({ item, colProps }) {
let options = {
let options = {
options: [],
options: [],
},
},
curoption = item.options ?? null;
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
if (Array.isArray(curoption)) {
...
@@ -1079,8 +1079,8 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
...
@@ -1079,8 +1079,8 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
function NolinkCascader({ item, colProps }) {
function NolinkCascader({ item, colProps }) {
let options = {
let options = {
options: [],
options: [],
},
},
curoption = item.options ?? null;
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
if (Array.isArray(curoption)) {
...
@@ -1610,58 +1610,58 @@ function TableSelect({ item, value, onChange, params = {} }) {
...
@@ -1610,58 +1610,58 @@ function TableSelect({ item, value, onChange, params = {} }) {
items={
items={
selectedRows.length > 0
selectedRows.length > 0
? selectedRows.map((it) => ({
? selectedRows.map((it) => ({
key: it[rowKey],
key: it[rowKey],
label: (
label: (
<div
<div
className="spread"
className="spread"
onClick={(e) => {
e.stopPropagation();
let key = it[rowKey];
setchooses((s) => {
let news = [...s];
if (s.includes(key)) {
news = news.filter((it) => {
return it != key;
});
} else {
news.push(key);
}
return news;
});
}}
>
<span
style={{
color: chooses.includes(it[rowKey]) ? '#1890ff' : '#333333',
transition: 'all 0.4s',
userSelect: 'none',
}}
>
{it[item.rowName]}
</span>
<CloseOutlined
onClick={(e) => {
onClick={(e) => {
e.stopPropagation();
e.stopPropagation();
let key = it[rowKey];
let newvalue = value.filter((its) => its[rowKey] != it[rowKey]);
onChange(newvalue);
setchooses((s) => {
setchooses((s) => {
let news = [...s];
let news = [...s];
if (s.includes(key)) {
news = news.filter((its) => {
news = news.filter((it) => {
return its != it[rowKey];
return it != key;
});
});
} else {
news.push(key);
}
return news;
return news;
});
});
}}
}}
>
/>
<span
</div>
style={{
),
color: chooses.includes(it[rowKey]) ? '#1890ff' : '#333333',
}))
transition: 'all 0.4s',
userSelect: 'none',
}}
>
{it[item.rowName]}
</span>
<CloseOutlined
onClick={(e) => {
e.stopPropagation();
let newvalue = value.filter((its) => its[rowKey] != it[rowKey]);
onChange(newvalue);
setchooses((s) => {
let news = [...s];
news = news.filter((its) => {
return its != it[rowKey];
});
return news;
});
}}
/>
</div>
),
}))
: [
: [
{
{
key: -1,
key: -1,
label: '请先选择',
label: '请先选择',
},
},
]
]
}
}
/>
/>
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment