@beisen-cmps/cooperation

1.3.7 • Public • Published

协作组件

参数说明

interface IProps {
 	id: string | number; //feed_id 无默认
	isShowHead?: boolean; //是否显示头部 默认 true
	isOpenReward?: boolean; //是否开通打赏  默认false
	cooperationHeadName?: string; //协作组件title名称 默认“协作”
	isShowOperationRecord?: boolean; //是否显示操作记录 默认true
	extendedComponentsData?: Array<ComponentsData>; //扩展  上部tab扩展
	userAdvanceMode?: boolean; //是否开启选人组件的高级模式 默认false
	isShowMentionAllBtn?: boolean; //是否显示@所有同事的按钮 默认true
	isShowMentionBtn?: boolean; //是否显示@同事按钮 默认true
	isShowEmojyBtn?: boolean; //是否显示表情包按钮 默认true
	isShowUploadBtn?: boolean; //是否显示上传按钮 默认 true
	isExtendBefor?:boolean;// 是否将扩展字段插入到tab前面显示 默认 false
	operationBtnExternal?: React.ReactElement | React.ReactElement[]; //下方沟通组件的扩展字段
}

interface ComponentsData{
	text:string; //显示的名称
	name:string, //内部标示key值
	components:ReactNode //下方需要显示的扩展内容
}
peerDependencies: {
		"react": "16.x.x",
		"react-dom": "16.x.x",
		"styled-components": "^4.2.0"
	}
//注意:组件内部使用Bsglobal里的相关字段,请确保承载页里有tenantInfo(租户信息)、loginUserInfo(用户信息)、apiPath(主站地址)

##配置说明

示例代码

// 一般用法
import * as React from 'react';
import Cooperation from './../../src/index';
interface IProps {}
const Test: React.FunctionComponent<IProps> = () => {
	const testProps = {
		id: '12312',
		isShowHead: false, //是否显示头部
		isShowOperationRecord: true,
		isOpenReward: false,
		cooperationHeadName: '协作',
		extendedComponentsData: [
			{ text: '扩展', name: 'test', components: <div>test</div> }
		],
		isShowMentionAllBtn: false,
		userAdvanceMode: true,
		isShowMentionBtn: false,
		isShowEmojyBtn: false,
		isShowVisible: true,
		operationBtnExternal: <div>扩展按钮</div>
	};
	return <Cooperation {...testProps} />;
};

export default Test;


##兼容性说明
1、ie、edge浏览器不支持粘贴上传
2、不支持windows系统下在资源管理器直接复制图片进行粘贴上传,支持截图粘贴上传

Readme

Keywords

none

Package Sidebar

Install

npm i @beisen-cmps/cooperation

Weekly Downloads

82

Version

1.3.7

License

ISC

Unpacked Size

120 kB

Total Files

40

Last publish

Collaborators

  • beisencorp