@beisen/tita-widget

1.12.6 • Public • Published

1) 封装组件注意事项

1. 所有有的文件名要保持一唯一
2. 所有的类名要保持和文件名一样
3. 只保留需要的有用的文件,
4. 样式表,去掉以前冗余的样式,样式表名称与组件文件夹名称一一对应

1.模板名称与view名称对应
2.ui查找通过data-name 
3.data-name 中需要加task-create-(***)
4.存储在model里数据 为驼峰式,首字母小写
5.日期显示时,当年的不显示是年,M/D,使用Context.formatDate
6.所有变量名称首字母小写
7.所有需要tipsy 里在滑上去才绑定
8.所有封装的view,需要在model里保存相关数据 

2)需要在页面打值

BSGlobal = {
	//租户信息
	"tenantInfo": {
		"Id": 204122
	}
	,"loginUserInfo": {
		"Id": 100360313
		,"Role": 4
	}
	,"apiPath": "http://webapi.tita-inc.com"
	,"titaHost":"" //有些需要跳转到tita 上面,比如说头像链接
}

3) task-list

1.依赖组件
	- talent,
	- UserSelector,
	- $.tipsy,
	- moment,
	- tita-network

2.在app/scripts/config.js,下增加,并依赖上面的组件
	'TitaWidget':'vendor/components/tita-widget/task-list'

3.使用方法如下:例


var mCollection = talent.Collection.extend({
	initialize:function(){
		this.model = talent.Model.extend({
			idAttribute:'Id'
		});
	}
});
var taskListView = new TitaWidget.TaskListView({
	collection:new mCollection(data)
});

this.$el.append(this.taskListView.render().el);

4.可选参数:
{
	'isShowKclass':true
	,'isShowOwnerTag': false // 是否显示我派发的,我参与的标签,上级安排
	,'isShowStar' : true // 是否显示星标
	,'isShowSetRemind' :false //显示设置提醒图标
	,'objType' : 7 // 如果出现闹钟提醒时,objtype要要有
	,'isShowDelete' : false
	,isChildTask : false //是否是子任务
	,pageSize:50   //一次加载的数量,超过50显示更多翻页
	,isShowPercent:false //是否显示任务完成度
}

4) pull-screen

	说明:
	如果要显示推拉屏,只需要改变推拉屏的model的id
	this.PullScreen.model.set('id',id);

	如果使用的是tita-widget中的task-list,不需要去绑定事件,也不要改变改变推拉屏的model的id,
	里面是监听全局事件global-pull-screen,而自动推拉屏的

	1.依赖组件
	 talent

	2.在app/scripts/config.js,下增加,并依赖上面的组件
		"PullScreen" : 'vendor/components/tita-widget/pull-screen'

	3.使用方法如下:例

	this.PullScreen = titaWidget.PullScreenView();
	this.$el.append(this.PullScreen.render().el);

4) 分享框 PublistMblogView

		'id':'pubMblog'//必填 
		/**
		* type: 默认feed, 如tita首面发动态,comment,如tita首页feed回复
		**/		   
		,'type':'feed'//type=comment; 
		,'maxlength':'1000'
		,'isLimit' : true
		,'defaultValue':'你在忙什么'
		,'value':''
		,'submitText':'发布'
		,'shape':'default'//line,default
		,'defaultHide':false
		,'inFocus':true//是否自动获得焦点
		,'toUserName':'' // 只有开启 type=comment 才生效

		//at all
		,'isShowAtAll':false
		,'atAllText':"所有同事"
		,'atAllValue':"@[所有同事:all_members] "
		,'atAllTipText':"所有同事将收到本条消息"

		//at
		,"isShowAt":true
		,'atText':"同事"
		,"atTipText":"想确保谁看到就@这个成员"

		////Attachment
		,"isShowAttachment":true

		//emotion
		,'isShowEmotion':true
		,'emotionText':'表情'

		//range:
		,"isShowRange":true
		,'privateText':'所有人可见'
		,'privateValue':1//1公开,2私密 3部门
		,'isShowRangeDropDown':true
		,'privateDropDownOptions':{
			'privateValue':1//1公开,2私密 3部门
		    ,'sort':[1,3,2]
		    ,'publicOptions':{ //公开 当为false,不可见
			     'name':'公开'
			     ,'des':'所有人可见'
		      }
		    ,'privateOptions':{ //私密 当为false,不可见
			   'name':'私密'
			   ,'des':'仅@的人可见'
		     }
		    ,'departmentOptions':{ //部门 当为false,不可见
			   'name':'部门可见'
			  ,'des':'仅我的部门可见'
		    }
		}

		//短信通知
		,'isShowSendSms':true
		,'params':{}
		,'submitRequest':function(options){
			var deferred = new Talent.$.Deferre;
			/*deferred.resolve(data);
			deferred.reject(msg);*/
			return deferred;
		}

5) 回复列表 CommentListView

		isPrivate':false // 是否私密私,私密是每条上会有个小锁
		,'privateTipText':'所有可见' //如果Model有,model优先
		,'actionMore':{
			'detail':true
			,'deleted':true
			,'setTop':false
		}
		,'defaultCount':4
		,'feedId':''
		,'sort':'append' //对回复列表进行排序,append 最新在下面,prepend 最新的在最在上面

6) feed列表 FeedListView

		"isInAppPage":false //true,在项目页等一些其它页面时,头像全部为人的头像
		,'onlyComment':false //只有回复列表
		/**
		*mBlogOptions:请参照 4) 分享框 PublistMblogView
		**/
		,'mBlogOptions':{ 
			'defaultHide':true
			,'defaultValue':''
		}//回复框设置
		,'custom':{
			'more':true
			,'remind':true
			,'collect':true
			,'reply':true
		}
		,'actionMore':{
			'detail':true
			,'delete':true
			,'setTop':true
			,'setTopPramas':{}
		}
		,'isPrivate':false
		,'privateTipText':''// 锁提示文字
		,'feedId':'' //如果onlyComment 为true时,就必需传feedid,否则添加回复时自己触发
		,'defaultCount':4  //默认显示几条回复
		,'sort':'append' //对回复列表进行排序,append 最新在下面,prepend 最新的在最在上面 绩效的widget 里,最新回复的在最上面

7) 带切换标签 FeedTabListView(例:tita首页)

8) 扩展信息 FeedExtraInfoListView

6) 操作记录 TrackView

######参数

	'defaultCount':4 //默认显示几条
事件
	showAll:点击展开,显示全部

#Changelog

tita-widget 整体升级

###0.2.12 修复: 1.任务列表里 ,任务完成之后,报错,缺少心得模板 2.feed 操作列表error

###0.2.11 修复: 1._.evaluation 报错

###0.2.10 修复: 1.开能目标产品的,分类不显示目标。 2.订制了不显示会议、出差,任务列表详情模式,依然显示会议出差

###0.2.9 增加了任务详情页,……

task-list

###0.2.8 支持心得

###0.2.7 修复bug:任务列不显示心得图标

###0.2.6 修复bug:任务列不显示沟通、工时图标

v 0.2.2

去掉了console.log

v 0.2.1

原来的多维数据结构,修改为一维数据结构 options: 增加了 data, 删除了 colltion 在new TaskListView 时 原来的数据 是 附给 colletion的,现在靠data 传送

pull-screen

0.2.3

因受过期影响,把任务详情页的地址修改为: http://www.tita.com/100055587/ITalentHome/#more/taskinfo?Id=110006_2033626_7_20_635800846411257164

原地地 http://www.tita.com/u/100055587/Home/#more/taskinfo?Id=110006_2033626_7_20_635800846411257164

##feed ###0.2.4 支持来自手机端的换行

Readme

Keywords

Package Sidebar

Install

npm i @beisen/tita-widget

Weekly Downloads

32

Version

1.12.6

License

ISC

Unpacked Size

17.2 MB

Total Files

1143

Last publish

Collaborators

  • beisencorp