Commit 355184c3 authored by 左玲玲's avatar 左玲玲 😬

1725

parent 7fc08338
......@@ -186,15 +186,15 @@ function Input({ item, colProps }) {
const defaultrule =
keys.indexOf('phone') != -1
? {
pattern: /^(((\d{3,4}-)?[0-9]{7,8})|(1(3|4|5|6|7|8|9)\d{9}))$/,
message: item.title + '格式不正确',
}
pattern: /^(((\d{3,4}-)?[0-9]{7,8})|(1(3|4|5|6|7|8|9)\d{9}))$/,
message: item.title + '格式不正确',
}
: keys.indexOf('mail') != -1
? {
? {
pattern: /^[a-z0-9A-Z]+[- | a-z0-9A-Z . _]+@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\.)+[a-z]{2,}$/,
message: '邮箱格式不正确',
}
: {};
: {};
return (
<>
......@@ -585,7 +585,7 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
formRef?.current?.setFieldsValue({ [curkey]: ifclean });
}
return res?.data?.dataList ?? [];
return item.showAll && res?.data?.dataList?.length > 0 ? [{ label: '全部', key: 'all' }, ...res?.data?.dataList] : [];
}}
showSearch
/>
......@@ -598,19 +598,19 @@ function LinkSelect({ item, colProps, formRef, name, curindex }) {
function NolinkSelect({ item, colProps }) {
let options = {
options: [],
},
options: [],
},
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
options = {
options: [...curoption],
options: item.showAll && curoption?.length > 0 ? [{ label: '全部', key: 'all' }] : [...curoption],
};
} else if (curoption) {
options = {
request: async (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 }) {
function NolinkTreeSelect({ item, colProps }) {
let options = {
options: [],
},
options: [],
},
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
......@@ -845,8 +845,8 @@ function LinkCheckbox({ item, colProps, formRef, name, curindex }) {
function NolinkCheckbox({ item, colProps }) {
let options = {
options: [],
},
options: [],
},
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
......@@ -965,8 +965,8 @@ function LinkRadio({ item, colProps, formRef, name, curindex }) {
function NolinkRadio({ item, colProps }) {
let options = {
options: [],
},
options: [],
},
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
......@@ -1079,8 +1079,8 @@ function LinkCascader({ item, colProps, formRef, name, curindex }) {
function NolinkCascader({ item, colProps }) {
let options = {
options: [],
},
options: [],
},
curoption = item.options ?? null;
if (Array.isArray(curoption)) {
......@@ -1610,58 +1610,58 @@ function TableSelect({ item, value, onChange, params = {} }) {
items={
selectedRows.length > 0
? selectedRows.map((it) => ({
key: it[rowKey],
label: (
<div
className="spread"
key: it[rowKey],
label: (
<div
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) => {
e.stopPropagation();
let key = it[rowKey];
let newvalue = value.filter((its) => its[rowKey] != it[rowKey]);
onChange(newvalue);
setchooses((s) => {
let news = [...s];
if (s.includes(key)) {
news = news.filter((it) => {
return it != key;
});
} else {
news.push(key);
}
news = news.filter((its) => {
return its != it[rowKey];
});
return news;
});
}}
>
<span
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>
),
}))
/>
</div>
),
}))
: [
{
key: -1,
label: '请先选择',
},
]
{
key: -1,
label: '请先选择',
},
]
}
/>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment