Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
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
ReactWeb5
wisdom-components
Commits
5e77ceb9
Commit
5e77ceb9
authored
Jun 27, 2022
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改
parent
61b4010f
Pipeline
#53962
failed with stages
in 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
105 deletions
+0
-105
index.js
packages/base-components/RichText/index.js
+0
-62
index.js
packages/base-components/RichText/src/index.js
+0
-43
No files found.
packages/base-components/RichText/index.js
deleted
100644 → 0
View file @
61b4010f
/* eslint-disable react-hooks/exhaustive-deps */
import
{
Spin
}
from
'antd'
;
import
PropTypes
from
'prop-types'
;
import
{
useEffect
,
useState
}
from
'react'
;
let
timer
=
null
;
const
LoadBox
=
({
delay
,
indicator
,
size
,
tip
,
wrapperClassName
,
timeout
,
timeoutTip
,
spinning
,
})
=>
{
const
[
loadTip
,
setloadTip
]
=
useState
(
tip
);
useEffect
(()
=>
{
setloadTip
(
tip
);
if
(
timer
)
clearTimeout
(
timer
);
if
(
spinning
)
timer
=
setTimeout
(()
=>
{
setloadTip
(
timeoutTip
);
},
timeout
);
return
()
=>
{
if
(
timer
)
clearTimeout
(
timer
);
};
},
[
spinning
]);
return
(
<
Spin
delay
=
{
delay
}
spinning
=
{
spinning
}
indicator
=
{
indicator
}
size
=
{
size
}
tip
=
{
loadTip
}
wrapperClassName
=
{
wrapperClassName
}
><
/Spin
>
);
};
LoadBox
.
defaultProps
=
{
spinning
:
true
,
delay
:
0
,
indicator
:
''
,
size
:
'default'
,
tip
:
''
,
wrapperClassName
:
''
,
timeout
:
3000
,
timeoutTip
:
'正在加载数据,请耐心等待...'
,
};
LoadBox
.
propTypes
=
{
spinning
:
PropTypes
.
bool
,
// 是否为加载中状态
delay
:
PropTypes
.
number
,
// 延迟显示加载效果的时间(防止闪烁)
indicator
:
PropTypes
.
node
,
// 加载指示符
size
:
PropTypes
.
string
,
// 组件大小,可选值为 small default large
tip
:
PropTypes
.
string
,
// 当作为包裹元素时,可以自定义描述文案
wrapperClassName
:
PropTypes
.
string
,
// 包装器的类属性
timeout
:
PropTypes
.
number
,
// 超时时间
timeoutTip
:
PropTypes
.
string
,
// 超时时间提示
};
export
default
LoadBox
;
packages/base-components/RichText/src/index.js
View file @
5e77ceb9
/*
* @Title:富文本编辑器
* @Author: hongmye
* @Date: 2022-03-01 14:23:55
*/
/**
* 1.引入组件 import RichText from '@/components/RichText';
* 示例:<RichText
content={this.state.content}
personList={this.state.personList}
placeholder={'placeholder属性值'}
onChange={val => {
this.setState({ content: val });
}}
onChangeFile={arr => {
this.setState({ fileList: arr });
}}
fileList={this.state.fileList}
projectId={19}
ref={this.myRichText}
/>
*
* 2.传递方法 onChange 每次更改内容回调
*
* 3.传值接收 可选值 projectId 项目id,根据项目id获取项目参与人员,
* 可选值 personList 人员列表 示例:[{userId:1,userName:'xxx'}]
* 可选值 config 框架wangEditor的配置参数
*
* 4.注意事项 projectId和personList只用传一个,projectId优先级高于personList
* content内容如果不是初始有的,可调用setHtml设置内容
*
* 2022-03-21新增图片预览,附件上传功能
* 新增方法:onChangeFile 每次附件更改回调 若不传则不显示附件上传按钮
* fileList 附件列表 示例:[{name:'xxx.jpg',type:'image/jpg',size:8192,path:'xxxx'}]
* 其中name和path是必传的,type为图片可以预览,其它类型文件直接下载
*
* 2022-04-29 修改@人员列表逻辑
* personList 传任务相关人员列表(如 创建、负责、跟进人),同时传入projectId,personList
* 下拉列表默认显示为任务相关人员,加项目人员(做了去重,任务相关人员在最上面)
* @搜索时,搜索全部人员
*/
import
{
Image
,
message
,
Spin
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
forwardRef
,
useEffect
,
useImperativeHandle
,
useRef
,
useState
}
from
'react'
;
...
...
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