italent-task-item v1.1.19
任务项展示组件
API
成员 | 类型 | 说明 |
---|---|---|
item | object | 任务项的数据 |
controlData | object | 任务项的权限控制信息和回调 |
controlData成员 | 类型 | 说明 |
---|---|---|
isDetail | Boolean | 是否详情模式 |
isCanEdit | Boolean | 任务是否可编辑,默认true, |
isCanEditStatus | Boolean | 是否可以编辑任务状态,默认true,选项为true且isCanEdit为true时可编辑 |
isCanEditTime | Boolean | 是否可以编辑时间,默认true,选项为true且isCanEdit为true时可编辑 |
isCanEditPerson | Boolean | 是否可以编辑任务负责人,默认true,选项为true且isCanEdit为true时可编辑 |
isShowPriority | Boolean | 是否显示优先级,默认true,预留 |
isShowStatus | Boolean | 是否显示任务状态,默认true,预留 |
isShowTag | Boolean | 是否显示名称后面的tag |
isExpand | Boolean | 子任务是否展开,默认为false |
isDistributed | Boolean | 是否为我派发的视图 |
handleClickAllItem | Function | 点击整条任务事件,参数节点、任务id |
handleChangeStatus | Function | 点击修改任务状态,参数:节点、任务id、修改后的任务状态 (1:未完成,2:完成) |
handleOpenOrCloseChile | Function | 点击打开或者关闭子任务,参数:节点、打开或者关闭状态 (true:打开,false:关闭) |
handleChangeTaskUser | Function | 点击头像负责人部分,参数:节点、任务id,负责人id |
handleChangeTaskTime | Function | 点击时间部分,参数:节点,任务id,开始时间,结束时间 |
handleClickTaskName | Function | 点击任务名称部分,参数:节点,任务id |
handleClickProgress | Function | 点击更新进展 |
handleClickRemind | Function | 点击提醒 |
handleClickReward | Function | 点击打赏 |
handleClickCommunicate | Function | 点击回复 |
示例
const item = {
taskId: '111111', //任务ID
taskName: '任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务任务', //任务名
counter: {
commentTotal: 0
},
principalUser: {
avatar: {
HasAvatar: true,
Small: '//cache.tita.com/Image/110006/5b298394cc7d4a0fb3019bc9a1d238cb_s.png',
Color: ''
},
name: "张三",
userId: 123456,
}, //任务负责人
priority: 3, //任务优先级
status: status, //任务状态
editable: true, //任务是否可编辑
startDate: "2018/01/02", //任务开始时间
deadLine: '2018/02/02', //任务截止时间
remainDay: 4, //剩余几天,前段判断如果大于3,显示截止时间
subTaskTotal: 2, //任务子任务数
parentTaskId: '222222', //任务母任务ID
isApply: false, //任务是否是申请中
isSuperior: true, // 是否上级派发
isEvaluated: true, // 是否已评价
rewardNum: 2, //打赏数
newExperence: '啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦',
hasSubTask: true, //任务是否有子任务
subTask: [
{
taskId: '222222', //任务ID
taskName: '子任务1', //任务名
principalUser: {
avatar: {
hasAvatar: true,
small: '//cache.tita.com/Image/110006/5b298394cc7d4a0fb3019bc9a1d238cb_s.png',
color: ''
},
name: "张三",
userId: 123456,
}, //任务负责人
priority: 3, //任务优先级
status: status, //任务状态
editable: true, //任务是否可编辑
startDate: "2018/11/13", //任务开始时间
deadLine: '2018/11/13', //任务截止时间
remainDay: 4, //剩余几天,前段判断如果大于3,显示截止时间
hasSubTask: true, //任务是否有子任务
subTaskTotal: 2, //任务子任务数
parentTaskId: '222222', //任务母任务ID
isApply: true, //任务是否是申请中
isSuperior: true,
subTaskList: [], //任务的子任务列表
rewardNum: 2, //打赏数
}
], //任务的子任务列表
};
const controlData = {
isDetail:true,//是否详情模式
isCanEdit:true, //任务是否可编辑,默认是true,
isCanEditStatus:true,//是否可以编辑任务状态 ,默认是 ,优先级同级isCanEdit
isCanEditTime:true,//是否可以编辑时间,默认是,优先级同级isCanEdit
isCanEditPerson:true,//是否可以编辑任务负责人,默认是,优先级同级isCanEdit
// 以上三项是否可编辑,与isCanEdit的关系是“且”,两项都是true,才可编辑,有一项不是,都不可编辑
isShowPriority:true,//是否显示优先级 ,默认true,预留
// isShowStatus:false,//是否显示任务状态,默认true,预留
isShowTag:true,//是否显示名称后面的tag
isExpand:false,//子任务是否展开
isDistributed:false,//是否为我派发的视图
// 事件
// 点击整条任务事件,参数节点、任务id
handleClickAllItem:(e,taskId)=>{console.log('click all task')},
// 点击修改任务状态,参数:节点、任务id、修改后的任务状态 (1:未完成,2:完成)
handleChangeStatus:(e,taskId,status)=>{console.log('change task status')},
// 点击打开或者关闭子任务,参数:节点、打开或者关闭状态 (true:打开,false:关闭)
handleOpenOrCloseChile:(e,taskId,isExpand)=>{console.log('open or close child')},
// 点击头像负责人部分,参数:节点、任务id,负责人id
handleChangeTaskUser:(e,taskId,principalUserId)=>{console.log('change task user')},
// 点击时间部分,参数:节点,任务id,开始时间,结束时间
handleChangeTaskTime:(e,taskId,startTime,endTime)=>{console.log('change task time')},
// 点击任务名称部分,参数:节点,任务id
handleClickTaskName:(e,taskId) => {console.log('click task name')},
// 点击更新进展
handleClickProgress:(e,taskId) => {console.log('click progress')},
// 点击提醒
handleClickRemind:(e,taskId) => {console.log('click remind')},
// 点击打赏
handleClickReward:(e,taskId) => {console.log('click reward')},
// 点击回复
handleClickCommunicate:(e,taskId) => {console.log('click communicate')}
}
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago