Commit ba12ccad authored by zhangwenshuai's avatar zhangwenshuai

update apolloTable upload

parent 8a5c07f6
...@@ -16,7 +16,6 @@ export const ApolloSelect = (props: ApolloSelectProps) => { ...@@ -16,7 +16,6 @@ export const ApolloSelect = (props: ApolloSelectProps) => {
if (isMultiple) { if (isMultiple) {
selfProps.mode = 'multiple'; selfProps.mode = 'multiple';
} }
debugger
return ( return (
<Select <Select
className={styles.select} className={styles.select}
......
...@@ -6,10 +6,15 @@ ...@@ -6,10 +6,15 @@
display: flex; display: flex;
align-items: center; align-items: center;
border: 1px solid @primaryColor; border: 1px solid @primaryColor;
min-height: 32px;
&.disabled {
background: @disabledColor;
border-color: #d9d9d9;
}
.add { .add {
cursor: pointer; cursor: pointer;
font-size: @textFontGen; font-size: @textFontGen;
.addIcon{ .addIcon {
width: 12px; width: 12px;
} }
} }
......
import React, { useEffect, useRef, useState } from 'react'; import React, { useEffect, useRef, useState } from 'react';
import { Modal, Tooltip } from 'antd'; import { Modal, Tooltip } from 'antd';
import classNames from 'classnames';
import { ApolloUploadProps } from '../editInterface'; import { ApolloUploadProps } from '../editInterface';
import { antiAssign } from '../../../../utils/utils'; import { antiAssign } from '../../../../utils/utils';
import s from './index.less'; import s from './index.less';
...@@ -7,7 +8,7 @@ import Upload from '../../extra/upload'; ...@@ -7,7 +8,7 @@ import Upload from '../../extra/upload';
import addIcon from '../../../../assets/addIcon.png'; import addIcon from '../../../../assets/addIcon.png';
export const ApolloUpload = (props: ApolloUploadProps) => { export const ApolloUpload = (props: ApolloUploadProps) => {
const { isMultiple, onEmitChange } = props; const { isMultiple, onEmitChange, onChange, disabled } = props;
const selfProps = antiAssign(props, ['onChange', 'value']); const selfProps = antiAssign(props, ['onChange', 'value']);
if (isMultiple) { if (isMultiple) {
selfProps.multiple = true; selfProps.multiple = true;
...@@ -45,6 +46,9 @@ export const ApolloUpload = (props: ApolloUploadProps) => { ...@@ -45,6 +46,9 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
if (typeof onEmitChange === 'function') { if (typeof onEmitChange === 'function') {
onEmitChange(value); onEmitChange(value);
} }
if (typeof onChange === 'function') {
onChange(value);
}
toggleUploadDialog(false); toggleUploadDialog(false);
}; };
const onCancel = () => { const onCancel = () => {
...@@ -58,10 +62,12 @@ export const ApolloUpload = (props: ApolloUploadProps) => { ...@@ -58,10 +62,12 @@ export const ApolloUpload = (props: ApolloUploadProps) => {
e.nativeEvent.stopImmediatePropagation(); e.nativeEvent.stopImmediatePropagation();
}; };
return ( return (
<div className={s.container} onClick={onClickContainer}> <div className={disabled ? classNames(s.container, s.disabled) : s.container} onClick={onClickContainer}>
{!disabled && (
<div className={s.add} onClick={toggleUploadDialog.bind(null, true)}> <div className={s.add} onClick={toggleUploadDialog.bind(null, true)}>
<img alt="" className={s.addIcon} src={addIcon} /> <img alt="" className={s.addIcon} src={addIcon} />
</div> </div>
)}
{value && {value &&
value.map((item, i) => { value.map((item, i) => {
return ( return (
......
...@@ -4,7 +4,7 @@ import { transferAttr } from '../component/base/_utils/transferAttr'; ...@@ -4,7 +4,7 @@ import { transferAttr } from '../component/base/_utils/transferAttr';
import styles from './index.less'; import styles from './index.less';
const DetailForm = (props: any) => { const DetailForm = (props: any) => {
const { data, rowData, title, goEdit } = props; const { data, rowData, title, goEdit, hideEditBtn } = props;
const renderDetailForm = (item: any) => { const renderDetailForm = (item: any) => {
const { columnType, columnAttrObj, value, renderDetailForm } = item; const { columnType, columnAttrObj, value, renderDetailForm } = item;
let detailConfig; let detailConfig;
...@@ -51,7 +51,7 @@ const DetailForm = (props: any) => { ...@@ -51,7 +51,7 @@ const DetailForm = (props: any) => {
<div className={styles.wrap}> <div className={styles.wrap}>
<div className={styles.titleRow}> <div className={styles.titleRow}>
<div className={styles.titleCls}>{title}</div> <div className={styles.titleCls}>{title}</div>
{renderBtn()} {!hideEditBtn && renderBtn()}
</div> </div>
<div id="gotop" className={styles.formWrap}> <div id="gotop" className={styles.formWrap}>
{data.map((item: any, index: number) => { {data.map((item: any, index: number) => {
......
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