diff --git a/components/apolloTable/component/Cell.tsx b/components/apolloTable/component/Cell.tsx
index 10263123f687b2b69dd2f589d94c71416d703dfd..3f696e2347ef1958ad692639520f43e5350f6f24 100644
--- a/components/apolloTable/component/Cell.tsx
+++ b/components/apolloTable/component/Cell.tsx
@@ -250,7 +250,7 @@ const Cell = (props: CellProps) => {
const EditComp: any = editConfig.cellComp;
const transferColumn = transferAttr(columnType, {
- ...(config.componentAttr || {}),
+ ...(editConfig.componentAttr || {}),
...(columnConfig.columnAttrObj || {}),
});
const newProps = {
diff --git a/components/apolloTable/component/base/_utils/getFormatter.tsx b/components/apolloTable/component/base/_utils/getFormatter.tsx
index 930b71dcd47dc355e9fc7d6cef91f37a55ab6820..0415a2b5aa2a64f96a0b20f028910f93644cace8 100644
--- a/components/apolloTable/component/base/_utils/getFormatter.tsx
+++ b/components/apolloTable/component/base/_utils/getFormatter.tsx
@@ -47,8 +47,10 @@ export const GetFormatter = {
},
MULTIPLE_SELECT: (val) => {
// 处理成[{}]结构
- const obj = val[0] || {};
- return { key: obj.value, label: obj.text };
+ if (!Array.isArray(val) || val.length === 0) return undefined;
+ return val.map((item) => {
+ return { key: item.value, label: item.text };
+ });
},
TEXT_SELECT: (val) => {
return GetFormatter.SELECT(val);
diff --git a/components/apolloTable/component/base/detail/input/index.less b/components/apolloTable/component/base/detail/input/index.less
index 28578af43409aafd6f3cddf0fc5691a87e481315..0e181bf40ce791b9b21eea085c2212e2caaf4048 100644
--- a/components/apolloTable/component/base/detail/input/index.less
+++ b/components/apolloTable/component/base/detail/input/index.less
@@ -6,15 +6,16 @@
width: 100%;
height: 100%;
align-items: center;
- .text {
- width: 100%;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
.itemBgTxt {
position: absolute;
z-index: -1;
visibility: hidden;
}
}
+.text {
+ width: 100%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ word-break: break-all;
+}
diff --git a/components/apolloTable/component/base/detail/input/index.tsx b/components/apolloTable/component/base/detail/input/index.tsx
index e7ca55f2144b57990519e77d36f5b44ad6588a73..462666c278cf29c552d7f70d509010bf59518521 100644
--- a/components/apolloTable/component/base/detail/input/index.tsx
+++ b/components/apolloTable/component/base/detail/input/index.tsx
@@ -5,7 +5,7 @@ import styles from './index.less';
import { InputProps } from '../detailInterface';
export const ApolloInputDetail = (props: InputProps) => {
- const { className } = props;
+ const { className, origin } = props;
const value = props.formatter ? props.formatter(props.value) : props.value;
if (!value) {
return null;
@@ -25,6 +25,10 @@ export const ApolloInputDetail = (props: InputProps) => {
}
}, [value]);
+ if (origin === 'detailForm') {
+ return
{value}
;
+ }
+
if (typeof value === 'string') {
return (
diff --git a/components/apolloTable/component/base/edit/select/index.tsx b/components/apolloTable/component/base/edit/select/index.tsx
index 6e5bf0982854f998d142b35ed18a6ecb2e783921..5312c432d61b18b966eb8c5d551bda00ec4d3065 100644
--- a/components/apolloTable/component/base/edit/select/index.tsx
+++ b/components/apolloTable/component/base/edit/select/index.tsx
@@ -5,9 +5,9 @@ import { antiAssign } from '../../../../utils/utils';
import styles from './styles.less';
export const ApolloSelect = (props: ApolloSelectProps) => {
- const { options = [], onChange, isMultiple, isMobile } = props;
+ const { options = [], onChange, isMultiple } = props;
const selfProps = antiAssign(props, ['columnConfig', 'onChange', 'isMultiple', 'options']);
- const changeValue = (value, option) => {
+ const changeValue = (value: any, option: any) => {
if (typeof onChange === 'function') {
onChange(value, option);
}
@@ -16,9 +16,12 @@ export const ApolloSelect = (props: ApolloSelectProps) => {
if (isMultiple) {
selfProps.mode = 'multiple';
}
-
return (
-