Commit ba12ccad authored by zhangwenshuai's avatar zhangwenshuai

update apolloTable upload

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