初始化
This commit is contained in:
commit
5acff56c29
|
|
@ -0,0 +1,4 @@
|
|||
node_modules
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
|
||||
//新建项目-类型
|
||||
export const getAddProjectTypes = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjCreateTemplet', 'GET', params);
|
||||
}
|
||||
|
||||
//新建项目 保存
|
||||
export const doSaveNewProject = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/doPrjOperation', 'POST', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
//列表
|
||||
export const getApprovalList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskapproval', 'GET', params);
|
||||
}
|
||||
|
||||
export const doTaskApprovalOpt = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/doTaskApprovalOpt', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import { WeaTools } from 'ecCom';
|
||||
|
||||
//右键菜单
|
||||
export const getRightMenus = params => {
|
||||
return WeaTools.callApi('/api/proj/prjutil/getrightmenus', 'GET', params);
|
||||
}
|
||||
|
||||
//高级搜索 公用
|
||||
export const getTaskCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskcondition', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
//获取思维导图数据
|
||||
export const getPrjMindMap = params => {
|
||||
return WeaTools.callApi('/api/proj/mindmap/getPrjMindData', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
// 项目类型-树形
|
||||
export const getPrjTypeTreePageList = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjTypeTree', 'GET', params);
|
||||
}
|
||||
//列表
|
||||
export const getMyPrjList = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getMyMangerPrjList', 'GET', params);
|
||||
}
|
||||
//我的项目 高级搜索
|
||||
export const getMyPrjCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjcondition', 'GET', params);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
//项目数据
|
||||
export const getProjectDatas = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getProjectDatas', 'POST', params);
|
||||
}
|
||||
|
||||
//项目分组表单
|
||||
export const getPrjGroupForm = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getPrjGroupForm', 'POST', params);
|
||||
}
|
||||
|
||||
//项目分组操作
|
||||
export const doPrjGroupOperation = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/doPrjGroupOperation', 'POST', params);
|
||||
}
|
||||
|
||||
//获取项目动态信息
|
||||
export const getPortalProjectDynamicInfo = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getPortalProjectDynamicInfo', 'POST', params);
|
||||
}
|
||||
|
||||
//项目日报操作
|
||||
export const doPortalProjectDailyOperation = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/doPortalProjectDailyOperation', 'POST', params);
|
||||
}
|
||||
|
||||
//获取项目日报数据
|
||||
export const getPortalProjectDailyDatas = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getPortalProjectDailyDatas', 'POST', params);
|
||||
}
|
||||
|
||||
//获取项目门户项目卡片数据
|
||||
export const getPortalProjectInfo = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getPortalProjectInfo', 'GET', params);
|
||||
}
|
||||
|
||||
//任务执行条件
|
||||
export const getTaskCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskcondition', 'GET', params);
|
||||
}
|
||||
|
||||
//任务执行列表
|
||||
export const getTaskExecuteList = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getProtalTaskList', 'GET', params);
|
||||
}
|
||||
|
||||
//任务分组表单
|
||||
export const getTaskGroupForm = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getTaskGroupForm', 'POST', params);
|
||||
}
|
||||
|
||||
//任务分组操作
|
||||
export const doTaskGroupOperation = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/doTaskGroupOperation', 'POST', params);
|
||||
}
|
||||
|
||||
//获取右键菜单
|
||||
export const getRightMenu = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getRightMenu', 'POST', params);
|
||||
}
|
||||
|
||||
//获取项目搜索分组数据
|
||||
export const getPrjSearchDatas = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getPrjSearchDatas', 'POST', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import {WeaTools} from 'ecCom';
|
||||
|
||||
//获取反馈数据
|
||||
export const getFeedBackData = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getFeedBackData', 'POST', params);
|
||||
}
|
||||
|
||||
//反馈信息表单
|
||||
export const getFeedBackInfoForm = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getFeedBackInfoForm', 'POST', params);
|
||||
}
|
||||
|
||||
//反馈信息相关操作
|
||||
export const doFeedBackOperation = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/doFeedBackOperation', 'POST', params);
|
||||
}
|
||||
|
||||
//反馈设置表单
|
||||
export const getFeedBackSettingForm = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getFeedBackSettingForm', 'POST', params);
|
||||
}
|
||||
|
||||
//获取活动周期options
|
||||
export const getCircleOptions = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getCircleOptions', 'POST', params);
|
||||
}
|
||||
|
||||
//保存完成情况信息
|
||||
export const saveMxDatas = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/saveMxDatas', 'POST', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
// 项目类型-树形
|
||||
export const getPrjTypeTreePageList = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjTypeTree', 'GET', params);
|
||||
}
|
||||
|
||||
// 根据项目类型,查询项目,分页显示
|
||||
export const getPrjByTypeId = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/getListByTypeIdForBoard', 'GET', params);
|
||||
}
|
||||
|
||||
export const getPrjInfoForBoard = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/getProjectInfo', 'GET', params);
|
||||
}
|
||||
|
||||
//看板显示
|
||||
export const getKanbanView = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/getPrjBoardView', 'GET', params);
|
||||
}
|
||||
//看板新增阶段
|
||||
export const addBoardStage = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/addBoardStage', 'GET', params);
|
||||
}
|
||||
//编辑阶段
|
||||
export const editBoardStage = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/editBoardStage', 'GET', params);
|
||||
}
|
||||
//删除阶段
|
||||
export const delBoardStage = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/delBoardStage', 'GET', params);
|
||||
}
|
||||
//看板拖动
|
||||
export const doMovePrjBoard = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/doMovePrjBoard', 'GET', params);
|
||||
}
|
||||
//看板新增任务
|
||||
export const addBoardTask = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/addBoardTask', 'GET', params);
|
||||
}
|
||||
//查询任务卡片
|
||||
export const getTaskInfo = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/getTaskInfo', 'GET', params);
|
||||
}
|
||||
//查询项目Tab
|
||||
export const getPrjTabs = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/getProjectTabs', 'GET', params);
|
||||
}
|
||||
//设置里程碑任务
|
||||
export const setLandMark = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/setLanMark', 'GET', params);
|
||||
}
|
||||
//保存任务排序
|
||||
export const saveItemOrder = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/saveItemOrder', 'GET', params);
|
||||
}
|
||||
//保存阶段排序
|
||||
export const saveGroupOrder = params => {
|
||||
return WeaTools.callApi('/api/proj/prjboard/saveGroupOrder', 'GET', params);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,203 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
// 项目类型-树形
|
||||
export const getPrjTypeTreePageList = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjTypeTree', 'GET', params);
|
||||
}
|
||||
//列表
|
||||
export const getPrjTypeList = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjExecuteList', 'GET', params);
|
||||
}
|
||||
//项目执行 高级搜索
|
||||
export const getPrjCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjcondition', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
//查詢項目 - 列表
|
||||
export const getQueryPrjList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjSearchList','GET', params);
|
||||
}
|
||||
|
||||
//批量共享 - 列表
|
||||
export const getBatchShareList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getBatchShareList','GET', params);
|
||||
}
|
||||
|
||||
//项目监控- 列表
|
||||
export const getPrjMonitorList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjMonitorList','GET', params);
|
||||
}
|
||||
|
||||
|
||||
//项目卡片接口
|
||||
|
||||
//tab查询
|
||||
export const getPrjTabs = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getProjectTabs','GET', params);
|
||||
}
|
||||
//项目信息
|
||||
export const getPrjInfo = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getProjectInfo','GET', params);
|
||||
}
|
||||
//项目日志
|
||||
export const getPrjLogList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjLogList','GET', params);
|
||||
}
|
||||
//项目字段日志
|
||||
export const getPrjFieldLogList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjFieldLogList','POST', params);
|
||||
}
|
||||
//项目字段详情日志
|
||||
export const getPrjFieldDetaiLogList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjFieldDetailLogList','POST', params);
|
||||
}
|
||||
|
||||
//项目信息 =-- 编辑保存
|
||||
export const savePrjInfo = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/doPrjOperation','POST', params);
|
||||
}
|
||||
|
||||
//项目信息 =-- 删除
|
||||
export const delPrjInfo = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/doPrjOperation','POST', params);
|
||||
}
|
||||
|
||||
|
||||
//子项目
|
||||
export const getPrjSubList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getSubProjectList','GET', params);
|
||||
}
|
||||
|
||||
//相关交流
|
||||
export const getPrjDiscuss = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjdiscuss','GET', params);
|
||||
}
|
||||
|
||||
//相关交流(new)
|
||||
export const getExchangeList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getExchangeList','GET', params);
|
||||
}
|
||||
|
||||
//相关交流保存
|
||||
export const exchangeSave = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/doDiscussOpt','POST', params);
|
||||
}
|
||||
|
||||
//相关交流删除
|
||||
export const exchangeDelete = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/exchangeDelete','GET', params);
|
||||
}
|
||||
|
||||
//共享设置
|
||||
export const getPrjShare = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjshare','GET', params);
|
||||
}
|
||||
|
||||
//共享设置添加
|
||||
export const addPrjShare = params => {
|
||||
return WeaTools.callApi('/api/proj/prjutil/doProjectShareOpt', 'POST', params);
|
||||
}
|
||||
|
||||
//共享设置批量删除
|
||||
export const delBatchPjrShare = params => {
|
||||
return WeaTools.callApi('/api/proj/prjutil/doProjectShareOpt', 'POST', params);
|
||||
}
|
||||
|
||||
//统计报告
|
||||
export const getPrjStastics = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjstastics','GET', params);
|
||||
}
|
||||
|
||||
//任务列表
|
||||
export const getPrjTaskList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjViewProcess','GET', params);
|
||||
}
|
||||
//任务列表 -- 版本
|
||||
export const getPrjTaskVersion = params =>{
|
||||
return WeaTools.callApi('/api/proj/pctask/gettaskversion','GET', params);
|
||||
}
|
||||
//任务列表 -- 相关流程-文档-写作-日志 列表
|
||||
export const getPrjDspList = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjDspList','GET', params);
|
||||
}
|
||||
|
||||
//任务列表 -- 通知项目成员
|
||||
export const getNoticeMember= params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/noticeMember','GET', params);
|
||||
}
|
||||
|
||||
//任务列表 -- 历史版本对比
|
||||
export const getPrjHisCompare = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjHisCompare','GET', params);
|
||||
}
|
||||
|
||||
|
||||
//项目执行
|
||||
export const doPlanOpt = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/doPlanOpt','GET', params);
|
||||
}
|
||||
|
||||
//项目另存为模板
|
||||
export const doSaveTemplet = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/doSaveTemplet','GET', params);
|
||||
}
|
||||
|
||||
//项目初始化导入
|
||||
export const prjimptopt = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/prjimpopt','GET', params);
|
||||
}
|
||||
|
||||
//WBS导入配置字段
|
||||
export const getTaskWbsField = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/getTaskWbsField','POST', params);
|
||||
}
|
||||
|
||||
//WBS导入配置字段
|
||||
export const doTaskWbsFieldSave = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/doSaveTaskWbsField','POST', params);
|
||||
}
|
||||
|
||||
//项目任务模板(重新生成项目类型模板)
|
||||
export const doPrjTemplateFile = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/doPrjTemplateFile','GET', params);
|
||||
}
|
||||
//项目导入
|
||||
export const doPrjimpopt = params =>{
|
||||
return WeaTools.callApi('/api/proj/prjutil/doprjimpopt','POST', params);
|
||||
}
|
||||
|
||||
//批量共享
|
||||
export const savePrjBatchShare = params =>{
|
||||
return WeaTools.callApi('/api/proj/pcproject/prjShareMultiOpt','POST', params);
|
||||
}
|
||||
|
||||
/*********** 报表 ********************** */
|
||||
|
||||
export const getPrjReport = params => {
|
||||
return WeaTools.callApi('/api/proj/prjReport/getPrjReport', 'GET', params);
|
||||
}
|
||||
|
||||
export const getPrjReportCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/prjReport/getRepCondition', 'GET', params);
|
||||
}
|
||||
|
||||
//模板阶段设置
|
||||
export const getPrjTempletStageList = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjTempletStageList', 'GET', params);
|
||||
}
|
||||
|
||||
//模板阶段保存
|
||||
export const savePrjTempletStage = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/savePrjTempletStage', 'POST', params);
|
||||
}
|
||||
|
||||
//模板阶段保存
|
||||
export const getPrjResources = params => {
|
||||
return WeaTools.callApi('/api/proj/pcproject/getPrjResources', 'GET', params);
|
||||
}
|
||||
|
||||
//获取资产模块应用分权是否开启和 禁用所有人是否开启并配置应用列表
|
||||
export const getDetachable = params => {
|
||||
return WeaTools.callApi('/api/cpt/maint/getDetachable', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
// 根据项目类型,查询项目,分页显示
|
||||
export const getTaskPageList = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getTaskPageList', 'GET', params);
|
||||
}
|
||||
|
||||
export const getTaskInfoNew = params => {
|
||||
return WeaTools.callApi('/api/proj/portal/getTaskInfoNew', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
//列表
|
||||
export const getTaskSearchList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/tasksearch', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,129 @@
|
|||
import {WeaTools} from 'ecCom'
|
||||
|
||||
//任务执行条件
|
||||
export const getTaskCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskcondition', 'GET', params);
|
||||
}
|
||||
|
||||
//任务执行列表
|
||||
export const getTaskExecuteList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskexecute', 'GET', params);
|
||||
}
|
||||
|
||||
//tab查询
|
||||
export const getTaskTabs = params =>{
|
||||
return WeaTools.callApi('/api/proj/pctask/getTaskTabs','GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--任务信息
|
||||
export const getTaskForm = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/gettaskform', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--编辑保存
|
||||
export const saveTaskInfo = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/doTaskOperation', 'POST', params);
|
||||
}
|
||||
|
||||
//任务卡片--删除
|
||||
export const delTask = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/doTaskOperation', 'POST', params);
|
||||
}
|
||||
|
||||
//任务卡片--子任务查询
|
||||
export const getTaskSubList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/tasksub', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--子任务查询
|
||||
export const getTaskSubCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskcondition', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--共享设置列表
|
||||
export const getTaskShareList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskshare', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--共享设置添加
|
||||
export const addTaskShare = params => {
|
||||
return WeaTools.callApi('/api/proj/prjutil/doProjectShareOpt', 'POST', params);
|
||||
}
|
||||
|
||||
//任务卡片--共享设置批量删除
|
||||
export const delBatchTaskShare = params => {
|
||||
return WeaTools.callApi('/api/proj/prjutil/doProjectShareOpt', 'POST', params);
|
||||
}
|
||||
|
||||
//任务卡片--相关流程-文档-客户-资产 reftype=req ,doc, crm , cpt
|
||||
export const getTaskReference = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskreference', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--相关交流--内容
|
||||
export const getTaskExchange = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskdiscuss', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--相关交流--高级搜索
|
||||
export const getTaskExchangeCondition = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskcondition', 'GET', params);
|
||||
}
|
||||
|
||||
|
||||
//任务卡片--所需 流程-文档 新增,删除 修改
|
||||
export const doDspTaskRequiredOpt = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/doDspTaskRequiredOpt', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--流程创建
|
||||
export const addRequiredWF = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/addRequiredWF', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片--相关流程-文档 -客户-资产 新增,删除
|
||||
export const doDspTaskReferenceOpt = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/doDspTaskReferenceOpt', 'GET', params);
|
||||
}
|
||||
//任务卡片--修改记录
|
||||
export const taskModifyList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskModifyList', 'GET', params);
|
||||
}
|
||||
|
||||
//任务卡片新增阶段联动 获取任务对应的阶段
|
||||
export const getTaskStage = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/getTaskStage', 'GET', params);
|
||||
}
|
||||
|
||||
//任务日志
|
||||
export const getTaskLogList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskLogList', 'POST', params);
|
||||
}
|
||||
|
||||
//任务字段日志
|
||||
export const getTaskFieldLogList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskFieldLogList', 'POST', params);
|
||||
}
|
||||
|
||||
//任务字段详情日志
|
||||
export const getTaskFieldDetailLogList = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/taskFieldDetailLogList', 'POST', params);
|
||||
}
|
||||
|
||||
//获取批量修改字段
|
||||
export const getModifySelect = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/getModifySelect', 'POST', params);
|
||||
}
|
||||
|
||||
export const getModifyFields = params => {
|
||||
return WeaTools.callApi('/api/proj/remind/getConditionField', 'POST', params);
|
||||
}
|
||||
|
||||
export const submitBatchModify = params => {
|
||||
return WeaTools.callApi('/api/proj/pctask/submitBatchModify', 'POST', params);
|
||||
}
|
||||
|
||||
//判断角色下是否有人员
|
||||
export const getCheckRole = params => {
|
||||
return WeaTools.callApi('/api/task/develop/checkRole', 'GET', params);
|
||||
}
|
||||
|
|
@ -0,0 +1,173 @@
|
|||
import React, { Component } from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import './kanban/style/index.less'
|
||||
import Kanban from './kanban';
|
||||
import { toJS } from 'mobx';
|
||||
import { Icon, message } from 'antd';
|
||||
import { WeaInput, WeaAlertPage } from 'ecCom';
|
||||
import QueueAnim from 'rc-queue-anim';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class App extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
columns: props.columns || [],
|
||||
visible: false,
|
||||
groupName: ""
|
||||
}
|
||||
}
|
||||
|
||||
index = 0;
|
||||
handleAdd = (value) => {
|
||||
const input = this.refs.groupNameInput.refs.inputNormal.refs.input.refs.input;
|
||||
if (value && this.state.visible) {
|
||||
if (this.checkGroupRepeat(value)) {
|
||||
this.props.boardStore.saveGroup(value);
|
||||
this.setState({ visible: !this.state.visible, groupName: "" });
|
||||
} else {
|
||||
message.error(getLabel('387703', "阶段名称重复!"));
|
||||
}
|
||||
}
|
||||
if (!this.state.visible) {
|
||||
input.focus();
|
||||
input.setSelectionRange(0, input.value.length);
|
||||
this.setState({ visible: !this.state.visible, groupName: "" });
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
checkGroupRepeat = (name) => {
|
||||
const { boardStore: { columns } } = this.props;
|
||||
let checked = true;
|
||||
const stages = toJS(columns);
|
||||
stages.map(item => {
|
||||
if (item.title == name) {
|
||||
checked = false;
|
||||
}
|
||||
});
|
||||
return checked;
|
||||
}
|
||||
|
||||
|
||||
componentWillUnmount() {
|
||||
const { boardStore, columns } = this.props;
|
||||
boardStore.clearStatus();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { boardStore } = this.props;
|
||||
const { userid, usericons, username, delGrop, isedit, columns, canEditBoard, canAddTask } = boardStore;
|
||||
if (!isedit && columns && columns.length == 0) {
|
||||
return (
|
||||
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@z6ww05`} iconSize={100}>
|
||||
<div style={{ color: '#000' }}>
|
||||
{getLabel('387719', "对不起,该看板暂无数据 !")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<Kanban ecId={`${this && this.props && this.props.ecId || ''}_Kanban@0cp91w`} addAction={
|
||||
<div style={{ display: canEditBoard ? 'inline-block' : "none" }}>
|
||||
<div className="addNewStage" onClick={this.handleAdd} style={{ display: this.state.visible ? "none" : "" }} >
|
||||
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@8p8ch0`} type="plus" />{getLabel('387718', "新建阶段")}
|
||||
</div>
|
||||
<div className="kanban-group" style={{ display: this.state.visible ? "" : "none" }}>
|
||||
<div className="kanban-group-head">
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@emlqsb`}
|
||||
// helpfulTip="测试"
|
||||
ref="groupNameInput"
|
||||
autofocus="autofocus"
|
||||
style={{ top: '9px' }}
|
||||
id='test'
|
||||
placeholder={getLabel('387717', "填写阶段名称")}
|
||||
value={this.state.groupName}
|
||||
onChange={value => {
|
||||
this.setState({ groupName: value })
|
||||
}}
|
||||
onBlur={value => {
|
||||
this.handleAdd(value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
} onChange={boardStore.doMovePrjBoard} >
|
||||
{boardStore.columns && boardStore.columns.map((column) => {
|
||||
|
||||
return (
|
||||
<Kanban.Group ecId={`${this && this.props && this.props.ecId || ''}_Kanban.Group@zwg7nd@${column.id}`}
|
||||
value={column.id}
|
||||
title={column.title}
|
||||
columns={boardStore.columns}
|
||||
delGrop={(id) => delGrop(id)}
|
||||
userInfo={{
|
||||
userid: userid,
|
||||
username: username,
|
||||
usericons: usericons
|
||||
}}
|
||||
isedit={isedit}
|
||||
canEditBoard={canEditBoard}
|
||||
canAddTask={canAddTask}
|
||||
groupid={column.id}
|
||||
// footer={ <Button onClick={()=>{this.setState({visible: !this.state.visible})}}>add</Button>}
|
||||
saveTask={(params) => { this.props.boardStore.saveTask(params) }}
|
||||
saveGroupName={(name, id) => { this.props.boardStore.saveGroupName(name, id) }}
|
||||
checkRepeat={(name, id) => { this.props.boardStore.checkGroupRepeat(name, id) }}
|
||||
// extra={}
|
||||
|
||||
>
|
||||
{
|
||||
this.getItems(column.items)
|
||||
}
|
||||
</Kanban.Group>
|
||||
)
|
||||
})
|
||||
}
|
||||
</Kanban>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getItems = (items) => {
|
||||
const { boardStore: { canAddTask, canEditBoard } } = this.props;
|
||||
let comItems = [];
|
||||
items && items.map((item) => {
|
||||
comItems.push(
|
||||
<Kanban.Item ecId={`${this && this.props && this.props.ecId || ''}_Kanban.Item@x125tp@${item.id}`}
|
||||
value={item.id}
|
||||
title={item.title}
|
||||
extra="more"
|
||||
managerid={toJS(item.hrmid)}
|
||||
managericon={toJS(item.hrmidicon)}
|
||||
managername={toJS(item.hrmidname)}
|
||||
islandmark={item.islandmark}
|
||||
description={item.overstr}
|
||||
colors={item.finishcolor}
|
||||
allnum={item.allnum}
|
||||
prefix={item.prefix}
|
||||
finishnum={item.finishnum}
|
||||
canAddTask={canAddTask}
|
||||
canEditBoard={canEditBoard}
|
||||
status ={item.status}
|
||||
setLandMark={(id, value) => { this.props.boardStore.setLandMark(id, value) }}
|
||||
onTaskClick={(value) => { this.props.boardStore.showSlideModal(true, value) }}
|
||||
finish={item.finish}
|
||||
key={item.id}
|
||||
/>
|
||||
)
|
||||
})
|
||||
return comItems;
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
|
@ -0,0 +1,219 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { Button, Tabs,Card,Pagination,Row,Col } from 'antd';
|
||||
import {toJS} from "mobx";
|
||||
import {Condition,getAdButtons} from './list/listCondition';
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
import ModifyLogDialog from "./dialog/modifyLogDialog"
|
||||
import ExchangeDialog from './dialog/exchangeDialog'
|
||||
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
import {WeaRightMenu,WeaTop,WeaTab,WeaErrorPage,WeaBrowser,WeaTools,WeaProgress,WeaLocaleProvider} from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject('prjApprovalStore')
|
||||
@observer
|
||||
class Approval extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
window._cptTable = {
|
||||
reLoad: props.prjApprovalStore.reLoad
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.doInit(this.props);
|
||||
}
|
||||
doInit(props){
|
||||
const { location,prjApprovalStore } = props;
|
||||
const {initDatas,doSearch,initTreeDatas} = prjApprovalStore;
|
||||
initDatas();
|
||||
doSearch();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps){
|
||||
if(this.props.location.key !== nextProps.location.key){
|
||||
const { location,prjApprovalStore } = nextProps;
|
||||
prjApprovalStore.clearStatus();
|
||||
this.doInit(nextProps);
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount(){
|
||||
const { prjApprovalStore } = this.props;
|
||||
prjApprovalStore.clearStatus();
|
||||
}
|
||||
render(){
|
||||
const {prjApprovalStore} = this.props;
|
||||
const {loading,tableStore,showSearchAd,form,exchangeStore,logTableStore,logVisible} = prjApprovalStore;
|
||||
const formParams = form.getFormParams() || {};
|
||||
return (
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@gnbydh`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@zutvpq`}
|
||||
title={getLabel(16410,"审批任务")}
|
||||
loading={loading}
|
||||
icon={<i className='icon-coms-project' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
buttonSpace={10}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
onDropMenuClick={this.onRightMenuClick.bind(this)}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@f8b4as`}
|
||||
buttonsAd={getAdButtons(prjApprovalStore,this.props.ecId || '')}
|
||||
searchType={['base','advanced']}
|
||||
searchsBaseValue={formParams.taskname}
|
||||
setShowSearchAd={bool=>{prjApprovalStore.setShowSearchAd(bool)}}
|
||||
hideSearchAd={()=> prjApprovalStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@juuuhw`} listStore={prjApprovalStore} form={form} onEnterSearch={this.onEnterSearch} ></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v=>{prjApprovalStore.doSearch()}}
|
||||
onSearchChange={v=>{prjApprovalStore.appendFormFields({taskname:{value:v}})}}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@crkoxg`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
getColumns={c=>this.reRenderColumns(c)}
|
||||
tableWidth={this.tableWidth}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
</WeaTop>
|
||||
<ExchangeDialog ecId={`${this && this.props && this.props.ecId || ''}_ExchangeDialog@do9fwa`} contentStore={exchangeStore} />
|
||||
<ModifyLogDialog ecId={`${this && this.props && this.props.ecId || ''}_ModifyLogDialog@zbi505`} ref="modifyLogDialog" title={getLabel(83905,"任务修改记录")} tableStore={logTableStore}/>
|
||||
</WeaRightMenu>)
|
||||
|
||||
}
|
||||
getTopButtons(){
|
||||
const {prjApprovalStore} = this.props;
|
||||
const {rightMenu,tableStore} = prjApprovalStore;
|
||||
let {selectedRowKeys} = tableStore;
|
||||
let btnArr = [];
|
||||
let that = this;
|
||||
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
|
||||
rightMenu && rightMenu.length>0 && toJS(rightMenu).map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@9onnbz@${m.type}`} type="primary"
|
||||
disabled={isDisabled && m.isControl == "1"}
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_BATCHAPPROVE"){
|
||||
prjApprovalStore.doTaskApprovalOpt({method:'approve',taskids:`${toJS(selectedRowKeys)}`});
|
||||
}else if(m.type == "BTN_BATCHBACK"){
|
||||
prjApprovalStore.doTaskApprovalOpt({method:"refuse",taskids:`${toJS(selectedRowKeys)}`});
|
||||
}
|
||||
}}>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
getRightMenu(){
|
||||
const {prjApprovalStore }= this.props;
|
||||
const {rightMenu,tableStore} = prjApprovalStore;
|
||||
let {selectedRowKeys} = tableStore;
|
||||
let btnArr = [];
|
||||
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName,
|
||||
disabled:isDisabled && m.isControl == "1"
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {prjApprovalStore }= this.props;
|
||||
const {rightMenu,tableStore} = prjApprovalStore;
|
||||
let {selectedRowKeys} = tableStore;
|
||||
let that = this;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
|
||||
if(m.type == "BTN_COLUMN"){ //定制列
|
||||
prjApprovalStore.onShowColumn();
|
||||
}else if(m.type == "BTN_BATCHAPPROVE"){
|
||||
prjApprovalStore.doTaskApprovalOpt({method:'approve',taskids:`${toJS(selectedRowKeys)}`});
|
||||
}else if(m.type == "BTN_BATCHBACK"){
|
||||
prjApprovalStore.doTaskApprovalOpt({method:"refuse",taskids:`${toJS(selectedRowKeys)}`});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
reRenderColumns(columns){
|
||||
columns.forEach((c,i)=>{
|
||||
if(c.dataIndex=='finish'){
|
||||
c.render = function(text, record){
|
||||
return <span className='wea-prj-progressStyle' >
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@qol3mq@${i}`} percent={record.finish||0} strokeColor={record.finishspan} />
|
||||
</span>
|
||||
}
|
||||
} else {
|
||||
// c.render = function(text, record){
|
||||
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
|
||||
// return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
|
||||
// }
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
tableWidth = (columns) => {
|
||||
let width = 0;
|
||||
let cols = 0;
|
||||
columns.map(col => {
|
||||
if (col.display === 'true') {
|
||||
let oldwidth = col.oldWidth || '10%';
|
||||
let widthInt = parseFloat(oldwidth.replace('%', ''));
|
||||
if (widthInt <= 0) {
|
||||
widthInt = 10;
|
||||
}
|
||||
width += widthInt;
|
||||
cols++
|
||||
}
|
||||
})
|
||||
//超过10列,才出现滚动条,width>100才出现滚动条
|
||||
if(cols<=10){
|
||||
width = 100 ;
|
||||
}
|
||||
return `${width}%`;
|
||||
}
|
||||
|
||||
onOperatesClick(record,index,operate,flag){
|
||||
let that = this;
|
||||
const {prjApprovalStore }= this.props;
|
||||
const {doTaskApprovalOpt,viewModifyLog,exchangeStore} = prjApprovalStore;
|
||||
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
if(fn != ""){
|
||||
if("onApprove"==fn){
|
||||
doTaskApprovalOpt({method:'approve',taskids:record.randomFieldId});
|
||||
}else if('onReject' == fn){
|
||||
doTaskApprovalOpt({method:"refuse",taskids:record.randomFieldId});
|
||||
}else if('onLog' == fn){
|
||||
viewModifyLog(record.randomFieldId);
|
||||
this.refs.modifyLogDialog.setVisible(true);
|
||||
}else if('onDiscuss' == fn){ //相关交流
|
||||
exchangeStore.handleExchangeDialog(true,"task",record.randomFieldId,{})
|
||||
}
|
||||
}
|
||||
}
|
||||
onEnterSearch = () =>{
|
||||
const {prjApprovalStore} = this.props;
|
||||
prjApprovalStore.doSearch();
|
||||
prjApprovalStore.setShowSearchAd(false);
|
||||
}
|
||||
}
|
||||
|
||||
export default WeaTools.tryCatch(React,
|
||||
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@p2sgak`} msg={ props.error ? props.error : getLabel(383324,"对不起,该页面异常,请联系管理员")} />,
|
||||
{error: ""}
|
||||
)(Approval);
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { Button, Tabs,Card,Pagination,Row,Col } from 'antd';
|
||||
import {toJS} from "mobx";
|
||||
import {Condition,getAdButtons} from './list/listCondition';
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
import {WeaRightMenu,WeaTop,WeaTab,WeaErrorPage,WeaBrowser,WeaTools,WeaLeftRightLayout,WeaProgress,WeaLocaleProvider} from 'ecCom';
|
||||
import ShareDialog from './dialog/shareDialog'
|
||||
import ListLeftTree from './list/listLeftTree'
|
||||
import BatchShareDialog from './comp/prj-batch-share'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject('prjBatchShareStore')
|
||||
@observer
|
||||
class BatchShare extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
doInit(props){
|
||||
const {prjBatchShareStore } = props;
|
||||
const {initTreeDatas,doSearch,initDatas} = prjBatchShareStore;
|
||||
//doSearch();
|
||||
initDatas();
|
||||
//initTreeDatas();
|
||||
}
|
||||
componentDidMount(){
|
||||
this.doInit(this.props);
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
if(this.props.location.key !== nextProps.location.key){
|
||||
const { location,prjBatchShareStore } = nextProps;
|
||||
prjBatchShareStore.clearStatus();
|
||||
this.doInit(nextProps);
|
||||
}
|
||||
}
|
||||
componentWillUnmount(){
|
||||
const { prjBatchShareStore } = this.props;
|
||||
prjBatchShareStore.clearStatus();
|
||||
}
|
||||
render(){
|
||||
const {prjBatchShareStore} = this.props;
|
||||
const {loading,tableStore,showSearchAd,form,reLoad,showLeft} = prjBatchShareStore;
|
||||
const formParams = form.getFormParams() || {};
|
||||
let {selectedRowKeys} = tableStore;
|
||||
return (
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@5ycmwl`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@fum9a8`}
|
||||
title={getLabel(18037,"批量共享")}
|
||||
loading={loading}
|
||||
icon={<i className='icon-coms-project' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
buttonSpace={10}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
onDropMenuClick={this.onRightMenuClick.bind(this)}
|
||||
>
|
||||
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@u3vsge`}
|
||||
isNew = {true}
|
||||
showLeft = {showLeft}
|
||||
leftCom={<ListLeftTree ecId={`${this && this.props && this.props.ecId || ''}_ListLeftTree@d5irbu`} listStore={prjBatchShareStore} key={this.props.location.key} initkey={"all"} />}
|
||||
onCollapse={showLeft => prjBatchShareStore.setLeftShow(showLeft)}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@4vvzs0`}
|
||||
buttonsAd={getAdButtons(prjBatchShareStore,this.props.ecId || '')}
|
||||
searchType={['base','advanced']}
|
||||
searchsBaseValue={formParams.name}
|
||||
setShowSearchAd={bool=>{prjBatchShareStore.setShowSearchAd(bool)}}
|
||||
hideSearchAd={()=> prjBatchShareStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@698a3n`} listStore={prjBatchShareStore} form={form} onEnterSearch={this.onEnterSearch} ></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v=>{prjBatchShareStore.doSearch()}}
|
||||
onSearchChange={v=>{prjBatchShareStore.appendFormFields({name:{value:v}})}}
|
||||
onChange={ this.changeData }
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@di9f90`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
register_table={()=>reLoad()}
|
||||
getColumns={c=>this.reRenderColumns(c)}
|
||||
tableWidth={this.tableWidth}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
</WeaLeftRightLayout>
|
||||
</WeaTop>
|
||||
<ShareDialog ecId={`${this && this.props && this.props.ecId || ''}_ShareDialog@ym9gr1`} contentStore={prjBatchShareStore} />
|
||||
<BatchShareDialog ecId={`${this && this.props && this.props.ecId || ''}_BatchShareDialog@snmybt`}
|
||||
visible={prjBatchShareStore.visible}
|
||||
condition ={toJS(prjBatchShareStore.shareCondition)}
|
||||
onSave={v=>{
|
||||
prjBatchShareStore.saveBatchShare({prjids:`${toJS(selectedRowKeys)}`,share:JSON.stringify(v)});
|
||||
}
|
||||
}
|
||||
onCancel={() => {prjBatchShareStore.handleShareDialog(false) }}
|
||||
/>
|
||||
</WeaRightMenu>)
|
||||
|
||||
}
|
||||
|
||||
getTopButtons(){
|
||||
const {prjBatchShareStore} = this.props;
|
||||
const {rightMenu,tableStore} = prjBatchShareStore;
|
||||
let {selectedRowKeys} = tableStore;
|
||||
let btnArr = [];
|
||||
let that = this;
|
||||
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
|
||||
rightMenu && rightMenu.length>0 && toJS(rightMenu).map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@q86rx3@${m.type}`} type="primary"
|
||||
disabled={isDisabled && m.isControl == "1"}
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_SHAREBATCH"){//批量共享
|
||||
prjBatchShareStore.handleShareDialog(true)
|
||||
}
|
||||
}}>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
getRightMenu(){
|
||||
const {prjBatchShareStore }= this.props;
|
||||
const {rightMenu,tableStore} = prjBatchShareStore;
|
||||
let btnArr = [];
|
||||
let {selectedRowKeys} = tableStore;
|
||||
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName,
|
||||
disabled: isDisabled && m.isControl == "1"
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {prjBatchShareStore }= this.props;
|
||||
const {rightMenu,tableStore} = prjBatchShareStore;
|
||||
let {selectedRowKeys} = tableStore;
|
||||
let that = this;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
|
||||
if(m.type == "BTN_SEARCH"){ //定制列
|
||||
prjBatchShareStore.doSearch();
|
||||
}else if(m.type == "BTN_COLUMN"){ //定制列
|
||||
prjBatchShareStore.onShowColumn();
|
||||
}else if(m.type == "BTN_SHAREBATCH"){ //批量共享
|
||||
prjBatchShareStore.handleShareDialog(true)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
reRenderColumns(columns){
|
||||
columns.forEach((c,i)=>{
|
||||
if(c.dataIndex=='finish'){
|
||||
c.render = function(text, record){
|
||||
return <span className='wea-prj-progressStyle' >
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@fp09dt@${i}`} percent={record.finish} strokeColor={record.finishspan} />
|
||||
</span>
|
||||
}
|
||||
} else {
|
||||
// c.render = function(text, record){
|
||||
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
|
||||
// return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
|
||||
// }
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
tableWidth = (columns) => {
|
||||
let width = 0;
|
||||
let cols = 0;
|
||||
columns.map(col => {
|
||||
if (col.display === 'true') {
|
||||
let oldwidth = col.oldWidth || '10%';
|
||||
let widthInt = parseFloat(oldwidth.replace('%', ''));
|
||||
if (widthInt <= 0) {
|
||||
widthInt = 10;
|
||||
}
|
||||
width += widthInt;
|
||||
cols++
|
||||
}
|
||||
})
|
||||
//超过10列,才出现滚动条,width>100才出现滚动条
|
||||
if(cols<=10){
|
||||
width = 100 ;
|
||||
}
|
||||
return `${width}%`;
|
||||
}
|
||||
|
||||
changeData=(key)=>{
|
||||
const {prjBatchShareStore} = this.props;
|
||||
prjBatchShareStore.setShowSearchAd(false);
|
||||
prjBatchShareStore.doSearch({
|
||||
tabkey:key
|
||||
});
|
||||
}
|
||||
|
||||
onOperatesClick(record,index,operate,flag){
|
||||
const {prjBatchShareStore} = this.props;
|
||||
const {shareStore,} = prjBatchShareStore;
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
let that = this;
|
||||
if(fn != ""){
|
||||
if("onShare"==fn){ //共享
|
||||
shareStore.handleShareDialog(true,"prj",record.randomFieldId)
|
||||
}
|
||||
}
|
||||
}
|
||||
onEnterSearch = () =>{
|
||||
const {prjBatchShareStore} = this.props;
|
||||
prjBatchShareStore.doSearch();
|
||||
prjBatchShareStore.setShowSearchAd(false);
|
||||
}
|
||||
}
|
||||
|
||||
export default WeaTools.tryCatch(React,
|
||||
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@0ocn5h`} msg={ props.error ? props.error : getLabel(383324,"对不起,该页面异常,请联系管理员")} />,
|
||||
{error: ""}
|
||||
)(BatchShare);
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
import React from 'react'
|
||||
import { WeaDraggable ,WeaBrowser,WeaInput} from 'ecCom';
|
||||
import { Row, Col } from 'antd';
|
||||
import jQuery from 'jquery';
|
||||
import { observable, action } from 'mobx';
|
||||
import { inject, observer} from 'mobx-react';
|
||||
import {WeaForm, WeaSwitch} from 'comsMobx';
|
||||
import {WeaSearchGroup, WeaFormItem} from 'ecCom';
|
||||
import {Button} from 'antd';
|
||||
|
||||
const datas = {
|
||||
"condition": [
|
||||
{
|
||||
"title": "基本信息",
|
||||
"items": [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT",
|
||||
'rules': 'required|string',
|
||||
"domkey": [
|
||||
"resourcename"
|
||||
],
|
||||
"fieldcol": 12,
|
||||
"isQuickSearch": true,
|
||||
"label": "姓名",
|
||||
"labelcol": 6,
|
||||
"value": "",
|
||||
"viewAttr": 2
|
||||
},
|
||||
{
|
||||
colSpan:2,
|
||||
"fieldcol": 12,
|
||||
"labelcol": 6,
|
||||
conditionType:"SCOPE",
|
||||
domkey:
|
||||
["seclevel", "seclevelTo"],
|
||||
endValue:100,
|
||||
isQuickSearch:false,
|
||||
label:"安全级别",
|
||||
startValue:'0',
|
||||
viewAttr:3,
|
||||
precision: 0,
|
||||
min:[0, 10],
|
||||
max:[10, 1000],
|
||||
},
|
||||
{
|
||||
colSpan:2,
|
||||
"fieldcol": 12,
|
||||
"labelcol": 6,
|
||||
conditionType:"TIMERANGEPICKER",
|
||||
domkey:
|
||||
["starttime", "endtime"],
|
||||
label:"时间区间",
|
||||
starttime:'14:50',
|
||||
endtime:"15:30",
|
||||
viewAttr:3,
|
||||
'rules': 'required|string', // 校验规则
|
||||
},
|
||||
|
||||
],
|
||||
"defaultshow": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
class DemoStore {
|
||||
@observable form = new WeaForm();
|
||||
|
||||
@action
|
||||
getFormParams() {
|
||||
return this.form.getFormParams();
|
||||
}
|
||||
}
|
||||
|
||||
const demoStore = new DemoStore();
|
||||
|
||||
@observer
|
||||
export default class Main extends React.Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
componentDidMount() {
|
||||
const conditioninfo = datas.condition;
|
||||
const {form} = demoStore;
|
||||
form.initFormFields(conditioninfo);
|
||||
}
|
||||
onChange(data) {
|
||||
|
||||
}
|
||||
getSearchs() {
|
||||
const conditioninfo = datas.condition;
|
||||
const { form } = demoStore;
|
||||
const {isFormInit} = form;
|
||||
let group = [];
|
||||
isFormInit && conditioninfo.map((c,i) =>{
|
||||
let items = [];
|
||||
c.items.map((field,index) => {
|
||||
items.push({
|
||||
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@ob84zg@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${field.labelcol}`}}
|
||||
error={form.getError(field)}
|
||||
wrapperCol={{span: `${field.fieldcol}`}}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@rrqhxt@${index}`} fieldConfig={field} form={form} onChange={this.onChange.bind(this)}/>
|
||||
</WeaFormItem>),
|
||||
colSpan:1
|
||||
})
|
||||
});
|
||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@k6q0d5@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items}/>)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
render() {
|
||||
const { form } = demoStore;
|
||||
return (<div>
|
||||
{this.getSearchs()}
|
||||
<br/>
|
||||
<div className="align-center"><Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ju1ve7`} onClick={()=>{}}>打印数据</Button><Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3g13h1`} onClick={()=> form.reset()}>重置</Button></div>
|
||||
</div>)
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import { WeaPopoverHrm,WeaLocaleProvider } from 'ecCom';
|
||||
|
||||
class Home extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div style={{height:"100%"}}>
|
||||
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@13js0w`} />
|
||||
<iframe id="hiddenPreLoaderSingle" name="hiddenPreLoaderSingle" style={{display: "none"}} width="0" height="0" border="0" frameborder="0"></iframe>
|
||||
<WeaLocaleProvider ecId={`${this && this.props && this.props.ecId || ''}_WeaLocaleProvider@xfyzty`}>
|
||||
{this.props.children}
|
||||
</WeaLocaleProvider>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Home
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { Button, } from 'antd';
|
||||
import {toJS} from "mobx";
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
import {WeaRightMenu,WeaTop,WeaTab,WeaErrorPage,WeaTools,WeaProgress,WeaBrowser,WeaLocaleProvider} from 'ecCom';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {Condition,getAdButtons} from './list/listCondition';
|
||||
|
||||
@inject('projectReportStore')
|
||||
@observer
|
||||
class ProjectReport extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
componentDidMount(){
|
||||
const {projectReportStore,params } = this.props;
|
||||
const {doSearch,initData} = projectReportStore;
|
||||
initData(params);
|
||||
doSearch(params);
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
const keyOld = this.props.location.key;
|
||||
const keyNew = nextProps.location.key;
|
||||
if(keyOld !== keyNew) {
|
||||
const {projectReportStore,params } = nextProps;
|
||||
const {doSearch,initData} = projectReportStore;
|
||||
initData(params);
|
||||
doSearch(params);
|
||||
}
|
||||
}
|
||||
componentWillUnmount(){
|
||||
const {projectReportStore,params } = this.props;
|
||||
projectReportStore.clearStatus();
|
||||
}
|
||||
render(){
|
||||
const {projectReportStore} = this.props;
|
||||
const {title,loading,form,showSearchAd,tableStore,reLoad} = projectReportStore;
|
||||
return (
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@bp0tk5`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}
|
||||
collectParams={{
|
||||
favname:'',
|
||||
favouritetype: "3",
|
||||
objid: 0,
|
||||
importantlevel:1,
|
||||
}}>
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@vlh844`}
|
||||
title={title}
|
||||
loading={loading}
|
||||
icon={<i className='icon-coms-project' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={[]}
|
||||
buttonSpace={10}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
onDropMenuClick={this.onRightMenuClick.bind(this)}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@c2pp0s`}
|
||||
buttonsAd={getAdButtons(projectReportStore,this.props.ecId || '')}
|
||||
searchType={['advanced']}
|
||||
setShowSearchAd={bool=>{projectReportStore.setShowSearchAd(bool)}}
|
||||
hideSearchAd={()=> projectReportStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@j1ltze`} listStore={projectReportStore} form={form} onEnterSearch={this.onEnterSearch} ></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v=>{prjExecuteStore.doSearch()}}
|
||||
advanceHeight={100}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@w7p0f7`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
getColumns={c=>this.reRenderColumns(c)}
|
||||
register_table={()=>reLoad()}
|
||||
/>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
)
|
||||
}
|
||||
|
||||
onEnterSearch = ()=>{
|
||||
const projectReportStore = this.props;
|
||||
projectReportStore.doSearch();
|
||||
projectReportStore.setShowSearchAd(false);
|
||||
}
|
||||
|
||||
reRenderColumns(columns){
|
||||
columns.forEach(c=>{
|
||||
if(c.dataIndex=='resultcount'){
|
||||
c.render = function(text, record){
|
||||
if(record.resultcountspan){
|
||||
return <span className='wea-prj-progressStyle' >
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@ubhejz`} percent={record.resultcountspan} />
|
||||
</span>
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// c.render = function(text, record){
|
||||
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
|
||||
// return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
|
||||
// }
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {projectReportStore} = this.props;
|
||||
const {rightMenu} = projectReportStore;
|
||||
let btnArr = [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName,
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {projectReportStore} = this.props;
|
||||
const {rightMenu} = projectReportStore;
|
||||
let that = this;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
if(m.type == "BTN_SEARCH"){
|
||||
projectReportStore.doSearch();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default WeaTools.tryCatch(React,
|
||||
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@gtrbyk`} msg={ props.error ? props.error : getLabel(383324,"对不起,该页面异常,请联系管理员")} />,
|
||||
{error: ""}
|
||||
)(ProjectReport);
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
|
||||
import {Card,Icon,Popover,Button,AutoComplete,Menu,message} from 'antd';
|
||||
import {WeaInputSearch,WeaTools,WeaErrorPage} from 'ecCom'
|
||||
import * as mobx from 'mobx'
|
||||
import isEqual from 'lodash/isEqual';
|
||||
|
||||
class LinkCardItem extends React.Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
width: 0
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
if (!document.getElementsByClassName) {
|
||||
document.getElementsByClassName = function (className, element) {
|
||||
var children = (element || document).getElementsByTagName('*');
|
||||
var elements = new Array();
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
var classNames = child.className.split(' ');
|
||||
for (var j = 0; j < classNames.length; j++) {
|
||||
if (classNames[j] == className) {
|
||||
elements.push(child);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return elements;
|
||||
};
|
||||
}
|
||||
let coms = document.getElementsByClassName('centerItem')[0];
|
||||
!!coms.offsetWidth && this.setState({width:coms.offsetWidth});
|
||||
}
|
||||
shouldComponentUpdate(nextProps,nextState) {
|
||||
const prjbean = this.props.prjbean;
|
||||
const prjbeanNext = nextProps.prjbean;
|
||||
let needrender = false;
|
||||
|
||||
return !isEqual(prjbean, prjbeanNext)
|
||||
|| this.props.iscommon !== nextProps.iscommon
|
||||
|| this.props.num !== nextProps.num
|
||||
|| this.state.width !== nextState.width;
|
||||
}
|
||||
render(){
|
||||
const {width} = this.state;
|
||||
const {prjbean,iscommon,num,actions,user} = this.props;
|
||||
const {beagenters,belongtoUsers,id,name,isview,typeId} = prjbean;
|
||||
|
||||
const colorarray = ["#55D2D4","#B37BFA","#FFC62E","#8DCE36","#37B2FF","#FF9537","#FF5E56"];
|
||||
return (
|
||||
<div className="centerItem" key={id} >
|
||||
{iscommon && <span style={{color:colorarray[num%7],fontSize:'30px',float:'left',marginLeft:20}}><i className={'icon-New-Flow-' + (num == 9 ? '10' : ('0' + (num + 1)))} /></span>}
|
||||
<div className="fontItem" style={{'width': iscommon ? '60%':'100%'}}>
|
||||
<a target="_blank" onClick={this.addProject.bind(this,id,typeId)} title={name}>{name}</a>
|
||||
</div>
|
||||
|
||||
<div className= "imageItem" style={{"display":"none"}}>
|
||||
{!iscommon &&
|
||||
<div className='wea-add-drop-btn' >
|
||||
<i style={{color:"#2DB7F5",fontSize:"18px",lineHeight:"35px"}} className={isview == "1" ?"icon-coms-investigate " :"" } title="预览" onClick={this.showPrjInfo.bind(this,id,typeId)} />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
//显示项目信息
|
||||
showPrjInfo(id,typeid){
|
||||
const {actions} = this.props;
|
||||
actions.addProjectStore.handleShareDialog(true,{viewtype:'showadd',templetid:id,prjtypeid:typeid});
|
||||
}
|
||||
//新建项目
|
||||
addProject(id,typeid){
|
||||
const {actions} = this.props;
|
||||
actions.addProjectStore.handleShareDialog(true,{viewtype:'add',templetid:id,prjtypeid:typeid});
|
||||
}
|
||||
}
|
||||
|
||||
export default LinkCardItem
|
||||
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
import LinkCardItem from './LinkCardItem';
|
||||
import {Card,Icon} from 'antd';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import * as mobx from 'mobx'
|
||||
|
||||
|
||||
class MLinkCard extends React.Component {
|
||||
shouldComponentUpdate(nextProps) {
|
||||
const _c = !isEqual(mobx.toJS(this.props.types), mobx.toJS(nextProps.types));
|
||||
return _c || this.props.isAbc !== nextProps.isAbc
|
||||
}
|
||||
render() {
|
||||
const {types,isAbc,actions,user} = this.props;
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
types.map((type,i)=>{
|
||||
const {prjbeans,img,color,letter,selected,typeName,prjtmpcount} = type;
|
||||
const icontype ="icon-base " +img;
|
||||
return (
|
||||
<Card ecId={`${this && this.props && this.props.ecId || ''}_Card@awhrvz@${i}`} id={letter} style={selected ? {"border-top-color":color,background:'#fff',boxShadow:'0 1px 6px hsla(0,0%,39%,.2)'} : {"border-top-color":color}}>
|
||||
<div style={{padding:'5px 0 25px 0',textAlign:'center'}}>
|
||||
{isAbc ?
|
||||
<span style={{fontSize:26,color:color}}>{letter}</span>
|
||||
:
|
||||
<div className="wf-card-type-name">
|
||||
<span style={{color:color,fontSize:26,marginRight:10}}><i className={icontype}/></span>
|
||||
<span style={{height:36,lineHeight:'36px'}}>{typeName}{('(' + (prjtmpcount) + ')')}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
{
|
||||
prjbeans.map((obj,j)=><LinkCardItem ecId={`${this && this.props && this.props.ecId || ''}_LinkCardItem@bzj05e@${j}`} user={user} prjbean={obj} iscommon={false} actions={actions} />)
|
||||
}
|
||||
</Card>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default MLinkCard
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
import LinkCardItem from './LinkCardItem';
|
||||
import {Card,Icon} from 'antd';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
class OLinkCard extends React.Component{
|
||||
|
||||
render() {
|
||||
const {types,isAbc,actions,user} = this.props;
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
types.map((type,i)=>{
|
||||
const {prjbeans,img,color,letter,selected,typeName} = type;
|
||||
const icontype ="icon-base " +img;
|
||||
return (
|
||||
<Card ecId={`${this && this.props && this.props.ecId || ''}_Card@tk8kvy@${i}`} id={letter} className='clearfix' style={selected? {"border-top-color":color,overflow:'visible',background:'#fff',boxShadow:'0 1px 6px hsla(0,0%,39%,.2)'} : {"border-top-color":color,overflow:'visible'}}>
|
||||
<div style={{"width":"100%","margin-bottom":"20px"}}>
|
||||
<div className="one-card-title">
|
||||
<div style={{"display": "table","height":"100%","width":"100%"}}>
|
||||
<div style={{"display": "table-cell",padding:'5px 0 25px 0',textAlign:'center'}}>
|
||||
{isAbc ?
|
||||
<span style={{fontSize:26,color:color}}>{letter}</span>
|
||||
:
|
||||
<div className="wf-card-type-name">
|
||||
<span style={{color:color,fontSize:26,marginRight:10}}><i className={icontype}/></span>
|
||||
<span style={{height:36,lineHeight:'36px'}}>{typeName}{prjbeans && ('(' + (prjbeans.length-1) + ')')}</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="one-card-content">
|
||||
<ul>
|
||||
{
|
||||
prjbeans.map((obj,j)=>
|
||||
<li>
|
||||
<LinkCardItem ecId={`${this && this.props && this.props.ecId || ''}_LinkCardItem@54lg2l@${j}`} user={user} prjbean={obj} iscommon={false} actions={actions} />
|
||||
</li>
|
||||
)
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default OLinkCard
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
|
||||
import { inject, observer} from 'mobx-react';
|
||||
import {Row,Col,Input,Button,Alert,Spin,Icon} from 'antd'
|
||||
import {WeaTop} from "ecCom"
|
||||
|
||||
import MLinkCard from './MLinkCard';
|
||||
import OLinkCard from './OLinkCard';
|
||||
|
||||
import AddProject from '../dialog/addProjectDialog'
|
||||
import {WeaLocaleProvider} from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject('prjAddStore')
|
||||
@observer
|
||||
class PrjAdd extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
const {prjAddStore} = this.props;
|
||||
prjAddStore.initDatas();
|
||||
this.scrollheigth();
|
||||
}
|
||||
scrollheigth(){
|
||||
let top = jQuery(".wea-prj-add-content").offset() ? (jQuery(".wea-prj-add-content").offset().top ? jQuery(".wea-prj-add-content").offset().top : 0) : 0;
|
||||
let scrollheigth = document.documentElement.clientHeight - top;
|
||||
jQuery(".wea-prj-add-content").height(scrollheigth-30);
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
const keyOld = this.props.location.key;
|
||||
const keyNew = nextProps.location.key;
|
||||
if(keyOld !== keyNew) {
|
||||
const {prjAddStore} = nextProps;
|
||||
prjAddStore.initDatas();
|
||||
this.scrollheigth();
|
||||
}
|
||||
}
|
||||
componentWillUnmount(){
|
||||
const { prjAddStore } = this.props;
|
||||
prjAddStore.clearStatus();
|
||||
}
|
||||
|
||||
render() {
|
||||
const {prjAddStore} = this.props;
|
||||
const {showDatas = {},mulitcol,isAbc,loading,addProjectStore} = prjAddStore;
|
||||
const {typesShow,typesCols,usedBeans,abcBtns,user} = showDatas;
|
||||
const actions = {addProjectStore};
|
||||
return (
|
||||
<div className="prj-create-main">
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@10mktg`}
|
||||
loading={loading}
|
||||
icon={<i className='icon-coms-project' />}
|
||||
iconBgcolor='#217346'
|
||||
title={getLabel(15007,"新建项目")}
|
||||
buttons={this.getButtons()}
|
||||
showDropIcon={false}/>
|
||||
<div className="wea-prj-add-content">
|
||||
{isAbc && (
|
||||
<div className="abcbtn-group">
|
||||
{
|
||||
abcBtns.map(abcBtn => <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kn6gus@${abcBtn.letter}`} className={abcBtn.selected ? 'btn-selected' : ''} type='ghost' key={abcBtn.letter}
|
||||
disabled={abcBtn.disabled} onClick={this.goABC.bind(this,abcBtn.letter)}>{abcBtn.letter}</Button>)
|
||||
}
|
||||
</div>)
|
||||
}
|
||||
{
|
||||
typesShow.length == 0 && !loading ? <Alert ecId={`${this && this.props && this.props.ecId || ''}_Alert@pekk6s`} message={getLabel(558,"提示")} description={getLabel(508226,"没有项目类型或无创建权限!")} type="info" showIcon /> :(
|
||||
mulitcol ?
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@au5g4v`}>
|
||||
{typesCols.map((c,i)=>{
|
||||
return <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@gxvbxx@${i}`} span={24 / typesCols.length} style={{padding:'0 10px'}}>
|
||||
<MLinkCard ecId={`${this && this.props && this.props.ecId || ''}_MLinkCard@ezb42p@${i}`} types={c} user={user} mulitcol={mulitcol} isAbc={isAbc} actions={actions}/>
|
||||
</Col>
|
||||
})}
|
||||
</Row>
|
||||
:
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@2f03su`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@052py5`} span="24" style={{paddingLeft:10,paddingRight:10}}>
|
||||
<OLinkCard ecId={`${this && this.props && this.props.ecId || ''}_OLinkCard@m0ckgg`} user={user} types={typesShow} mulitcol={mulitcol} isAbc={isAbc} actions={actions}/>
|
||||
</Col>
|
||||
</Row>)
|
||||
}
|
||||
</div>
|
||||
<AddProject ecId={`${this && this.props && this.props.ecId || ''}_AddProject@myvuh3`} contentStore={prjAddStore} isreflesh={false} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
getButtons(){
|
||||
const {prjAddStore} = this.props;
|
||||
const {isAbc,mulitcol} = prjAddStore;
|
||||
return [
|
||||
<i className={"icon-button icon-New-Flow-Letter" + (isAbc ? ' wea-new-top-btn-clicked' : '')} onClick={this.showABC.bind(this)}/>,
|
||||
<i className={"icon-button icon-New-Flow-1" + (mulitcol ? ' wea-new-top-btn-clicked' : '')} onClick={this.showMulitcol.bind(this)}/>
|
||||
]
|
||||
}
|
||||
goABC(letter){
|
||||
const {prjAddStore} = this.props;
|
||||
prjAddStore.setAbcSelected(letter);
|
||||
let topheight = jQuery('#'+letter).position().top;
|
||||
jQuery(".wea-prj-add-content").scrollTop(topheight);
|
||||
}
|
||||
showMulitcol(){
|
||||
const {prjAddStore} = this.props;
|
||||
const mulitcol = prjAddStore.mulitcol;
|
||||
prjAddStore.setMulitcol(!mulitcol);
|
||||
jQuery(".wea-wf-add-content").scrollTop(0);
|
||||
}
|
||||
showABC(){
|
||||
const {prjAddStore} = this.props;
|
||||
const {isAbc} = prjAddStore;
|
||||
prjAddStore.setIsAbc(!isAbc);
|
||||
jQuery(".wea-wf-add-content").scrollTop(0);
|
||||
}
|
||||
}
|
||||
|
||||
export default PrjAdd
|
||||
|
|
@ -0,0 +1,376 @@
|
|||
|
||||
import { Tooltip } from 'antd';
|
||||
import { WeaLocaleProvider, WeaEchart } from 'ecCom';
|
||||
import { observer } from "mobx-react";
|
||||
import { toJS } from 'mobx';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import '../../style/stastic.less'
|
||||
|
||||
@observer
|
||||
export default class ProjectStastics extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.chart1 = null;
|
||||
this.chart2 = null;
|
||||
this.chart3 = null;
|
||||
this.setChart1Ref = element => {
|
||||
this.chart1 = element;
|
||||
}
|
||||
this.setChart2Ref = element => {
|
||||
this.chart2 = element;
|
||||
}
|
||||
this.setChart3Ref = element => {
|
||||
this.chart3 = element;
|
||||
}
|
||||
const _this = this;
|
||||
window.onresize = function() {
|
||||
_this.chart1 && _this.chart1.chart.resize();
|
||||
_this.chart2 && _this.chart2.chart.resize();
|
||||
_this.chart3 && _this.chart3.chart.resize();
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
let key = this.props.statkey;
|
||||
let key_ = nextProps.statkey;
|
||||
if(key!==key_){
|
||||
this.chart1 && this.chart1.paint();
|
||||
this.chart2 && this.chart2.paint();
|
||||
this.chart3 && this.chart3.paint();
|
||||
}
|
||||
}
|
||||
render() {
|
||||
|
||||
const { contentStore: { stastics } } = this.props;
|
||||
let chartdata = toJS(stastics);
|
||||
let charts = {
|
||||
option1: {
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: "{a} <br/>{b}: {c} ({d}%)"
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
x: 'left',
|
||||
data: chartdata.chart1 ? chartdata.chart1.legend:[]
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
normal: {
|
||||
show: false,
|
||||
position: 'center'
|
||||
},
|
||||
emphasis: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: '30',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
}
|
||||
},
|
||||
labelLine: {
|
||||
normal: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
// data: [
|
||||
// { value: 335, name: '直接访问' },
|
||||
// { value: 310, name: '邮件营销' },
|
||||
// { value: 234, name: '联盟广告' },
|
||||
// { value: 135, name: '视频广告' },
|
||||
// { value: 1548, name: '搜索引擎' }
|
||||
// ]
|
||||
data : chartdata.chart1 ? chartdata.chart1.series:[]
|
||||
}
|
||||
]
|
||||
},
|
||||
option2:{
|
||||
color: ['#0270c1','#C2C9D4', '#75D294', '#F72E04'],
|
||||
tooltip: {
|
||||
trigger: 'none',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data:[getLabel(23774,"已完成"),getLabel(1979,"未开始"),getLabel(1960,"进行中"),getLabel(32556,"已延期")]
|
||||
},
|
||||
grid: {
|
||||
top: 70,
|
||||
bottom: 50
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
axisLine: {
|
||||
onZero: false,
|
||||
lineStyle: {
|
||||
color:'#d14a61'
|
||||
}
|
||||
},
|
||||
axisPointer: {
|
||||
label: {
|
||||
formatter: function (params) {
|
||||
return getLabel(1331,"数量")+' ' + params.value
|
||||
+ (params.seriesData.length>3 ? ':' +(parseInt(params.seriesData[0].data)+parseInt(params.seriesData[1].data)+parseInt(params.seriesData[2].data)+parseInt(params.seriesData[3].data)): '');
|
||||
}
|
||||
}
|
||||
},
|
||||
//data: ["2016-1", "2016-2", "2016-3", "2016-4", "2016-5", "2016-6", "2016-7", "2016-8", "2016-9", "2016-10", "2016-11", "2016-12"]
|
||||
data : chartdata.chart2 ? chartdata.chart2.xAxis:[]
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name:getLabel(23774,"已完成"),
|
||||
type:'line',
|
||||
smooth: true,
|
||||
//data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
|
||||
data : chartdata.chart2 ? chartdata.chart2.finish_data:[]
|
||||
},
|
||||
{
|
||||
name:getLabel(1979,"未开始"),
|
||||
type:'line',
|
||||
smooth: true,
|
||||
//data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3]
|
||||
data : chartdata.chart2 ? chartdata.chart2.todo_data:[]
|
||||
},
|
||||
{
|
||||
name:getLabel(1960,"进行中"),
|
||||
type:'line',
|
||||
smooth: true,
|
||||
data : chartdata.chart2 ? chartdata.chart2.doing_data:[]
|
||||
},
|
||||
{
|
||||
name:getLabel(32556,"已延期"),
|
||||
type:'line',
|
||||
smooth: true,
|
||||
data : chartdata.chart2 ? chartdata.chart2.overtime_data:[]
|
||||
}
|
||||
]
|
||||
},
|
||||
option3: {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: [getLabel(23774,"已完成"),getLabel(1979,"未开始"), getLabel(1960,"进行中"), getLabel(32556,"已延期")]
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
//data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||
data : chartdata.chart3 ? chartdata.chart3.xAxis:[]
|
||||
}
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value'
|
||||
}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: getLabel(23774,"已完成"),
|
||||
type: 'line',
|
||||
areaStyle: { normal: {} },
|
||||
data : chartdata.chart3 ? chartdata.chart3.finish_data:[],
|
||||
color: {
|
||||
colorStops: [{
|
||||
offset: 0, color: '#0270c1' // 0% 处的颜色
|
||||
}, {
|
||||
offset: 1, color: '#0270c1' // 100% 处的颜色
|
||||
}],
|
||||
globalCoord: false // 缺省为 false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: getLabel(1979,"未开始"),
|
||||
type: 'line',
|
||||
areaStyle: { normal: {} },
|
||||
data : chartdata.chart3 ? chartdata.chart3.todo_data:[],
|
||||
color: {
|
||||
colorStops: [{
|
||||
offset: 0, color: '#C2C9D4' // 0% 处的颜色
|
||||
}, {
|
||||
offset: 1, color: '#C2C9D4' // 100% 处的颜色
|
||||
}],
|
||||
globalCoord: false // 缺省为 false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: getLabel(1960,"进行中"),
|
||||
type: 'line',
|
||||
areaStyle: { normal: {} },
|
||||
data : chartdata.chart3 ? chartdata.chart3.doing_data:[],
|
||||
color: {
|
||||
colorStops: [{
|
||||
offset: 0, color: '#75D294' // 0% 处的颜色
|
||||
}, {
|
||||
offset: 1, color: '#75D294' // 100% 处的颜色
|
||||
}],
|
||||
globalCoord: false // 缺省为 false
|
||||
}
|
||||
},
|
||||
{
|
||||
name: getLabel(32556,"已延期"),
|
||||
type: 'line',
|
||||
areaStyle: { normal: {} },
|
||||
data : chartdata.chart3 ? chartdata.chart3.overtime_data:[],
|
||||
color: {
|
||||
colorStops: [{
|
||||
offset: 0, color: '#F72E04' // 0% 处的颜色
|
||||
}, {
|
||||
offset: 1, color: '#F72E04' // 100% 处的颜色
|
||||
}],
|
||||
globalCoord: false // 缺省为 false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// let topTab = [
|
||||
// {
|
||||
// color: '#000000',
|
||||
// groupid: 'flowAll',
|
||||
// showcount: true,
|
||||
// title: '任务统计',
|
||||
// viewcondition: 0
|
||||
// },
|
||||
// {
|
||||
// color: '#ff3232',
|
||||
// groupid: 'flowNew',
|
||||
// showcount: true,
|
||||
// title: '按负责人',
|
||||
// viewcondition: 1
|
||||
// },
|
||||
// {
|
||||
// color: '#fea468',
|
||||
// groupid: 'flowRes',
|
||||
// showcount: true,
|
||||
// title: '按看板',
|
||||
// viewcondition: 2
|
||||
// }
|
||||
// ];
|
||||
|
||||
return (
|
||||
<div className={"prjStastics"} >
|
||||
{/* {this.getStastics(toJS(stastics))} */}
|
||||
<div className={"folderChartBar flexRow"}>
|
||||
<div className={"folderChartBarLeft"}>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@1eqb8g`} placement="bottom">
|
||||
<div className={"ThemeColor3"}>
|
||||
<span class="charBarNum1">{chartdata.allnum ? chartdata.allnum.value:0}</span>{getLabel(27591,"个")}
|
||||
<span class="block">{chartdata.allnum ? chartdata.allnum.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@7y6qvi`} placement="bottom" >
|
||||
<div>
|
||||
<span class="charBarNum1">{chartdata.finishnum ? chartdata.finishnum.value:0}</span>{getLabel(27591,"个")}
|
||||
<span class="block">{chartdata.finishnum ? chartdata.finishnum.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@7tr9jd`} placement="bottom" >
|
||||
<div >
|
||||
<span class="charBarNum1">{chartdata.todonum ? chartdata.todonum.value:0}</span>{getLabel(27591,"个")}
|
||||
<span class="block">{chartdata.todonum ? chartdata.todonum.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@pui1a9`} placement="bottom">
|
||||
<div>
|
||||
<span class="charBarNum1">{chartdata.doingnum ? chartdata.doingnum.value:0}</span>{getLabel(27591,"个")}
|
||||
<span class="block">{chartdata.doingnum ? chartdata.doingnum.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@ihnf6j`} placement="bottom" title={""}>
|
||||
<div>
|
||||
<span class="charBarNum1">{chartdata.overtimenum ? chartdata.overtimenum.value:0}</span>{getLabel(27591,"个")}
|
||||
<span class="block">{chartdata.overtimenum ? chartdata.overtimenum.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@w2fm1a`} placement="bottom" >
|
||||
<div className={"ThemeColor3"}>
|
||||
<span class="charBarNum1">{chartdata.workday1 ? chartdata.workday1.value:0}</span>{getLabel(1925,"天")}
|
||||
<span class="block">{chartdata.workday1 ? chartdata.workday1.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@gfauc3`} placement="bottom">
|
||||
<div>
|
||||
<span class="charBarNum1">{chartdata.workday2 ? chartdata.workday2.value:0}</span>{getLabel(1925,"天")}
|
||||
<span class="block">{chartdata.workday2 ? chartdata.workday2.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
<div className={"folderChartBarRight"}>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@1sly4y`} placement="bottom" >
|
||||
<div>
|
||||
<span class="charBarNum1">{chartdata.hrmidsnum ? chartdata.hrmidsnum.value:0}</span>{getLabel(127,"人")}
|
||||
<span class="block">{chartdata.hrmidsnum ? chartdata.hrmidsnum.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@9rs98x`} placement="bottom" >
|
||||
<div>
|
||||
<span class="charBarNum1">{chartdata.members ? chartdata.members.value:0}</span>{getLabel(127,"人")}
|
||||
<span class="block">{chartdata.members ? chartdata.members.lable:''}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={"folderChartBox"}>
|
||||
<div className={"folderChartBoxModel flexRow"}>
|
||||
<div className={"flex"}>
|
||||
<div className={"folderChartBoxTitle"}>{getLabel(387425,"阶段任务分布")}</div>
|
||||
<div className={"folderChartBoxContent"}>
|
||||
{chartdata.chart1&&<WeaEchart ecId={`${this && this.props && this.props.ecId || ''}_WeaEchart@3y5t05`} ref={this.setChart1Ref} option={charts.option1} useDefault={false} />}
|
||||
</div>
|
||||
</div>
|
||||
<div className={"flex"}>
|
||||
<div className={"folderChartBoxTitle"}>{getLabel(387426,"阶段任务状态统计")}</div>
|
||||
<div className={"folderChartBoxContent"}>
|
||||
{chartdata.chart2&&<WeaEchart ecId={`${this && this.props && this.props.ecId || ''}_WeaEchart@wxgnge`} ref={this.setChart2Ref} option={charts.option2} useDefault={false} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={"folderChartBoxModel flexRow"}>
|
||||
<div className={"flex"}>
|
||||
<div className={"folderChartBoxTitle"}>{getLabel(387427,"负责人任务状态统计")}</div>
|
||||
<div className={"folderChartBoxContent"}>
|
||||
{chartdata.chart3&&<WeaEchart ecId={`${this && this.props && this.props.ecId || ''}_WeaEchart@bimm68`} ref={this.setChart3Ref} option={charts.option3} useDefault={false} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,586 @@
|
|||
import { Row, Col,Button, Modal, message } from 'antd';
|
||||
import { WeaBrowser, WeaNewScroll, WeaRichText } from 'ecCom';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { imgZoom} from '../../util/index';
|
||||
const confirm = Modal.confirm;
|
||||
import {toJS} from 'mobx';
|
||||
import {WeaLocaleProvider} from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class TabDiscuss extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
|
||||
|
||||
componentDidMount() {
|
||||
let dom = ReactDOM.findDOMNode(this);
|
||||
imgZoom(dom, ".wea-cl-content");
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
let dom = ReactDOM.findDOMNode(this);
|
||||
imgZoom(dom, ".wea-cl-content");
|
||||
}
|
||||
|
||||
componentWillUnmount(){
|
||||
const {setBrowserList} = this.props.contentStore;
|
||||
setBrowserList({
|
||||
'create': {remark: ''},
|
||||
datas: [],
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {exchangeList,_BrowserList} = this.props.contentStore;
|
||||
let _exchangeList = toJS(exchangeList);
|
||||
let BrowserList = toJS(_BrowserList);
|
||||
const { sortid } = this.props;
|
||||
let exchangeListDatas = _exchangeList ? _exchangeList.datas : [];
|
||||
let wf_auth_url = _exchangeList ? _exchangeList.wf_auth_url : "";
|
||||
let doc_auth_url = _exchangeList ? _exchangeList.doc_auth_url : "";
|
||||
let acc_auth_url = _exchangeList ? _exchangeList.acc_auth_url : "";
|
||||
|
||||
let bottomBarConfig = [];
|
||||
let mirror = {
|
||||
Document: { type: 37, name: getLabel(126529,"文档"), icon: 'icon-blog-Document' },
|
||||
Flow: { type: 152, name: getLabel(131692,"流程"), icon: 'icon-blog-Process' },
|
||||
Customer: { type: 18, name: getLabel(30043,"客户"), icon: 'icon-blog-Personnel' },
|
||||
Project: { type: 135, name: getLabel(30046,"项目"), icon: 'icon-blog-Project' },
|
||||
Task: { type: 'prjtsk', name: getLabel(383349,"任务"), icon: 'icon-blog-Task' },
|
||||
}
|
||||
let objDocument = {
|
||||
name: 'Browser',
|
||||
show: <div className="wea-cb-item">
|
||||
<span className={`wea-cbi-icon ${mirror['Document'].icon}`} />
|
||||
<span className="wea-cbi-text">{mirror['Document'].name}</span>
|
||||
</div>,
|
||||
type: mirror['Document'].type,
|
||||
title: mirror['Document'].name,
|
||||
};
|
||||
let objFlow = {
|
||||
name: 'Browser',
|
||||
show: <div className="wea-cb-item">
|
||||
<span className={`wea-cbi-icon ${mirror['Flow'].icon}`} />
|
||||
<span className="wea-cbi-text">{mirror['Flow'].name}</span>
|
||||
</div>,
|
||||
type: mirror['Flow'].type,
|
||||
title: mirror['Flow'].name,
|
||||
};
|
||||
let objCustomer = {
|
||||
name: 'Browser',
|
||||
show: <div className="wea-cb-item">
|
||||
<span className={`wea-cbi-icon ${mirror['Customer'].icon}`} />
|
||||
<span className="wea-cbi-text">{mirror['Customer'].name}</span>
|
||||
</div>,
|
||||
type: mirror['Customer'].type,
|
||||
title: mirror['Customer'].name,
|
||||
};
|
||||
|
||||
let objProject = {
|
||||
name: 'Browser',
|
||||
show: <div className="wea-cb-item">
|
||||
<span className={`wea-cbi-icon ${mirror['Project'].icon}`} />
|
||||
<span className="wea-cbi-text">{mirror['Project'].name}</span>
|
||||
</div>,
|
||||
type: mirror['Project'].type,
|
||||
title: mirror['Project'].name,
|
||||
};
|
||||
let objTask = {
|
||||
name: 'Browser',
|
||||
show: <div className="wea-cb-item">
|
||||
<span className={`wea-cbi-icon ${mirror['Task'].icon}`} />
|
||||
<span className="wea-cbi-text">{mirror['Task'].name}</span>
|
||||
</div>,
|
||||
type: mirror['Task'].type,
|
||||
title: mirror['Task'].name,
|
||||
};
|
||||
|
||||
_exchangeList.docids && bottomBarConfig.push(objDocument);//相关文档
|
||||
_exchangeList.relatedwf && bottomBarConfig.push(objFlow);//相关流程
|
||||
_exchangeList.relatedcus && bottomBarConfig.push(objCustomer);//相关客户
|
||||
_exchangeList.projectids && bottomBarConfig.push(objProject);//相关项目
|
||||
_exchangeList.relatedprj && bottomBarConfig.push(objTask);//相关任务
|
||||
_exchangeList.relateddoc && bottomBarConfig.push({
|
||||
name: 'Upload',
|
||||
show: <div className="wea-cb-item">
|
||||
<span className='wea-cbi-icon icon-blog-Enclosure' />
|
||||
<span className="wea-cbi-text">{getLabel(128158,"附件")}</span>
|
||||
</div>,
|
||||
uploadId: 'project_edit',
|
||||
uploadUrl: `${_exchangeList.relateddoc.uploadUrl}?category=${_exchangeList.relateddoc.category}`,
|
||||
category: _exchangeList.relateddoc.category,
|
||||
maxUploadSize: _exchangeList.relateddoc.maxSize,
|
||||
style: { display: "inline-block", padding: 0 }
|
||||
})
|
||||
//相关附件--relateddoc
|
||||
let browserParam = {
|
||||
hasAddBtn: false,
|
||||
hasAdvanceSerach: true,
|
||||
idSeparator: ",",
|
||||
isAutoComplete: 1,
|
||||
isDetail: 0,
|
||||
isMultCheckbox: false,
|
||||
isSingle: true,
|
||||
linkUrl: "/hrm/resource/HrmResource.jsp?id=",
|
||||
pageSize: 10,
|
||||
quickSearchName: "",
|
||||
title: getLabel(383424,"人力资源"),
|
||||
type: "1",
|
||||
viewAttr: 1,
|
||||
}
|
||||
return (
|
||||
<div className="wea-prj-tabDiscuss"
|
||||
style={{ backgroundColor: '#f7f7f7', padding: '16px 16px 0 16px', height: '100%' }}
|
||||
>
|
||||
{
|
||||
Array.isArray(BrowserList.datas) && BrowserList.datas.map((element, index) => {
|
||||
let replaceDatas = [];
|
||||
replaceDatas.push(element.creater);
|
||||
let baseParams = {
|
||||
'37': 'docids',
|
||||
'152': 'relatedwf',
|
||||
'18': 'relatedcus',
|
||||
'135': 'projectids',
|
||||
'prjtsk': 'relatedprj',
|
||||
}
|
||||
element['id'] == BrowserList[element['id']]
|
||||
let newbottomBarConfig = bottomBarConfig.map((_element, _index) => {
|
||||
_element['memorise'] = true
|
||||
for (let key in BrowserList) {
|
||||
if (key == element['id']) {
|
||||
return { ..._element, replaceDatas: BrowserList[element['id']][baseParams[_element.type]] }
|
||||
}
|
||||
}
|
||||
return _element
|
||||
})
|
||||
let bottomBarRight={
|
||||
Component: <span style={{position:'absolute',right:'10px'}}>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@8yp32z@submit`} key="submit" type="primary" style={{ display: 'inline-block', borderRadius: '3px' }} onClick={() => this.dosubmit(element.id)} ><span className="icon-coms-Release" style={{ paddingRight: '7px' }} />{getLabel(383336,"提交")}</Button>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@4n1iwe@cancel`} key="cancel" type="primary" style={{ display: element.id != 'create' ? 'inline-block' : 'none', marginLeft: '5px', borderRadius: '3px' }} onClick={() => { this.docancel(index) }} >{getLabel(31129,"取消")}</Button>
|
||||
</span>
|
||||
};
|
||||
|
||||
|
||||
let show = element.isEdit == true ?
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@h9mkdb`} height='252px'>
|
||||
<div style={{ backgroundColor: '#ffffff', height: '242px', marginBottom: '10px' }}>
|
||||
<WeaRichText ecId={`${this && this.props && this.props.ecId || ''}_WeaRichText@79055b`}
|
||||
id={`${element.id}_discuss`}
|
||||
ref={`${element.id}_discuss`}
|
||||
value={BrowserList[element.id].remark}
|
||||
ckConfig={{
|
||||
toolbar: [
|
||||
{ name: 'document', items: ['Source'] },
|
||||
{ name: 'paragraph', items: ['JustifyLeft', 'JustifyCenter', 'JustifyRight', '-', 'NumberedList', 'BulletedList'] },
|
||||
{ name: 'styles', items: ['Format', 'Font', 'FontSize'] },
|
||||
{ name: 'colors', items: ['TextColor'] },
|
||||
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike',] },
|
||||
{ name: 'insert', items: ['Image', 'Table', 'Smiley'] }
|
||||
],
|
||||
extraPlugins: 'autogrow',
|
||||
height: 150,
|
||||
autoGrow_minHeight: 150,
|
||||
autoGrow_maxHeight: 160,
|
||||
removePlugins: 'resize',
|
||||
uploadUrl: (window.ecologyContentPath || '')+'/api/doc/upload/uploadFile?model=reply',
|
||||
}}
|
||||
bottomBarConfig={newbottomBarConfig}
|
||||
bottomBarRight={bottomBarRight}
|
||||
onChange={(text) => this.onChange(element.id, text)}
|
||||
onStatusChange={s => { }}
|
||||
onToolsChange={(name, ids, list, type) => this.transfStr(name, ids, list, type, element.id)}
|
||||
/>
|
||||
</div>
|
||||
</WeaNewScroll>
|
||||
: <div style={{ borderBottom: '1px solid #E2E2E2', padding: "10px 10px 0 10px", backgroundColor: '#ffffff' }}>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@kx952b`} >
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2kot4f@${index}`} span={2}>
|
||||
<img src={`${element.creater.imgurl}`} style={{ height: '40px', width: '40px', borderRadius: '20px' }} />
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@sorqsm@${index}`} span={22}>
|
||||
|
||||
<div style={{ marginBottom: '8px' }}>
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@r90h66@${index}`} {...browserParam} replaceDatas={replaceDatas} />
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="wea-cl-content"
|
||||
dangerouslySetInnerHTML={{__html: `<div class="wea-ckeditor-content">${element.remark}</div>`}}
|
||||
/>
|
||||
{
|
||||
element.projectids&&element.projectids.length > 0 ?
|
||||
element.projectids.map((e, _index) => {//相关项目
|
||||
return <div>
|
||||
<span className="icon-blog-Project" style={{ paddingRight: '5px' }} />
|
||||
<a href='javascript:void(0)' linkid={e.id} linkType='workflow'
|
||||
onClick={() => openProjectAppLink('project', e.id, sortid)} ondblclick={() => false}
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.name} </a>
|
||||
</div>
|
||||
}) : ''
|
||||
}
|
||||
{
|
||||
element.relatedcus&&element.relatedcus.length > 0 ?
|
||||
element.relatedcus.map((e, _index) => {//客户
|
||||
return <div>
|
||||
<span className="icon-blog-Personnel" style={{ paddingRight: '5px' }} />
|
||||
<a href='javascript:void(0)' linkid={e.id} linkType='workflow'
|
||||
onClick={() => openProjectAppLink('crm', e.id, sortid)} ondblclick={() => false}
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.name} </a>
|
||||
</div>
|
||||
}) : ''
|
||||
}
|
||||
{
|
||||
element.relateddoc&&element.relateddoc.length > 0 ?
|
||||
element.relateddoc.map((e, _index) => {//修改成附件
|
||||
if (e.showLoad) {
|
||||
return <div>
|
||||
<span className="icon-blog-Enclosure" style={{ paddingRight: '5px' }} />
|
||||
<a onClick={() => openProjectDiscussDoc(this, e.fileid, sortid,acc_auth_url)} href='javascript:void(0);'
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.filename}</a>
|
||||
<a unselectable='off' contenteditable='false' href={e.loadlink+acc_auth_url} target='_blank'
|
||||
style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{`${getLabel(258,"下载")}(${e.filesize})`}</a>
|
||||
</div>
|
||||
} else {
|
||||
return <div>
|
||||
<span className="icon-blog-Enclosure" style={{ paddingRight: '5px' }} />
|
||||
<a onClick={() => openProjectDiscussDoc(this, e.fileid, sortid,acc_auth_url)} href='javascript:void(0);'
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.filename}</a>
|
||||
</div>
|
||||
}
|
||||
}) : ''
|
||||
}
|
||||
{
|
||||
element.relatedprj&&element.relatedprj.length > 0 ?
|
||||
element.relatedprj.map((e, _index) => {
|
||||
return <div>
|
||||
<span className="icon-blog-Task" style={{ paddingRight: '5px' }} />
|
||||
<a href='javascript:void(0)' linkid={e.id} linkType='workflow'
|
||||
onClick={() => openProjectAppLink('task', e.id, sortid)} ondblclick={() => false}
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.name} </a>
|
||||
</div>
|
||||
}) : ''
|
||||
}
|
||||
{
|
||||
element.relatedwf&&element.relatedwf.length > 0 ?
|
||||
element.relatedwf.map((e, _index) => {//流程
|
||||
return <div>
|
||||
<span className="icon-blog-Process" style={{ paddingRight: '5px' }} />
|
||||
<a href='javascript:void(0)' linkid={e.id} linkType='workflow'
|
||||
onClick={() => openProjectAppLink('workflow', e.id, sortid,wf_auth_url)} ondblclick={() => false}
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.name} </a>
|
||||
</div>
|
||||
}) : ''
|
||||
}
|
||||
{
|
||||
element.docids&&element.docids.length > 0 ?
|
||||
element.docids.map((e, _index) => {//文档
|
||||
return <div>
|
||||
<span className="icon-blog-Document" style={{ paddingRight: '5px' }} />
|
||||
<a href='javascript:void(0)' linkid={e.id} linkType='workflow'
|
||||
onClick={() => openProjectAppLink('doc', e.id, sortid,doc_auth_url)} ondblclick={() => false}
|
||||
unselectable='off' contenteditable='false' style={{ cursor: 'pointer', textDecoration: 'underline !important', marginRight: '8px' }}>{e.name} </a>
|
||||
</div>
|
||||
}) : ''
|
||||
}
|
||||
</Col>
|
||||
{/*</WeaNewScroll>*/}
|
||||
</Row>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@clbkgd@${index}`} style={{ margin: '10px 0' }}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@emr6hm@${index}`} span={8} offset={2}>
|
||||
<span style={{ color: '#999999' }}>
|
||||
{element.time}
|
||||
</span>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@oxjn3c@${index}`} span={14}>
|
||||
{
|
||||
element.canedit ? (
|
||||
<span
|
||||
className="wea-mbwcbr-item icon-coms-edit"
|
||||
style = {{cursor:'pointer',position:'absolute',right:'90px',color: '#b2b2b2'}}
|
||||
onClick={() => this.edit(element.id)}
|
||||
><span style={{ fontSize: "12px", color: '#666666' }}> {`${getLabel(126036,"编辑")}`}</span></span>
|
||||
) : ""
|
||||
}
|
||||
{
|
||||
element.canedit ? (
|
||||
<span
|
||||
className="wea-mbwcbr-item icon-coms-delete"
|
||||
onClick={() => this.delete(element.id)}
|
||||
style = {{position:'absolute',right:'20px',cursor:'pointer', color: '#b2b2b2'}}
|
||||
><span style={{ fontSize: "12px", color: '#666666' }}> {`${getLabel(131966,"删除")}`}</span></span>
|
||||
) : ""
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</div>
|
||||
return show
|
||||
})
|
||||
}
|
||||
{
|
||||
exchangeListDatas.length == 1 ?
|
||||
<div style={{ textAlign: 'center', height: '135px' }}>
|
||||
<span className="icon-blog-Unhappy" style={{ display: 'inline-block', marginTop: '50px' }}><span style={{ paddingLeft: '5px' }}>{getLabel(383567,"暂无相关交流")}</span></span>
|
||||
</div>
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
edit = (_id) => {
|
||||
const {exchangeList,changeDiscussList,_BrowserList,setBrowserList} = this.props.contentStore;
|
||||
let _exchangeList = toJS(exchangeList);
|
||||
let BrowserList = toJS(_BrowserList);
|
||||
let oldBrowserList = { ...BrowserList };
|
||||
let oldexchangeList = { ..._exchangeList }
|
||||
oldexchangeList.datas.forEach((element, index) => {
|
||||
if (_id == element['id']) {
|
||||
element.isEdit = true;
|
||||
if (oldBrowserList[_id] == undefined) {
|
||||
oldBrowserList[_id] = {};
|
||||
}
|
||||
oldBrowserList[_id].relatedwf = element.relatedwf;
|
||||
oldBrowserList[_id].docids = element.docids;
|
||||
oldBrowserList[_id].projectids = element.projectids;
|
||||
oldBrowserList[_id].relatedcus = element.relatedcus;
|
||||
oldBrowserList[_id].relateddoc = element.relateddoc;
|
||||
oldBrowserList[_id].relatedprj = element.relatedprj;
|
||||
}
|
||||
})
|
||||
setBrowserList(oldBrowserList);
|
||||
changeDiscussList(oldexchangeList)
|
||||
}
|
||||
onChange = (id, text) => {
|
||||
const {_BrowserList,setBrowserList} = this.props.contentStore;
|
||||
let BrowserList = toJS(_BrowserList);
|
||||
let oldBrowserList = { ...BrowserList };
|
||||
if (oldBrowserList[id] == undefined) {
|
||||
oldBrowserList[id] = {};
|
||||
}
|
||||
oldBrowserList[id]['remark'] = text;
|
||||
setBrowserList(oldBrowserList);
|
||||
}
|
||||
delete = (e) => {
|
||||
const {exchangeDelete} = this.props.contentStore;
|
||||
const { sortid } = this.props;
|
||||
confirm({
|
||||
title : getLabel(131329,"信息确认"),
|
||||
content : getLabel(15097,"确定要删除吗?"),
|
||||
onOk(){
|
||||
exchangeDelete({ id: e, sortid: sortid });
|
||||
},
|
||||
onCancel() {}
|
||||
})
|
||||
|
||||
}
|
||||
dosubmit = (id) => {
|
||||
const {exchangeSave,_BrowserList,setBrowserList} = this.props.contentStore;
|
||||
let BrowserList = toJS(_BrowserList);
|
||||
let oldBrowserList = { ...BrowserList }
|
||||
const { sortid } = this.props;
|
||||
let params = oldBrowserList[id];
|
||||
let mewParams = { ...params }
|
||||
let canSubmit = false;
|
||||
for (let key in mewParams) {
|
||||
if (key != 'id' && key != 'sortid') {
|
||||
if (key == 'remark') {
|
||||
if (mewParams[key]) {
|
||||
canSubmit = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (params.docids.length == 0) {
|
||||
delete mewParams.docids
|
||||
}
|
||||
if (params.projectids.length == 0) {
|
||||
delete mewParams.projectids
|
||||
}
|
||||
if (params.relatedcus.length == 0) {
|
||||
delete mewParams.relatedcus
|
||||
}
|
||||
if (params.relateddoc.length == 0) {
|
||||
delete mewParams.relateddoc
|
||||
}
|
||||
if (params.relatedprj.length == 0) {
|
||||
delete mewParams.relatedprj
|
||||
}
|
||||
if (params.relatedwf.length == 0) {
|
||||
delete mewParams.relatedwf
|
||||
}
|
||||
if (params.docids.length > 0) {
|
||||
let docidsarr = []
|
||||
params.docids.forEach((_e, _index) => {
|
||||
docidsarr.push(_e['id']);
|
||||
})
|
||||
mewParams.docids = docidsarr.join(',');
|
||||
}
|
||||
if (params.projectids.length > 0) {
|
||||
let projectidssarr = []
|
||||
params.projectids.forEach((_e, _index) => {
|
||||
projectidssarr.push(_e['id']);
|
||||
})
|
||||
mewParams.projectids = projectidssarr.join(',');
|
||||
|
||||
}
|
||||
if (params.relatedcus.length > 0) {//客户和任务有问题
|
||||
let relatedcusarr = []
|
||||
params.relatedcus.forEach((_e, _index) => {
|
||||
relatedcusarr.push(_e['id']);
|
||||
})
|
||||
mewParams.relatedcus = relatedcusarr.join(',');
|
||||
|
||||
}
|
||||
if (params.relateddoc.length > 0) {
|
||||
let relateddocarr = []
|
||||
params.relateddoc.forEach((_e, _index) => {
|
||||
relateddocarr.push(_e['id']);
|
||||
})
|
||||
mewParams.relateddoc = relateddocarr.join(',');
|
||||
|
||||
}
|
||||
if (params.relatedprj.length > 0) {
|
||||
let relatedprjarr = []
|
||||
params.relatedprj.forEach((_e, _index) => {
|
||||
relatedprjarr.push(_e['id']);
|
||||
})
|
||||
mewParams.relatedprj = relatedprjarr.join(',');
|
||||
|
||||
}
|
||||
if (params.relatedwf.length > 0) {
|
||||
let relatedwfarr = []
|
||||
params.relatedwf.forEach((_e, _index) => {
|
||||
relatedwfarr.push(_e['id']);
|
||||
})
|
||||
mewParams.relatedwf = relatedwfarr.join(',');
|
||||
|
||||
}
|
||||
mewParams['id'] = id == 'create' ? '' : id;
|
||||
mewParams['sortid'] = sortid;
|
||||
let stateBrowserList = { ...BrowserList };
|
||||
stateBrowserList['create']['docids'] = []
|
||||
stateBrowserList['create']['projectids'] = []
|
||||
stateBrowserList['create']['relatedcus'] = []
|
||||
stateBrowserList['create']['relateddoc'] = []
|
||||
stateBrowserList['create']['relatedprj'] = []
|
||||
stateBrowserList['create']['relatedwf'] = []
|
||||
stateBrowserList['create']['remark'] = ''
|
||||
|
||||
if (canSubmit) {
|
||||
setBrowserList(stateBrowserList);
|
||||
exchangeSave(mewParams);
|
||||
} else {
|
||||
message.error(getLabel(126982,"请填写内容"));
|
||||
// Modal.warning({
|
||||
// title: getLabel(382056,"警告"),
|
||||
// content: getLabel(126982,"请填写内容"),
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
docancel = (e) => {
|
||||
const {exchangeList,changeDiscussList} = this.props.contentStore;
|
||||
let _exchangeList = toJS(exchangeList);
|
||||
let oldexchangeList = { ..._exchangeList }
|
||||
oldexchangeList.datas.forEach((element, index) => {
|
||||
if (e == index) {
|
||||
element.isEdit = false;
|
||||
}
|
||||
})
|
||||
changeDiscussList(oldexchangeList)
|
||||
}
|
||||
|
||||
transfStr = (name = '', ids = '', list = [], type = '', id = '') => {
|
||||
const {_BrowserList,setBrowserList,exchangeList} = this.props.contentStore;
|
||||
let BrowserList = toJS(_BrowserList);
|
||||
let _exchangeList = toJS(exchangeList);
|
||||
let acc_auth_url = _exchangeList ? _exchangeList.acc_auth_url : "";
|
||||
let { sortid } = this.props;
|
||||
let str = '';
|
||||
let idsArr = [];
|
||||
const mirror = {
|
||||
37: "doc",
|
||||
prjtsk: "task",
|
||||
18: "crm",
|
||||
152: "workflow",
|
||||
135: "project",
|
||||
workplan: "workplan",
|
||||
blogTemplate: "blogTemplate"
|
||||
}
|
||||
const browserType = {
|
||||
37: "docids",
|
||||
prjtsk: "relatedprj",
|
||||
18: "relatedcus",
|
||||
152: "relatedwf",
|
||||
135: "projectids",//项目
|
||||
Upload: "relateddoc",//附件
|
||||
}
|
||||
list.map(item => {
|
||||
if (name === 'Browser') {
|
||||
let urlstr=this.openProjectAppLink(mirror[type],item.id,sortid);
|
||||
str +=` <a href='${urlstr}' target='new' linkid='${item.id}' linkType='${mirror[type]}' unselectable='off' contenteditable='false' style='cursor:pointer;text-decoration:underline !important;margin-right:8px'>${item.name || item.showname}</a> `
|
||||
idsArr.push(item.id)
|
||||
}
|
||||
if (name === 'Upload' && type === 'image') {
|
||||
str += ' <img class="formImgPlay" src="' + item.imgSrc + '" onclick="ecCom.WeaRichText.playImg(this)" data-imgsrc="' + item.imgSrc + '" /> '
|
||||
}
|
||||
if (name === 'Upload' && type === 'file') {
|
||||
str += ` <a onclick='openProjectDiscussDoc(this,${item.fileid},${sortid},${acc_auth_url})' unselectable='off' contenteditable='false' style='cursor:pointer;text-decoration:underline !important;margin-right:8px'>${item.filename}</a> `
|
||||
if (item.showLoad) {
|
||||
let urlstr=item.loadlink+"&sortid="+sortid+acc_auth_url;
|
||||
str += `<a href='${urlstr}' target='_blank' unselectable='off' contenteditable='false' style='cursor:pointer;text-decoration:underline !important;margin-right:8px'>${getLabel(258,"下载")}(${item.filesize})</a> `
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
let oldBrowserList = { ...BrowserList };
|
||||
if (oldBrowserList[id] == undefined) {
|
||||
oldBrowserList[id] = {};
|
||||
}
|
||||
if (name != 'Upload') {
|
||||
oldBrowserList[id][browserType[type]] = list;
|
||||
} else {
|
||||
if(type === 'file'){
|
||||
list.map(item => {
|
||||
oldBrowserList[id]['relateddoc'].push({ id: item.fileid})
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
setBrowserList(oldBrowserList);
|
||||
return str
|
||||
}
|
||||
|
||||
openProjectAppLink=(linkType, linkid, prjid)=>{
|
||||
const {exchangeList} = this.props.contentStore;
|
||||
let _exchangeList = toJS(exchangeList);
|
||||
let wf_auth_url = _exchangeList ? _exchangeList.wf_auth_url : "";
|
||||
let doc_auth_url = _exchangeList ? _exchangeList.doc_auth_url : "";
|
||||
let acc_auth_url = _exchangeList ? _exchangeList.acc_auth_url : "";
|
||||
if (linkType == "doc")
|
||||
return `${window.ecologyContentPath || ''}/spa/document/index.jsp?id=${linkid}&prjid=${prjid}`+doc_auth_url;
|
||||
else if (linkType == "task")
|
||||
return `${window.ecologyContentPath || ''}/spa/prj/index.html#/main/prj/taskCard?taskid=${linkid}`;
|
||||
else if (linkType == "crm")
|
||||
return `${window.ecologyContentPath || ''}/spa/crm/static/index.html#/main/crm/customerView?customerId=${linkid}`;
|
||||
else if (linkType == "workflow")
|
||||
return `${window.ecologyContentPath || ''}/spa/workflow/static4form/index.html#/main/workflow/req?fromModul=prj&modulResourceId=${prjid}&requestid=${linkid}`+wf_auth_url;
|
||||
else if (linkType == "project")
|
||||
return `${window.ecologyContentPath || ''}/spa/prj/index.html#/main/prj/projectCard?prjid=${prjid}`;
|
||||
else
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default TabDiscuss
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
|
||||
import { Button, Row, Col, Icon, message, Modal } from 'antd';
|
||||
import { WeaTab, WeaAlertPage, WeaProgress, WeaSearchGroup, WeaFormItem, WeaLocaleProvider } from 'ecCom';
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from 'mobx';
|
||||
import { WeaTableNew, WeaSwitch } from 'comsMobx';
|
||||
import { Condition } from "../list/listCondition"
|
||||
import TaskInfoDialog from '../dialog/taskDialog'
|
||||
import ExchangeDialog from '../dialog/exchangeDialog'
|
||||
import ShareDialog from '../dialog/shareDialog'
|
||||
import RelateListDialog from "../dialog/relateListDialog"
|
||||
import EditPrjTaskDataDialog from "../dialog/editPrjTaskDataDialog"
|
||||
import TaskBatchEditDialog from '../dialog/taskBatchEditDialog';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class TaskList extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taskid: "",
|
||||
coWorkVisiable: false,
|
||||
workPlanVisible: false
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
if(!window.weaWorkplan && !window.weaCowork){
|
||||
eventRegister.loadModule('f_workplan', ()=> {
|
||||
eventRegister.loadModule('f_cowork', ()=> {
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载协作模块失败,请联系系统管理员!");
|
||||
});
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载日程模块失败,请联系系统管理员!");
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(window.weaWorkplan && !window.weaCowork){
|
||||
eventRegister.loadModule('f_cowork', ()=> {
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载协作模块失败,请联系系统管理员!");
|
||||
});
|
||||
}else{
|
||||
eventRegister.loadModule('f_workplan', ()=> {
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载协作模块失败,请联系系统管理员!");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { contentStore, account, taskBatchEditDialogStore, delCallBack } = this.props;
|
||||
const { taskListTableStore, taskListRight: { hasRight, verified }, taskListTabs, taskListform, showSearchAd, taskListSearchParams, shareStore, exchangeStore, taskInfoStore, reLoad, prjid, refTaskList, showEditTask } = contentStore;
|
||||
const formParams = taskListform.getFormParams() || {};
|
||||
const rowSelection = {
|
||||
onChange(selectedRowKeys, selectedRows) {
|
||||
taskInfoStore.onRowSelect(selectedRowKeys);
|
||||
}
|
||||
};
|
||||
if (verified && !hasRight) {
|
||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@o0d1b4`} >
|
||||
<div style={{ color: '#000' }}>
|
||||
{getLabel(2012, "对不起,您暂时没有权限!")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
}
|
||||
if (verified && hasRight) {
|
||||
return (
|
||||
<div >
|
||||
{
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@5byy7j`}
|
||||
datas={toJS(taskListTabs)}
|
||||
keyParam="key" //主键
|
||||
selectedKey={taskListSearchParams.version}
|
||||
buttonsAd={this.getAdButtons()}
|
||||
searchType={['base', 'advanced']}
|
||||
searchsBaseValue={formParams.taskname}
|
||||
setShowSearchAd={bool => { contentStore.setShowSearchAd(bool) }}
|
||||
hideSearchAd={() => contentStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@gjwq9i`} listStore={contentStore} form={taskListform} onEnterSearch={this.onEnterSearch} ></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v => { contentStore.getPrjTaskList() }}
|
||||
onSearchChange={v => { contentStore.taskListform.updateFields({ taskname: { value: v } }, false); }}
|
||||
onChange={this.changeVision}
|
||||
/>
|
||||
}
|
||||
<div>
|
||||
{this.getQuickSearch()}
|
||||
</div>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@ro1kok`}
|
||||
comsWeaTableStore={taskListTableStore}
|
||||
childrenColumnName="subListspan"
|
||||
hasOrder={true}
|
||||
needScroll={false}
|
||||
register_table={() => reLoad(taskListTableStore)}
|
||||
getColumns={c => this.reRenderColumns(c)}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
rowSelection={rowSelection}
|
||||
/>
|
||||
<TaskBatchEditDialog ecId={`${this && this.props && this.props.ecId || ''}_TaskBatchEditDialog@6v94n1`} contentStore={taskBatchEditDialogStore} selectedRowKeys={taskListTableStore.selectedRowKeys} prjid={prjid} reset={() =>{contentStore.resetTaskInfoStore()}}/>
|
||||
<ShareDialog ecId={`${this && this.props && this.props.ecId || ''}_ShareDialog@79lajn`} contentStore={contentStore} />
|
||||
<ExchangeDialog ecId={`${this && this.props && this.props.ecId || ''}_ExchangeDialog@12smie`} contentStore={exchangeStore} />
|
||||
<TaskInfoDialog ecId={`${this && this.props && this.props.ecId || ''}_TaskInfoDialog@3m0j06`} contentStore={taskInfoStore} prjid={prjid} callBack={() => {
|
||||
refTaskList();
|
||||
if(delCallBack){
|
||||
delCallBack();
|
||||
}
|
||||
}} />
|
||||
<RelateListDialog ecId={`${this && this.props && this.props.ecId || ''}_RelateListDialog@7bd8qd`} contentStore={contentStore} />
|
||||
<EditPrjTaskDataDialog ecId={`${this && this.props && this.props.ecId || ''}_EditPrjTaskDataDialog@bndggk`} ref="editPrjTaskData" contentStore={contentStore} visible={showEditTask} />
|
||||
{window.weaCowork && window.weaCowork.com && window.weaCowork.com.CreateCowork && this.state.coWorkVisiable && this.state.taskid !== "" && (
|
||||
<window.weaCowork.com.CreateCowork ecId={`${this && this.props && this.props.ecId || ''}_CreateCowork@axpsbl`}
|
||||
initAddQuery={
|
||||
{
|
||||
relatedType: "task",
|
||||
ids: this.state.taskid
|
||||
}
|
||||
}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
coWorkVisiable: false
|
||||
});
|
||||
}}
|
||||
/>)
|
||||
}
|
||||
|
||||
{
|
||||
window.weaWorkplan && window.weaWorkplan.com && window.weaWorkplan.com.WorkPlanCreate &&
|
||||
(<window.weaWorkplan.com.WorkPlanCreate ecId={`${this && this.props && this.props.ecId || ''}_WorkPlanCreate@mpuht9`}
|
||||
type={"create"}//新建为'create',查看为'preview',编辑edit,共享share
|
||||
visible={this.state.workPlanVisible}//显隐受控
|
||||
doClose={() => { this.setWorkPlanVisible(false); }}//关闭回调
|
||||
onlyClose={() => { this.setWorkPlanVisible(false) }}//关闭回调,只做关闭操作
|
||||
workPlanId={""} //日程id,1查看日程时用到
|
||||
createConditionParams={[]}//创建的默认值日期和时间,没有传[]
|
||||
activeKey={""} //查看页面显示的面板1是基本信息,7是相关交流
|
||||
//changeTab={(key) => { }}//查看页面切换面板的回调
|
||||
selectUser={account && account.userid}//新建日程的创建人id
|
||||
workPlanTypeOptions={"2"}//客户模块的新建日程,普通新建传'',客户新建传3
|
||||
crmIDs={[]}//通过客户模块新建日程,并自动带出相关客户,[{'id':'','name':''}]
|
||||
projectid={prjid}
|
||||
taskid={this.state.taskid}
|
||||
description={""}//客户模块需求,支持新建时传入的'基本信息-内容'
|
||||
/>)
|
||||
}
|
||||
</div>)
|
||||
}
|
||||
return <div></div>
|
||||
}
|
||||
reRenderColumns(columns) {
|
||||
columns.forEach((c,i) => {
|
||||
if (c.dataIndex == 'finish') {
|
||||
c.render = function (text, record) {
|
||||
return <span className='wea-prj-progressStyle' >
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@fmpr9h@${i}`} percent={record.finish || 0} strokeColor={record.finishspan} />
|
||||
</span>
|
||||
}
|
||||
} else {
|
||||
// c.render = function (text, record) {
|
||||
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
|
||||
// return <span dangerouslySetInnerHTML={{ __html: valueSpan }}></span>
|
||||
// }
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
getQuickSearch() {
|
||||
const { taskListQuickitems, taskListquickform, getPrjTaskList } = this.props.contentStore;
|
||||
const { isFormInit } = taskListquickform;
|
||||
let group = [];
|
||||
const formParams = taskListquickform.getFormParams();
|
||||
isFormInit && toJS(taskListQuickitems).map((c,i) => {
|
||||
let items = [];
|
||||
c.items.map((fields, index) => {
|
||||
items.push({
|
||||
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@b143dj@${index}`}
|
||||
label={`${fields.label}`}
|
||||
labelCol={{ span: `${fields.labelcol}` }}
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@hhx4ay@${index}`} fieldConfig={fields} form={taskListquickform} onChange={(res) => { getPrjTaskList({ [fields.domkey[0]]: res[fields.domkey[0]].value }); }} />
|
||||
</WeaFormItem>),
|
||||
colSpan: 1,
|
||||
})
|
||||
});
|
||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@gpgv4z@${i}`} needTigger={true} col={4} title={getLabel(32840, "基本条件")} showGroup={true} items={items} />)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
onOperatesClick(record, index, operate, flag) {
|
||||
let that = this;
|
||||
const { contentStore, delCallBack } = this.props;
|
||||
const { shareStore, exchangeStore, taskInfoStore, prjid } = contentStore;
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:", "");
|
||||
fn = fn.substring(0, fn.indexOf('('));
|
||||
|
||||
if (fn != "") {
|
||||
if ("onShare" == fn) { //共享
|
||||
shareStore.handleShareDialog(true, "task", record.randomFieldId, {})
|
||||
} else if ('onNewCowork' == fn) { //新建协作
|
||||
this.setState({ taskid: record.randomFieldId, coWorkVisiable: true });
|
||||
const coworkStoreMap = window.weaCowork.store && window.weaCowork.store.coworkStoreMap;
|
||||
const cowortore = coworkStoreMap && coworkStoreMap.getMapStore(3);
|
||||
cowortore && cowortore.setCreateState({ showNewCowork: true, createOrEdit: 0 });
|
||||
} else if ('onNewWorkplan' == fn) { //新建日程
|
||||
this.setState({ taskid: record.randomFieldId, workPlanVisible: true });
|
||||
} else if ('onAddSubTask' == fn) { //新建子任务
|
||||
taskInfoStore.handleDialog(true, "add", '', { prjid: prjid, parentid: record.randomFieldId });
|
||||
} else if ('onEditTask' == fn) { //编辑
|
||||
taskInfoStore.handleDialog(true, "edit", record.randomFieldId);
|
||||
} else if ('onDiscuss' == fn) { //相关交流
|
||||
exchangeStore.handleExchangeDialog(true, "task", record.randomFieldId, {})
|
||||
} else if ('onDel' == fn) { //删除
|
||||
taskInfoStore.delTask("del", record.randomFieldId, ()=> {if(delCallBack) delCallBack()});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
changeVision = (key) => {
|
||||
const { contentStore, getRightMenu } = this.props;
|
||||
contentStore.getPrjTaskList({ version: key == "0" ? "" : key })
|
||||
getRightMenu&&getRightMenu({type:'tasklist',version: key == "0" ? "" : key});
|
||||
}
|
||||
|
||||
getAdButtons = () => {
|
||||
const { contentStore,ecid } = this.props;
|
||||
const { getPrjTaskList, setShowSearchAd, taskListform } = contentStore;
|
||||
return [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@c49a66@search`} type="primary" onClick={() => { getPrjTaskList(); setShowSearchAd(false); }}>{getLabel(197, "搜索")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@74dg0f@reset`} type="ghost" onClick={() => { taskListform.reset(); }}>{getLabel(2022, "重置")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5ancbk@cancel`} type="ghost" onClick={() => { setShowSearchAd(false) }}>{getLabel(201, "取消")}</Button>)
|
||||
];
|
||||
}
|
||||
|
||||
setWorkPlanVisible = (bool) => {
|
||||
this.setState({ workPlanVisible: bool })
|
||||
}
|
||||
|
||||
onEnterSearch=() =>{
|
||||
const { contentStore } = this.props;
|
||||
contentStore.getPrjTaskList();
|
||||
contentStore.setShowSearchAd(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
import { Card,Pagination } from 'antd';
|
||||
import {WeaPopoverHrm,WeaLocaleProvider} from 'ecCom'
|
||||
import equals from 'deep-equal'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class ExchangeLogs extends React.Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
page:props.page || 1
|
||||
}
|
||||
}
|
||||
shouldComponentUpdate(nextProps,nextState) {
|
||||
if(!equals(this.props.data, nextProps.data)){
|
||||
this.setState({page:1})
|
||||
}
|
||||
return !equals(this.props.data, nextProps.data)||
|
||||
!equals(this.state.page,nextState.page);
|
||||
}
|
||||
render(){
|
||||
const {page} = this.state;
|
||||
const {data=[],totalSize=0} = this.props;
|
||||
return (
|
||||
<div className="prj-view-contactlog">
|
||||
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@yye8aw`} />
|
||||
{this.getCards(page)}
|
||||
{
|
||||
Number(totalSize)>0 ?
|
||||
<div className="prj-pagination"><Pagination ecId={`${this && this.props && this.props.ecId || ''}_Pagination@waiie7`} defaultCurrent={1} total={totalSize} onChange={this.changePageSize}/></div>
|
||||
:<div className="crm-no-datas-show">{getLabel(83320,"没有可显示的数据")}</div>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getCards(page){
|
||||
const {data} = this.props;
|
||||
let cards = [];
|
||||
data.map((item,index)=>{
|
||||
if(index>=(10*Number(page)-10) && index<= (10*Number(page)-1)){
|
||||
cards.push( <Card ecId={`${this && this.props && this.props.ecId || ''}_Card@jeynio@${index}`} className="view-contactlog-card" key={index}>
|
||||
<div className="card-left"><img src={item.createrimg} /></div>
|
||||
<div className="card-right">
|
||||
<div className="card-right-hrm"><span dangerouslySetInnerHTML={{__html:item.creatername}}></span> {item.createdate} {item.createtime}</div>
|
||||
<div className="feedbackrelate">
|
||||
<div dangerouslySetInnerHTML={{__html:item.remark}}></div>
|
||||
{item.docids && <div className="relatetitle">{getLabel(857,"相关文档")}: <span dangerouslySetInnerHTML={{__html:item.docids}}></span></div>}
|
||||
{item.requestids && <div className="relatetitle">{getLabel(1044,"相关流程")}: <span dangerouslySetInnerHTML={{__html:item.requestids}}></span></div>}
|
||||
{item.crmids && <div className="relatetitle">{getLabel(783,"相关客户")}: <span dangerouslySetInnerHTML={{__html:item.crmids}}></span></div>}
|
||||
{item.projectids && <div className="relatetitle">{getLabel(782,"相关项目")}: <span dangerouslySetInnerHTML={{__html:item.projectids}}></span></div>}
|
||||
{item.tskids && <div className="relatetitle">{getLabel(33414,"相关任务")}: <span dangerouslySetInnerHTML={{__html:item.tskids}}></span></div>}
|
||||
{item.accessory && <div className="relatetitle">{getLabel(22194,"相关附件")}: <span dangerouslySetInnerHTML={{__html:item.accessory}}></span></div>}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="clear"></div>
|
||||
</Card>)
|
||||
}
|
||||
});
|
||||
return cards;
|
||||
}
|
||||
changePageSize=(page)=>{
|
||||
this.setState({page:page});
|
||||
typeof this.props.onChange === 'function' && this.props.onChange(page);
|
||||
}
|
||||
}
|
||||
|
||||
export default ExchangeLogs;
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
import { Button, Radio, Slider, message, Modal } from 'antd';
|
||||
import * as React from 'react';
|
||||
import { WeaLocaleProvider, WeaInputSearch, WeaBrowser } from 'ecCom';
|
||||
import D3Tree from './RectTree';
|
||||
import { toJS } from 'mobx';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import './index.less';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class MindMap extends React.Component {
|
||||
searchedNode = []
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
layout : '0',
|
||||
scale : 10
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { store } = this.props;
|
||||
const { nodeForm, topButtons, hasChildren,path,canEdit } = this.props;
|
||||
const dataParams = path?{pathid:path.id,nodeid:nodeForm.id}:{};
|
||||
return (
|
||||
<div className="wea-edc-path-designer">
|
||||
<div className="tree-layout-toggle d3-tree-toggle">
|
||||
{topButtons.length > 0 && <Button.Group ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@j3i2ly`}>
|
||||
{
|
||||
topButtons
|
||||
}
|
||||
</Button.Group>}
|
||||
<Radio.Group ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@u16jis`} value={this.state.layout} onChange={this.changeLayout}>
|
||||
<Radio.Button ecId={`${this && this.props && this.props.ecId || ''}_RadioButton@c6o7ni`} value="0">{getLabel(22986, '左')}</Radio.Button>
|
||||
<Radio.Button ecId={`${this && this.props && this.props.ecId || ''}_RadioButton@w1ejve`} value="2">{getLabel(22988, '右')}</Radio.Button>
|
||||
<Radio.Button ecId={`${this && this.props && this.props.ecId || ''}_RadioButton@2wzfrk`} value="1">{getLabel(31276, '上')}</Radio.Button>
|
||||
<Radio.Button ecId={`${this && this.props && this.props.ecId || ''}_RadioButton@kxn5bw`} value="3">{getLabel(23010, '下')}</Radio.Button>
|
||||
</Radio.Group>
|
||||
<div className="edc-zoom-line">
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@q2h78q`}
|
||||
onClick={this.zoomOut}
|
||||
>
|
||||
<i className="anticon">
|
||||
<svg viewBox="64 64 896 896" class="" data-icon="zoom-out" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M637 443H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h312c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path></svg></i>
|
||||
</Button>
|
||||
<Slider ecId={`${this && this.props && this.props.ecId || ''}_Slider@reu4gh`}
|
||||
value={this.state.scale}
|
||||
marks={{ 1: '10%', 20: '200%', [this.state.scale]: `${this.state.scale * 10}%` }}
|
||||
min={1} max={20}
|
||||
tipFormatter={value => `${value * 10}%`}
|
||||
onChange={this.changeScale}
|
||||
>
|
||||
</Slider>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1rejrr`}
|
||||
onClick={this.zoomIn}
|
||||
>
|
||||
<i className="anticon">
|
||||
<svg viewBox="64 64 896 896" class="" data-icon="zoom-in" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M637 443H519V309c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v134H325c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h118v134c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V519h118c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8zm284 424L775 721c122.1-148.9 113.6-369.5-26-509-148-148.1-388.4-148.1-537 0-148.1 148.6-148.1 389 0 537 139.5 139.6 360.1 148.1 509 26l146 146c3.2 2.8 8.3 2.8 11 0l43-43c2.8-2.7 2.8-7.8 0-11zM696 696c-118.8 118.7-311.2 118.7-430 0-118.7-118.8-118.7-311.2 0-430 118.8-118.7 311.2-118.7 430 0 118.7 118.8 118.7 311.2 0 430z"></path></svg>
|
||||
</i>
|
||||
</Button>
|
||||
</div>
|
||||
<Button.Group ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@0qilil`}>
|
||||
<WeaInputSearch ecId={`${this && this.props && this.props.ecId || ''}_WeaInputSearch@5ddxps`}
|
||||
placeholder={getLabel('502644', '搜索节点')}
|
||||
onSearch={this.searchNode}
|
||||
onChange={this.changeSearchValue}
|
||||
/>
|
||||
</Button.Group>
|
||||
</div >
|
||||
{
|
||||
this.props.pathType === 1 &&
|
||||
<D3Tree ecId={`${this && this.props && this.props.ecId || ''}_D3Tree@jgt9oh`}
|
||||
data={toJS(this.props.data)}
|
||||
onClick={this.props.onClick}
|
||||
showRight={this.props.showRight}
|
||||
showDialog={this.props.showDialog}
|
||||
renderRight={this.props.renderRight}
|
||||
renderRightTitle={this.props.renderRightTitle}
|
||||
layout={this.state.layout}
|
||||
style={{ height: 'calc(100% - 32px)', top: 50 }}
|
||||
scale={this.state.scale}
|
||||
zoom={this.zoom}
|
||||
ref={ref => store.d3Tree = ref}
|
||||
showMenu={true}
|
||||
menus={this.props.rightMenus}
|
||||
closeRight={(bool)=>{this.props.closeRight(bool)}}
|
||||
closeDialog={(bool)=>{this.props.closeDialog(bool)}}
|
||||
// onDelete={(readonly || !nodeForm.parentid) || this.deleteNode}
|
||||
// onAddChild={readonly || this.addChildren}
|
||||
// onDeleteChild={(readonly) || (hasChildren && this.deleteChildren)}
|
||||
// onSynchro={readonly || this.synchronize}
|
||||
showname={this.getShowname}
|
||||
desc="hrmNames"
|
||||
desc2="description"
|
||||
desc3="overstr"
|
||||
></D3Tree>
|
||||
}
|
||||
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
getShowname = (d) => {
|
||||
return `${d.name}`;
|
||||
}
|
||||
changeSearchValue = () => {
|
||||
this.searchedNode = [];
|
||||
}
|
||||
searchNode = (value) => {
|
||||
const { store, params } = this.props;
|
||||
if (!value) {
|
||||
this.searchedNode = [];
|
||||
return;
|
||||
}
|
||||
if (store.d3Tree ) {
|
||||
if (this.searchedNode.length === 0) {
|
||||
this.timer = 0;
|
||||
this.searchedNode = store.d3Tree .searchNode(value.toLowerCase());
|
||||
}
|
||||
const length = this.searchedNode.length;
|
||||
if (length > 0) {
|
||||
store.d3Tree .centerNode(this.searchedNode[this.timer % length]);
|
||||
this.timer++;
|
||||
}
|
||||
}
|
||||
}
|
||||
zoom = (scale) => {
|
||||
// this.props.changeScale(parseInt(scale * 10));
|
||||
this.setState({
|
||||
scale : parseInt(scale * 10)
|
||||
});
|
||||
}
|
||||
zoomIn = () => {
|
||||
// this.props.changeScale(Math.min(this.props.scale + 1, 30));
|
||||
this.setState({
|
||||
scale : Math.min(this.state.scale + 1, 30)
|
||||
});
|
||||
}
|
||||
zoomOut = () => {
|
||||
// this.props.changeScale(Math.max(this.props.scale - 1, 1));
|
||||
this.setState({
|
||||
scale : Math.max(this.state.scale - 1, 1)
|
||||
});
|
||||
}
|
||||
changeScale = (scale) => {
|
||||
this.setState({
|
||||
scale : scale
|
||||
});
|
||||
}
|
||||
importPath = () => {
|
||||
this.props.openPathTemplateDialog();
|
||||
}
|
||||
setCombine = () => {
|
||||
const { edcPathDesignerStore: store, params } = this.props;
|
||||
this.props.combineSetDialogStore.open({ appid: params.appid });
|
||||
}
|
||||
changeLayout = (e) => {
|
||||
// const { edcPathDesignerStore: store } = this.props;
|
||||
this.searchedNode = [];
|
||||
// this.props.changeLayout(e.target.value);
|
||||
this.setState({
|
||||
layout : e.target.value
|
||||
});
|
||||
}
|
||||
|
||||
saveNode = () => {
|
||||
this.props.saveNode();
|
||||
}
|
||||
saveAsTemplate = () => {
|
||||
const { edcPathDesignerStore: store } = this.props;
|
||||
if (this.props.d3Tree) {
|
||||
const { edcPathDesignerStore: store } = this.props;
|
||||
const svg = this.props.d3Tree .baseSvg;
|
||||
const g = this.props.d3Tree .svgGroup;
|
||||
const serializer = new XMLSerializer();
|
||||
let source = serializer.serializeToString(svg.node());
|
||||
source = '<?xml version="1.0" standalone="no"?>\r\n' + source;
|
||||
const url = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(source);
|
||||
const canvas = document.createElement("canvas");
|
||||
const { width, height } = svg.node().getBoundingClientRect();
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
const context = canvas.getContext("2d");
|
||||
const image = new Image;
|
||||
image.src = url;
|
||||
image.onload = () => {
|
||||
context.drawImage(image, 50, 25);
|
||||
const img = canvas.toDataURL("image/png");
|
||||
this.props.saveAsTemplate(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
addChildren = () => {
|
||||
const { edcPathDesignerStore: store } = this.props;
|
||||
const { nodeForm } = store;
|
||||
this.props.setChildOpreator([]);
|
||||
this.props.allChildOpreator(nodeForm.id).then((childOpreator) => {
|
||||
this.props.setChildOpreator(childOpreator);
|
||||
if (this.browser) {
|
||||
this.browser.openModal();
|
||||
const selectPerson = (ids, names, objs) => {
|
||||
if (objs.length > 99) {
|
||||
message.warn(getLabel('502645', '下级节点不能超过99个'));
|
||||
this.browser.openModal();
|
||||
return;
|
||||
}
|
||||
const { edcPathDesignerStore: store } = this.props;
|
||||
const oldids = childOpreator.map(d => d.id);
|
||||
const newids = objs.filter(d => oldids.indexOf(d.id) === -1).map(d => d.id);
|
||||
if (newids.length === 0) {
|
||||
message.warn(getLabel('502646', '请选择需要添加的人员'));
|
||||
return;
|
||||
}
|
||||
this.props.addNodes(nodeForm.id, newids.join(','));
|
||||
}
|
||||
this.selectPerson = selectPerson;
|
||||
}
|
||||
});
|
||||
}
|
||||
addNodes = (ids, names, objs) => {
|
||||
this.selectPerson(ids, names, objs);
|
||||
}
|
||||
|
||||
deleteNode = () => {
|
||||
Modal.confirm({
|
||||
title: getLabel('505951','删除节点') ,
|
||||
content: getLabel('505952','确认要删除选中的节点?') ,
|
||||
onOk: () => {
|
||||
const { edcPathDesignerStore: store } = this.props;
|
||||
const { nodeForm } = store;
|
||||
this.props.deleteNode(nodeForm.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
deleteChildren = () => {
|
||||
Modal.confirm({
|
||||
title: getLabel('505953','删除节点') ,
|
||||
content: getLabel('505954','确认要删除所有下级节点?') ,
|
||||
onOk: () => {
|
||||
const { edcPathDesignerStore: store } = this.props;
|
||||
const { nodeForm } = store;
|
||||
this.props.deleteChildren(nodeForm.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
synchronize = () => {
|
||||
if (this.nodeBrowser) {
|
||||
this.nodeBrowser.openModal();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,940 @@
|
|||
|
||||
import { isEqual, uniqueId, cloneDeep } from 'lodash';
|
||||
import * as React from 'react';
|
||||
import loadjs from 'loadjs';
|
||||
import classnames from 'classnames';
|
||||
import { RightMenu, RightMenuStore } from './rightMenu';
|
||||
import { WeaSlideModal, WeaDialog } from 'ecCom';
|
||||
|
||||
import './index.less';
|
||||
const getLength = (str) => {
|
||||
let realLength = 0, len = str.length, charCode = -1;
|
||||
for (let i = 0; i < len; i++) {
|
||||
charCode = str.charCodeAt(i);
|
||||
if (charCode >= 0 && charCode <= 128) realLength += 1;
|
||||
else realLength += 2;
|
||||
}
|
||||
return realLength;
|
||||
};
|
||||
const getSubStr = (str, start, length) => {
|
||||
let rt = [], currentLength = 0, len = str.length, charCode = -1;
|
||||
for (let i = 0; i < len; i++) {
|
||||
charCode = str.charCodeAt(i);
|
||||
if (charCode >= 0 && charCode <= 128) {
|
||||
currentLength++;
|
||||
} else {
|
||||
currentLength += 2;
|
||||
}
|
||||
if (currentLength > start && currentLength <= length) {
|
||||
rt.push(str.charAt(i));
|
||||
}
|
||||
}
|
||||
return rt.join('');
|
||||
}
|
||||
const getShortStr = (ele, data, w = 100) => {
|
||||
const length = parseInt(w / 6);
|
||||
const datalength = data ? getLength(data) : 0;
|
||||
if (length >= datalength) {
|
||||
return data;
|
||||
}
|
||||
return getSubStr(data, 0, length) + '...';
|
||||
}
|
||||
export default class D3Tree extends React.Component {
|
||||
totalNodes = 0;
|
||||
maxLabelLength = 0;
|
||||
i = 0;
|
||||
selectedPath = [];
|
||||
currentPath = [];
|
||||
overedPath = [];
|
||||
static defaultProps = {
|
||||
widthToggle: true,
|
||||
showRight: true,
|
||||
layout: '0',
|
||||
showMenu: false
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
duration: 750,
|
||||
hoverNode: undefined,
|
||||
id: `d3TreeContainer_${new Date().getTime()}_${uniqueId()}`,
|
||||
width: 220,
|
||||
height: 100
|
||||
}
|
||||
this.didMountTree = false;
|
||||
this.rightMenuStore = new RightMenuStore();
|
||||
}
|
||||
render() {
|
||||
const { showRight, style, showMenu } = this.props;
|
||||
const menu = [
|
||||
{
|
||||
key: '1',
|
||||
icon: <i className='icon-coms-search' />,
|
||||
content: '按钮 1',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
icon: <i className='icon-coms-search' />,
|
||||
content: '按钮 2',
|
||||
}
|
||||
];
|
||||
return (
|
||||
<div className={classnames("d3-tree-wrapper", { "with-right": showRight })} onClick={() => { this.props.closeRight(false) }}>
|
||||
{/* <WeaRightMenu datas={this.props.menus} > */}
|
||||
<div
|
||||
ref={ref => this.container = ref}
|
||||
id={this.state.id}
|
||||
className="d3-tree"
|
||||
style={style}
|
||||
onContextMenu={showMenu ? this.onContextMenu : undefined}
|
||||
/>
|
||||
{/* </WeaRightMenu> */}
|
||||
{/* <div className="right">
|
||||
{this.props.showRight && this.renderRight()}
|
||||
</div> */}
|
||||
<div onClick={(e) => e.stopPropagation()} className={"Prj-WeaSlideModal"}>
|
||||
<WeaSlideModal ecId={`${this && this.props && this.props.ecId || ''}_WeaSlideModal@pxpvk1`} visible={this.props.showRight}
|
||||
key={this.renderRight()}
|
||||
top={"0px"}
|
||||
width={"40%"}
|
||||
height={"calc(100%)"}
|
||||
direction={'right'}
|
||||
measure={''}
|
||||
content={(typeof(this.renderRight()) == 'object' ? this.renderRight() : <iframe style={{ height: "100%", width: "100%", border: "0" }} src={this.renderRight() }></iframe>)}
|
||||
onClose={() => { this.props.closeRight(false) }}
|
||||
onAnimationEnd={() => console.log('onAnimationEnd')} />
|
||||
</div>
|
||||
|
||||
{/* <WeaDialog
|
||||
onCancel={() => this.props.closeDialog(false) }
|
||||
visible={this.props.showDialog}
|
||||
style={{ width: 1000, height: 600 }}
|
||||
title={'活动计划'}
|
||||
hasScroll
|
||||
url={this.renderRight() !== 'function'&& this.renderRight()}
|
||||
>
|
||||
</WeaDialog> */}
|
||||
<div className="border-selection" ref={ref => this.selection = ref}></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
onContextMenu = (e) => {
|
||||
if (this.isClickNode && this.opreateNode) {
|
||||
const left = e.clientX;
|
||||
const top = e.clientY;
|
||||
this.showRightMenu();
|
||||
this.rightMenuStore.show(left, top,
|
||||
this.opreateNode.id === this.root.id,
|
||||
this.getHasChild(this.opreateNode),
|
||||
this.getChildVisible(this.opreateNode));
|
||||
}
|
||||
this.isClickNode = false;
|
||||
e.stopPropagation && e.stopPropagation();
|
||||
e.preventDefault && e.preventDefault();
|
||||
e.nativeEvent && e.nativeEvent.preventDefault();
|
||||
}
|
||||
showRightMenu = () => {
|
||||
if (!this.menuWrapper) {
|
||||
this.menuWrapper = document.createElement('div');
|
||||
document.body.appendChild(this.menuWrapper);
|
||||
}
|
||||
ReactDOM.render(<RightMenu ecId={`${this && this.props && this.props.ecId || ''}_RightMenu@tvll17`}
|
||||
data={this.opreateNode}
|
||||
store={this.rightMenuStore}
|
||||
onToggleChildren={this.toggleChildren}
|
||||
menus={this.props.menus}
|
||||
/>, this.menuWrapper);
|
||||
}
|
||||
clickAnyWhere = (e) => {
|
||||
this.rightMenuStore.hide();
|
||||
if (this.startMove && this.selection) {
|
||||
this.startMove = false;
|
||||
this.selection.style.display = 'none';
|
||||
const top = parseInt(this.selection.style.top);
|
||||
const left = parseInt(this.selection.style.left);
|
||||
const width = parseInt(this.selection.style.width);
|
||||
const height = parseInt(this.selection.style.height);
|
||||
|
||||
this.selection.style.height = '0px';
|
||||
this.selection.style.width = '0px';
|
||||
}
|
||||
}
|
||||
mouseup = (d) => {
|
||||
const e = window.event;
|
||||
if (e.button === 2) {
|
||||
this.opreateNode = d;
|
||||
this.isClickNode = true;
|
||||
this.click(d);
|
||||
}
|
||||
|
||||
}
|
||||
renderRight = () => {
|
||||
if (typeof this.props.renderRight === 'function') {
|
||||
if (this.selectedNode && this.props.renderRight) {
|
||||
return this.props.renderRight(this.selectedNode);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return this.props.renderRight;
|
||||
}
|
||||
}
|
||||
diableMouseOut = () => {
|
||||
this.canTriggerMouseOut = false;
|
||||
}
|
||||
enableMouseOut = () => {
|
||||
this.canTriggerMouseOut = true;
|
||||
this.outNode();
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (!isEqual(this.props.data, nextProps.data) ||
|
||||
this.props.layout !== nextProps.layout && this.container &&
|
||||
(this.didMountTree = false, this.container.innerHTML = "", true)) {
|
||||
if (nextProps.data) {
|
||||
clearTimeout(this.initTimer);
|
||||
this.initTimer = setTimeout(() => {
|
||||
this.initTree(nextProps.data);
|
||||
}, 100);
|
||||
}
|
||||
}
|
||||
if (this.props.scale !== nextProps.scale) {
|
||||
if (this.svgGroup) {
|
||||
const transform = this.svgGroup.attr("transform");
|
||||
if (transform) {
|
||||
const scale = nextProps.scale / 10;
|
||||
this.svgGroup.attr("transform", `${transform.split('scale')[0]}scale(${scale})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('resize', this.resize);
|
||||
document.removeEventListener('mouseup', this.clickAnyWhere);
|
||||
if (this.container) {
|
||||
/* this.container.removeEventListener('mousedown', this.onMouseDown);
|
||||
this.container.removeEventListener('mousemove', this.onMouseMove); */
|
||||
}
|
||||
if (this.menuWrapper) {
|
||||
ReactDOM.unmountComponentAtNode(this.menuWrapper);
|
||||
document.body.removeChild(this.menuWrapper);
|
||||
delete this.menuWrapper;
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
window.addEventListener('resize', this.resize);
|
||||
document.addEventListener('mouseup', this.clickAnyWhere);
|
||||
if (this.container) {
|
||||
/* this.container.addEventListener('mousedown', this.onMouseDown);
|
||||
this.container.addEventListener('mousemove', this.onMouseMove); */
|
||||
}
|
||||
if (!loadjs.isDefined('weaEdcD3js')) {
|
||||
loadjs(['/edc/d3/d3.v3.js'], 'weaEdcD3js', {
|
||||
success: () => {
|
||||
if (this.container && this.props.data) {
|
||||
const _this = this;
|
||||
setTimeout(function(){
|
||||
_this.initTree(_this.props.data);
|
||||
_this.resize();
|
||||
_this.click(_this.root);
|
||||
},1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (this.container && this.props.data) {
|
||||
const _this = this;
|
||||
setTimeout(function(){
|
||||
_this.initTree(_this.props.data);
|
||||
_this.resize();
|
||||
_this.click(_this.root);
|
||||
},1000);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
onMouseDown = (e) => {
|
||||
if (e.button === 0 && this.selection && e.target.tagName === 'svg') {
|
||||
this.selectionLeft = e.clientX;
|
||||
this.selectionTop = e.clientY;
|
||||
this.selection.style.display = 'block';
|
||||
this.selection.style.top = this.selectionTop + 'px';
|
||||
this.selection.style.left = this.selectionLeft + 'px';
|
||||
this.startMove = true;
|
||||
}
|
||||
}
|
||||
onMouseMove = (e) => {
|
||||
if (this.startMove) {
|
||||
this.selection.style.height = (e.y - this.selectionTop) + 'px';
|
||||
this.selection.style.width = (e.x - this.selectionLeft) + 'px';
|
||||
e.stopPropagation && e.stopPropagation();
|
||||
e.preventDefault && e.preventDefault();
|
||||
e.nativeEvent && e.nativeEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
resize = () => {
|
||||
clearTimeout(this.resizeTimer);
|
||||
this.resizeTimer = setTimeout(() => {
|
||||
const viewerHeight = this.container.clientHeight;
|
||||
const viewerWidth = this.container.clientWidth;
|
||||
d3.select(`#${this.state.id}>svg`)
|
||||
.attr("width", viewerWidth)
|
||||
.attr("height", viewerHeight);
|
||||
}, 100);
|
||||
}
|
||||
getSize = () => {
|
||||
const { layout } = this.props;
|
||||
const { width, height } = this.state;
|
||||
if (layout === '1') { // 上
|
||||
return {
|
||||
nodeSize: [width + 10, height],
|
||||
width,
|
||||
height,
|
||||
deep: width
|
||||
}
|
||||
} else if (layout === '3') { // 下
|
||||
return {
|
||||
nodeSize: [width + 10, height],
|
||||
width,
|
||||
height,
|
||||
deep: width * -1
|
||||
}
|
||||
} else if (layout === '0') { // 左
|
||||
return {
|
||||
nodeSize: [height + 10, width],
|
||||
width,
|
||||
height,
|
||||
deep: width * 2,
|
||||
}
|
||||
} else if (layout === '2') { // 右
|
||||
return {
|
||||
nodeSize: [height + 10, width],
|
||||
width,
|
||||
height,
|
||||
deep: width * -2,
|
||||
}
|
||||
}
|
||||
}
|
||||
searchNode = (name, nodes = [this.root]) => {
|
||||
const searchedNode = [];
|
||||
nodes.forEach(node => {
|
||||
if (node.name.toLowerCase().indexOf(name) > -1) {
|
||||
searchedNode.push(node);
|
||||
}
|
||||
if (node.children) {
|
||||
searchedNode.push(...this.searchNode(name, node.children));
|
||||
}
|
||||
if (node._children) {
|
||||
searchedNode.push(...this.searchNode(name, node._children));
|
||||
}
|
||||
});
|
||||
return searchedNode;
|
||||
}
|
||||
initTree(treeData) {
|
||||
const { layout } = this.props;
|
||||
const { width, height } = this.state;
|
||||
const { nodeSize } = this.getSize();
|
||||
if (this.container && window.d3) {
|
||||
const viewerHeight = this.container.clientHeight;
|
||||
const viewerWidth = this.container.clientWidth;
|
||||
this.tree = d3.layout.tree().nodeSize(nodeSize);
|
||||
// define a d3 diagonal projection for use by the node paths later on.
|
||||
this.diagonal = d3.svg.diagonal()
|
||||
.projection((d) => {
|
||||
return (layout === '1' || layout === '3') ?
|
||||
[d.x + width / 2, d.y + height / 2] :
|
||||
[d.y + width / 2, d.x + height / 2];
|
||||
});
|
||||
|
||||
this.sortTree();
|
||||
if (!this.didMountTree) {
|
||||
const zoom = (e) => {
|
||||
this.svgGroup.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")");
|
||||
if (this.props.zoom) {
|
||||
this.props.zoom(d3.event.scale)
|
||||
}
|
||||
}
|
||||
if (this.props.zoom) {
|
||||
this.props.zoom(1)
|
||||
}
|
||||
this.zoomListener = d3.behavior.zoom().scaleExtent([0.1, 2]).on("zoom", zoom);
|
||||
|
||||
// define the baseSvg, attaching a class for styling and the zoomListener
|
||||
this.baseSvg = d3.select("#" + this.state.id).append("svg")
|
||||
.attr("width", viewerWidth)
|
||||
.attr("height", viewerHeight)
|
||||
.attr("class", "overlay")
|
||||
.call(this.zoomListener);
|
||||
this.svgGroup = this.baseSvg.append("g");
|
||||
}
|
||||
// Define the drag listeners for drag/drop behaviour of nodes.
|
||||
// Define the root
|
||||
const { x0 = viewerHeight / 2, y0 = 0 } = this.root || {};
|
||||
this.root = cloneDeep(treeData)
|
||||
this.root.x0 = x0
|
||||
this.root.y0 = y0;
|
||||
|
||||
// Layout the tree initially and center on the root node.
|
||||
this.update(this.root);
|
||||
if (!this.didMountTree) {
|
||||
this.centerNode(this.root);
|
||||
}
|
||||
//选中的节点在不在树中时 选中根节点
|
||||
const curNodeId = this.selectedNode.id;
|
||||
const treeNodeIds = [treeData.id];
|
||||
treeData.children.map(c => {
|
||||
treeNodeIds.push(c.id);
|
||||
})
|
||||
if (treeNodeIds.indexOf(curNodeId) < 0) {
|
||||
this.click(this.root);
|
||||
}
|
||||
this.didMountTree = true;
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.initTree(treeData);
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
centerNode = (source) => {
|
||||
const { layout } = this.props;
|
||||
const { width, height } = this.state;
|
||||
const viewerHeight = this.container.clientHeight;
|
||||
const viewerWidth = this.container.clientWidth;
|
||||
const scale = this.zoomListener.scale();
|
||||
const isRoot = source === this.root;
|
||||
this.selectedNode = source;
|
||||
let x = 0;
|
||||
let y = 0;
|
||||
if (layout === '1') {
|
||||
y = -source.y0;
|
||||
x = -source.x0;
|
||||
x = x * scale + viewerWidth / 2;
|
||||
if (isRoot) {
|
||||
y = y * scale + height;
|
||||
} else {
|
||||
y = y * scale + viewerHeight / 2;
|
||||
}
|
||||
} else if (layout === '3') {
|
||||
y = -source.y0;
|
||||
x = -source.x0;
|
||||
x = x * scale + viewerWidth / 2;
|
||||
if (isRoot) {
|
||||
y = y * scale + viewerHeight - height * 2;
|
||||
} else {
|
||||
y = y * scale + viewerHeight / 2;
|
||||
}
|
||||
} else if (layout === '2') {
|
||||
x = -source.y0;
|
||||
y = -source.x0;
|
||||
if (isRoot) {
|
||||
x = x * scale + viewerWidth - width * 2;
|
||||
} else {
|
||||
x = x * scale + viewerWidth / 2;
|
||||
}
|
||||
y = y * scale + viewerHeight / 2;
|
||||
} else {
|
||||
x = -source.y0;
|
||||
y = -source.x0;
|
||||
if (isRoot) {
|
||||
x = x * scale + width;
|
||||
} else {
|
||||
x = x * scale + viewerWidth / 2;
|
||||
}
|
||||
y = y * scale + viewerHeight / 2;
|
||||
}
|
||||
this.svgGroup.transition()
|
||||
.duration(this.state.duration)
|
||||
.attr("transform", "translate(" + x + "," + y + ")scale(" + scale + ")");
|
||||
this.zoomListener.scale(scale);
|
||||
this.zoomListener.translate([x, y]);
|
||||
this.click(source);
|
||||
}
|
||||
collapse = (d) => {
|
||||
if (d.children) {
|
||||
d._children = d.children;
|
||||
d._children.forEach(collapse);
|
||||
d.children = null;
|
||||
}
|
||||
}
|
||||
|
||||
expand = (d) => {
|
||||
if (d._children) {
|
||||
d.children = d._children;
|
||||
d.children.forEach(expand);
|
||||
d._children = null;
|
||||
}
|
||||
}
|
||||
sortTree = () => {
|
||||
this.tree.sort((a, b) => {
|
||||
return parseInt(a.id) - parseInt(b.id);
|
||||
});
|
||||
}
|
||||
getXY = (x, y) => {
|
||||
const { layout } = this.props;
|
||||
if (layout === '1' || layout === '3') { // 上下
|
||||
return `${x},${y}`;
|
||||
} else {
|
||||
return `${y},${x}`;
|
||||
}
|
||||
}
|
||||
|
||||
update = (source) => {
|
||||
if (!this.tree) {
|
||||
setTimeout(() => {
|
||||
this.update(source);
|
||||
}, 50);
|
||||
return;
|
||||
}
|
||||
const { desc, desc2, desc3, showname, showSubmitCount = true, nameTitle } = this.props;
|
||||
const { duration } = this.state;
|
||||
const { deep, width, height, textAnchor } = this.getSize();
|
||||
// Compute the new tree layout.
|
||||
window.tree = this.tree;
|
||||
const nodes = this.tree.nodes(this.root).reverse();
|
||||
const links = this.tree.links(nodes);
|
||||
const isShownameFunc = typeof showname === 'function';
|
||||
const isDescFunc = typeof desc === 'function';
|
||||
const isDesc2Func = typeof desc2 === 'function';
|
||||
const isDesc3Func = typeof desc3 === 'function';
|
||||
// Normalize for fixed-depth.
|
||||
nodes.forEach((d) => {
|
||||
d.y = d.depth * deep;
|
||||
if (d.current) {
|
||||
this.currentPath = this.getLinksToParents(d);
|
||||
}
|
||||
});
|
||||
|
||||
// Update the nodes…
|
||||
const node = this.svgGroup.selectAll("g.node")
|
||||
.data(nodes, (d) => d.id);
|
||||
|
||||
// Enter any new nodes at the parent's previous position.
|
||||
const nodeEnter = node.enter().append("g")
|
||||
.attr("class", 'node')
|
||||
.attr("transform", d => `translate(${this.getXY(source.x0, source.y0)})`)
|
||||
.on("click", this.click)
|
||||
.on('mouseup', this.mouseup);
|
||||
|
||||
nodeEnter.append("rect")
|
||||
.attr('class', 'node-rect')
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.attr("stroke", "#999")
|
||||
.attr("stroke-width", 2)
|
||||
.attr("fill", "#fff")
|
||||
.attr("rx", 2)
|
||||
.attr("ry", 2);
|
||||
nodeEnter.append("rect")
|
||||
.attr("class", 'flag')
|
||||
.attr("x", 1)
|
||||
.attr("y", 1)
|
||||
.attr("width", 6)
|
||||
.attr("height", height - 2)
|
||||
.attr("fill", "rgb(230, 228, 228)")
|
||||
nodeEnter.append("rect")
|
||||
.attr("class", 'flag2')
|
||||
.attr("x", 1)
|
||||
.attr("y", (d)=>{
|
||||
if(d.type=="task"){
|
||||
// console.log((height - 2)*(d.finish/100),222,height,d.finish,d.id);
|
||||
let finish = d.finish == -1 ? 0 : d.finish;
|
||||
return height - height*(finish/100) + 1*(finish/100)
|
||||
}else{
|
||||
return 1
|
||||
}
|
||||
})
|
||||
.attr("width", 6)
|
||||
.attr("height", (d)=>{
|
||||
if(d.type=="task"){
|
||||
// console.log((height - 2)*(d.finish/100),222,height,d.finish,d.id);
|
||||
let finish = d.finish == -1 ? 0 : d.finish;
|
||||
return (height - 2)*(finish/100)
|
||||
}else{
|
||||
// console.log((height - 2));
|
||||
return height - 2
|
||||
}
|
||||
|
||||
})
|
||||
.attr("fill", "#fff")
|
||||
.style("fill", (d) => {
|
||||
if(d.type=="task"){
|
||||
if(d.overstr!==""){
|
||||
return "red";
|
||||
}else{
|
||||
return "#52c41a";
|
||||
}
|
||||
|
||||
}else{
|
||||
return d.type=="prj" ? "#f7f7f7" : (d.type=="task" && d.isfinish == 1 ? "#52c41a" : '#f7f7f7');
|
||||
}
|
||||
});
|
||||
const textg = nodeEnter.append('g').attr('class', 'text-g');
|
||||
textg.append("text")
|
||||
.attr("x", 20)
|
||||
.attr("y", 20)
|
||||
.attr("dy", ".5em")
|
||||
.attr("text-anchor", textAnchor)
|
||||
.text(function (d) {
|
||||
return getShortStr(this, isShownameFunc ? showname(d) : d[showname],120);
|
||||
})
|
||||
.on('click', this.clickTitle);
|
||||
textg.append('title').text(d => nameTitle ? nameTitle : isShownameFunc ? showname(d) : d[showname]);
|
||||
|
||||
nodeEnter.append("text")
|
||||
.attr("display", d => {
|
||||
let all = 0;
|
||||
if (d.children) {
|
||||
all = d.children.length;
|
||||
} else if (d._children) {
|
||||
all = d._children.length;
|
||||
}
|
||||
return all ? 'block' : 'none';
|
||||
})
|
||||
.attr("class", 'count')
|
||||
.attr("x", width - 30)
|
||||
.attr("y", 20)
|
||||
.attr("dy", ".35em")
|
||||
.attr("text-anchor", textAnchor)
|
||||
.text(d => {
|
||||
let submitCount = 0;
|
||||
let all = 0;
|
||||
if (d.children) {
|
||||
submitCount = d.children.filter(d => d.isfinish).length;
|
||||
all = d.children.length;
|
||||
} else if (d._children) {
|
||||
submitCount = d._children.filter(d => d.isfinish).length;
|
||||
all = d._children.length;
|
||||
}
|
||||
if (showSubmitCount) {
|
||||
return `${submitCount}/${all}`
|
||||
} else {
|
||||
return `${all}`
|
||||
}
|
||||
});
|
||||
|
||||
const descg = nodeEnter.append('g').attr('class', 'desc-g');
|
||||
descg.append("text")
|
||||
.attr("class", 'desc')
|
||||
.attr("x", 20)
|
||||
.attr("y", 45)
|
||||
.attr("dy", ".35em")
|
||||
.attr("text-anchor", textAnchor).text(function (d) {
|
||||
return getShortStr(this, isDescFunc ? desc(d) : d[desc], 120);
|
||||
});
|
||||
descg.append('title').text(d => isDescFunc ? desc(d) : d[desc]);
|
||||
const descg2 = nodeEnter.append('g').attr('class', 'desc-g2');
|
||||
descg2.append("text")
|
||||
.attr("class", 'desc')
|
||||
.attr("x", 20)
|
||||
.attr("y", 65)
|
||||
.attr("dy", ".35em")
|
||||
.attr("text-anchor", textAnchor).text(function (d) {
|
||||
return d[desc2];
|
||||
});
|
||||
descg2.append('title').text(d => isDesc2Func ? desc(d) : d[desc2]);
|
||||
const descg3 = nodeEnter.append('g').attr('class', 'desc-g3');
|
||||
descg3.append("text")
|
||||
.attr("class", 'desc')
|
||||
.attr("x", 20)
|
||||
.attr("y", 85)
|
||||
.attr("dy", ".35em")
|
||||
.attr("fill", "rgb(109, 106, 236")
|
||||
.attr("text-anchor", textAnchor).text(function (d) {
|
||||
return getShortStr(this, isDesc3Func ? desc(d) : d[desc3], 120);
|
||||
});
|
||||
descg3.append('title').text(d => isDesc3Func ? desc(d) : d[desc3]);
|
||||
// descText.append('svg:title').text(d=>d[desc]);
|
||||
// Transition nodes to their new position.
|
||||
const nodeUpdate = node.transition()
|
||||
.duration(duration)
|
||||
.attr("transform", d => `translate(${this.getXY(d.x, d.y)})`)
|
||||
.attr("class", (d) => {
|
||||
if (this.selectedNode && d.id === this.selectedNode.id) {
|
||||
return 'node node-selected'
|
||||
} else {
|
||||
return 'node';
|
||||
}
|
||||
});
|
||||
nodeEnter.append("rect")
|
||||
.attr("class", 'flag2')
|
||||
.attr("x", 1)
|
||||
.attr("y", (d)=>{
|
||||
if(d.type=="task"){
|
||||
// console.log((height - 2)*(d.finish/100),222,height,d.finish,d.id);
|
||||
let finish = d.finish == -1 ? 0 : d.finish;
|
||||
return height - height*(finish/100) + 1*(finish/100)
|
||||
}else{
|
||||
return 1
|
||||
}
|
||||
})
|
||||
.attr("width", 6)
|
||||
.attr("height", (d)=>{
|
||||
if(d.type=="task"){
|
||||
// console.log((height - 2)*(d.finish/100),222,height,d.finish,d.id);
|
||||
let finish = d.finish == -1 ? 0 : d.finish;
|
||||
return (height - 2)*(finish/100)
|
||||
}else{
|
||||
// console.log((height - 2));
|
||||
return height - 2
|
||||
}
|
||||
|
||||
})
|
||||
.attr("fill", "#fff")
|
||||
.style("fill", (d) => {
|
||||
if(d.type=="task"){
|
||||
if(d.overstr!==""){
|
||||
return "red";
|
||||
}else{
|
||||
return "#52c41a";
|
||||
}
|
||||
|
||||
}else{
|
||||
return d.type=="prj" ? "#f7f7f7" : (d.type=="task" && d.isfinish == 1 ? "#52c41a" : '#f7f7f7');
|
||||
}
|
||||
});
|
||||
|
||||
nodeUpdate.select("rect.flag2")
|
||||
.attr("y", (d)=>{
|
||||
if(d.type=="task"){
|
||||
// console.log((height - 2)*(d.finish/100),222,height,d.finish,d.id);
|
||||
let finish = d.finish == -1 ? 0 : d.finish;
|
||||
return height - height*(finish/100) + 1*(finish/100)
|
||||
}else{
|
||||
return 1
|
||||
}
|
||||
})
|
||||
.attr("height", (d)=>{
|
||||
if(d.type=="task"){
|
||||
// console.log((height - 2)*(d.finish/100),222,height,d.finish,d.id);
|
||||
let finish = d.finish == -1 ? 0 : d.finish;
|
||||
return (height - 2)*(finish/100)
|
||||
}else{
|
||||
// console.log((height - 2));
|
||||
return height - 2
|
||||
}
|
||||
|
||||
})
|
||||
.style("fill", (d) => {
|
||||
if(d.type=="task"){
|
||||
if(d.overstr!==""){
|
||||
return "red";
|
||||
}else{
|
||||
return "#52c41a";
|
||||
}
|
||||
|
||||
}else{
|
||||
return d.type=="prj" ? "#f7f7f7" : (d.type=="task" && d.isfinish == 1 ? "#52c41a" : '#f7f7f7');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
nodeUpdate.select("rect.node-rect")
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.attr("stroke", "#999")
|
||||
.attr("stroke-width", 2)
|
||||
.attr("fill", "#fff");
|
||||
|
||||
nodeUpdate.select("text").style("fill-opacity", 1);
|
||||
nodeUpdate.select("g.text-g>text").text(function (d) {
|
||||
return getShortStr(this, isShownameFunc ? showname(d) : d[showname]);
|
||||
});
|
||||
nodeUpdate.select("g.text-g>title").text(function (d) {
|
||||
return nameTitle ? nameTitle : isShownameFunc ? showname(d) : d[showname];
|
||||
})
|
||||
nodeUpdate.select("g.desc-g>text.desc").text(function (d) {
|
||||
return getShortStr(this, isDescFunc ? desc(d) : d[desc], 120);
|
||||
});
|
||||
nodeUpdate.select("g.desc-g2>text.desc").text(function (d) {
|
||||
return d[desc2];
|
||||
});
|
||||
nodeUpdate.select("g.desc-g3>text.desc").text(function (d) {
|
||||
return getShortStr(this, isDesc3Func ? desc(d) : d[desc3], 120);
|
||||
});
|
||||
nodeUpdate.select("g.desc-g>title").text(function (d) {
|
||||
return isDescFunc ? desc(d) : d[desc];
|
||||
});
|
||||
nodeUpdate.select("g.desc-g>title").text(d => isDescFunc ? desc(d) : d[desc]);
|
||||
|
||||
nodeUpdate.select('text.count').text(d => {
|
||||
let submitCount = 0;
|
||||
let all = 0;
|
||||
if (d.children) {
|
||||
submitCount = d.children.filter(d => d.isfinish).length;
|
||||
all = d.children.length;
|
||||
} else if (d._children) {
|
||||
submitCount = d._children.filter(d => d.isfinish).length;
|
||||
all = d._children.length;
|
||||
}
|
||||
if (showSubmitCount) {
|
||||
return `${submitCount}/${all}`
|
||||
} else {
|
||||
return `${all}`
|
||||
}
|
||||
|
||||
}).attr("display", d => {
|
||||
let all = 0;
|
||||
if (d.children) {
|
||||
all = d.children.length;
|
||||
} else if (d._children) {
|
||||
all = d._children.length;
|
||||
}
|
||||
return all ? 'block' : 'none';
|
||||
})
|
||||
|
||||
nodeUpdate.select("g.count>text").text(d => {
|
||||
let submitCount = 0;
|
||||
let all = 0;
|
||||
if (d.children) {
|
||||
submitCount = d.children.filter(d => d.isfinish).length;
|
||||
all = d.children.length;
|
||||
} else if (d._children) {
|
||||
submitCount = d._children.filter(d => d.isfinish).length;
|
||||
all = d._children.length;
|
||||
}
|
||||
if (showSubmitCount) {
|
||||
return `${submitCount}/${all}`
|
||||
} else {
|
||||
return `${all}`
|
||||
}
|
||||
|
||||
}).attr("display", d => {
|
||||
let all = 0;
|
||||
if (d.children) {
|
||||
all = d.children.length;
|
||||
} else if (d._children) {
|
||||
all = d._children.length;
|
||||
}
|
||||
return all ? 'block' : 'none';
|
||||
})
|
||||
|
||||
|
||||
|
||||
// Transition exiting nodes to the parent's new position.
|
||||
const nodeExit = node.exit().transition()
|
||||
.duration(duration)
|
||||
.attr("transform", d => `translate(${this.getXY(source.x, source.y)})`)
|
||||
.remove();
|
||||
|
||||
nodeExit.select("rect")
|
||||
.attr("width", width)
|
||||
.attr("height", height)
|
||||
.attr("stroke", "#ccc")
|
||||
.attr("stroke-width", 2);
|
||||
|
||||
nodeExit.select("text");
|
||||
// Update the links…
|
||||
const link = this.svgGroup.selectAll("path.link")
|
||||
.data(links, d => d.target.id)
|
||||
.attr('class', "link");
|
||||
|
||||
// Enter any new links at the parent's previous position.
|
||||
link.enter().insert("path", "g")
|
||||
.attr('class', "link")
|
||||
.attr("stroke", d => {
|
||||
const { source: { id: from }, target: { id: to } } = d;
|
||||
if (this.selectedPath.indexOf(`${from},${to}`) > -1) {
|
||||
return "#2db7f5"
|
||||
} else if (this.currentPath.indexOf(`${from},${to}`) > -1) {
|
||||
return "#2db7f5";
|
||||
}
|
||||
return "#ccc"
|
||||
})
|
||||
.attr('fill', "none")
|
||||
.attr("stroke-width", 1.5)
|
||||
.attr("x", width / 2)
|
||||
.attr("y", height / 2)
|
||||
.attr("d", (d) => {
|
||||
const o = {
|
||||
x: source.x0,
|
||||
y: source.y0
|
||||
};
|
||||
return this.diagonal({
|
||||
source: o,
|
||||
target: o
|
||||
});
|
||||
});
|
||||
|
||||
// Transition links to their new position.
|
||||
link.transition()
|
||||
.duration(duration)
|
||||
.attr("d", this.diagonal)
|
||||
.attr("stroke", d => {
|
||||
const { source: { id: from }, target: { id: to } } = d;
|
||||
if (this.selectedPath.indexOf(`${from},${to}`) > -1) {
|
||||
return "#2db7f5"
|
||||
} else if (this.currentPath.indexOf(`${from},${to}`) > -1) {
|
||||
return "#2db7f5";
|
||||
}
|
||||
return "#ccc"
|
||||
});
|
||||
|
||||
// Transition exiting nodes to the parent's new position.
|
||||
link.exit().transition()
|
||||
.duration(duration)
|
||||
.attr("d", (d) => {
|
||||
var o = {
|
||||
x: source.x,
|
||||
y: source.y
|
||||
};
|
||||
return this.diagonal({
|
||||
source: o,
|
||||
target: o
|
||||
});
|
||||
})
|
||||
.remove();
|
||||
|
||||
// Stash the old positions for transition.
|
||||
nodes.forEach((d) => {
|
||||
d.x0 = d.x;
|
||||
d.y0 = d.y;
|
||||
});
|
||||
}
|
||||
clickTitle = (d) => {
|
||||
if (this.props.onClickTitle) {
|
||||
this.props.onClickTitle(d);
|
||||
window.event.stopPropagation();
|
||||
}
|
||||
}
|
||||
click = (d) => {
|
||||
if (d) {
|
||||
this.selectedPath = this.getLinksToParents(d);
|
||||
this.selectedNode = d;
|
||||
// d = this.toggleChildren(d);
|
||||
this.update(d);
|
||||
if (this.props.onClick) {
|
||||
this.props.onClick(d, this.getHasChild(d));
|
||||
}
|
||||
}
|
||||
}
|
||||
getLinksToParents = (d) => {
|
||||
const selectedPath = [];
|
||||
let current = d;
|
||||
while (current) {
|
||||
selectedPath.push(`${current.parentid},${current.id}`);
|
||||
current = current.parent;
|
||||
}
|
||||
return selectedPath;
|
||||
}
|
||||
toggleChildren = () => {
|
||||
const d = this.opreateNode;
|
||||
if (d) {
|
||||
if (d.children) {
|
||||
d._children = d.children;
|
||||
d.children = null;
|
||||
} else if (d._children) {
|
||||
d.children = d._children;
|
||||
d._children = null;
|
||||
}
|
||||
this.update(d);
|
||||
}
|
||||
}
|
||||
getChildVisible = (d) => {
|
||||
return !!d.children;
|
||||
}
|
||||
getHasChild = (d) => {
|
||||
return !!d.children || !!d._children;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,364 @@
|
|||
@right-width: 450px;
|
||||
@right-size: 450px;
|
||||
.d3-tree-wrapper {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
.right {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.d3-tree {
|
||||
overflow: hidden; // margin: 16px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
}
|
||||
&.with-toggle {
|
||||
.d3-tree {
|
||||
top: 50px;
|
||||
}
|
||||
}
|
||||
&.with-right {
|
||||
.right {
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
width: @right-width;
|
||||
display: block;
|
||||
margin-left: 8px;
|
||||
transition: 0.3s;
|
||||
top: 50px;
|
||||
bottom: 0px; // border-left: 1px solid #efefef;
|
||||
box-shadow: 0 9px 12px -2px rgba(39, 54, 78, 0.11);
|
||||
z-index: 100;
|
||||
}
|
||||
.d3-tree {
|
||||
height: e("calc(100% - 82px)");
|
||||
overflow: hidden; // margin: 16px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px; // margin-right: 8px;
|
||||
}
|
||||
}
|
||||
.node {
|
||||
cursor: pointer;
|
||||
}
|
||||
/* .link {
|
||||
fill: none;
|
||||
stroke: #ccc;
|
||||
stroke-width: 1.5px;
|
||||
&.link-selected {
|
||||
stroke: #2db7f5;
|
||||
}
|
||||
&-over {
|
||||
stroke: #2db7f5;
|
||||
}
|
||||
} */
|
||||
.node-selected {
|
||||
.node-rect {
|
||||
stroke: #2db7f5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edc-tree-memu-item {
|
||||
&:hover {
|
||||
background-color: #57c5f7;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.d3-tree-add {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
padding: 5px 8px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.d3-tree-tips {
|
||||
&>div {
|
||||
-webkit-box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0 0 7px 0 rgba(0, 0, 0, 0.3);
|
||||
background: #fff;
|
||||
padding: 16px;
|
||||
}
|
||||
.tips-handle {
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
color: #2db7f5;
|
||||
}
|
||||
}
|
||||
.tips-opts {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
button {
|
||||
padding: 5px 8px;
|
||||
border-radius: 50%;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.d3-tree-toggle {
|
||||
.ant-radio-button-wrapper-checked {
|
||||
background: #2db7f5;
|
||||
color: #fff;
|
||||
}
|
||||
.ant-radio-button-wrapper {
|
||||
border-radius: 0px;
|
||||
padding: 0px 8px;
|
||||
}
|
||||
.ant-radio-button-wrapper:first-child {
|
||||
border-radius: 3px 0px 0px 3px;
|
||||
}
|
||||
.ant-radio-button-wrapper:last-child {
|
||||
border-radius: 0px 3px 3px 0px;
|
||||
}
|
||||
.ant-btn-group,
|
||||
.ant-radio-group {
|
||||
padding: 10px 0px;
|
||||
margin-right: 10px;
|
||||
float: left;
|
||||
position: relative;
|
||||
}
|
||||
.ant-btn-group {
|
||||
.opt-btn {
|
||||
margin-right: 10px;
|
||||
&:last-child {
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
&.linked {
|
||||
.opt-btn {
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.opt-btn {
|
||||
padding: 4px 8px; // border-radius: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.border-selection {
|
||||
position: fixed;
|
||||
border: 1px solid #2db7f5;
|
||||
}
|
||||
|
||||
|
||||
.wea-edc-path-designer {
|
||||
height: 100%;
|
||||
background: #ebedf0;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.tree-layout-toggle {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
background: #fff;
|
||||
padding: 0px 16px;
|
||||
box-shadow: 1px 0 6px 0 rgba(39, 54, 78, 0.12);
|
||||
.edc-zoom-line {
|
||||
position: relative;
|
||||
float: left;
|
||||
padding: 10px 0px;
|
||||
margin-right: 10px;
|
||||
button,
|
||||
.ant-slider {
|
||||
float: left;
|
||||
}
|
||||
button {
|
||||
border-radius: 50%;
|
||||
padding: 0px 4px;
|
||||
border: 0px;
|
||||
font-size: 16px;
|
||||
&:not(:hover) {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
.ant-slider {
|
||||
width: 200px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.border-selection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.edc-node-form {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
.wea-form-item {
|
||||
padding: 8px 24px;
|
||||
}
|
||||
.toggle {
|
||||
width: 18px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0px;
|
||||
margin-top: -80px;
|
||||
z-index: 11;
|
||||
cursor: pointer;
|
||||
background-size: 100% 100%;
|
||||
background: url("/cloudstore/resource/pc/com/images/leftTree-hide.png") no-repeat -2px 0;
|
||||
&:hover {
|
||||
background: url(/cloudstore/resource/pc/com/images/leftTree-hide-hover.png) no-repeat -2px 0;
|
||||
}
|
||||
}
|
||||
.reporttime {
|
||||
width:fit-content;
|
||||
width:-moz-fit-content;
|
||||
display: inline-block;
|
||||
}
|
||||
.saveTime {
|
||||
width:fit-content;
|
||||
width:-moz-fit-content;
|
||||
display: inline-block;
|
||||
}
|
||||
.wea-input-number {
|
||||
width: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
.edc-path-tree {
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: 50px;
|
||||
bottom: 0px;
|
||||
margin: 10px;
|
||||
width: 100%;
|
||||
.react-resizable-handle {
|
||||
position: absolute;
|
||||
width: 10px;
|
||||
height: 100%;
|
||||
bottom: 0;
|
||||
right: 0px;
|
||||
cursor: col-resize;
|
||||
}
|
||||
&>.left,
|
||||
&>.right {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 32px;
|
||||
margin: 0;
|
||||
padding: 0 15px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
line-height: 30px;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-top-width: 1.02px;
|
||||
border-left: 0;
|
||||
cursor: pointer;
|
||||
-webkit-transition: color .3s, background .3s, border-color .3s;
|
||||
transition: color .3s, background .3s, border-color .3s;
|
||||
.d3-tree-wrapper>.right{
|
||||
top: 0px;
|
||||
right: -15px;
|
||||
}
|
||||
|
||||
}
|
||||
&>.left {
|
||||
float: left;
|
||||
position: relative;
|
||||
border-left: 1px solid #d9d9d9;
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
&>.right {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
&>.left,
|
||||
&>.right {
|
||||
&.checked {
|
||||
z-index: 1;
|
||||
color: #1890ff;
|
||||
background: #fff;
|
||||
border-color: #1890ff;
|
||||
-webkit-box-shadow: -1px 0 0 0 #1890ff;
|
||||
box-shadow: -1px 0 0 0 #1890ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.edc-path-node-form {
|
||||
padding: 10px 24px;
|
||||
.edc-node-setting {
|
||||
border: 1px solid #eaeaea;
|
||||
.edc-addNode-item-row {
|
||||
padding: 0px 18px 5px 18px;
|
||||
}
|
||||
}
|
||||
.edc-addNode-item-row {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
.edc-operator-group {
|
||||
border: 1px solid #eaeaea;
|
||||
margin-top: 10px;
|
||||
.itemCol {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
line-height: 32px;
|
||||
height: 32px;
|
||||
&.BROWSER {
|
||||
width: 200px;
|
||||
}
|
||||
&.SCOPE,
|
||||
&.SELECT,
|
||||
&.SELECT_LINKAGE {
|
||||
margin-left: 10px;
|
||||
}
|
||||
&.SELECT_LINKAGE {
|
||||
.wea-select-group {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
.labelStyle {
|
||||
line-height: 32px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.ant-select {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
}
|
||||
.edc-operator-table {
|
||||
border: 1px solid #eaeaea;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.wea-slide-modal-content{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.d3-tree-wrapper.rodal-close{
|
||||
display: none;
|
||||
}
|
||||
.d3-tree-wrapper.wea-slide-modal-content {
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
}
|
||||
.d3-tree-wrapper.ant-spin-nested-loading{
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
.d3-tree-wrapper.ant-spin-container{
|
||||
position: relative;
|
||||
zoom: 1;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.Prj-WeaSlideModal .wea-slide-modal {
|
||||
position: static!important;
|
||||
.rodal-fade-enter {
|
||||
position: absolute!important;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
import { observer } from "mobx-react";
|
||||
import { observable, action, computed } from "mobx";
|
||||
import { Icon } from 'antd';
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export const RightMenu = observer(({ store, onToggleChildren,menus }) => {
|
||||
const { left, top, visible, hasChild, childVisible, isRoot } = store;
|
||||
// console.log(data);
|
||||
|
||||
return (
|
||||
<div className="wea-right-menu wea-right-menu-show" style={{ display: visible ? 'block' : 'none', position: 'absolute', top, left }}>
|
||||
<div className="wea-right-menu-icon-background"></div>
|
||||
<ul className="ant-menu ant-menu-vertical ant-menu-light ant-menu-root">
|
||||
{hasChild && <li className="ant-menu-item text-elli" onClick={onToggleChildren}>
|
||||
<li unselectable="on" class="wea-right-menu-item">
|
||||
<span className="wea-right-menu-icon" >
|
||||
{childVisible ? <i className="anticon anticon-folder" style={{ marginLeft: "8px" }}></i>
|
||||
: <i className="anticon anticon-folder-open" style={{ marginLeft: "8px" }}></i>}
|
||||
</span>
|
||||
<span className="">{childVisible ? getLabel('26985','收起') : getLabel('15315','展开') }</span>
|
||||
</li>
|
||||
|
||||
</li>}
|
||||
{/* {onBatchReject && hasChild && data && data.current && data.status != 2 && data.arrival && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onBatchReject.bind(store, data)}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-coms-Reset"></i></span>
|
||||
<span className="">{getLabel('506005','批量退回')}</span>
|
||||
</li>}
|
||||
{onSetting && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onSettingHandle}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-edc-common-setting"></i></span>
|
||||
<span className="">{getLabel('502283', '设置')}</span>
|
||||
</li>}
|
||||
{onAddChild && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onAddChildHandle}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-coms-New-Flow"></i></span>
|
||||
<span className="">{getLabel('502284', '添加下级')}</span>
|
||||
</li>}
|
||||
{onDeleteChild && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onDeleteChild}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-coms-delete"></i></span>
|
||||
<span className="">{getLabel('502285', '删除下级')}</span>
|
||||
</li>}
|
||||
{!isRoot && onDelete && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onDelete}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-coms-delete"></i></span>
|
||||
<span className="">{getLabel('502286', '删除')}</span>
|
||||
</li>}
|
||||
{onReject && data.status == 2 && data.parent && data.parent.current && data.parent.iscurrentnode == 1
|
||||
&& data.parent.status != 2 && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onReject.bind(store, data)}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-coms-Reset"></i></span>
|
||||
<span className="">{getLabel('502287', '退回')}</span>
|
||||
</li>}
|
||||
{onSynchro && <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={onSynchroHandle}>
|
||||
<span className="wea-right-menu-icon"><i className="icon-coms-Synchro"></i></span>
|
||||
<span className="">{getLabel('506099', '同步')}</span>
|
||||
</li>} */}
|
||||
{
|
||||
menus.length > 0 && menus.map((obj)=>{
|
||||
return <li className="ant-menu-item text-elli edc-tree-memu-item" onClick={(e)=>{obj.action(e)}}>
|
||||
<li unselectable="on" class="wea-right-menu-item">
|
||||
<span className="wea-right-menu-icon"><i className={obj.icon}></i></span>
|
||||
<span className="">{obj.name}</span>
|
||||
</li>
|
||||
</li>
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
});
|
||||
|
||||
export class RightMenuStore {
|
||||
@observable visible = false;
|
||||
@observable left = 0;
|
||||
@observable top = 0;
|
||||
@observable isRoot = false;
|
||||
@observable hasChild = false;
|
||||
@observable childVisible = false;
|
||||
@action show = (left, top, isRoot, hasChild, childVisible) => {
|
||||
this.visible = true;
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.isRoot = isRoot;
|
||||
this.hasChild = hasChild;
|
||||
this.childVisible = childVisible;
|
||||
}
|
||||
@action hide = () => {
|
||||
this.visible = false;
|
||||
}
|
||||
@action position = (left, top) => {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
import { observer} from "mobx-react";
|
||||
import {WeaAlertPage,WeaLocaleProvider } from "ecCom"
|
||||
import ProjectCondition from '../list/projectCondition'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class ProjectInfo extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
componentDidMount(){
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
}
|
||||
render() {
|
||||
const {prjinfoRight:{verified,hasRight},fieldInfo,form,setFormFields,setValidate } = this.props.formStore;
|
||||
if (verified && !hasRight) {
|
||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@0txrf5`} >
|
||||
<div style={{color : '#000'}}>
|
||||
{getLabel(2012,"对不起,您暂时没有权限!")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
}
|
||||
if (verified && hasRight) {
|
||||
return (
|
||||
<div style={{height:"100%"}}>
|
||||
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@n8x73p`} fieldInfo={fieldInfo} form={form} setFormFields={(v)=>{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
|
||||
</div>)
|
||||
}
|
||||
return <div></div>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,135 @@
|
|||
|
||||
import {Button,Row,Col,Icon,message,Modal} from 'antd';
|
||||
import {WeaTab,WeaAlertPage, WeaProgress,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import {Condition} from '../list/listCondition';
|
||||
import ProjectDialog from '../dialog/projectDialog'
|
||||
import ShareDialog from '../dialog/shareDialog'
|
||||
import ExchangeDialog from '../dialog/exchangeDialog'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class ProjectSub extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
||||
}
|
||||
componentDidMount(){
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
const {showSearchAd,prjSubStore,prjSubform,condition,prjsubRight:{hasRight,verified},exchangeStore,projectInfoStore,reLoad} = contentStore;
|
||||
const formParams = prjSubform.getFormParams() || {};
|
||||
if (verified && !hasRight) {
|
||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@f10zei`} >
|
||||
<div style={{color : '#000'}}>
|
||||
{getLabel(2012,"对不起,您暂时没有权限!")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
}
|
||||
|
||||
if (verified && hasRight) {
|
||||
return (
|
||||
<div >
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@hfqond`}
|
||||
buttonsAd={this.getAdButtons()}
|
||||
searchType={['base','advanced']}
|
||||
searchsBaseValue={formParams.prjname}
|
||||
setShowSearchAd={bool=>{contentStore.setShowSearchAd(bool)}}
|
||||
hideSearchAd={()=> contentStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@t7d1nt`} listStore={contentStore} form={prjSubform} onEnterSearch={this.onEnterSearch} ></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v=>{contentStore.getPrjSubList()}}
|
||||
onSearchChange={v=>{contentStore.appendFormFields({prjname:{value:v}})}}
|
||||
/>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@cni1ev`}
|
||||
comsWeaTableStore={prjSubStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
register_table={()=>reLoad(prjSubStore)}
|
||||
getColumns={c=>this.reRenderColumns(c)}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
<ShareDialog ecId={`${this && this.props && this.props.ecId || ''}_ShareDialog@r71zyb`} contentStore={contentStore} />
|
||||
<ExchangeDialog ecId={`${this && this.props && this.props.ecId || ''}_ExchangeDialog@5ropxi`} contentStore={exchangeStore} />
|
||||
<ProjectDialog ecId={`${this && this.props && this.props.ecId || ''}_ProjectDialog@dt5qia`} contentStore={projectInfoStore}/>
|
||||
</div>)
|
||||
}
|
||||
return <div></div>
|
||||
}
|
||||
|
||||
reRenderColumns(columns){
|
||||
columns.forEach((c,i)=>{
|
||||
if(c.dataIndex=='finish'){
|
||||
c.render = function(text, record){
|
||||
return <span className='wea-prj-progressStyle' >
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@orj630@${i}`} percent={record.finish} strokeColor={record.finishspan} />
|
||||
</span>
|
||||
}
|
||||
} else {
|
||||
// c.render = function(text, record){
|
||||
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
|
||||
// return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
|
||||
// }
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
onOperatesClick(record,index,operate,flag){
|
||||
const {contentStore} = this.props;
|
||||
const {shareStore,exchangeStore,projectInfoStore} = contentStore;
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
let that = this;
|
||||
// saveCapitalId(record.randomFieldId); //保存资产id
|
||||
if(fn != ""){
|
||||
if("onShare"==fn){ //共享
|
||||
shareStore.handleShareDialog(true,"prj",record.randomFieldId)
|
||||
}else if('onNormal' == fn){ //正常
|
||||
contentStore.doSubPlanOpt({method:'normal',prjid:record.randomFieldId})
|
||||
}else if('onOver' == fn){ //延期
|
||||
contentStore.doSubPlanOpt({method:'delay',prjid:record.randomFieldId})
|
||||
}else if('onFinish' == fn){ //完成
|
||||
contentStore.doSubPlanOpt({method:'complete',prjid:record.randomFieldId})
|
||||
}else if('onFrozen' == fn){ //冻结
|
||||
contentStore.doSubPlanOpt({method:'freeze',prjid:record.randomFieldId})
|
||||
}else if('onEdit' == fn){ //编辑
|
||||
projectInfoStore.handleDialog(true,record.randomFieldId,{viewtype:'edit',prjid:record.randomFieldId}) ;
|
||||
}else if('onListTask' == fn){ //任务列表
|
||||
|
||||
}else if('onDiscuss' == fn){ //相关交流
|
||||
exchangeStore.handleExchangeDialog(true,"prj",record.randomFieldId,{})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getAdButtons = () => {
|
||||
const {contentStore} = this.props;
|
||||
const {getPrjSubList,setShowSearchAd,clearFormFields} = contentStore;
|
||||
return [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@wlo7kl@search`} type="primary" onClick={()=>{getPrjSubList();setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@wu4o2i@reset`} type="ghost" onClick={()=>{clearFormFields();}}>{getLabel(2022,"重置")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@cbpg50@cancel`} type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
|
||||
];
|
||||
}
|
||||
|
||||
onEnterSearch=()=>{
|
||||
const {contentStore} = this.props;
|
||||
contentStore.getPrjSubList();
|
||||
contentStore.setShowSearchAd(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
|
||||
import {Button,Row,Col, Icon,message,Modal} from 'antd';
|
||||
import {WeaTools,WeaBrowser,WeaAlertPage,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import PrjShowGroup from '../comp/prj-show-group'
|
||||
import PrjTableEdit from '../comp/prj-table-edit'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class RelateExchange extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state ={
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
componentDidMount(){
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
const {taskDocStore,relateList,taskRelRight:{hasRight,verified},relateList:{canRef}} = contentStore;
|
||||
const columns = [
|
||||
{
|
||||
title: getLabel(16398,"文档目录"), //列名
|
||||
dataIndex: 'docCategoryName', //列的id 对应数据
|
||||
key: 'docCategoryName', //前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'LINK_DOC' , key: 'docCategoryName', viewAttr:1, width: 120, otherParams: {className: 'test-className'}},
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '50%',
|
||||
className: 'wea-table-edit-name',
|
||||
},
|
||||
{
|
||||
title: getLabel(17906,"必要"), //列名
|
||||
dataIndex: 'isNecessary', //列的id 对应数据
|
||||
key: 'isNecessary', //前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'CHECKBOX' ,editType: '1',viewAttr:canRef?2:1, key: 'isNecessary', width: 80, }
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '40%',
|
||||
className: 'wea-table-edit-ismust',
|
||||
},
|
||||
{
|
||||
title: '', //列名
|
||||
dataIndex: 'operate', //列的id 对应数据
|
||||
key: 'sex', //前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'OPERATE' ,editType: '1', key: 'operate', options: [{ key: '1', showname: getLabel(91,"删除")}] }
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '10%',
|
||||
className: 'prj-dropdown-link',
|
||||
},
|
||||
];
|
||||
if (verified && !hasRight) {
|
||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@phvbye`} >
|
||||
<div style={{color : '#000'}}>
|
||||
{getLabel(2012,"对不起,您暂时没有权限!")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
}
|
||||
if (verified && hasRight) {
|
||||
return (
|
||||
<div className="prj-exchange">
|
||||
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@bqaxq2`}
|
||||
leftComponent={getLabel(83873,"所需文档")}
|
||||
rightComponent={this.getButtons()}
|
||||
>
|
||||
<PrjTableEdit ecId={`${this && this.props && this.props.ecId || ''}_PrjTableEdit@4j1ktl`}
|
||||
columns={columns}
|
||||
datas={toJS(relateList.needList)}
|
||||
onChange={this.onChange}
|
||||
onRowSelect={null}
|
||||
pagination={false}
|
||||
viewAttr={1}
|
||||
tableProps={{rowSelection:null}}
|
||||
getRowSelection={this.getRowSelection}
|
||||
operate ={this.handleOperate}
|
||||
onCreatDoc = {(categoryid,taskid)=>{this.onCreatDoc(categoryid,taskid)}}
|
||||
/>
|
||||
|
||||
</PrjShowGroup>
|
||||
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@751czf`}
|
||||
leftComponent={getLabel(857,"相关文档")}
|
||||
rightComponent={this.getRelateButtons()}
|
||||
btnspace={10}
|
||||
>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@gv1um9`}
|
||||
comsWeaTableStore={taskDocStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
</PrjShowGroup>
|
||||
</div>)
|
||||
}
|
||||
return <div></div>
|
||||
}
|
||||
getButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {relateList:{canRef}} = contentStore;
|
||||
let btn = [];
|
||||
if(canRef){
|
||||
btn.push(
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@4aa8sd`} type={"doccategory"} title={getLabel(16398,"文档目录")} hasAdvanceSerach={true} isSingle={true} onChange ={(ids, names, datas)=>this.addDocType(ids, names, datas)} customized={true} >
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@6iap6n@add`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@p6fv00`} type="plus" /></Button>
|
||||
</WeaBrowser>
|
||||
);
|
||||
}
|
||||
return btn;
|
||||
}
|
||||
getRelateButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {taskDocStore,relateList:{canRelated}} = contentStore;
|
||||
const {selectedRowKeys} = taskDocStore;
|
||||
let btn = [];
|
||||
if(canRelated){
|
||||
btn.push(<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@su8uoh`} type={"9"} title={getLabel(58,"文档")} hasAdvanceSerach={true} isSingle={true} onChange ={(ids, names, datas)=>this.addDocument(ids, names, datas)} customized={true} >
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@aum745@add`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@sd84fb`} type="plus" /></Button>
|
||||
</WeaBrowser>);
|
||||
btn.push( <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@l7f9uh`} type="primary" className="prj-btn-small" title={getLabel(91,"删除")} disabled={!(selectedRowKeys.length>0)} size="small" onClick={this.deleteDocument}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@3sigu2`} type="minus" /></Button>);
|
||||
}
|
||||
return btn;
|
||||
}
|
||||
//编辑
|
||||
onChange=(data)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskRequiredOpt,taskid,} = contentStore;
|
||||
doDspTaskRequiredOpt({
|
||||
method:'modifyRequiredDocN',
|
||||
taskid : taskid,
|
||||
secID : data.reqDocSecCategory,
|
||||
isNecessary:data.isNecessary
|
||||
},'doc');
|
||||
}
|
||||
//新增所需文档
|
||||
addDocType=(ids, names, datas)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskRequiredOpt,taskid,} = contentStore;
|
||||
doDspTaskRequiredOpt({
|
||||
method:'addRequiredDoc',
|
||||
taskid : taskid,
|
||||
secID : ids
|
||||
},'doc');
|
||||
}
|
||||
onCreatDoc = (categoryid,taskid) =>{
|
||||
// const {addDocFn} = this.props;
|
||||
window.open((window.ecologyContentPath || '')+"/spa/document/index.jsp?secid="+categoryid+"&isEdit=1&router=1&moudleFrom=task#/main/document/edit", "_blank");
|
||||
let _this = this;
|
||||
window.__createDocFn = function (obj) {
|
||||
let docid = obj.docid;
|
||||
let docsubject = obj.docSubject;
|
||||
// console.log(docid,docsubject);
|
||||
// addDocFn && addDocFn(docid,docsubject);
|
||||
_this.addDocument(docid, docsubject, '')
|
||||
}
|
||||
}
|
||||
//删除
|
||||
handleOperate=(record)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskRequiredOpt,taskid,} = contentStore;
|
||||
Modal.confirm({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83600,"您确认要删除吗?"),
|
||||
onOk() {
|
||||
doDspTaskRequiredOpt({
|
||||
method:'delRequiredDoc',
|
||||
taskid : taskid,
|
||||
secID : record.reqDocSecCategory
|
||||
},'doc');
|
||||
},
|
||||
onCancel() { },
|
||||
})
|
||||
|
||||
}
|
||||
//新建
|
||||
addDocument=(ids, names, datas)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskReferenceOpt,taskid,prjid} = contentStore;
|
||||
doDspTaskReferenceOpt({
|
||||
dotype:'doc',
|
||||
method:'add',
|
||||
prjid : prjid,
|
||||
taskid:taskid,
|
||||
docid:ids,
|
||||
ids:""
|
||||
},'doc')
|
||||
}
|
||||
deleteDocument=()=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskReferenceOpt,taskid,taskDocStore,prjid} = contentStore;
|
||||
const {selectedRowKeys} = taskDocStore;
|
||||
Modal.confirm({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83601,"您确认要删除选中的记录吗?"),
|
||||
onOk() {
|
||||
doDspTaskReferenceOpt({
|
||||
dotype:'doc',
|
||||
method:'del',
|
||||
prjid : prjid,
|
||||
taskid:taskid,
|
||||
docid:"",
|
||||
ids:`${toJS(selectedRowKeys)}`
|
||||
},'doc')
|
||||
},
|
||||
onCancel() { },
|
||||
})
|
||||
}
|
||||
onOperatesClick(record,index,operate,flag){
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskReferenceOpt,taskid,taskDocStore,prjid} = contentStore;
|
||||
if(fn != ""){
|
||||
if("onDelRelated"==fn){ //delete
|
||||
Modal.confirm({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83600,"您确认要删除吗?"),
|
||||
onOk() {
|
||||
doDspTaskReferenceOpt({
|
||||
dotype:'doc',
|
||||
method:'del',
|
||||
prjid : prjid,
|
||||
taskid:taskid,
|
||||
docid:"",
|
||||
ids:record.randomFieldId
|
||||
},'doc')
|
||||
},
|
||||
onCancel() { },
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
|
||||
import {Button,Row,Col,Icon,message} from 'antd';
|
||||
import {WeaNewScroll,WeaTextarea,WeaSearchGroup ,WeaRichText,WeaLocaleProvider } from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import * as Util from '../../util/index'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class RelateExchange extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state ={
|
||||
showGroup:true,
|
||||
richValue:"",
|
||||
status:"",
|
||||
"doc":"",
|
||||
"task":"",
|
||||
"crm":"",
|
||||
"workflow":"",
|
||||
"project":"",
|
||||
file:""
|
||||
}
|
||||
|
||||
}
|
||||
componentDidMount(){
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const {showGroup,richValue} = this.state;
|
||||
const basicToolBar = {
|
||||
toolbar: [
|
||||
{ name: 'document', items: [ 'Source'] },
|
||||
{ name: 'styles', items: [ 'Format', 'Font', 'FontSize' ] },
|
||||
{ name: 'colors', items: [ 'TextColor' ] },
|
||||
{ name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', ] },
|
||||
],
|
||||
extraPlugins: 'autogrow',
|
||||
height:150,
|
||||
autoGrow_minHeight: 150,
|
||||
autoGrow_maxHeight: 600,
|
||||
removePlugins: 'resize',
|
||||
};
|
||||
|
||||
// 顶部,底部工具栏扩展
|
||||
const bottomBarConfig = [
|
||||
{
|
||||
name: 'Browser', // 浏览按钮组件
|
||||
show: <span style={{ fontSize: 12 }}>
|
||||
<i className='icon-coms-Journal' title={getLabel(58,"文档")} />{getLabel(857,"相关文档")}</span>, // 使用组件库图标
|
||||
type: '37', // 浏览按钮类型 文档
|
||||
title: getLabel(58,"文档"), // 浏览按钮标题
|
||||
},
|
||||
{
|
||||
name: 'Browser', // 浏览按钮组件
|
||||
show: <span style={{ fontSize: 12 }}>
|
||||
<i className='icon-coms-Workflow-o' title={getLabel(18015,"流程")} />{getLabel(1044,"相关流程")}</span>,
|
||||
type: '152', // 浏览按钮类型
|
||||
title: getLabel(18015,"流程"), // 浏览按钮标题
|
||||
},
|
||||
{
|
||||
name: 'Browser',
|
||||
show: <span style={{ fontSize: 12 }}>
|
||||
<i className='icon-coms-crm' title={getLabel(136,"客户")} />{getLabel(783,"相关客户")}</span>,
|
||||
type: '18', // 浏览按钮类型
|
||||
title: getLabel(136,"客户"), // 浏览按钮标题
|
||||
},
|
||||
{
|
||||
name: 'Browser',
|
||||
show: <span style={{ fontSize: 12 }}>
|
||||
<i className='icon-coms-project' title={getLabel(101,"项目")} />{getLabel(782,"相关项目")}</span>,
|
||||
type: '135', // 浏览按钮类型
|
||||
title: getLabel(101,"项目"), // 浏览按钮标题
|
||||
},
|
||||
{
|
||||
name: 'Browser',
|
||||
show: <span style={{ fontSize: 12 }}>
|
||||
<i className='icon-coms-task-list' title={getLabel(1332,"任务")} />{getLabel(33414,"相关任务")}</span>,
|
||||
type: 'prjtsk', // 浏览按钮类型 --目前没有,等待开发
|
||||
title: getLabel(1332,"任务"), // 浏览按钮标题
|
||||
},
|
||||
{
|
||||
name: 'Upload', // 上传组件
|
||||
type: 'file', // 上传组件类型
|
||||
show: <span style={{ fontSize: 12 }}>
|
||||
<Icon type='paper-clip' title={getLabel(128095,"上传附件")}/>{getLabel(156,"附件")+"("+getLabel(18642,"此目录下上传附件最大大小")+":5M)"}</span>, // 使用 antd 图标
|
||||
uploadUrl: (window.ecologyContentPath || '')+'/api/doc/upload/uploadFile?model=reply', // 上传地址 --目前没有,等待开发
|
||||
category: (window.ecologyContentPath || '')+'/api/doc/upload/uploadFile?model=reply', // 文档目录 --目前没有,等待开发
|
||||
maxUploadSize:5
|
||||
},
|
||||
{
|
||||
name: 'Component',
|
||||
style: {float: 'right'},
|
||||
show: (
|
||||
<Button type="primary" onClick={this.handleSubmitExchange}>
|
||||
<span><span>{getLabel(615,"提交")}</span></span>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
];
|
||||
return (
|
||||
<div className="prj-exchange">
|
||||
|
||||
<div className="prj-exchange-header">
|
||||
<Row className="prj-exchange-title">
|
||||
<Col span="20" className="prj-exchange-title-left">
|
||||
<div>{getLabel(1044,"相关交流")}</div>
|
||||
</Col>
|
||||
<Col span="4" className="prj-exchange-title-right" >
|
||||
<i className={showGroup ? 'icon-coms-up' : 'icon-coms-down'} onClick={()=>this.setState({showGroup:!showGroup})}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="prj-exchange-content" style={{display:showGroup ? "block":"none"} }>
|
||||
<Col className="prj-exchange-cell" span={24}>
|
||||
<WeaRichText
|
||||
ref={"prjRelateExchange"}
|
||||
value={richValue}
|
||||
ckConfig={basicToolBar}
|
||||
bottomBarConfig={bottomBarConfig}
|
||||
onChange={v=>this.setState({richValue: v})}
|
||||
onStatusChange={s => this.setState({status: s})}
|
||||
onToolsChange={this.transfStr}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</div>
|
||||
|
||||
<div></div>
|
||||
{
|
||||
// <div> <Row>
|
||||
// <Col className="prj-exchange-header-left" span={12}>相关交流</Col>
|
||||
// <Col className="prj-exchange-header-right" span={12}><Button type="primary">提交</Button></Col>
|
||||
// </Row>
|
||||
// <WeaTextarea fieldName="prjrelateExchange" minRows={4} maxRows={8} />
|
||||
// </div>
|
||||
// <WeaSearchGroup title={"title"} customComponent="附加信息">
|
||||
|
||||
// </WeaSearchGroup>
|
||||
}
|
||||
</div>)
|
||||
}
|
||||
transfStr = (name = '', ids = '', list = [], type = '') => {
|
||||
const {doc,task,workflow,crm,project,} = this.state;
|
||||
if(type == "37"){
|
||||
|
||||
}else if(type== "prjtsk"){
|
||||
|
||||
}else if(type== "18"){
|
||||
|
||||
}else if(type== "152"){
|
||||
|
||||
}else if(type== "135"){
|
||||
|
||||
}else if(type== "file"){
|
||||
|
||||
}
|
||||
let str = '';
|
||||
const mirror = {
|
||||
37: "doc",
|
||||
prjtsk: "task",
|
||||
18: "crm",
|
||||
152: "workflow",
|
||||
135: "project",
|
||||
}
|
||||
list.map(item => {
|
||||
if(name === 'Upload' && type === 'image'){
|
||||
str += '<img class="formImgPlay" src="' + item.filelink + '" data-imgsrc="' + (item.loadlink || item.filelink) + '" />'
|
||||
}
|
||||
if(name === 'Upload' && type === 'file'){
|
||||
str += (`<a href='javascript:void(0)' style='cursor:pointer;text-decoration:underline !important;margin-right:8px'>${item.filename}</a><br>`)
|
||||
}
|
||||
if(name === 'Browser'){
|
||||
str += ( `<a href='javascript:void(0)' style='cursor:pointer;text-decoration:underline !important;margin-right:8px'>${item.name || item.showname}</a><br>`)
|
||||
}
|
||||
})
|
||||
return str
|
||||
}
|
||||
handleSubmitExchange=()=>{
|
||||
let { richValue} = this.state;
|
||||
let ckref = this.refs.prjRelateExchange;
|
||||
if (!ckref.checkMode()) {
|
||||
message.error(getLabel(27541,"请将编辑器切换到可视化模式"));
|
||||
return;
|
||||
}
|
||||
this.refs.prjRelateExchange.setData('');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,211 @@
|
|||
|
||||
import {Button,Row,Col,Icon,message,Modal} from 'antd';
|
||||
import {WeaNewScroll,WeaTextarea,WeaSearchGroup ,WeaRichText,WeaFormItem ,WeaBrowser,WeaUpload,WeaTab,WeaTools,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import ExchangeLogs from './exchangeLogs'
|
||||
import {Condition} from '../list/listCondition';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class RelateExchange extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state ={
|
||||
showGroup:false,
|
||||
value:"",
|
||||
"doc":"",
|
||||
"task":"",
|
||||
"crm":"",
|
||||
"workflow":"",
|
||||
"project":"",
|
||||
file:"",
|
||||
key:0
|
||||
}
|
||||
}
|
||||
componentWillUnmount(){
|
||||
this.setState({
|
||||
showGroup:false,
|
||||
value:"",
|
||||
"doc":"",
|
||||
"task":"",
|
||||
"crm":"",
|
||||
"workflow":"",
|
||||
"project":"",
|
||||
file:"",
|
||||
key:0
|
||||
})
|
||||
}
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
const {showSearchAd ,exchangeContent,exchangeform } = contentStore;
|
||||
const formParams = exchangeform.getFormParams() || {};
|
||||
const {showGroup,value,key} = this.state;
|
||||
const formItemLayout = {
|
||||
labelCol: { span:5 },
|
||||
wrapperCol: { span: 14 },
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="prj-exchange" style={{height:"100%"}}>
|
||||
<div className="prj-exchange-header">
|
||||
{/* <WeaTab
|
||||
buttonsAd={this.getAdButtons()}
|
||||
searchType={['base','advanced']}
|
||||
searchsBaseValue={formParams.remark}
|
||||
setShowSearchAd={bool=>{contentStore.setShowSearchAd(bool)}}
|
||||
hideSearchAd={()=> contentStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition listStore={contentStore} form={exchangeform}></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v=>{contentStore.getRelateExchangeInfo()}}
|
||||
onSearchChange={v=>{contentStore.setFormFields({remark:{value:v}})}}
|
||||
/> */}
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@btxkn0`} className="prj-exchange-content" style={{margin:"5px 10px 0"}}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@gvxpiu`} className="prj-exchange-cell" span={24}>
|
||||
<WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@wcqte0`} fieldName="prjrelateExchange" value={value} minRows={4} maxRows={8} onChange={v=>{this.saveValue(v)}} />
|
||||
</Col>
|
||||
</Row>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@dt2fza`} className="prj-exchange-title">
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@msjdts`} span="18" className="prj-exchange-title-left">
|
||||
<div><Button ecId={`${this && this.props && this.props.ecId || ''}_Button@9mk469`} type="primary" onClick={this.handleSubmitExchange}>{getLabel(615,"提交")}</Button></div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@3jnahn`} span="6" className="prj-exchange-title-right" >
|
||||
<span style={{marginRight:"10px"}}>{getLabel(83273,"附加信息")}</span>
|
||||
<i className={showGroup ? 'icon-coms-up' : 'icon-coms-down'} onClick={()=>this.setState({showGroup:!showGroup})}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@g7737t`} className="prj-exchange-content" style={{display:showGroup ? "block":"none"} }>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@yr92vb`} className="prj-exchange-cell prj-exchange-cell-fujian" span={24}>
|
||||
{this.getFormItem()}
|
||||
{ (exchangeContent.showacc || false) &&
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@w1nsv5`}
|
||||
label={getLabel(22194,"相关附件")}
|
||||
{ ...formItemLayout}>
|
||||
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@jx3aio`}
|
||||
key={key}
|
||||
uploadId="relatedfile"
|
||||
uploadUrl={(window.ecologyContentPath || '')+"/api/proj/prjutil/fileUpload?accsec="+exchangeContent.accsec}
|
||||
category={exchangeContent.accsec}
|
||||
autoUpload={true}
|
||||
showBatchLoad={false}
|
||||
showClearAll={false}
|
||||
multiSelection={true}
|
||||
datas={[]}
|
||||
maxUploadSize={exchangeContent.accsize}
|
||||
onChange={this.fileUploadBack}
|
||||
// onUploading={(state)=>{}}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<div className="prj-exchange-logs">
|
||||
<ExchangeLogs ecId={`${this && this.props && this.props.ecId || ''}_ExchangeLogs@9btpyu`} onChange={this.pageNoChange} totalSize={exchangeContent.totalSize} data={toJS(exchangeContent.datas) || []} />
|
||||
</div>
|
||||
</div>)
|
||||
}
|
||||
getFormItem(){
|
||||
const {contentStore} = this.props;
|
||||
const { exchangeContent } = contentStore;
|
||||
const items =[
|
||||
{label:getLabel(857,"相关文档"),title:getLabel(857,"文档"),type:37,key:"doc",show:exchangeContent.showdoc || false},
|
||||
{label:getLabel(1044,"相关流程"),title:getLabel(18015,"流程"),type:152,key:"wf",show:exchangeContent.showwf || false},
|
||||
{label:getLabel(783,"相关客户"),title:getLabel(136,"客户"),type:18,key:"crm",show:exchangeContent.showcrm || false},
|
||||
{label:getLabel(782,"相关项目"),title:getLabel(101,"项目"),type:135,key:"prj",show:exchangeContent.showprj || false},
|
||||
{label:getLabel(33414,"相关任务"),title:getLabel(1332,"任务"),type:'prjtsk',key:"task",show:exchangeContent.showtask || false},
|
||||
];
|
||||
const formItemLayout = {
|
||||
labelCol: { span:5 },
|
||||
wrapperCol: { span: 14 },
|
||||
};
|
||||
let group =[];
|
||||
items.map((item,i)=>{
|
||||
if(item.show){
|
||||
group.push(
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@tnjlxq@${i}`}
|
||||
label={item.label}
|
||||
{ ...formItemLayout}>
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@h1zi4z@${i}`} key={this.state.key} type={item.type} title={item.title} hasAdvanceSerach={true} isSingle={false} onChange ={(ids, names, datas)=>this.docOnchange(item.key,ids, names, datas)} />
|
||||
</WeaFormItem>
|
||||
)
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
})
|
||||
return group;
|
||||
}
|
||||
docOnchange=(type,ids, names, datas)=>{
|
||||
if(type =="doc"){
|
||||
this.setState({doc:ids})
|
||||
}else if(type == "wf"){
|
||||
this.setState({workflow:ids})
|
||||
}else if(type == "crm"){
|
||||
this.setState({crm:ids})
|
||||
}else if(type == "task"){
|
||||
this.setState({task:ids})
|
||||
}else if(type == "prj"){
|
||||
this.setState({project:ids})
|
||||
}
|
||||
}
|
||||
fileUploadBack=(arr)=>{
|
||||
this.setState({file:arr})
|
||||
}
|
||||
saveValue=(v)=>{
|
||||
this.setState({value:v})
|
||||
}
|
||||
|
||||
handleSubmitExchange=()=>{
|
||||
const { value,doc,task,crm,workflow, project, file,key} = this.state;
|
||||
const {targetid,discusstype} = this.props.contentStore;
|
||||
if(value){
|
||||
let params = {
|
||||
id:targetid,
|
||||
discusstype:discusstype,
|
||||
remark:value.replace(/(^\s*)|(\s*$)/g,"").replace(/\n/g,'<br>'),
|
||||
relateddoc:doc,
|
||||
relatedwf:workflow,
|
||||
relatedcrm:crm,
|
||||
relatedprj:project,
|
||||
relatedtsk:task,
|
||||
relatedacc:`${file}`,
|
||||
}
|
||||
WeaTools.callApi('/api/proj/prjutil/doDiscussOpt', 'POST', params).then(data=>{
|
||||
typeof this.props.callBack == "function" && this.props.callBack();
|
||||
this.setState({
|
||||
value:"",
|
||||
"doc":"",
|
||||
"task":"",
|
||||
"crm":"",
|
||||
"workflow":"",
|
||||
"project":"",
|
||||
file:"",
|
||||
key:key+1
|
||||
})
|
||||
});
|
||||
}else{
|
||||
Modal.info({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83900,"请填写交流信息"),
|
||||
});
|
||||
}
|
||||
}
|
||||
getAdButtons = () => {
|
||||
const {contentStore} = this.props;
|
||||
const {setShowSearchAd,clearFormFields,getRelateExchangeInfo} = contentStore;
|
||||
return [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3loogm@search`} type="primary" onClick={()=>{getRelateExchangeInfo();setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@sk8us3@reset`} type="ghost" onClick={()=>{clearFormFields();}}>{getLabel(2022,"重置")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@6s49jh@cancel`} type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
|
||||
];
|
||||
}
|
||||
pageNoChange=(index)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {getRelateExchangeInfo} = contentStore;
|
||||
getRelateExchangeInfo({pageIndex:index});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,248 @@
|
|||
|
||||
import {Button,Row,Col, Icon,message,Modal} from 'antd';
|
||||
import {WeaTools,WeaBrowser,WeaAlertPage,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import PrjShowGroup from '../comp/prj-show-group'
|
||||
import PrjTableEdit from '../comp/prj-table-edit'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class RelateExchange extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state ={
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
componentDidMount(){
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
const {taskReqStore,relateList,relateList:{canRef},taskRelRight:{hasRight,verified},register_table} = contentStore;
|
||||
const columns = [
|
||||
{
|
||||
title: getLabel(16579,"流程类型"), //列名
|
||||
dataIndex: 'wfname', //列的id 对应数据
|
||||
key: 'wfname', //前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'LINK_WF' , key: 'wfname', viewAttr:1, width: 120, otherParams: {className: 'test-className'}},
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '50%',
|
||||
className: 'wea-table-edit-name',
|
||||
},
|
||||
{
|
||||
title: getLabel(17906,"必要"), //列名
|
||||
dataIndex: 'isNecessary', //列的id 对应数据
|
||||
key: 'isNecessary', //前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'CHECKBOX' ,editType: '1', viewAttr:canRef?2:1,key: 'isNecessary', width: 80, }
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '40%',
|
||||
className: 'wea-table-edit-ismust',
|
||||
},
|
||||
{
|
||||
title: '', //列名
|
||||
dataIndex: 'operate', //列的id 对应数据
|
||||
key: 'sex', //前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'OPERATE' ,editType: '1', key: 'operate', options: [{ key: '1', showname: getLabel(91,"删除")}] }
|
||||
],
|
||||
colSpan: 1,
|
||||
width: '10%',
|
||||
className: 'prj-dropdown-link',
|
||||
},
|
||||
];
|
||||
if (verified && !hasRight) {
|
||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@ukfh1m`} >
|
||||
<div style={{color : '#000'}}>
|
||||
{getLabel(2012,"对不起,您暂时没有权限!")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
}
|
||||
if (verified && hasRight) {
|
||||
return (
|
||||
<div className="prj-exchange">
|
||||
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@nz3pd2`}
|
||||
leftComponent={getLabel(83870,"所需流程")}
|
||||
rightComponent={this.getButtons()}
|
||||
>
|
||||
<PrjTableEdit ecId={`${this && this.props && this.props.ecId || ''}_PrjTableEdit@hxizqu`}
|
||||
columns={columns}
|
||||
datas={toJS(relateList.needList)}
|
||||
onChange={this.onChange}
|
||||
onRowSelect={null}
|
||||
pagination={false}
|
||||
viewAttr={1}
|
||||
tableProps={{rowSelection:null}}
|
||||
getRowSelection={this.getRowSelection}
|
||||
operate ={this.handleOperate}
|
||||
onCreatReq={this.onCreatReq}
|
||||
onCreatDoc={this.onCreatDoc}
|
||||
/>
|
||||
|
||||
</PrjShowGroup>
|
||||
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@hunf8t`}
|
||||
leftComponent={getLabel(1044,"相关流程")}
|
||||
rightComponent={this.getRelateButtons()}
|
||||
btnspace={10}
|
||||
>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@f3qsbk`}
|
||||
comsWeaTableStore={taskReqStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
register_table={register_table}
|
||||
/>
|
||||
</PrjShowGroup>
|
||||
</div>)
|
||||
}
|
||||
return <div></div>
|
||||
}
|
||||
getButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {taskReqStore,relateList:{canRef}} = contentStore;
|
||||
let btn = [];
|
||||
if(canRef){
|
||||
btn.push(
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@8eq8ht`} type={"-99991"} title={getLabel(18499,"路径")} hasAdvanceSerach={true} isSingle={false} onChange ={(ids, names, datas)=>this.addWorkFlowType(ids, names, datas)} customized={true} >
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pmfdro`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@allf77`} type="plus" /></Button>
|
||||
</WeaBrowser>
|
||||
);
|
||||
}
|
||||
return btn;
|
||||
}
|
||||
getRelateButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {taskReqStore,relateList:{canRelated}} = contentStore;
|
||||
const {selectedRowKeys} = taskReqStore;
|
||||
let btn = [];
|
||||
if(canRelated){
|
||||
btn.push(<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@6tcc4p`} type={"16"} title={getLabel(18015,"流程")} hasAdvanceSerach={true} isSingle={true} onChange ={(ids, names, datas)=>this.addWorkFlow(ids, names, datas)} customized={true} >
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@gnzedh`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@1adcsw`} type="plus" /></Button>
|
||||
</WeaBrowser>);
|
||||
btn.push( <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@zsvqog`} type="primary" className="prj-btn-small" title={getLabel(91,"删除")} disabled={!(selectedRowKeys.length>0)} size="small" onClick={this.deleteWorkFlow}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@taejhk`} type="minus" /></Button>);
|
||||
}
|
||||
return btn;
|
||||
}
|
||||
//编辑
|
||||
onChange=(data)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskRequiredOpt,taskid,} = contentStore;
|
||||
doDspTaskRequiredOpt({
|
||||
method:'modifyRequiredWFN',
|
||||
taskid : taskid,
|
||||
wfid : data.wfid1,
|
||||
isNecessary:data.isNecessary
|
||||
},'req');
|
||||
}
|
||||
//新增
|
||||
addWorkFlowType=(ids, names, datas)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskRequiredOpt,taskid,} = contentStore;
|
||||
doDspTaskRequiredOpt({
|
||||
method:'addRequiredWF',
|
||||
taskid : taskid,
|
||||
wfids : ids
|
||||
},'req');
|
||||
}
|
||||
//删除
|
||||
handleOperate=(record)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskRequiredOpt,taskid,} = contentStore;
|
||||
Modal.confirm({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83600,"您确认要删除吗?"),
|
||||
onOk() {
|
||||
doDspTaskRequiredOpt({
|
||||
method:'delRequiredWF',
|
||||
taskid : taskid,
|
||||
wfid : record.wfid1
|
||||
},'req');
|
||||
},
|
||||
onCancel() { },
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
onCreatReq = (workflowid,taskId) => {
|
||||
window.open("/workflow/request/CreateRequestForward.jsp?workflowid="+workflowid+"&taskrecordid="+taskId , "_blank");
|
||||
}
|
||||
|
||||
onCreatDoc = (docid,taskid) => {
|
||||
window.open((window.ecologyContentPath || '')+"/spa/document/index.jsp?secid="+ docid +"&isEdit=1&router=1&moudleFrom=task#/main/document/edit?taskrecordid="+taskid , "_blank");
|
||||
}
|
||||
|
||||
//新建流程
|
||||
addWorkFlow=(ids, names, datas)=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskReferenceOpt,taskid,prjid} = contentStore;
|
||||
doDspTaskReferenceOpt({
|
||||
dotype:'workflow',
|
||||
method:'add',
|
||||
prjid : prjid,
|
||||
taskid:taskid,
|
||||
requestid:ids,
|
||||
ids:""
|
||||
},'req')
|
||||
}
|
||||
//删除流程
|
||||
deleteWorkFlow = ()=>{
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskReferenceOpt,taskid,taskReqStore,prjid} = contentStore;
|
||||
const {selectedRowKeys} = taskReqStore;
|
||||
Modal.confirm({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83601,"您确认要删除选中的记录吗?"),
|
||||
onOk() {
|
||||
doDspTaskReferenceOpt({
|
||||
dotype:'workflow',
|
||||
method:'del',
|
||||
prjid : prjid,
|
||||
taskid:taskid,
|
||||
requestid:"",
|
||||
ids:`${toJS(selectedRowKeys)}`
|
||||
},'req')
|
||||
},
|
||||
onCancel() { },
|
||||
})
|
||||
}
|
||||
onOperatesClick(record,index,operate,flag){
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
const {contentStore} = this.props;
|
||||
const {doDspTaskReferenceOpt,taskid,taskReqStore,prjid} = contentStore;
|
||||
if(fn != ""){
|
||||
if("onDelRelated"==fn){ //delete
|
||||
Modal.confirm({
|
||||
title: getLabel(15172,"系统提示"),
|
||||
content: getLabel(83600,"您确认要删除吗?"),
|
||||
onOk() {
|
||||
doDspTaskReferenceOpt({
|
||||
dotype:'workflow',
|
||||
method:'del',
|
||||
prjid : prjid,
|
||||
taskid:taskid,
|
||||
requestid:"",
|
||||
ids:record.randomFieldId
|
||||
},'req')
|
||||
},
|
||||
onCancel() { },
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
|
||||
import { observer } from "mobx-react";
|
||||
import React from 'react';
|
||||
import { toJS } from 'mobx';
|
||||
import {WeaAlertPage} from 'ecCom';
|
||||
import {WeaLocaleProvider} from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {Spin} from 'antd';
|
||||
import '../../style/resource.less';
|
||||
@observer
|
||||
export default class resourcePage extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
let {resourceInfo} = contentStore;
|
||||
let resource = toJS(resourceInfo);
|
||||
if (!resource.success) {
|
||||
return (
|
||||
<div className="top40 align-center"><Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@ln6hb9`} /></div>
|
||||
);
|
||||
}
|
||||
let Document, Workflow, Customer, Project, Task, Accessory, Capital;
|
||||
//相关文档
|
||||
resource.docList && (
|
||||
Document = resource.docList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli"><a href={item.url} target="_blank" title={item.name}>{item.name}</a></li>
|
||||
)
|
||||
}))
|
||||
|
||||
//相关流程
|
||||
resource.wfList && (
|
||||
Workflow = resource.wfList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli"><a href={item.url} target="_blank" title={item.name}>{item.name}</a></li>
|
||||
)
|
||||
}))
|
||||
|
||||
//相关客戶
|
||||
resource.cusList && (
|
||||
Customer = resource.cusList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli"><a href={item.url} target="_blank" title={item.name}>{item.name}</a></li>
|
||||
)
|
||||
}))
|
||||
|
||||
//相关項目
|
||||
resource.prjList && (
|
||||
Project = resource.prjList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli"><a href={item.url} target="_blank" title={item.name}>{item.name}</a></li>
|
||||
)
|
||||
}))
|
||||
|
||||
//相关任务
|
||||
resource.taskList && (
|
||||
Task = resource.taskList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli">
|
||||
<a href={item.url} target="_blank" title={item.name}>{item.name}</a>
|
||||
</li>
|
||||
)
|
||||
}))
|
||||
|
||||
//相关附件
|
||||
resource.accList && (
|
||||
Accessory = resource.accList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli">
|
||||
<a href={item.url} target="_blank" title={item.name}>{item.name}</a>
|
||||
</li>
|
||||
)
|
||||
}))
|
||||
|
||||
//相关资产
|
||||
resource.cptList && (
|
||||
Capital = resource.cptList.map((item, index) => {
|
||||
return (
|
||||
<li className="text-elli">
|
||||
<a href={item.url} target="_blank" title={item.name}>{item.name}</a>
|
||||
</li>
|
||||
)
|
||||
}))
|
||||
|
||||
return (<div className='wea-prj-content-list'>{((resource.docList && resource.docList.length !== 0) || (resource.wfList && resource.wfList.length !== 0) ||
|
||||
(resource.cusList && resource.cusList.length !== 0) || (resource.prjList && resource.prjList.length !== 0) ||
|
||||
(resource.taskList && resource.taskList.length !== 0) || (resource.accList && resource.accList.length !== 0)) ? (
|
||||
<div className='prj-content-resource prj-content-style-public'>
|
||||
{
|
||||
(resource.docList && resource.docList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-doc'>
|
||||
<em className='icon-coms-currency2'></em>
|
||||
<span>{getLabel(857, '相关文档')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-document'>
|
||||
{Document}
|
||||
{/*<li><a>E8-DEMO网站需要修正的地方</a></li>
|
||||
<li><a>E8-DEMO网站需要修正的地方</a></li>
|
||||
<li><a>demo9档案</a></li>*/}
|
||||
</ul>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
{(resource.wfList && resource.wfList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-workflow'>
|
||||
<em className='icon-coms-Relevant-workflow'></em>
|
||||
<span>{getLabel(1044, '相关流程')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-document'>
|
||||
{Workflow}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
{(resource.accList && resource.accList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-acc'>
|
||||
<em className='icon-coms-Enclosure'></em>
|
||||
<span>{getLabel(22194, '相关附件')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-accessory'>
|
||||
{Accessory}
|
||||
{/* <li>
|
||||
<a>E8-DEMO网站需要修正的地方</a>
|
||||
<i className='icon-coms-download'></i>
|
||||
<span>2345K</span>
|
||||
</li>*/}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(resource.prjList && resource.prjList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-project'>
|
||||
<em className='icon-coms-Relevant-project'></em>
|
||||
<span>{getLabel(782, '相关项目')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-document'>
|
||||
{Project}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(resource.taskList && resource.taskList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-task'>
|
||||
<em className='icon-coms-Relevant-task'></em>
|
||||
<span>{getLabel(33414, '相关任务')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-document'>
|
||||
{Task}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(resource.cusList && resource.cusList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-customer'>
|
||||
<em className='icon-coms-Relevant-Customer'></em>
|
||||
<span>{getLabel(783, '相关客户')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-document'>
|
||||
{Customer}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{(resource.cptList && resource.cptList.length !== 0) && (
|
||||
<div>
|
||||
<div className='prj-content-pub prj-content-cpt'>
|
||||
<em className='icon-coms-fa'></em>
|
||||
<span>{getLabel(858, '相关资产')}</span>
|
||||
</div>
|
||||
<ul className='prj-content-public prj-content-document'>
|
||||
{Capital}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
</div>) : (
|
||||
<div style={{height: window.innerHeight}}>
|
||||
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@6l5brj`} icon="icon-coms-blank" >
|
||||
<div>{getLabel(83553, '暂无数据')}</div>
|
||||
</WeaAlertPage>
|
||||
</div>
|
||||
)}</div>)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,622 @@
|
|||
|
||||
import {Button,Row,Col,Icon,message,Modal} from 'antd';
|
||||
import {WeaTab,WeaAuth,WeaAlertPage,WeaLocaleProvider } from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
import * as Apis from '../../apis/project';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class TaskShare extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
|
||||
}
|
||||
shareCondition = [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharetype"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(21956, "对象类型"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(179, "人力资源")
|
||||
}, {
|
||||
"key": "5",
|
||||
"selected": false,
|
||||
"showname": getLabel(141, "分部")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(124, "部门")
|
||||
}, {
|
||||
"key": "11",
|
||||
"selected": false,
|
||||
"showname": getLabel(6086, "岗位")
|
||||
}, {
|
||||
"key": "3",
|
||||
"selected": false,
|
||||
"showname": getLabel(122, "角色")
|
||||
}, {
|
||||
"key": "4",
|
||||
"selected": false,
|
||||
"showname": getLabel(1340, "所有人")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}, {
|
||||
"2": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "57",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106, "对象"),
|
||||
"labelcol": 6,
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683, "安全级别"),
|
||||
"labelcol": 6,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385, "权限"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564, "查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93, "编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"5": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "194",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106, "对象"),
|
||||
"labelcol": 6,
|
||||
"value": 3,
|
||||
"viewAttr": 2
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683, "安全级别"),
|
||||
"labelcol": 6,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385, "权限"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564, "查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93, "编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"1": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "17",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106, "对象"),
|
||||
"labelcol": 6,
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385, "权限"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564, "查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93, "编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"11": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "278",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106, "对象"),
|
||||
"labelcol": 6,
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT_LINKAGE",
|
||||
"domkey": [
|
||||
"joblevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(28169, "岗位级别"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "0",
|
||||
"selected": true,
|
||||
"showname": getLabel(140, "总部")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(19437, "指定分部")
|
||||
}, {
|
||||
"key": "1",
|
||||
"selected": false,
|
||||
"showname": getLabel(19438, "指定部门")
|
||||
}
|
||||
],
|
||||
"selectLinkageDatas": {
|
||||
"1": {
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "57",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"jobtitledepartment"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": "",
|
||||
"labelcol": 6,
|
||||
"viewAttr": 3
|
||||
},
|
||||
"2": {
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "194",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"jobtitlesubcompany"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": "",
|
||||
"labelcol": 6,
|
||||
"viewAttr": 3
|
||||
}
|
||||
},
|
||||
"viewAttr": 2
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385, "权限"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564, "查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93, "编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"4": [[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683, "安全级别"),
|
||||
"labelcol": 6,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385, "权限"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564, "查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93, "编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"3": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "65",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106, "对象"),
|
||||
"labelcol": 6,
|
||||
"viewAttr": 3
|
||||
}, {
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"rolelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(139, "级别"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "0",
|
||||
"selected": true,
|
||||
"showname": getLabel(124, "部门")
|
||||
}, {
|
||||
"key": "1",
|
||||
"selected": false,
|
||||
"showname": getLabel(141, "分部")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(140, "总部")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683, "安全级别"),
|
||||
"labelcol": 6,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
], [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385, "权限"),
|
||||
"labelcol": 6,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564, "查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93, "编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
];
|
||||
componentDidMount(){
|
||||
Apis.getDetachable().then(data=>{
|
||||
if(data.appDetachDisableAll){//禁用所有人选项
|
||||
let temp =this.shareCondition[0];
|
||||
temp.options.splice(5,1);
|
||||
this.shareCondition[0] = temp ;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const {contentStore:{shareTableStore,isShowShare,showAddShareModal,shareRight:{hasRight,verified}},contentStore,title} = this.props;
|
||||
|
||||
if (verified && !hasRight) {
|
||||
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@hzux0g`} >
|
||||
<div style={{color : '#000'}}>
|
||||
{getLabel(2012,"对不起,您暂时没有权限!")}
|
||||
</div>
|
||||
</WeaAlertPage>
|
||||
)
|
||||
}
|
||||
if (verified && hasRight) {
|
||||
return (
|
||||
<div >
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@vx573t`}
|
||||
comsWeaTableStore={shareTableStore}
|
||||
hasOrder={true}
|
||||
needScroll={false}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
<WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@un2b30`}
|
||||
visible={isShowShare}
|
||||
conditions={toJS(this.shareCondition)}
|
||||
title={title}
|
||||
icon={"icon-coms-project"}
|
||||
iconBgcolor="#217346"
|
||||
onOk={v => {
|
||||
contentStore.addShare(v);
|
||||
showAddShareModal(false);
|
||||
}}
|
||||
onCancel={() => {
|
||||
showAddShareModal(false);
|
||||
}}
|
||||
/>
|
||||
</div>)
|
||||
}
|
||||
return <div></div>
|
||||
}
|
||||
|
||||
onOperatesClick=(record,index,operate,flag)=>{
|
||||
const {contentStore} = this.props;
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
let that = this;
|
||||
if(fn != ""){
|
||||
if('onDel' == fn){ //删除
|
||||
contentStore.delBatchShare(record.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
import { observer } from "mobx-react";
|
||||
import React from 'react';
|
||||
import { WeaTableEdit } from 'ecCom';
|
||||
import { toJS } from 'mobx';
|
||||
@observer
|
||||
export default class StageList extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { contentStore } = this.props;
|
||||
const { stageInfo : { stageColumns, stageColumnDatas, selectedDatas, selectedRowKeys,canedit }, onRowSelect, onChange } = contentStore;
|
||||
return (
|
||||
<div >
|
||||
{stageColumns && stageColumns.length>0 &&<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@tdhnss`}
|
||||
draggable={canedit}
|
||||
showTitle={false}
|
||||
columns={toJS(stageColumns)}
|
||||
datas={stageColumnDatas}
|
||||
onChange={onChange}
|
||||
onRowSelect={onRowSelect}
|
||||
selectedData={selectedDatas}
|
||||
selectedRowKeys={selectedRowKeys}
|
||||
getRowSelection={this.getRowSelection}
|
||||
copyFilterProps={["id"]}
|
||||
rowKey={"id"}
|
||||
ref={el => {this.tableEdit = el}}
|
||||
/>}
|
||||
</div>)
|
||||
|
||||
}
|
||||
|
||||
getRowSelection = (rowSelection) => {
|
||||
const { contentStore } = this.props;
|
||||
const { stageInfo : { canedit }} = contentStore;
|
||||
let sel = { ...rowSelection };
|
||||
sel.getCheckboxProps = (record) => {
|
||||
return { disabled: record.candel == false };
|
||||
}
|
||||
return canedit ? sel:null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* @Author: lusx
|
||||
* @Date: 2020-04-22 11:11:59
|
||||
* @Last Modified by: lusx
|
||||
* @Last Modified time: 2020-04-22 11:35:08
|
||||
*/
|
||||
|
||||
import { observer } from "mobx-react";
|
||||
import { WeaTab, WeaLocaleProvider } from 'ecCom';
|
||||
import { Button } from 'antd';
|
||||
import { Condition } from '../list/listCondition';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
@observer
|
||||
class TabComponent extends React.Component {
|
||||
render() {
|
||||
const { contentStore, account } = this.props;
|
||||
const { showSearchAd, tasksubform } = contentStore;
|
||||
const formParams = tasksubform.getFormParams() || {};
|
||||
return (
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@wu1wr8`}
|
||||
buttonsAd={this.getAdButtons()}
|
||||
searchType={['base', 'advanced']}
|
||||
searchsBaseValue={formParams.taskname}
|
||||
setShowSearchAd={bool => { contentStore.setShowSearchAd(bool) }}
|
||||
hideSearchAd={() => contentStore.setShowSearchAd(false)}
|
||||
searchsAd={
|
||||
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@961lbd`} listStore={contentStore} form={tasksubform}></Condition></div>
|
||||
}
|
||||
showSearchAd={showSearchAd}
|
||||
onSearch={v => { contentStore.getTaskSubList() }}
|
||||
onSearchChange={v => { contentStore.setFormFields({ taskname: { value: v } }) }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
getAdButtons = () => {
|
||||
const { contentStore } = this.props;
|
||||
const { getTaskSubList, setShowSearchAd, clearFormFields } = contentStore;
|
||||
return [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v8ecgo@search`} type="primary" onClick={() => { getTaskSubList(); setShowSearchAd(false); }}>{getLabel(197, "搜索")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@qpz910@reset`} type="ghost" onClick={() => { clearFormFields(); }}>{getLabel(2022, "重置")}</Button>),
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ug9w8z@cancel`} type="ghost" onClick={() => { setShowSearchAd(false) }}>{getLabel(201, "取消")}</Button>)
|
||||
];
|
||||
}
|
||||
}
|
||||
export { TabComponent }
|
||||
|
|
@ -0,0 +1,478 @@
|
|||
import { WeaSearchGroup, WeaFormItem, WeaDatePicker, WeaTimePicker, WeaTools, WeaAlertPage, WeaUpload, WeaProgress, WeaRichText, WeaLocaleProvider, WeaInputEncrypt } from 'ecCom';
|
||||
import { Button, Row, Col, InputNumber, Modal, message } from 'antd';
|
||||
import { toJS } from "mobx"
|
||||
import { WeaSwitch } from "comsMobx"
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import PrjDateTime from '../comp/prj-data-time'
|
||||
import { datediff } from '../../util/index'
|
||||
import { isUndefined } from 'util';
|
||||
const getKey = WeaTools.getKey;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const view_basicToolBar = {
|
||||
uploadUrl: (window.ecologyContentPath || '')+"/api/blog/fileupload/uploadimage",
|
||||
startupFocus: false,
|
||||
toolbar: [],
|
||||
};
|
||||
|
||||
const basicToolBar = {
|
||||
uploadUrl: (window.ecologyContentPath || '')+"/api/blog/fileupload/uploadimage",
|
||||
startupFocus: false,
|
||||
toolbar: [
|
||||
{ name: 'markdown', items: ['Markdown'] },
|
||||
{ name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview', '-', 'Templates'] },
|
||||
{ name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
|
||||
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'] },
|
||||
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
|
||||
{ name: 'colors', items: ['TextColor', 'BGColor'] },
|
||||
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
|
||||
{ name: 'insert', items: ['Image', 'Table', 'Smiley'] }
|
||||
],
|
||||
};
|
||||
|
||||
@observer
|
||||
export default class TaskInfo extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
stageVisiable : 3
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { taskInfo, setFormFields, setValidate, fieldinfo, isTimeShow } = this.props.listStore;
|
||||
const { form } = this.props;
|
||||
const { isFormInit } = form;
|
||||
let group = [];
|
||||
const formParams = form.getFormParams();
|
||||
isFormInit && fieldinfo.map((c,i) => {
|
||||
let items = [];
|
||||
c.items.map(fields => {
|
||||
let hide = false;
|
||||
let dom;
|
||||
let hasunderline = false;
|
||||
//只读样式控制
|
||||
let stylecss = { 'margin-right': '5px', 'margin-top': '6px' };
|
||||
if (fields.viewAttr == "1" || (fields.conditionType == "BROWSER" && fields.browserConditionParam.viewAttr == "1")) {
|
||||
hasunderline = true;
|
||||
stylecss = { 'margin-right': '5px', 'margin-top': '16px' };
|
||||
}
|
||||
if (fields.domkey[0] == "begindate") {
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@gh6xl8@${fields.domkey[0]}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2mjr68@${fields.domkey[0]}`} span={24} style={stylecss}>
|
||||
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@kuovcm@${fields.domkey[0]}`}
|
||||
{...fields}
|
||||
isTimeShow={isTimeShow}
|
||||
type='start'
|
||||
endValue={formParams.enddate ? new Date(formParams.enddate) : null}
|
||||
value={[formParams.begindate, formParams.begintime]}
|
||||
onChange={(v) => { setFormFields({ begindate__begintime: { value: v } }); this.workdayComputed(v, "begin") }} />
|
||||
</Col>
|
||||
</Row>
|
||||
} else if (fields.domkey[0] == "enddate") {
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@p72lhi@${fields.domkey[0]}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@r6pjjd@${fields.domkey[0]}`} span={24} style={stylecss}>
|
||||
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@dydyss@${fields.domkey[0]}`}
|
||||
{...fields}
|
||||
isTimeShow={isTimeShow}
|
||||
type='end'
|
||||
value={[formParams.enddate, formParams.endtime]}
|
||||
startValue={formParams.begindate ? new Date(formParams.begindate) : null}
|
||||
onChange={(v) => {
|
||||
if (taskInfo.maxSubTaskEndDate == "" || typeof (taskInfo.maxSubTaskEndDate) == "undefined") {
|
||||
setFormFields({ enddate__endtime: { value: v } });
|
||||
this.workdayComputed(v, "end")
|
||||
} else {
|
||||
if (new Date(v[0]) < new Date(taskInfo.maxSubTaskEndDate)) {
|
||||
// Modal.warning({
|
||||
// title: getLabel(83887, "任务完成的最后时间小于其子任务完成的最后时间!"),
|
||||
// content: ""
|
||||
// });
|
||||
message.error(getLabel(83887, "任务完成的最后时间小于其子任务完成的最后时间!"));
|
||||
setFormFields({ enddate__endtime: { value: [taskInfo.maxSubTaskEndDate, formParams.endtime] } });
|
||||
this.workdayComputed([taskInfo.maxSubTaskEndDate, formParams.endtime], "end")
|
||||
} else {
|
||||
setFormFields({ enddate__endtime: { value: v } });
|
||||
this.workdayComputed(v, "end")
|
||||
}
|
||||
}
|
||||
}} />
|
||||
</Col>
|
||||
</Row>
|
||||
} else if (fields.domkey[0] == "actualbegindate") {
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@odnp30@${fields.domkey[0]}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@hk4dbh@${fields.domkey[0]}`} span={24} style={stylecss}>
|
||||
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@4k8rtc@${fields.domkey[0]}`}
|
||||
endValue={formParams.actualenddate ? new Date(formParams.actualenddate) : null}
|
||||
{...fields}
|
||||
isTimeShow={isTimeShow}
|
||||
type='start'
|
||||
value={[formParams.actualbegindate, formParams.actualbegintime]}
|
||||
onChange={(v) => { setFormFields({ actualbegindate__actualbegintime: { value: v } }); this.onActualComputed(v, "begin") }} />
|
||||
</Col>
|
||||
</Row>
|
||||
} else if (fields.domkey[0] == "actualenddate") {
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@98l5oa@${fields.domkey[0]}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@i5o1t5@${fields.domkey[0]}`} span={24} style={stylecss}>
|
||||
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@5uknm8`} startValue={formParams.actualbegindate ? new Date(formParams.actualbegindate) : null} {...fields}
|
||||
isTimeShow={isTimeShow}
|
||||
type='end'
|
||||
value={[formParams.actualenddate, formParams.actualendtime]}
|
||||
onChange={(v) => { setFormFields({ actualenddate__actualendtime: { value: v } }); this.onActualComputed(v, "end") }} />
|
||||
</Col>
|
||||
</Row>
|
||||
} else if (fields.domkey[0] == "finish") {
|
||||
if (fields.viewAttr == "1") {
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@v5w2xu`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@yxpfde`} span={12} style={stylecss}>
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@x5lp6k`} name={fields.domkey[0]} percent={fields.value || 0} strokeColor={fields.strokeColor} status="active" />
|
||||
</Col><span style={{ color: "#FF0000" }}>{fields.befSpan || ""}</span>
|
||||
</Row>
|
||||
} else {
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@6yxf8i`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@cc1mvy`} span={24} style={stylecss}>
|
||||
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@h7m3y3`} name={fields.domkey[0]} min={0} value={formParams.finish}
|
||||
onChange={(v) => { this.checkProgress(v); }} />
|
||||
<span style={{ marginLeft: 5 }}>%</span>
|
||||
</Col>
|
||||
</Row>
|
||||
}
|
||||
} else if (fields.conditionType == "RICHTEXT") { //多行文本
|
||||
if(fields.viewAttr == "1"){
|
||||
dom = WeaTools.EncryBase.desensitization(fields.value)? <WeaInputEncrypt ecId={`${this && this.props && this.props.ecId || ''}_WeaInputEncrypt@c6yqas`} value={fields.value} type={'TEXTAREA'} />:
|
||||
<div className='view_basicToolBar'><WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@4ysjy5`} fieldConfig={{...fields,ckConfig:view_basicToolBar}} form={form}/></div>;
|
||||
}else{
|
||||
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@3ikm4k`} fieldConfig={{...fields,ckConfig:basicToolBar}} form={form}/>
|
||||
}
|
||||
} else if (fields.domkey[0] == "accessory") {
|
||||
let domkey = fields.domkey[0];
|
||||
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@xfo7mw`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@590wtd`} span={24} style={stylecss}>
|
||||
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@g30n0b`}
|
||||
name = {domkey}
|
||||
uploadId={[domkey]}
|
||||
uploadUrl={(window.ecologyContentPath || '')+"/api/proj/prjutil/fileUpload?accsec=" + fields.accsec}
|
||||
category={fields.accsec}
|
||||
autoUpload={true}
|
||||
showBatchLoad={false}
|
||||
showClearAll={false}
|
||||
multiSelection={true}
|
||||
datas={toJS(fields.datas)}
|
||||
maxUploadSize={fields.accsize}
|
||||
onChange={v => { setFormFields({ [domkey]: { value: v } }) }}
|
||||
viewAttr={fields.viewAttr}
|
||||
// onUploading={(state)=>{}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
} else if (fields.domkey[0] == "workday") {
|
||||
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@l296a4`} fieldConfig={fields} form={form} onChange={v => { this.endDateComputed(v) }} />;
|
||||
} else if (fields.domkey[0] == "realmandays") {
|
||||
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@6pa9lp`} fieldConfig={fields} form={form} onChange={v => { this.endActualDateComputed(v) }} />;
|
||||
} else if (fields.domkey[0] == "parentid") {
|
||||
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@y136ya`} fieldConfig={fields} form={form} onChange={v => { this.onParentChange(v) }} />;
|
||||
}else {
|
||||
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@vse05u`} fieldConfig={fields} form={form} />;
|
||||
}
|
||||
if (hasunderline) {
|
||||
items.push({
|
||||
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@3vxf79@${fields.domkey[0]}`}
|
||||
label={`${fields.label}`}
|
||||
labelCol={{ span: `${fields.labelcol}` }}
|
||||
error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} underline>
|
||||
{dom}
|
||||
</WeaFormItem>),
|
||||
colSpan: 1,
|
||||
hide: hide
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@zumg6p@${fields.domkey[0]}`}
|
||||
label={`${fields.label}`}
|
||||
labelCol={{ span: `${fields.labelcol}` }}
|
||||
error={form.getError(fields)}
|
||||
tipPosition="bottom"
|
||||
wrapperCol={{ span: `${fields.fieldcol}` }} >
|
||||
{dom}
|
||||
</WeaFormItem>),
|
||||
colSpan: 1,
|
||||
hide: hide
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@w6yww2@${i}`} needTigger={true} title={c.title} col={1} showGroup={c.defaultshow} items={items} />)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
workdayComputed = (arg, type) => {
|
||||
const { setFormFields, taskInfo: { passnoworktime, userid }, isTimeShow } = this.props.listStore;
|
||||
const { form } = this.props;
|
||||
const formParams = form.getFormParams() || {};
|
||||
let res = "";
|
||||
if (type == "begin") {
|
||||
if (arg[0] && formParams.enddate) {
|
||||
res = datediff(arg[0], formParams.enddate, isTimeShow=='1'?arg[1] || "00:00":"00:00", isTimeShow=='1'?formParams.endtime || "23:59":"23:59", userid, passnoworktime);
|
||||
}
|
||||
} else {
|
||||
if (arg[0] && formParams.begindate) {
|
||||
res = datediff(formParams.begindate, arg[0], isTimeShow=='1'?formParams.begintime || "00:00":"00:00", isTimeShow=='1'?arg[1] || "23:59":"23:59", userid, passnoworktime);
|
||||
}
|
||||
}
|
||||
setFormFields({ workday: { value: res } });
|
||||
}
|
||||
|
||||
onActualComputed = (arg, type) => { //maxSubTaskEndDate
|
||||
const { setFormFields, taskInfo: { passnoworktime, userid }, isTimeShow } = this.props.listStore;
|
||||
const { form } = this.props;
|
||||
const formParams = form.getFormParams() || {};
|
||||
let res = "0";
|
||||
if (type == "begin") {
|
||||
if (arg[0] && formParams.actualenddate) {
|
||||
res = datediff(arg[0], formParams.actualenddate, isTimeShow=='1'?arg[1] || "00:00":"00:00", isTimeShow=='1'?formParams.actualendtime || "23:59":"23:59", userid, passnoworktime);
|
||||
}
|
||||
} else {
|
||||
if (arg[0] && formParams.actualbegindate) {
|
||||
res = datediff(formParams.actualbegindate, arg[0], isTimeShow=='1'?formParams.actualbegintime || "00:00":"00:00", isTimeShow=='1'?arg[1] || "23:59":"23:59", userid, passnoworktime);
|
||||
}
|
||||
}
|
||||
setFormFields({ realmandays: { value: res } })
|
||||
}
|
||||
|
||||
endDateComputed = (value) => {
|
||||
const { setFormFields, taskInfo: { passnoworktime, userid } } = this.props.listStore;
|
||||
const { form } = this.props;
|
||||
const formParams = form.getFormParams() || {};
|
||||
|
||||
let b = typeof (formParams.begindate) == "undefined" ? "" : formParams.begindate;
|
||||
let e = typeof (formParams.enddate) == "undefined" ? "" : formParams.enddate;
|
||||
let w = typeof (formParams.workday) == "undefined" ? "" : formParams.workday;
|
||||
let bt = typeof (formParams.begintime) == "undefined" ? "" : formParams.begintime;
|
||||
let et = typeof (formParams.endtime) == "undefined" ? "" : formParams.endtime;
|
||||
let res = "";
|
||||
let alldate = "";
|
||||
if (bt == "") {
|
||||
bt = "00:00";
|
||||
}
|
||||
if (et == "") {
|
||||
et = "23:59";
|
||||
}
|
||||
|
||||
if (w == "" && b != "" && e != "") {
|
||||
setFormFields({ enddate: { value: "" } })
|
||||
} else if (w != "" && ((b != "" && e != "") || (b != "" && e == ""))) {
|
||||
if (w > 0) {
|
||||
if (passnoworktime != "1") {
|
||||
|
||||
alldate = this.addEndDate(b, w, bt);
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/proj/process/GetDateByWorkLong.jsp",
|
||||
data: "method=getEndDate&workLong=" + w + "&begindate=" + b + "&begintime=" + bt + "&manager=" + userid,
|
||||
dataType: "text",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
alldate = data.trim();
|
||||
}
|
||||
});
|
||||
}
|
||||
if(alldate == 'error'){
|
||||
message.error(getLabel(84409, "一般工作时间未设置,请告知管理员!"));
|
||||
setFormFields({ enddate__endtime: { value: [] } })
|
||||
}else{
|
||||
let tmpesp = alldate.split(" ");
|
||||
setFormFields({ enddate__endtime: { value: [tmpesp[0], tmpesp[1]] } })
|
||||
}
|
||||
} else {
|
||||
setFormFields({ workday: { value: "" }, enddate__endtime: { value: [] } })
|
||||
}
|
||||
|
||||
} else if (w != "" && b == "" && e != "") {
|
||||
if (w > 0) {
|
||||
if (passnoworktime != "1") {
|
||||
|
||||
alldate = this.addBeginDate(e, -(w), et);
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/proj/process/GetDateByWorkLong.jsp",
|
||||
data: "method=getBeginDate&workLong=" + w + "&enddate=" + e + "&endtime=" + et + "&manager=" + userid,
|
||||
dataType: "text",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
alldate = data.trim();
|
||||
}
|
||||
});
|
||||
}
|
||||
if(alldate == 'error'){
|
||||
message.error(getLabel(84409, "一般工作时间未设置,请告知管理员!"));
|
||||
setFormFields({ enddate__endtime: { value: [] } })
|
||||
}else{
|
||||
let tmpesp = alldate.split(" ");
|
||||
setFormFields({ enddate__endtime: { value: [tmpesp[0], tmpesp[1]] } })
|
||||
}
|
||||
} else {
|
||||
setFormFields({ workday: { value: "" }, begindate__begintime: { value: [] } })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
endActualDateComputed = (value) => {
|
||||
const { setFormFields, taskInfo: { passnoworktime, userid } } = this.props.listStore;
|
||||
const { form } = this.props;
|
||||
const formParams = form.getFormParams() || {};
|
||||
|
||||
let b = typeof (formParams.actualbegindate) == "undefined" ? "" : formParams.actualbegindate;
|
||||
let e = typeof (formParams.actualenddate) == "undefined" ? "" : formParams.actualenddate;
|
||||
let w = typeof (formParams.realmandays) == "undefined" ? "" : formParams.realmandays;
|
||||
let bt = typeof (formParams.actualbegintime) == "undefined" ? "" : formParams.actualbegintime;
|
||||
let et = typeof (formParams.actualendtime) == "undefined" ? "" : formParams.actualendtime;
|
||||
let res = "";
|
||||
let alldate = "";
|
||||
if (bt == "") {
|
||||
bt = "00:00";
|
||||
}
|
||||
if (et == "") {
|
||||
et = "23:59";
|
||||
}
|
||||
|
||||
if (w == "" && b != "" && e != "") {
|
||||
setFormFields({ actualenddate: { value: "" } })
|
||||
} else if (w != "" && ((b != "" && e != "") || (b != "" && e == ""))) {
|
||||
if (w > 0) {
|
||||
if (passnoworktime != "1") {
|
||||
|
||||
alldate = this.addEndDate(b, w, bt);
|
||||
} else {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/proj/process/GetDateByWorkLong.jsp",
|
||||
data: "method=getEndDate&workLong=" + w + "&begindate=" + b + "&begintime=" + bt + "&manager=" + userid,
|
||||
dataType: "text",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
alldate = data.trim();
|
||||
}
|
||||
});
|
||||
}
|
||||
if(alldate == 'error'){
|
||||
message.error(getLabel(84409, "一般工作时间未设置,请告知管理员!"));
|
||||
setFormFields({ actualenddate__actualendtime: { value: [] } })
|
||||
}else{
|
||||
let tmpesp = alldate.split(" ");
|
||||
setFormFields({ actualenddate__actualendtime: { value: [tmpesp[0], tmpesp[1]] } })
|
||||
}
|
||||
} else {
|
||||
setFormFields({ realmandays: { value: "" }, actualenddate__actualendtime: { value: [] } })
|
||||
}
|
||||
|
||||
} else if (w != "" && b == "" && e != "") {
|
||||
if (w > 0) {
|
||||
if (passnoworktime != "1") {
|
||||
|
||||
alldate = this.addBeginDate(e, -(w), et);
|
||||
} else {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/proj/process/GetDateByWorkLong.jsp",
|
||||
data: "method=getBeginDate&workLong=" + w + "&enddate=" + e + "&endtime=" + et + "&manager=" + userid,
|
||||
dataType: "text",
|
||||
async: false,
|
||||
success: function (data) {
|
||||
alldate = data.trim();
|
||||
}
|
||||
});
|
||||
}
|
||||
if(alldate == 'error'){
|
||||
message.error(getLabel(84409, "一般工作时间未设置,请告知管理员!"));
|
||||
setFormFields({ actualenddate__actualendtime: { value: [] } })
|
||||
}else{
|
||||
let tmpesp = alldate.split(" ");
|
||||
setFormFields({ actualenddate__actualendtime: { value: [tmpesp[0], tmpesp[1]] } })
|
||||
}
|
||||
} else {
|
||||
setFormFields({ realmandays: { value: "" }, actualenddate__actualendtime: { value: [] } })
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
addBeginDate = (dd, dadd, bt) => {
|
||||
let arr = dd.split("-");
|
||||
let btt = bt.split(":");
|
||||
let a = new Date(arr[0], arr[1] - 1, arr[2], btt[0], btt[1]).valueOf();
|
||||
a = (a + dadd * 24 * 60 * 60 * 1000) + 60 * 1000;
|
||||
a = new Date(a);
|
||||
return this.format(a);
|
||||
}
|
||||
|
||||
|
||||
addEndDate = (dd, dadd, bt) => {
|
||||
let arr = dd.split("-");
|
||||
let btt = bt.split(":");
|
||||
let a = new Date(arr[0], arr[1] - 1, arr[2], btt[0], btt[1]).valueOf();
|
||||
a = (a + dadd * 24 * 60 * 60 * 1000) - 60 * 1000;
|
||||
a = new Date(a);
|
||||
return this.format(a);
|
||||
}
|
||||
|
||||
format = (date) => {
|
||||
let o = {
|
||||
"M+": date.getMonth() + 1, //month
|
||||
"d+": date.getDate(), //day
|
||||
"h+": date.getHours(), //hour
|
||||
"m+": date.getMinutes(), //minute
|
||||
"s+": date.getSeconds(), //second
|
||||
"q+": Math.floor((date.getMonth() + 3) / 3), //quarter
|
||||
"S": date.getMilliseconds() //millisecond
|
||||
}
|
||||
let format = "yyyy-MM-dd hh:mm";
|
||||
if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
|
||||
(date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o) if (new RegExp("(" + k + ")").test(format))
|
||||
format = format.replace(RegExp.$1,
|
||||
RegExp.$1.length == 1 ? o[k] :
|
||||
("00" + o[k]).substr(("" + o[k]).length));
|
||||
return format;
|
||||
}
|
||||
|
||||
checkProgress = (value) => { //进度编辑校验
|
||||
const { taskInfo, setFormFields } = this.props.listStore;
|
||||
if (Number(taskInfo.finishmax) == 99) {
|
||||
if (value > 99) {
|
||||
// Modal.warning({
|
||||
// title: getLabel(383829, "该任务所必须的相关文档或者相关流程不存在,任务不能完成100%。"),
|
||||
// content: '',
|
||||
// });
|
||||
message.error(getLabel(383829, "该任务所必须的相关文档或者相关流程不存在,任务不能完成100%。"));
|
||||
setFormFields({ finish: { value: 99 } });
|
||||
} else {
|
||||
setFormFields({ finish: { value: value } });
|
||||
}
|
||||
} else {
|
||||
if (value > 100) {
|
||||
setFormFields({ finish: { value: 100 } });
|
||||
} else {
|
||||
setFormFields({ finish: { value: value } });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onParentChange = (obj) => {
|
||||
const { resetStage } = this.props.listStore;
|
||||
if(obj.parentid.value != ""){
|
||||
resetStage({viewAttr : 1},obj.parentid.value);
|
||||
}else{
|
||||
resetStage({viewAttr : 3});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
|
||||
import { Button, Row, Col, Icon, message, Modal } from 'antd';
|
||||
import { WeaTab, WeaProgress, WeaLocaleProvider } from 'ecCom';
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from 'mobx';
|
||||
// import { Condition } from '../list/listCondition';
|
||||
import { WeaTableNew } from 'comsMobx';
|
||||
import ShareDialog from '../dialog/shareDialog'
|
||||
import ExchangeDialog from '../dialog/exchangeDialog'
|
||||
import TaskInfoDialog from '../dialog/taskDialog'
|
||||
import ModifyLogDialog from "../dialog/modifyLogDialog"
|
||||
import { TabComponent as TabSelf } from './tabComponent';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class TaskSub extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
taskid: "",
|
||||
coWorkVisiable: false,
|
||||
workPlanVisible: false
|
||||
}
|
||||
|
||||
}
|
||||
componentDidMount(){
|
||||
|
||||
if(!window.weaWorkplan && !window.weaCowork){
|
||||
eventRegister.loadModule('f_workplan', ()=> {
|
||||
eventRegister.loadModule('f_cowork', ()=> {
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载协作模块失败,请联系系统管理员!");
|
||||
});
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载日程模块失败,请联系系统管理员!");
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(window.weaWorkplan && !window.weaCowork){
|
||||
eventRegister.loadModule('f_cowork', ()=> {
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载协作模块失败,请联系系统管理员!");
|
||||
});
|
||||
}else{
|
||||
eventRegister.loadModule('f_workplan', ()=> {
|
||||
}, ()=> {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
alert("加载协作模块失败,请联系系统管理员!");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const { contentStore, account, showTab = true, callBack } = this.props;
|
||||
const { showSearchAd, taskSubStore, tasksubform, exchangeStore, taskInfoStore, logVisible, logTableStore, reLoad, prjid } = contentStore;
|
||||
const formParams = tasksubform.getFormParams() || {};
|
||||
return (
|
||||
<div >
|
||||
{showTab && <TabSelf ecId={`${this && this.props && this.props.ecId || ''}_TabSelf@k3vfo8`} contentStore={contentStore} />}
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@6j52jl`}
|
||||
comsWeaTableStore={taskSubStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
register_table={() => reLoad(taskSubStore)}
|
||||
getColumns={c => this.reRenderColumns(c)}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
<ShareDialog ecId={`${this && this.props && this.props.ecId || ''}_ShareDialog@airjmf`} contentStore={contentStore} />
|
||||
<ExchangeDialog ecId={`${this && this.props && this.props.ecId || ''}_ExchangeDialog@jjhite`} contentStore={exchangeStore} />
|
||||
<TaskInfoDialog ecId={`${this && this.props && this.props.ecId || ''}_TaskInfoDialog@mjb68p`} contentStore={taskInfoStore} prjid={prjid} callBack={callBack}/>
|
||||
<ModifyLogDialog ecId={`${this && this.props && this.props.ecId || ''}_ModifyLogDialog@icfrus`} ref="modifyLogDialog" title={getLabel(83905, "任务修改记录")} tableStore={logTableStore} />
|
||||
{window.weaCowork && window.weaCowork.com && window.weaCowork.com.CreateCowork && this.state.coWorkVisiable && this.state.taskid !== "" && (
|
||||
<window.weaCowork.com.CreateCowork ecId={`${this && this.props && this.props.ecId || ''}_CreateCowork@wt2c6x`}
|
||||
initAddQuery={
|
||||
{
|
||||
relatedType: "task",
|
||||
ids: this.state.taskid
|
||||
}
|
||||
}
|
||||
onCancel={() => {
|
||||
this.setState({
|
||||
coWorkVisiable: false
|
||||
});
|
||||
}}
|
||||
/>)
|
||||
}
|
||||
|
||||
{
|
||||
window.weaWorkplan && window.weaWorkplan.com && window.weaWorkplan.com.WorkPlanCreate &&
|
||||
(<window.weaWorkplan.com.WorkPlanCreate ecId={`${this && this.props && this.props.ecId || ''}_WorkPlanCreate@mvwf2h`}
|
||||
type={"create"}//新建为'create',查看为'preview',编辑edit,共享share
|
||||
visible={this.state.workPlanVisible}//显隐受控
|
||||
doClose={() => { this.setWorkPlanVisible(false); }}//关闭回调
|
||||
onlyClose={() => { this.setWorkPlanVisible(false) }}//关闭回调,只做关闭操作
|
||||
workPlanId={""} //日程id,1查看日程时用到
|
||||
createConditionParams={[]}//创建的默认值日期和时间,没有传[]
|
||||
activeKey={""} //查看页面显示的面板1是基本信息,7是相关交流
|
||||
//{(key) => { }}//查看页面切换面板的回调
|
||||
selectUser={account && account.userid}//新建日程的创建人id
|
||||
workPlanTypeOptions={"2"}//客户模块的新建日程,普通新建传'',客户新建传3
|
||||
crmIDs={[]}//通过客户模块新建日程,并自动带出相关客户,[{'id':'','name':''}]
|
||||
projectid={prjid}
|
||||
taskid={this.state.taskid}
|
||||
description={""}//客户模块需求,支持新建时传入的'基本信息-内容'
|
||||
/>)
|
||||
}
|
||||
</div>)
|
||||
}
|
||||
|
||||
// getAdButtons = () => {
|
||||
// const {contentStore} = this.props;
|
||||
// const {getTaskSubList,setShowSearchAd,clearFormFields} = contentStore;
|
||||
// return [
|
||||
// (<Button type="primary" onClick={()=>{getTaskSubList();setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
|
||||
// (<Button type="ghost" onClick={()=>{clearFormFields();}}>{getLabel(2022,"重置")}</Button>),
|
||||
// (<Button type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
|
||||
// ];
|
||||
// }
|
||||
reRenderColumns(columns) {
|
||||
columns.forEach((c,i) => {
|
||||
if (c.dataIndex == 'finish') {
|
||||
c.render = function (text, record) {
|
||||
return <span className='wea-prj-progressStyle' >
|
||||
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@b8gzd3@${i}`} percent={record.finish || 0} strokeColor={record.finishspan} />
|
||||
</span>
|
||||
}
|
||||
} else {
|
||||
// c.render = function(text, record){
|
||||
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
|
||||
// return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
|
||||
// }
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
onOperatesClick(record,index,operate,flag){
|
||||
const {contentStore:{shareStore,exchangeStore,taskInfoStore,viewModifyLog},callBack} = this.props;
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
let that = this;
|
||||
// saveCapitalId(record.randomFieldId); //保存资产id
|
||||
if(fn != ""){
|
||||
if("onShare"==fn){ //共享
|
||||
shareStore.handleShareDialog(true,"task",record.randomFieldId,{})
|
||||
}else if('onNewCowork' == fn){ //新建协作
|
||||
this.setState({ taskid: record.randomFieldId, coWorkVisiable: true });
|
||||
const coworkStoreMap = window.weaCowork.store && window.weaCowork.store.coworkStoreMap;
|
||||
const cowortore = coworkStoreMap && coworkStoreMap.getMapStore(3);
|
||||
cowortore && cowortore.setCreateState({ showNewCowork: true, createOrEdit: 0 });
|
||||
}else if('onNewWorkplan' == fn){ //新建日程
|
||||
this.setState({ taskid: record.randomFieldId, workPlanVisible: true });
|
||||
}else if('onApprove' == fn){ //
|
||||
|
||||
}else if('onReject' == fn){ //
|
||||
|
||||
}else if('onEdit' == fn){ //编辑
|
||||
taskInfoStore.handleDialog(true,"edit",record.randomFieldId);
|
||||
}else if('onLog' == fn){ //修改记录
|
||||
viewModifyLog(record.randomFieldId);
|
||||
this.refs.modifyLogDialog.setVisible(true);
|
||||
}else if('onDiscuss' == fn){ //相关交流
|
||||
exchangeStore.handleExchangeDialog(true,"task",record.randomFieldId,{})
|
||||
}else if('onDel' == fn){ //删除
|
||||
taskInfoStore.delTask("del",record.randomFieldId,callBack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setWorkPlanVisible = (bool) => {
|
||||
this.setState({ workPlanVisible: bool })
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
import { WeaSearchGroup, WeaFormItem, WeaHelpfulTip, WeaLocaleProvider, WeaTableEditable, WeaSelect } from 'ecCom';
|
||||
import { Row, Col } from 'antd';
|
||||
import { toJS } from "mobx"
|
||||
import { WeaSwitch } from "comsMobx"
|
||||
import { observer } from 'mobx-react';
|
||||
import WeaPrjFieldSetTableEdit from "../comp/weaPrjFieldSetTableEdit";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
export default class WbsFieldSet extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
getCircle() {
|
||||
let style = {
|
||||
height: 30,
|
||||
textAlign: 'center',
|
||||
}
|
||||
return style;
|
||||
}
|
||||
render() {
|
||||
const { wbsStore } = this.props;
|
||||
const { columns,columnDatas} = this.props.wbsStore;
|
||||
return (<div>
|
||||
<WeaPrjFieldSetTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaPrjFieldSetTableEdit@v5s3a6`}
|
||||
contentStore={wbsStore}
|
||||
showGroup={true}
|
||||
columns={toJS(columns)}
|
||||
datas={toJS(columnDatas)}
|
||||
onChange={this.onChange}
|
||||
ref={el => {this.wbsFieldSet = el}}
|
||||
rowKey={"groupid"}
|
||||
needAdd={true}
|
||||
needCopy={false}
|
||||
onRowSelect={this.onRowSelect}
|
||||
getRowSelection={this.getRowSelection}
|
||||
/>
|
||||
</div>);
|
||||
}
|
||||
|
||||
onRowSelect = (selectedKey) => {
|
||||
const {wbsStore} = this.props;
|
||||
wbsStore.setSelectRowKeys(selectedKey);
|
||||
}
|
||||
|
||||
onChange=(datas)=>{
|
||||
const {wbsStore} = this.props;
|
||||
const {setColumnDatas} = wbsStore;
|
||||
setColumnDatas(datas);
|
||||
}
|
||||
|
||||
getRowSelection = (rowSelection) => {
|
||||
let sel = { ...rowSelection };
|
||||
sel.getCheckboxProps = (record) => {
|
||||
return { disabled: record.canDel == 'n' };
|
||||
}
|
||||
return sel;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,143 @@
|
|||
import React from 'react';
|
||||
import { Row,Col } from 'antd';
|
||||
import {WeaNewScroll } from "ecCom"
|
||||
import classnames from 'classnames';
|
||||
import './style/index.less';
|
||||
|
||||
class DailyPaper extends React.Component {
|
||||
static defaultProps = {
|
||||
stageGroups:[
|
||||
{
|
||||
key:"0",
|
||||
name:"全部",
|
||||
},
|
||||
{
|
||||
key:"1",
|
||||
name:"立项",
|
||||
},
|
||||
{
|
||||
key:"2",
|
||||
name:"搭建中",
|
||||
},
|
||||
{
|
||||
key:"3",
|
||||
name:"验收中",
|
||||
},
|
||||
{
|
||||
key:"4",
|
||||
name:"维护中",
|
||||
},
|
||||
],
|
||||
selectGroupTypeKey:"0"
|
||||
}
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
|
||||
}
|
||||
}
|
||||
renderTitleGroup(stageGroups){
|
||||
const {selectGroupTypeKey="0"} = this.props;
|
||||
let btnArr = [];
|
||||
stageGroups && stageGroups.map((group)=>{
|
||||
let isSelect = "";
|
||||
if(selectGroupTypeKey == group.key) {
|
||||
isSelect = "selected";
|
||||
}
|
||||
btnArr.push(
|
||||
<span key={group.key} onClick={()=>{this.changeTypeGroup(group.key)}} className={isSelect} >
|
||||
{group.name}
|
||||
</span>
|
||||
)
|
||||
})
|
||||
return btnArr
|
||||
}
|
||||
changeTypeGroup=(key)=>{
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { stageGroups } = this.props;
|
||||
|
||||
return (
|
||||
<div className="project-paper">
|
||||
<div className="project-paper-header">
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<span className="header-left">阶段 :</span>
|
||||
<span className="header-right">{stageGroups && this.renderTitleGroup(stageGroups)}</span>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<WeaNewScroll
|
||||
scrollId={'project-paper-scroll'}
|
||||
height={"100%"}
|
||||
>
|
||||
<div className="project-paper-body">
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<div className="body-img"></div>
|
||||
<div className="body-right">
|
||||
<div className="body-right-title">
|
||||
<span className="body-right-title-left"><span style={{marginRight:"10px"}}>张三</span> 泛微上海大区/EBU上海一部 </span>
|
||||
<span className="body-right-title-right">回复评论 </span>
|
||||
</div>
|
||||
<div className="body-right-time">2017/02/05 14:22</div>
|
||||
<div className="body-right-content">
|
||||
<div className="body-right-content-h body-right-content-title">项目:<span className="project-name" >上海投资咨询公司(二次开发合同)2012</span> 当前阶段: 立项 当前任务:需求调研</div>
|
||||
<div className="body-right-content-h body-right-content-reply">预计十一之后收取第三笔款,现场调研确认,需求变更与新增工作量</div>
|
||||
<div className="body-right-content-h body-right-content-link">相关文档:人力资源模块调研文档(v1)</div>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<div className="body-img"></div>
|
||||
<div className="body-right">
|
||||
<div className="body-right-title">
|
||||
<span className="body-right-title-left"><span style={{marginRight:"10px"}}>张三</span> 泛微上海大区/EBU上海一部 </span>
|
||||
<span className="body-right-title-right"></span>
|
||||
</div>
|
||||
<div className="body-right-time">2017/02/05 14:22</div>
|
||||
<div className="body-right-content">
|
||||
<div className="body-right-content-h body-right-content-title">项目:<span className="project-name" >上海投资咨询公司(二次开发合同)2012</span> 当前阶段: 立项 当前任务:需求调研</div>
|
||||
<div className="body-right-content-h body-right-content-reply">预计十一之后收取第三笔款,现场调研确认,需求变更与新增工作量</div>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
<Col span={24}>
|
||||
<div className="body-img"></div>
|
||||
<div className="body-right">
|
||||
<div className="body-right-title">
|
||||
<span className="body-right-title-left"><span style={{marginRight:"10px"}}>张三</span> 泛微上海大区/EBU上海一部 </span>
|
||||
<span className="body-right-title-right"></span>
|
||||
</div>
|
||||
<div className="body-right-time">2017/02/05 14:22</div>
|
||||
<div className="body-right-content">
|
||||
<div className="body-right-content-h body-right-content-title">项目:<span className="project-name" >上海投资咨询公司(二次开发合同)2012</span> 当前阶段: 立项 当前任务:需求调研</div>
|
||||
<div className="body-right-content-h body-right-content-reply">预计十一之后收取第三笔款,现场调研确认,需求变更与新增工作量</div>
|
||||
<div className="body-right-content-reply-reply">
|
||||
<div className="reply-container">
|
||||
<div className="reply-name">李四 2017/05/02 14:55</div>
|
||||
<div className="reply-content">ok!!!</div>
|
||||
</div>
|
||||
<div className="reply-container">
|
||||
<div className="reply-name">王五 2017/05/02 16:55</div>
|
||||
<div className="reply-content">没问题。</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default DailyPaper
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import DailyPaper from './dailyPaper'
|
||||
|
||||
export default DailyPaper
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
.project-paper{
|
||||
height: 100%;
|
||||
color: #494949;
|
||||
.project-paper-header .ant-row{
|
||||
margin: 15px 10px;
|
||||
border: 2px solid #eaeaea;
|
||||
height: 35px;
|
||||
line-height: 35px;
|
||||
border-radius: 5px;
|
||||
.header-left{
|
||||
display: inline-block;
|
||||
width: 100px;
|
||||
text-align: center;
|
||||
background-color: #ececec;
|
||||
height: 31px;
|
||||
border-right: 2px solid #eaeaea;
|
||||
}
|
||||
.header-right span{
|
||||
display: inline-block;
|
||||
height: 31px;
|
||||
line-height: 31px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.header-right .selected{
|
||||
color: #2A7CBC
|
||||
}
|
||||
}
|
||||
.project-paper-body .ant-row{
|
||||
margin: 10px 10px;
|
||||
.body-img{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 100%;
|
||||
background-color: #e9e9e9;
|
||||
float: left;
|
||||
}
|
||||
.body-right{
|
||||
margin-left: 60px;
|
||||
border-bottom: 2px solid #eaeaea;
|
||||
padding-bottom: 10px;
|
||||
.body-right-title {
|
||||
height: 25px;
|
||||
line-height: 25px;
|
||||
font-weight: 700;
|
||||
.body-right-title-right{
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
color: #2A7CBC;
|
||||
}
|
||||
}
|
||||
.body-right-time{
|
||||
color: #999;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.body-right-content{
|
||||
.project-name{
|
||||
color: #2A7CBC;
|
||||
font-weight: 700;
|
||||
}
|
||||
.body-right-content-h{
|
||||
line-height: 22px;
|
||||
}
|
||||
// .body-right-content-reply,.body-right-content-link{
|
||||
|
||||
// }
|
||||
.body-right-content-reply-reply{
|
||||
background: #ececec;
|
||||
border-radius: 4px;
|
||||
margin: 5px;
|
||||
.reply-container{
|
||||
padding: 5px 15px 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,231 @@
|
|||
import { Modal,Row, Col, Button,Icon,Menu,} from 'antd';
|
||||
import {Dropdown} from 'mode-coms'
|
||||
import {WeaLocaleProvider} from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const Item = Menu.Item
|
||||
import isString from 'lodash/isString';
|
||||
import './style/index.css'
|
||||
|
||||
class Main extends React.Component {
|
||||
static defaultProps = {
|
||||
style: {width: 520, height: 400},
|
||||
icon: 'icon-coms-ModelingEngine',
|
||||
maskClosable: false,
|
||||
closable: true,
|
||||
title: 'Dialog',
|
||||
iconBgcolor: '#2db7f5',
|
||||
isallscreen:false,
|
||||
hasMoreBtn:false
|
||||
}
|
||||
static contextTypes = {
|
||||
router: React.PropTypes.routerShape
|
||||
}
|
||||
listenRouter(){
|
||||
this.context.router.listen(nextState => {
|
||||
const { path } = this.state;
|
||||
const { pathname } = nextState;
|
||||
if(path !== pathname){
|
||||
this._reactInternalInstance !== undefined && this.setState({path:pathname, visible:false});
|
||||
}
|
||||
})
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
visible: false,
|
||||
modalBody: '',
|
||||
title: props.title || '',
|
||||
url: props.url || '',
|
||||
style: props.style,
|
||||
icon: props.icon,
|
||||
closable: props.closable,
|
||||
buttons: props.buttons,
|
||||
maskClosable: props.maskClosable,
|
||||
iconBgcolor: props.iconBgcolor,
|
||||
path: window.location.hash && window.location.hash.split('#/')[1].split('?')[0],
|
||||
isallscreen:false,
|
||||
hasMoreBtn:props.hasMoreBtn || false,
|
||||
dropMenuDatas:props.dropMenuDatas || [],
|
||||
showDrop:false
|
||||
}
|
||||
this.onCancel = this.onCancel.bind(this);
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
|
||||
|
||||
if (this.props.visible !== nextProps.visible || this.state.visible !== nextProps.visible) {
|
||||
this.setState({visible: nextProps.visible});
|
||||
}
|
||||
if (this.props.url !== nextProps.url) {
|
||||
this.setState({url: nextProps.url});
|
||||
}
|
||||
// if (!WeaTools.isEqual(this.props.style, nextProps.style)) {
|
||||
// this.setState({style: nextProps.style});
|
||||
// }
|
||||
if ('buttons' in this.props) {
|
||||
this.setState({buttons: nextProps.buttons});
|
||||
}
|
||||
if (this.props.title !== nextProps.title) {
|
||||
this.setState({title: nextProps.title});
|
||||
}
|
||||
// if (this.props.icon !== nextProps.icon) {
|
||||
// this.setState({icon: nextProps.icon});
|
||||
// }
|
||||
// if (this.props.iconBgcolor !== nextProps.iconBgcolor) {
|
||||
// this.setState({iconBgcolor: nextProps.iconBgcolor});
|
||||
// }
|
||||
}
|
||||
shouldComponentUpdate(...args) {
|
||||
return true
|
||||
// return PureRenderMixin.shouldComponentUpdate.apply(this, args);
|
||||
}
|
||||
componentDidMount(){
|
||||
this.listenRouter();
|
||||
window.initExtendDialog = params => {
|
||||
let state = {};
|
||||
if (params.style) {
|
||||
state.style = params.style;
|
||||
}
|
||||
if (params.buttons) {
|
||||
state.buttons = params.buttons;
|
||||
}
|
||||
if (params.url) {
|
||||
state.url = params.url;
|
||||
}
|
||||
if (params.modalBody) {
|
||||
state.modalBody = params.modalBody;
|
||||
}
|
||||
if (params.title) {
|
||||
state.title = params.title;
|
||||
}
|
||||
if (params.icon) {
|
||||
state.icon = params.icon;
|
||||
}
|
||||
if (params.closable !== undefined) {
|
||||
state.closable = params.closable;
|
||||
}
|
||||
if (params.maskClosable !== undefined) {
|
||||
state.maskClosable = params.maskClosable;
|
||||
}
|
||||
if (params.iconBgcolor) {
|
||||
state.iconBgcolor = params.iconBgcolor;
|
||||
}
|
||||
if(params.hasMoreBtn){
|
||||
state.hasMoreBtn = params.hasMoreBtn
|
||||
}
|
||||
if(params.dropMenuDatas){
|
||||
state.dropMenuDatas = params.dropMenuDatas
|
||||
}
|
||||
this.setState(state);
|
||||
}
|
||||
window.showExtendDialog = () => {
|
||||
this.setState({visible: true});
|
||||
}
|
||||
window.closeExtendDialog = () => {
|
||||
this.onCancel();
|
||||
}
|
||||
}
|
||||
onCancel() {
|
||||
this.setState({visible: false});
|
||||
this.props.onCancel && this.props.onCancel();
|
||||
}
|
||||
toAllScreen=()=>{
|
||||
const screenH = window.document.documentElement.clientHeight || window.body.clientHeight;
|
||||
|
||||
this.setState({
|
||||
style:{width:"100%",height:screenH-100},
|
||||
isallscreen:true
|
||||
});
|
||||
jQuery('.extend-dialog .ant-modal').addClass('extend-dialog-allscreen')
|
||||
}
|
||||
claseAllScreen=()=>{
|
||||
this.setState({
|
||||
style:this.props.style,
|
||||
isallscreen:false
|
||||
});
|
||||
jQuery('.extend-dialog .ant-modal').removeClass('extend-dialog-allscreen')
|
||||
}
|
||||
getFooterButtons(){
|
||||
const {buttons,dropMenuDatas,hasMoreBtn,showDrop} = this.state;
|
||||
let newButtons = [];
|
||||
const menu = dropMenuDatas ?
|
||||
<Menu mode='vertical' onClick={o => {if(typeof this.props.onDropMenuClick == 'function') this.props.onDropMenuClick(o.key)}}>
|
||||
{
|
||||
dropMenuDatas.map((d, i)=> {
|
||||
return <Item key={d.key || i} disabled={d.disabled}>
|
||||
<span className='extend-dialog-menu-icon'>{d.icon}</span>
|
||||
{d.content}
|
||||
</Item>
|
||||
})}
|
||||
</Menu> : '';
|
||||
if(hasMoreBtn){
|
||||
newButtons.push(<span style={{position:"relative"}}>
|
||||
<span className="extend-dialog-menu" onMouseLeave={()=>this.setState({showDrop:false})} style={{display:showDrop ? "block":"none"}}>
|
||||
<div className="extend-right-menu-icon-background"></div>
|
||||
{menu}</span>
|
||||
<Button onClick={()=>this.setState({showDrop:!showDrop})}>{getLabel(17499,"更多")}<i className="icon-coms-Browse-box-Add-to" style={{marginLeft:"5px"}}/>
|
||||
<i className="icon-coms-Browse-box-Add-to" style={{marginLeft:"-5px"}} /></Button>
|
||||
</span>)
|
||||
}
|
||||
return [...buttons,...newButtons]
|
||||
|
||||
}
|
||||
render(){
|
||||
const {children, hideIcon = false} = this.props;
|
||||
const {modalBody, visible, url, closable, style, maskClosable, buttons, title, icon, iconBgcolor,isallscreen,hasMoreBtn,dropMenuDatas} = this.state;
|
||||
let titleEle = (
|
||||
<Row>
|
||||
<Col span="18" style={{paddingLeft:20,lineHeight:'48px'}}>
|
||||
<div>
|
||||
{
|
||||
!hideIcon &&
|
||||
<div className="wea-browser-single-icon-circle" style={{background: iconBgcolor}}>
|
||||
<i className={icon}/>
|
||||
</div>
|
||||
}
|
||||
<span style={{verticalAlign:'middle'}}>{title}</span>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span="6" style={{paddingRight:10,lineHeight:'48px',textAlign:"right"}}>
|
||||
<div>
|
||||
{
|
||||
isallscreen ? <span onClick={this.claseAllScreen} className="extend-dialog-header-icon" style={{cursor:"pointer",color:"#999"}}> <Icon type="shrink" /></span>:
|
||||
<span onClick={this.toAllScreen} className="extend-dialog-header-icon" style={{cursor:"pointer",color:"#999"}}> <Icon type="arrow-salt" /></span>
|
||||
}
|
||||
<span onClick={this.onCancel} className="extend-dialog-header-icon" style={{cursor:"pointer",color:"#999",marginLeft:"-5px"}}> <Icon type="cross" /></span>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
let body;
|
||||
if (modalBody) {
|
||||
body = modalBody;
|
||||
if (isString(modalBody)) body = <div dangerouslySetInnerHTML={{__html: modalBody}}></div>
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal
|
||||
wrapClassName={`extend-dialog ${this.props.className}`}
|
||||
zIndex={this.props.zIndex}
|
||||
title={titleEle}
|
||||
width={style.width}
|
||||
closable={false}
|
||||
maskClosable={maskClosable}
|
||||
visible={visible}
|
||||
onCancel={this.onCancel}
|
||||
footer={this.getFooterButtons()}
|
||||
>
|
||||
<div className="extend-dialog-body" style={{height: style.height}}>
|
||||
{children ? children : ''}
|
||||
{body}
|
||||
{url?
|
||||
<iframe src={url} height={style.height - 20} width={style.width}>
|
||||
</iframe>
|
||||
: ''
|
||||
}
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default Main;
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
.extend-dialog iframe {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.extend-dialog .extend-dialog-header-icon{
|
||||
display: inline-block;
|
||||
height: 48px;
|
||||
width: 35px;
|
||||
text-align: center
|
||||
}
|
||||
.extend-dialog .extend-dialog-header-icon:hover{
|
||||
color:#666 !important;
|
||||
}
|
||||
.extend-dialog-allscreen{
|
||||
top: 10 !important;
|
||||
left: 0 !important;
|
||||
padding-bottom: 0;
|
||||
transform: translate(0px, 0px)!important;
|
||||
}
|
||||
|
||||
.extend-dialog .ant-modal-body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.extend-dialog .ant-modal-content .ant-modal-header {
|
||||
padding: 0;
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.extend-dialog .ant-modal-footer button {
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.extend-dialog .ant-modal-footer button:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.extend-dialog .ant-modal-footer button {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.extend-dialog .extend-dialog-body {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.extend-dialog .extend-dialog-menu{
|
||||
position: absolute;
|
||||
bottom: 21px;
|
||||
right: 0px;
|
||||
max-width: 200px;
|
||||
border: 1px solid #dadada;
|
||||
box-shadow: 0 0 2px #dadada;
|
||||
z-index: 1000;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.extend-dialog-menu{
|
||||
background-color: #fff;
|
||||
}
|
||||
.extend-dialog-menu .ant-menu {
|
||||
margin: 10px 0;
|
||||
border: 0;
|
||||
text-align: left;
|
||||
}
|
||||
.extend-dialog-menu .ant-menu .ant-menu-item-selected {
|
||||
border: 0;
|
||||
color: #000;
|
||||
}
|
||||
.extend-dialog-menu .ant-menu .ant-menu-item-active{
|
||||
background-color: #57c5f7;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.extend-dialog-menu .ant-menu .ant-menu-item {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
padding: 0 8px 0 0;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.extend-dialog-menu .ant-menu .ant-menu-item .extend-dialog-menu-icon {
|
||||
display: inline-block;
|
||||
width: 36px;
|
||||
margin-right: 6px;
|
||||
text-align: center;
|
||||
}
|
||||
.extend-dialog-menu .extend-right-menu-icon-background{
|
||||
width: 36px;
|
||||
height: 100%;
|
||||
background-color: #f2f5f7;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
import React from 'react';
|
||||
|
||||
|
||||
export default class Draggable extends React.Component {
|
||||
constructor(){
|
||||
super();
|
||||
this._timer ;
|
||||
}
|
||||
componentDidMount() {
|
||||
let $this = $(this.refs._container)
|
||||
let handle = $this.find(this.props.handle)
|
||||
let isDrag = false;
|
||||
// let _timer =
|
||||
handle.mousedown((e1) => {
|
||||
clearTimeout(this._timer)
|
||||
|
||||
let startX = e1.clientX;
|
||||
let startY = e1.clientY;
|
||||
let offset = $this.offset();
|
||||
// isDrag = false;
|
||||
// $this.css({ position: 'fixed', ...offset, width: $this.width(), height: $this.height() });
|
||||
this.props.onStart && this.props.onStart(e1, { $target: $this }, { position: 'fixed', ...offset, width: $this.width(), height: $this.height() });
|
||||
// this._timer = setTimeout(()=>{
|
||||
$(document).mousemove((e) => {
|
||||
|
||||
let offsetX = e.clientX - startX;
|
||||
let offsetY = e.clientY - startY;
|
||||
// isDrag = true;
|
||||
if (this.props.axis == 'x') {
|
||||
// let offsetX = e.clientX - startX;
|
||||
$this.css({ left: offset.left + offsetX });
|
||||
} else if (this.props.axis == 'y') {
|
||||
// let offsetY = e.clientY - startY;
|
||||
$this.css({ top: offset.top + offsetY });
|
||||
} else {
|
||||
// let offsetX = e.clientX - startX;
|
||||
// let offsetY = e.clientY - startY;
|
||||
$this.css({ left: offset.left + offsetX, top: offset.top + offsetY, zIndex: 9999 });
|
||||
}
|
||||
this.props.onDrag && this.props.onDrag({ target: this.refs._container });
|
||||
}).mouseup(() => {
|
||||
$(document).unbind('mousemove');
|
||||
$(document).unbind('mouseup');
|
||||
this.props.onStop && this.props.onStop({ target: this.refs._container });
|
||||
$this.removeAttr("style");
|
||||
return false;
|
||||
})
|
||||
// },200)
|
||||
|
||||
//if (!isDrag) {
|
||||
// this.props.onClick && this.props.onClick({ target: this.refs._container });
|
||||
// return false;
|
||||
// } else {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
});
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div ref="_container"
|
||||
{...this.props}
|
||||
id={this.props.id}
|
||||
className={`${this.props.defaultClassName} ${this.props.className}`}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,413 @@
|
|||
import React from 'react'
|
||||
import Draggable from './Draggable';
|
||||
import './index.less';
|
||||
import { Icon, Tooltip, Menu, Dropdown, Input } from 'antd';
|
||||
|
||||
export default class Main extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
columns: props.columns || [],
|
||||
_columns: [],
|
||||
key: 0,
|
||||
newTask: {
|
||||
name: ''
|
||||
}
|
||||
|
||||
}
|
||||
this._columns = props.columns;
|
||||
}
|
||||
handleStart = (column, _, { $target }, targetOffset) => {
|
||||
// let $columnplaceholder = $(this.refs._columnplaceholder);
|
||||
// let $columnstore = $(this.refs._columnstore);
|
||||
this._dragColumn = column;
|
||||
this.offset = { width: $target.width(), height: $target.height(), ...$target.offset() };
|
||||
this.targetOffset = targetOffset;
|
||||
const startAction = ($target, offset, placeoffset) => {
|
||||
$target.css(offset);
|
||||
let $columnplaceholder = $(this.refs._columnplaceholder);
|
||||
let $columnstore = $(this.refs._columnstore);
|
||||
$columnplaceholder.show().css(placeoffset)
|
||||
$target.after($columnplaceholder).appendTo($columnstore);
|
||||
};
|
||||
this.startAction = startAction.bind(this, $target, targetOffset, { width: $target.width(), height: $target.height(), ...$target.offset() });
|
||||
//this.startAction();
|
||||
|
||||
this.moving = true;
|
||||
// $columnplaceholder.show().css({ width: $target.width(), height: $target.height(), ...$target.offset() })
|
||||
// $target.after($columnplaceholder).appendTo($columnstore);
|
||||
}
|
||||
handleMove = (e) => {
|
||||
let $target = $(e.target);
|
||||
const diffX = e.clientX - this.offset.left;
|
||||
if (!this.moving || Math.abs(diffX) < 5) {
|
||||
return;
|
||||
}
|
||||
$target.css(this.targetOffset);
|
||||
let $columnplaceholder = $(this.refs._columnplaceholder);
|
||||
let $columnstore = $(this.refs._columnstore);
|
||||
$columnplaceholder.show().css(this.offset)
|
||||
$target.after($columnplaceholder).appendTo($columnstore);
|
||||
|
||||
|
||||
// this.startAction && this.startAction();
|
||||
|
||||
//let columnKey = e.columnKey;
|
||||
let { left } = $target.offset();
|
||||
let width = $target.width();
|
||||
let children = $(this.refs._columns).children();
|
||||
let first = children.eq(0);
|
||||
let { left: firstLeft } = $(first).offset();
|
||||
if (left < (firstLeft + width / 2)) {
|
||||
first.children().appendTo($(this.refs._columnplaceholder).parent())
|
||||
first.append($(this.refs._columnplaceholder));
|
||||
this._columns = this.swapColumn(this._columns, 0, this.getIndex(this._columns, this._dragColumn))
|
||||
} else {
|
||||
children.each((index, ele) => {
|
||||
const { left: currentLeft } = $(ele).offset();
|
||||
if (left + width > currentLeft + width / 2 && left < currentLeft + width / 2) {
|
||||
$(ele).children().appendTo($(this.refs._columnplaceholder).parent())
|
||||
$(ele).append($(this.refs._columnplaceholder))
|
||||
this._columns = this.swapColumn(this._columns, index, this.getIndex(this._columns, this._dragColumn))
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
getIndex = (columns, column) => {
|
||||
for (let index = 0; index < columns.length; index++) {
|
||||
if (columns[index].key == column.key) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
}
|
||||
swrapColumnByKey = (columns, key1, key2) => {
|
||||
let index1 = 0, index2 = 0;
|
||||
for (let index = 0; index < columns.length; index++) {
|
||||
if (columns[index].key == key1) {
|
||||
index1 = index;
|
||||
}
|
||||
if (columns[index].key == key2) {
|
||||
index2 == index;
|
||||
}
|
||||
}
|
||||
return this.swapColumn(columns, index1, index2);
|
||||
}
|
||||
swapColumn = (columns, index1, index2) => {
|
||||
let _columns = [];
|
||||
for (let index = 0; index < columns.length; index++) {
|
||||
if (index == index1) {
|
||||
_columns.push(columns[index2]);
|
||||
} else if (index == index2) {
|
||||
_columns.push(columns[index1]);
|
||||
} else {
|
||||
_columns.push(columns[index]);
|
||||
}
|
||||
}
|
||||
return _columns;
|
||||
}
|
||||
handleStop = () => {
|
||||
$(this.refs._columnstore).empty();
|
||||
$(this.refs._columnplaceholder).removeAttr('style');
|
||||
$(this.refs._columnplaceholder).appendTo($(this.refs._columnstore).parent());
|
||||
this.setState({ columns: this._columns, key: this.state.key + 1 });
|
||||
this.moving = false;
|
||||
}
|
||||
|
||||
handleItemStart = (column, item, _, { $target }) => {
|
||||
this._dragColumn = column;
|
||||
this._dragItem = item;
|
||||
this.itemMoving = true;
|
||||
this.itemOffset = { width: $target.width(), height: $target.height(), ...$target.offset() };
|
||||
// let $itemplaceholder = $(this.refs._itemplaceholder);
|
||||
// $itemplaceholder.show().css({ width: $target.width(), height: $target.height(), ...$target.offset() })
|
||||
// $target.after($itemplaceholder).appendTo($(this.refs._itemstore));
|
||||
}
|
||||
handleItemMove = (e) => {
|
||||
const { left, top } = $(e.target).offset();
|
||||
let $target = $(e.target);
|
||||
const width = $(e.target).width();
|
||||
const height = $(e.target).height();
|
||||
const thisId = $(e.target).attr("id");
|
||||
const diffX = e.clientX - this.itemOffset.left;
|
||||
if (!this.itemMoving || Math.abs(diffX) < 5) {
|
||||
return;
|
||||
}
|
||||
let $itemplaceholder = $(this.refs._itemplaceholder);
|
||||
$itemplaceholder.show().css(this.itemOffset);
|
||||
$target.after($itemplaceholder).appendTo($(this.refs._itemstore));
|
||||
|
||||
$("[id^=drag-item-]").each((_, ele) => {
|
||||
if ($(ele).attr("id") == thisId) {
|
||||
return;
|
||||
}
|
||||
const { left: currentLeft, top: currentTop } = $(ele).offset();
|
||||
const currentWidth = $(ele).width();
|
||||
const currentHeight = $(ele).height();
|
||||
|
||||
if (left + width > currentLeft + currentWidth / 2 && left < currentLeft + currentWidth / 2) {
|
||||
if (top + height > currentTop + currentHeight / 2) {
|
||||
if (top < currentTop + currentHeight / 2) {
|
||||
$(ele).before($(this.refs._itemplaceholder));
|
||||
this._columns = this.appendItem(this._columns, thisId, $(ele).attr("id"), false);
|
||||
} else {
|
||||
if (this.isLastItemOfColumn($(ele))) {
|
||||
$(ele).after($(this.refs._itemplaceholder));
|
||||
this._columns = this.appendItem(this._columns, thisId, $(ele).attr("id"), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
$('.wea-draggable-column.column-empty').each((_, ele) => {
|
||||
const { left: currentLeft } = $(ele).offset();
|
||||
const currentWidth = $(ele).width();
|
||||
if (left + width > currentLeft + currentWidth / 2 && left < currentLeft + currentWidth / 2) {
|
||||
$(ele).find('.drag-item-wrap').append($(this.refs._itemplaceholder));
|
||||
this._columns = this.appendItem(this._columns, thisId, '', false, $(ele).attr('id'));
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
}
|
||||
handleItemStop = () => {
|
||||
$(this.refs._itemstore).empty();
|
||||
$(this.refs._itemplaceholder).removeAttr('style');
|
||||
$(this.refs._itemplaceholder).appendTo($(this.refs._itemstore).parent());
|
||||
this.setState({ columns: this._columns, key: this.state.key + 1 });
|
||||
this.itemMoving = false;
|
||||
}
|
||||
isLastItemOfColumn = ($ele) => {
|
||||
let silbs = $ele.parent().find("[id^=drag-item-]");
|
||||
let last = silbs.last();
|
||||
return last.attr("id") == $ele.attr("id");
|
||||
}
|
||||
appendItem = (columns, fromkey1, tokey2, after, toColumnKey) => {
|
||||
let _columns = [];
|
||||
for (let i = 0; i < columns.length; i++) {
|
||||
let _items = [];
|
||||
let items = columns[i].items;
|
||||
if (`drag-column-${columns[i].key}` == toColumnKey) {
|
||||
_items.push(this._dragItem);
|
||||
} else {
|
||||
for (let j = 0; j < items.length; j++) {
|
||||
if (!items[j]) {
|
||||
continue;
|
||||
}
|
||||
if (`drag-item-${items[j].key}` == fromkey1) {
|
||||
continue;
|
||||
} else if (`drag-item-${items[j].key}` == tokey2) {
|
||||
let formitem = this._dragItem
|
||||
if (after) {
|
||||
_items.push(items[j]);
|
||||
if (formitem) {
|
||||
_items.push(formitem);
|
||||
}
|
||||
} else {
|
||||
if (formitem) {
|
||||
_items.push(formitem);
|
||||
}
|
||||
_items.push(items[j]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
_items.push(items[j]);
|
||||
}
|
||||
}
|
||||
_columns.push({ ...columns[i], items: _items })
|
||||
}
|
||||
return _columns;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
let $this = $(this.refs._kanban);
|
||||
// let kanban_column = $this.find(".mode-kanban-column-row");
|
||||
let kanban = $this;
|
||||
|
||||
|
||||
|
||||
kanban.mousedown((e) => {
|
||||
let startX = e.clientX;
|
||||
let startY = e.clientY;
|
||||
let offset = $this.offset();
|
||||
let lastmoveX = startX;
|
||||
e.stopPropagation();
|
||||
/* setTimeout(function () {
|
||||
$(document).mousemove((e) => {
|
||||
let offsetX = e.clientX - lastmoveX;
|
||||
let nowoffsetX = kanban.scrollLeft();
|
||||
lastmoveX = e.clientX;
|
||||
if (offsetX < 0) {
|
||||
kanban.scrollLeft(nowoffsetX + (offsetX * -1));
|
||||
} else {
|
||||
kanban.scrollLeft(nowoffsetX - (offsetX));
|
||||
}
|
||||
//$(document).scrollLeft(kanban.scrollLeft()+offsetX);
|
||||
}).mouseup(() => {
|
||||
$(document).unbind('mousemove');
|
||||
return false;
|
||||
})
|
||||
return false;
|
||||
}, 200); */
|
||||
return false;
|
||||
});
|
||||
let $area = $(this.refs._area);
|
||||
let area = $area;
|
||||
area.mousedown(() => {
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const menu = (
|
||||
<Menu>
|
||||
<Menu.Item key="0">
|
||||
<span>修改阶段名称</span>
|
||||
</Menu.Item>
|
||||
<Menu.Divider />
|
||||
<Menu.Item key="1">
|
||||
<span>删除阶段</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (
|
||||
<div ref="_kanban" className="mode-kanban">
|
||||
<div ref="_columnplaceholder" className="mode-kanban-column-placeholder" />
|
||||
<div ref="_columnstore" className="mode-kanban-column-store" />
|
||||
<div ref="_itemplaceholder" className="mode-kanban-item-placeholder" />
|
||||
<div ref="_itemstore" className="mode-kanban-item-store" />
|
||||
<div key={this.state.key} ref="_columns" className="ant-row mode-kanban-column-row" style={{ width: (this.state.columns.length * 360) + "px" }} >
|
||||
{this.state.columns.map((column) => {
|
||||
return (
|
||||
<div style={{ float: "left" }} >
|
||||
<div className="mode-kanban-column" >
|
||||
<Draggable
|
||||
id={`drag-column-${column.key}`}
|
||||
className={`${column.items.length > 0 ? 'column' : 'column-empty'}`}
|
||||
defaultClassName="wea-draggable-column"
|
||||
onStart={this.handleStart.bind(this, column)}
|
||||
onStop={this.handleStop}
|
||||
onDrag={this.handleMove}
|
||||
handle=".column-dragg-handle"
|
||||
axis="both"
|
||||
>
|
||||
|
||||
<header className="column-dragg-handle column-header" >
|
||||
<i className="icon-mode-mode" style={{ fontSize: 18, paddingRight: 10 }} />
|
||||
<span>{column.title}</span>
|
||||
<Dropdown overlay={menu}>
|
||||
<span className="icon-coms-down2 column-header-menu"></span>
|
||||
</Dropdown>
|
||||
</header>
|
||||
<div className="drag-item-wrap">
|
||||
{
|
||||
column.items.map((item) => {
|
||||
return (
|
||||
<Draggable
|
||||
id={`drag-item-${item.key}`}
|
||||
defaultClassName="wea-draggable-item mode-kanban-item"
|
||||
handle=".item-dragg-handle"
|
||||
onStart={this.handleItemStart.bind(this, column, item)}
|
||||
onDrag={this.handleItemMove}
|
||||
onStop={this.handleItemStop}
|
||||
|
||||
axis='both'
|
||||
>
|
||||
|
||||
<div className="item-dragg-handle" >
|
||||
|
||||
<span className="item-dragg-handle-title" >{item.title}</span>
|
||||
{
|
||||
item.islandmark != "1" &&
|
||||
<Tooltip placement="bottom" title={"设为里程碑"}>
|
||||
<span className="icon-coms-operation-o item-dragg-handle-operation" tip={"添加"}></span>
|
||||
</Tooltip>
|
||||
}
|
||||
{
|
||||
item.islandmark == "1" &&
|
||||
<Tooltip placement="bottom" title={"取消里程碑"}>
|
||||
<span className="icon-coms-operation item-dragg-handle-operation2"></span>
|
||||
</Tooltip>
|
||||
}
|
||||
{
|
||||
item.collection != "1" &&
|
||||
<Tooltip placement="bottom" title={"星标任务"}>
|
||||
<span className="icon-coms-Collection item-dragg-handle-collection"></span>
|
||||
</Tooltip>
|
||||
}
|
||||
{
|
||||
item.collection == "1" &&
|
||||
<Tooltip placement="bottom" title={"取消星标"}>
|
||||
<span className="icon-coms-Collection2 item-dragg-handle-collection2"></span>
|
||||
</Tooltip>
|
||||
}
|
||||
|
||||
{/* <div>
|
||||
<span>Tag 1</span>
|
||||
<span>>Link</span>
|
||||
<span >Tag 2</span>
|
||||
<span >Prevent Default</span>
|
||||
</div> */}
|
||||
</div>
|
||||
</Draggable>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
</Draggable>
|
||||
|
||||
<div className="mode-kanban-new-task" ref="_area" >
|
||||
<div className="mode-kanban-new-task-area" >
|
||||
<Input type="textarea" rows={4} onClick={this._handleClick.bind(this)} />
|
||||
</div>
|
||||
|
||||
<div className="mode-kanban-new-task-btn">
|
||||
<span >
|
||||
+新任务
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
_handleClick = (e) => {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
areaClick(event) {
|
||||
|
||||
}
|
||||
|
||||
saveTask(key, value) {
|
||||
|
||||
}
|
||||
|
||||
handleChange = (value) => {
|
||||
this.setState({
|
||||
newTask: {
|
||||
name: value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
handleFocus = (value) => {
|
||||
//console.log('这是获得焦点的value: ' + value);
|
||||
}
|
||||
|
||||
handleBlur = (value) => {
|
||||
//console.log('这是失去焦点的value: ' + value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
.column-header {
|
||||
background-color: #eef0f4;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
padding: 16px;
|
||||
border-radius: 2px 2px 0 0;
|
||||
zoom: 1;
|
||||
margin-bottom: -1px;
|
||||
min-height: 48px;
|
||||
font-size: 16px;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
.ant-dropdown-link{
|
||||
float: right;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #484848;
|
||||
}
|
||||
.column-header-menu{
|
||||
z-index: 999;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.mode-kanban {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
height: 93%;
|
||||
position: relative;
|
||||
// width:auto;
|
||||
// padding-left: 8px;
|
||||
.ant-row,
|
||||
[class*=" ant-col"],
|
||||
[class^=ant-col] {
|
||||
height: 100%
|
||||
}
|
||||
.mode-kanban-column-placeholder {
|
||||
border: 1px dashed gray;
|
||||
display: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin-top: 8px;
|
||||
//margin-left: -8px;
|
||||
// margin-right: -8px;
|
||||
}
|
||||
.mode-kanban-item {
|
||||
min-height: 41px;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
margin: 0 5px 5px 5px;
|
||||
padding: 0 0 0 10px;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.2)
|
||||
}
|
||||
.mode-kanban-item-placeholder{
|
||||
border: 1px dashed gray;
|
||||
display: none;
|
||||
// height: 88px;
|
||||
margin: 10px;
|
||||
// padding-left: 50px
|
||||
}
|
||||
.mode-kanban-column-row{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
min-width: 640px;
|
||||
padding: 0 20px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.mode-kanban-column {
|
||||
background-color: #eef0f4;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
|
||||
height: 100%;
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
border: 1px solid #e9e9e9;
|
||||
border-radius: 10px;
|
||||
width: 290px;
|
||||
overflow: auto;
|
||||
}
|
||||
.mode-kanban-new-task{
|
||||
position: relative;
|
||||
|
||||
}
|
||||
.mode-kanban-new-task-area{
|
||||
min-height: 41px;
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
margin: 0 5px 5px 5px;
|
||||
padding: 0 0 0 10px;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,.2)
|
||||
}
|
||||
|
||||
.mode-kanban-new-task-btn{
|
||||
border-radius: 5px;
|
||||
position: relative;
|
||||
// cursor: pointer;
|
||||
span {
|
||||
background-color: #fff;
|
||||
color : #757575;
|
||||
line-height: 32px;
|
||||
display: inline-block;
|
||||
height: 32px;
|
||||
margin: 3px 5px 6px 5px;
|
||||
padding: 0 18px;
|
||||
cursor: pointer;
|
||||
border-radius: 18px;
|
||||
box-shadow: 0 1px 2px rgba(0,0,0,.12);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
.item-header{
|
||||
margin: 10px 0
|
||||
}
|
||||
.item-dragg-handle{
|
||||
// padding-left: 24px;
|
||||
// height: 80px;
|
||||
// overflow: hidden ;
|
||||
overflow: hidden;
|
||||
padding: 10px 20px 10px 10px;
|
||||
}
|
||||
.item-dragg-handle-title{
|
||||
// margin: 16px 0;
|
||||
width : 80% ;
|
||||
font-size: 14px;
|
||||
// padding: 10px 0px 10px 0px;
|
||||
display: inline-block;
|
||||
// text-align:center;
|
||||
// display:block;
|
||||
// float:left
|
||||
}
|
||||
|
||||
.item-dragg-handle-operation{
|
||||
font-size: 18px;
|
||||
color: gainsboro;
|
||||
padding-right: 10px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.item-dragg-handle-operation2{
|
||||
font-size: 18px;
|
||||
padding-right: 10px;
|
||||
color: #2db7f5;
|
||||
}
|
||||
|
||||
.item-dragg-handle-collection{
|
||||
font-size: 18px;
|
||||
color: gainsboro;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.item-dragg-handle-collection2{
|
||||
font-size: 18px;
|
||||
color: rgb(248, 192, 72);
|
||||
}
|
||||
|
||||
span.item-dragg-handle-collection:hover{
|
||||
color:black;
|
||||
}
|
||||
|
||||
span.item-dragg-handle-operation:hover{
|
||||
color:black;
|
||||
}
|
||||
|
||||
div.mode-kanban-item:hover {
|
||||
background-color: #eef0f4;
|
||||
}
|
||||
|
||||
div.mode-kanban-item:hover span{
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div.mode-kanban-new-task-btn:hover span{
|
||||
background-color: rgb(59, 56, 56);
|
||||
color: white;
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
import {Table,Icon,Row,Col,Button,Spin} from 'antd'
|
||||
import {WeaTools,WeaInput,WeaSelect,WeaBrowser,WeaLocaleProvider} from 'ecCom'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import equal from 'deep-equal'
|
||||
|
||||
const { getComponent } = WeaTools;
|
||||
|
||||
class CustomerShare extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
columns: [],
|
||||
datas: [],
|
||||
selectedRowKeys: [],
|
||||
current: 1,
|
||||
showGroup: props.showGroup ? props.showGroup : false
|
||||
}
|
||||
this.doDelete = this.doDelete.bind(this);
|
||||
this.doAdd = this.doAdd.bind(this);
|
||||
}
|
||||
componentDidMount() {
|
||||
const { datas = [], columns = [] } = this.props;
|
||||
columns.length > 0 && this.setState(datas.length > 0 ? {datas: this.addKeytoDatas(datas),columns} : {columns})
|
||||
}
|
||||
componentWillReceiveProps(nextProps,nextState) {
|
||||
const { columns = [], datas = [], selectedRowKeys = [] } = this.props;
|
||||
const _columns = nextProps.columns || [];
|
||||
const _datas = nextProps.datas || [];
|
||||
const _selectedRowKeys = nextProps.selectedRowKeys || [];
|
||||
!equal(columns,_columns) && this.setState({columns:_columns});
|
||||
this.setState({datas: this.addKeytoDatas(_datas)});
|
||||
!equal(selectedRowKeys,_selectedRowKeys) && this.setState({selectedRowKeys:_selectedRowKeys})
|
||||
}
|
||||
addKeytoDatas(datas){
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = {...data};
|
||||
_data.key = i
|
||||
return _data
|
||||
})
|
||||
return _datas
|
||||
}
|
||||
render() {
|
||||
const { datas,showGroup,columns, selectedRowKeys } = this.state;
|
||||
const {title,needAdd,needCopy} = this.props;
|
||||
return(
|
||||
<div className="wea-batchshare-table" >
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@9m9gde`} className="wea-title">
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@6w81sj`} span="20">
|
||||
<div>{title}</div>
|
||||
</Col>
|
||||
{needAdd &&
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@5hv9s0`} span="4" style={{textAlign:"right",paddingRight:10,fontSize:12}}>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5g5vyd`} type="primary" title={getLabel(1421,"新增")} size="small" onClick={this.doAdd}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@grn2q1`} type="plus" /></Button>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@zqazcs`} type="primary" disabled={!`${selectedRowKeys}`} title={getLabel(91,"删除")} size="small" onClick={this.doDelete} ><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@7obh8j`} type="minus" /></Button>
|
||||
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@kbcizf`} type={showGroup ? 'up' : 'down'} onClick={()=>this.setState({showGroup:!showGroup})}/>
|
||||
</Col>
|
||||
}
|
||||
</Row>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@6ww4v9`} className="wea-content" style={{display:showGroup ? "block":"none"} }>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@6xpkpz`} className="wea-form-cell" span={24}>
|
||||
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@yrw1bc`}
|
||||
columns={this.getColumns()}
|
||||
dataSource={datas}
|
||||
pagination={false}
|
||||
rowSelection={this.getRowSelection()}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getColumns(){
|
||||
const { columns } = this.state;
|
||||
let _columns = [].concat(columns);
|
||||
_columns = _columns.map(col => {
|
||||
let _col = { ...col };
|
||||
_col.render = ( text, record, index ) => {
|
||||
return this.getColRender( _col, text, record, index );
|
||||
}
|
||||
return _col
|
||||
});
|
||||
return _columns
|
||||
}
|
||||
getColRender( _col, text, record, index ){
|
||||
const { com,isLink = false,linkKey =[],linkUrl=""} = _col;
|
||||
let _com = [];
|
||||
com.map((c,i) => {
|
||||
if(typeof c.props === 'object'){
|
||||
_com.push(c);
|
||||
}else{
|
||||
const { domkey,viewAttr =2,key, label, formItemType = 'INPUT', options = [], browserConditionParam = {}, width ,value } = c;
|
||||
const _type = formItemType.toUpperCase();
|
||||
_com.push(
|
||||
<span>
|
||||
{label && <span style={{marginLeft: 5}}>{label}</span>}
|
||||
{ _type === 'INPUT' && !isLink &&
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@vqdk63@${i}`}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
style={{width, display: 'inline-block'}}
|
||||
viewAttr={viewAttr} />
|
||||
}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
{_com}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getRowSelection(){
|
||||
const { columns, selectedRowKeys } = this.state;
|
||||
if(!`${columns}`) return null
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (sRowKeys, selectedRows) => {
|
||||
this.setState({selectedRowKeys : sRowKeys});
|
||||
}
|
||||
}
|
||||
return rowSelection
|
||||
}
|
||||
|
||||
doAdd(){
|
||||
typeof this.props.addColumns === 'function' && this.props.addColumns();
|
||||
}
|
||||
doDelete(){
|
||||
const { datas, current, selectedRowKeys } = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
selectedRowKeys.map(key => {
|
||||
_datas = _datas.filter(data => data.key !== key);
|
||||
});
|
||||
_datas = _datas.map((data, i) => {
|
||||
let _data = {...data};
|
||||
_data.key = i;
|
||||
return _data
|
||||
})
|
||||
this.setState({datas: _datas,selectedRowKeys: []});
|
||||
this.onChange(_datas);
|
||||
|
||||
}
|
||||
onChange(datas){
|
||||
const { columns } = this.state;
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = {...data}
|
||||
delete _data.key
|
||||
return _data
|
||||
});
|
||||
typeof this.props.onChange === 'function' && this.props.onChange(_datas, columns);
|
||||
}
|
||||
}
|
||||
|
||||
export default CustomerShare;
|
||||
|
||||
|
|
@ -0,0 +1,198 @@
|
|||
import React from 'react';
|
||||
import { WeaDialog, WeaRightMenu, WeaNewScroll, WeaAuth, WeaLocaleProvider } from "ecCom"
|
||||
import { Button, } from "antd"
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import PrjShowGroup from "../prj-show-group"
|
||||
import WeaBatchShareTable from './customerShare.js'
|
||||
import './index.less'
|
||||
|
||||
class BatchShareDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
datas: []
|
||||
};
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if(this.props.visible !== nextProps.visible){
|
||||
this.setState({ datas: [] });
|
||||
}
|
||||
}
|
||||
shouldComponentUpdate() {
|
||||
return true;
|
||||
}
|
||||
render() {
|
||||
const { visible, title, condition, onCancel } = this.props;
|
||||
const { datas } = this.state;
|
||||
const columns = [
|
||||
{
|
||||
"title": getLabel(21956, "对象类型"),
|
||||
"com": [{ label: '', type: 'INPUT', "viewAttr": 1, key: 'sharetypespan', disabled: false, },],
|
||||
"width": "20%",
|
||||
"dataIndex": "sharetypespan",
|
||||
"key": "sharetypespan"
|
||||
},
|
||||
{
|
||||
"title": getLabel(106, "对象"),
|
||||
"com": [{ label: '', type: 'INPUT', "viewAttr": 1, key: 'relatedshareidspan', disabled: false, },],
|
||||
"width": "30%",
|
||||
"dataIndex": "relatedshareidspan",
|
||||
"key": "relatedshareidspan"
|
||||
},
|
||||
{
|
||||
"title": getLabel(683, "安全级别"),
|
||||
"com": [{ label: '', type: 'INPUT', "viewAttr": 1, key: 'seclevel_seclevelMax', disabled: false, },],
|
||||
"width": "30%",
|
||||
"dataIndex": "seclevel_seclevelMax",
|
||||
"key": "seclevel_seclevelMax"
|
||||
},
|
||||
{
|
||||
"title": getLabel(3005, "共享级别"),
|
||||
"com": [{ label: '', type: 'INPUT', "viewAttr": 1, key: 'sharelevelspan', disabled: false, },],
|
||||
"width": "20%",
|
||||
"dataIndex": "sharelevelspan",
|
||||
"key": "sharelevelspan"
|
||||
},
|
||||
];
|
||||
let that = this;
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ldv3sf`}
|
||||
title={title || getLabel(18645, "添加共享")}
|
||||
visible={visible}
|
||||
buttons={this.getBottomButtons()}
|
||||
icon='icon-coms-project'
|
||||
iconBgcolor='#217346'
|
||||
onCancel={() => { typeof onCancel === 'function' && onCancel(); }}
|
||||
style={{ width: 800, height: 500 }}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@cwq7dz`} datas={this.getRightMenu()} >
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@2o2rxl`} height={"100%"}>
|
||||
<div style={{ width: "100%", height: "450px", overflow: "auto" }}>
|
||||
<div >
|
||||
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@02xr5r`} needTigger={true} leftComponent={getLabel(1361, "基本信息")} showGroup={true} >
|
||||
<WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@nup18d`}
|
||||
visible={true}
|
||||
ref="customerShare"
|
||||
type="form"
|
||||
className="prj-auth-customersize"
|
||||
icon={'icon-coms-fa'}
|
||||
iconBgcolor='#f14a2d'
|
||||
conditions={condition}
|
||||
title={getLabel(2112, "共享设置")}
|
||||
onOk={v => {
|
||||
let seclevel = v.seclevel;
|
||||
let seclevelMax = v.seclevelMax;
|
||||
if(v.sharetype === '1'||v.sharetype === '6'||v.sharetype === '7'||v.sharetype === '9'||v.sharetype === '11'){
|
||||
}else{
|
||||
if(""+seclevel&&(typeof seclevelMax === 'undefined' || seclevelMax === null || seclevelMax === "")){
|
||||
v.seclevel_seclevelMax = "≥"+seclevel;
|
||||
}else if(""+seclevelMax&&(typeof seclevel === 'undefined' || seclevel === null || seclevel === "")){
|
||||
v.seclevel_seclevelMax = "≤"+seclevelMax;
|
||||
}else{
|
||||
v.seclevel_seclevelMax = seclevel+" - "+seclevelMax;
|
||||
}
|
||||
}
|
||||
//if (v.seclevel) { v.seclevel_seclevelMax = v.seclevel + "-" + v.seclevelMax; }
|
||||
if (v.sharetype !== "4") {
|
||||
const relatedshareids = v.relatedshareid.split(",");
|
||||
const relatedshareidspans = v.relatedshareidspan.split(",");
|
||||
let joblevel = '';
|
||||
let joblevelspan = '';
|
||||
let jobtitlespan = '';
|
||||
if(v.sharetype==='11'){
|
||||
joblevel = v.joblevel;
|
||||
joblevelspan = v.joblevelspan;
|
||||
if(joblevel==='1'){
|
||||
jobtitlespan = v.jobtitledepartmentspan;
|
||||
}else if(joblevel==='2'){
|
||||
jobtitlespan = v.jobtitlesubcompanyspan;
|
||||
}
|
||||
}
|
||||
if (relatedshareids.length > 1) {
|
||||
relatedshareids.map((item, index) => {
|
||||
let relatedshareidspan = relatedshareidspans[index]
|
||||
if(v.sharetype==='11'){
|
||||
relatedshareidspan +='/'+joblevelspan;
|
||||
if(joblevel==='1'||joblevel==='2'){
|
||||
relatedshareidspan +='('+jobtitlespan+')';
|
||||
}
|
||||
}
|
||||
datas.push({
|
||||
...v,
|
||||
relatedshareid: item,
|
||||
relatedshareidspan: relatedshareidspan
|
||||
})
|
||||
});
|
||||
}else {
|
||||
let relatedshareidspan = v.relatedshareidspan;
|
||||
let rolelevelspan = v.rolelevelspan;
|
||||
if(v.sharetype==='11'||v.sharetype==='3'){
|
||||
if(v.sharetype==='11'){
|
||||
relatedshareidspan +='/'+joblevelspan;
|
||||
if(joblevel==='1'||joblevel==='2'){
|
||||
relatedshareidspan +='('+jobtitlespan+')';
|
||||
}
|
||||
}else if(v.sharetype==='3'){
|
||||
relatedshareidspan = rolelevelspan+"/"+relatedshareidspan;
|
||||
}
|
||||
datas.push({...v,relatedshareidspan:relatedshareidspan});
|
||||
}else{
|
||||
datas.push(v)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
datas.push(v)
|
||||
}
|
||||
that.setState({ datas: datas });
|
||||
}}
|
||||
onCancel={() => { }}
|
||||
/>
|
||||
</PrjShowGroup>
|
||||
<WeaBatchShareTable ecId={`${this && this.props && this.props.ecId || ''}_WeaBatchShareTable@ojhwmw`}
|
||||
title={getLabel(1279, "共享信息")}
|
||||
showGroup={true}
|
||||
needAdd={true}
|
||||
needCopy={false}
|
||||
columns={columns}
|
||||
datas={datas}
|
||||
canAdd={true}
|
||||
addColumns={this.addColumns.bind(this)}
|
||||
onChange={this.editTableDatas.bind(this)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
getBottomButtons() {
|
||||
const { onCancel, onSave } = this.props;
|
||||
const { datas } = this.state;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@eimtx3@save`} type="primary" onClick={() => { typeof onSave === 'function' && onSave(datas); }}>{getLabel(86, "保存")}</Button>)
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@leq4kb@close`} type="primary" onClick={() => { typeof onCancel === 'function' && onCancel(); }}>{getLabel(309, "关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu() {
|
||||
const { onCancel, onSave } = this.props;
|
||||
const { datas } = this.state;
|
||||
let btns = [];
|
||||
btns.push({
|
||||
key: "1",
|
||||
icon: <i className='icon-coms-Preservation' />,
|
||||
content: getLabel(86, "保存"),
|
||||
onClick: () => { typeof onSave === 'function' && onSave(datas); this.setState({ datas: [] }); }
|
||||
});
|
||||
return btns;
|
||||
}
|
||||
addColumns() {
|
||||
this.refs.customerShare.onOk();
|
||||
}
|
||||
editTableDatas(data) {
|
||||
this.setState({ datas: data })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default BatchShareDialog
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
.prj-auth-customersize{
|
||||
margin-top: 10px;
|
||||
.ant-form-item {
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-batchshare-table{
|
||||
padding-top: 20px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
}
|
||||
.wea-batchshare-table .wea-title {
|
||||
font-size: 12px;
|
||||
color: #484848;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
border-bottom: solid 1px #ebebeb;
|
||||
}
|
||||
.wea-batchshare-table .wea-title i {
|
||||
cursor: pointer;
|
||||
}
|
||||
.wea-batchshare-table .wea-title button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.wea-batchshare-table .ant-table-tbody>tr>td {
|
||||
padding: 10px 8px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.wea-batchshare-table .ant-table-thead>tr>th {
|
||||
background-color: #f8fcff;
|
||||
}
|
||||
.wea-batchshare-table .ant-table-thead>tr>th {
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
.wea-batchshare-table .ant-table-thead th {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
font-weight: 400;
|
||||
}
|
||||
.wea-batchshare-table .ant-table,.wea-batchshare-table .ant-table table {
|
||||
border-radius: 0;
|
||||
}
|
||||
.wea-batchshare-table .ant-btn-sm {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
import {InputNumber, Modal, Icon} from 'antd';
|
||||
import isEmpty from 'lodash/isEmpty';
|
||||
import isArray from 'lodash/isArray'
|
||||
import {WeaDatePicker,WeaTimePicker} from "ecCom"
|
||||
import equals from 'deep-equal'
|
||||
|
||||
class Main extends React.Component {
|
||||
constructor(props){
|
||||
super(props)
|
||||
this.state={
|
||||
dateValue: '',
|
||||
timeValue: ''
|
||||
}
|
||||
if (!isEmpty(props.value)) {
|
||||
if (props.value[0]) this.state.dateValue = props.value[0];
|
||||
if (props.value[1]) this.state.timeValue = props.value[1];
|
||||
}
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
if (!equals(this.props.value,nextProps.value)) {
|
||||
let dateValue = '', timeValue = '';
|
||||
if (!isEmpty(nextProps.value)) {
|
||||
dateValue = nextProps.value[0];
|
||||
timeValue = nextProps.value[1];
|
||||
}
|
||||
this.setState({dateValue, timeValue});
|
||||
}
|
||||
}
|
||||
onChangeDate(value) {
|
||||
this.setState({dateValue: value});
|
||||
const {timeValue = ''} = this.state;
|
||||
this.props.onChange && this.props.onChange([value, timeValue]);
|
||||
}
|
||||
onChangeTime(value) {
|
||||
this.setState({timeValue: value});
|
||||
const {dateValue = ''} = this.state;
|
||||
this.props.onChange && this.props.onChange([dateValue, value]);
|
||||
}
|
||||
render(){
|
||||
const {dateValue, timeValue, } = this.state;
|
||||
const {viewAttr,otherParams,startValue="",endValue="",isTimeShow='1',type,domkey}=this.props;
|
||||
let name = domkey&&domkey[0];
|
||||
let timename = '';
|
||||
if(name==='begindate'){
|
||||
timename ='begintime';
|
||||
}else if(name==='enddate'){
|
||||
timename ='endtime';
|
||||
}else if(name==='actualbegindate'){
|
||||
timename ='actualbegintime';
|
||||
}else if(name==='actualenddate'){
|
||||
timename ='actualendtime';
|
||||
}
|
||||
return(
|
||||
<div className='prj-date-time'>
|
||||
<span>
|
||||
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@yzs4u6`} name={name} startValue={startValue} endValue={endValue} viewAttr={viewAttr} formatPattern={2} value={dateValue} {...otherParams} onChange={this.onChangeDate.bind(this)}/>
|
||||
</span>
|
||||
<span style={{marginLeft:10}}>
|
||||
<WeaTimePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaTimePicker@ywlbuo`} name={timename} style={{display:isTimeShow=='1'?'':'none'}} viewAttr={viewAttr} formatPattern={3} value={isTimeShow=='1'?timeValue:type=='start'?'00:00':'23:59'} {...otherParams} onChange={this.onChangeTime.bind(this)} />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Main;
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
import { Icon} from 'antd';
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import './index.less'
|
||||
|
||||
|
||||
class LeftRightLayout extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showLeft:props.defaultShowLeft || true,
|
||||
isHover:false,
|
||||
leftWidth:props.leftWidth || 250,
|
||||
treeWidth:props.treeWidth || 250
|
||||
// showRight:false
|
||||
}
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
if(this.props.showRight !== nextProps.showRight){
|
||||
this.showright(nextProps.showRight);
|
||||
}
|
||||
}
|
||||
leftShowCo(e){
|
||||
const {showLeft,leftWidth,treeWidth} = this.state;
|
||||
const { onLeftChange,leftCom} = this.props;
|
||||
if(showLeft){
|
||||
jQuery(".three-side-left").animate({width:0},300,"linear",onLeftChange && onLeftChange(false))
|
||||
}else{
|
||||
jQuery(".three-side-left").animate({width:leftCom? leftWidth:treeWidth},300,"linear",onLeftChange && onLeftChange(true))
|
||||
}
|
||||
this.setState({showLeft:!showLeft});
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
e.nativeEvent.preventDefault();
|
||||
}
|
||||
render() {
|
||||
const {showLeft,height,isHover,leftWidth,treeWidth} = this.state;
|
||||
const {children,leftCom,rightCom,showRight} = this.props;
|
||||
return (
|
||||
<div className="wea-left-middle-right-layout" >
|
||||
{
|
||||
leftCom &&
|
||||
<div className="three-side-left" style={{width:leftCom ? leftWidth :treeWidth}}>
|
||||
<div style={{width:treeWidth}} className="three-side-left-left" >
|
||||
{leftCom}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div className="three-side-right">
|
||||
{
|
||||
leftCom &&
|
||||
<div className='wea-three-side-layout-show-left'
|
||||
onClick={this.leftShowCo.bind(this)}
|
||||
onMouseEnter={()=>this.setState({isHover:true})}
|
||||
onMouseLeave={()=>this.setState({isHover:false})}
|
||||
style={{background: `url('/cloudstore/images/e9/leftTree-${showLeft ? "show" : "hide"}${isHover ? "-hover" : ""}.png') no-repeat -2px 0`}}
|
||||
></div>
|
||||
}
|
||||
<div className="three-side-right-container">
|
||||
<div style={{background:"#fff",height:"100%"}}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default LeftRightLayout;
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
|
||||
@coms-prefix:coms-mode;
|
||||
|
||||
@coms-height:46px;
|
||||
@coms-small-height:32px;
|
||||
|
||||
.wea-left-middle-right-layout,
|
||||
.wea-left-middle-right-layout .three-side-left,
|
||||
.wea-left-middle-right-layout .three-side-right{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.wea-left-middle-right-layout{
|
||||
background-color: #e8edf4;
|
||||
width: 100%;
|
||||
}
|
||||
.wea-left-middle-right-layout .three-side-left{
|
||||
float: left;
|
||||
background-color: #fff;
|
||||
.three-side-left-left1{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
border-right: 1px solid #ececec;
|
||||
}
|
||||
.three-side-left-left2{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
.wea-left-middle-right-layout .three-side-right{
|
||||
border-right: 1px solid #ececec;
|
||||
position: relative;
|
||||
.three-side-right-container{
|
||||
padding: 0 0px 0 1px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-left-middle-right-layout .wea-three-side-layout-show-left{
|
||||
width: 18px;
|
||||
height: 60px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
margin-top: -30px;
|
||||
z-index: 11;
|
||||
cursor: pointer;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import React from 'react';
|
||||
import Progress from './progress';
|
||||
import warning from 'warning';
|
||||
|
||||
const AntProgress = Progress;
|
||||
|
||||
// For downward compatibility
|
||||
AntProgress.Line = (props) => {
|
||||
warning(false, '<Progress.Line /> is deprecated, use <Progress type="line" /> instead.');
|
||||
return <Progress {...props} type="line" />;
|
||||
};
|
||||
AntProgress.Circle = (props) => {
|
||||
warning(false, '<Progress.Circle /> is deprecated, use <Progress type="circle" /> instead.');
|
||||
return <Progress {...props} type="circle" />;
|
||||
};
|
||||
|
||||
export default AntProgress;
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
import React, { PropTypes } from 'react';
|
||||
import {Icon} from 'antd';
|
||||
import { Circle } from 'rc-progress';
|
||||
import classNames from 'classnames';
|
||||
|
||||
const statusColorMap = {
|
||||
normal: '#2db7f5',
|
||||
exception: '#ff5500',
|
||||
success: '#87d068',
|
||||
};
|
||||
|
||||
export default class Line extends React.Component {
|
||||
static defaultProps = {
|
||||
type: 'line',
|
||||
percent: 0,
|
||||
showInfo: true,
|
||||
trailColor: '#f3f3f3',
|
||||
prefixCls: 'ant-progress',
|
||||
}
|
||||
|
||||
static propTypes = {
|
||||
status: PropTypes.oneOf(['normal', 'exception', 'active', 'success']),
|
||||
type: PropTypes.oneOf(['line', 'circle']),
|
||||
showInfo: PropTypes.bool,
|
||||
percent: PropTypes.number,
|
||||
width: PropTypes.number,
|
||||
strokeWidth: PropTypes.number,
|
||||
trailColor: PropTypes.string,
|
||||
format: PropTypes.func,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { prefixCls, status, format, percent, trailColor,
|
||||
type, strokeWidth,progressBg, width, className, showInfo, ...restProps} = this.props;
|
||||
// const progressStatus = (parseInt(percent, 10) >= 100 && !('status' in this.props))
|
||||
// ? 'success' : (status || 'normal');
|
||||
const progressStatus= status|| 'normal';
|
||||
let progressInfo;
|
||||
let progress;
|
||||
const textFormatter = format || (percentNumber => `${percentNumber}%`);
|
||||
|
||||
if (showInfo) {
|
||||
let text;
|
||||
const iconType = type === 'circle' ? '' : '-circle';
|
||||
if (progressStatus === 'exception') {
|
||||
text = format ? textFormatter(percent) : <Icon type={`cross${iconType}`} />;
|
||||
} else if (progressStatus === 'success') {
|
||||
text = format ? textFormatter(percent) : <Icon type={`check${iconType}`} />;
|
||||
} else {
|
||||
text = textFormatter(percent);
|
||||
}
|
||||
progressInfo = <span className={`${prefixCls}-text`}>{text}</span>;
|
||||
}
|
||||
|
||||
if (type === 'line') {
|
||||
const percentStyle = {
|
||||
width: `${percent}%`,
|
||||
height: strokeWidth || 10,
|
||||
backgroundColor:progressBg || "#2db7f5"
|
||||
};
|
||||
progress = (
|
||||
<div>
|
||||
<div className={`${prefixCls}-outer`}>
|
||||
<div className={`${prefixCls}-inner`} style={{overflow:"hidden"}}>
|
||||
<div className={`${prefixCls}-bg`} style={percentStyle}></div>
|
||||
</div>
|
||||
</div>
|
||||
{progressInfo}
|
||||
</div>
|
||||
);
|
||||
} else if (type === 'circle') {
|
||||
const circleSize = width || 132;
|
||||
const circleStyle = {
|
||||
width: circleSize,
|
||||
height: circleSize,
|
||||
fontSize: circleSize * 0.16 + 6,
|
||||
};
|
||||
progress = (
|
||||
<div className={`${prefixCls}-inner`} style={circleStyle}>
|
||||
<Circle percent={percent} strokeWidth={strokeWidth || 6}
|
||||
strokeColor={statusColorMap[progressStatus]} trailColor={trailColor}
|
||||
/>
|
||||
{progressInfo}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const classString = classNames({
|
||||
[`${prefixCls}`]: true,
|
||||
[`${prefixCls}-${type}`]: true,
|
||||
[`${prefixCls}-status-${progressStatus}`]: true,
|
||||
[`${prefixCls}-show-info`]: showInfo,
|
||||
[className]: !!className,
|
||||
});
|
||||
|
||||
return (
|
||||
<div {...restProps} className={classString}>
|
||||
{progress}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import {Row, Col, Icon} from 'antd';
|
||||
import './index.less'
|
||||
|
||||
class PrjShowGroup extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showGroup: props.showGroup ? props.showGroup : true
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {title,leftComponent=[],rightComponent=[], children,btnspace} = this.props;
|
||||
const {showGroup} = this.state;
|
||||
return (
|
||||
<div className={`${this.props.className || ''}`}>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@svo88k`} className="prj-exchange-title">
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@zn1jyp`} span="20" className="prj-exchange-title-left">
|
||||
<div>{leftComponent}</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@l9px6l`} span="4" className="prj-exchange-title-right" >
|
||||
<span style={{marginRight:"10px"}}>{rightComponent}</span>
|
||||
<i className={showGroup ? 'icon-coms-up' : 'icon-coms-down'} onClick={()=>this.setState({showGroup:!showGroup})}/>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@mr443s`} className="prj-exchange-content" style={{display:showGroup ? "block":"none"} }>
|
||||
{
|
||||
children
|
||||
}
|
||||
</Row>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default PrjShowGroup
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
.prj-exchange-title{
|
||||
height: 50px;
|
||||
line-height: 50px!important;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
.prj-exchange-title-left{
|
||||
padding-left: 20px;
|
||||
color: #484848;
|
||||
font-weight: 600;
|
||||
}
|
||||
.prj-exchange-title-right{
|
||||
text-align: right;
|
||||
padding-right: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.prj-exchange-content{
|
||||
.prj-exchange-cell-fujian{
|
||||
margin-top: 10px;
|
||||
padding-bottom: 5px;
|
||||
border-bottom: 1px solid #e2e2e2;
|
||||
.wea-form-item{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*全局设置button samll 样式*/
|
||||
.prj-btn-small{
|
||||
padding: 0px 4px;
|
||||
border-radius: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
|
@ -0,0 +1,271 @@
|
|||
import {Table, Icon, Button, Spin, Row, Col,Menu, Dropdown,} from 'antd';
|
||||
import { WeaTools,WeaInput,WeaTextarea,WeaSelect,WeaBrowser,WeaDatePicker,WeaTimePicker,WeaCheckbox,WeaLocaleProvider} from "ecCom"
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import classNames from 'classnames'
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import './index.less'
|
||||
|
||||
//国际化 zxt- 20170419
|
||||
const defaultLocale = {
|
||||
total: getLabel(18609,"共"),
|
||||
totalUnit: getLabel(18256,"条"),
|
||||
};
|
||||
|
||||
|
||||
class Main extends React.Component {
|
||||
//国际化 zxt- 20170419
|
||||
static contextTypes = {
|
||||
antLocale: React.PropTypes.object,
|
||||
}
|
||||
getLocale() {
|
||||
let locale = {};
|
||||
if(this.context.antLocale && this.context.antLocale.Table) {
|
||||
locale = this.context.antLocale.WeaTableEdit;
|
||||
}
|
||||
return {
|
||||
...defaultLocale,
|
||||
...locale,
|
||||
...this.props.locale
|
||||
};
|
||||
}
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
columns: [],
|
||||
datas: [],
|
||||
selectedRowKeys: [],
|
||||
current: 1
|
||||
}
|
||||
this.onEdit = this.onEdit.bind(this);
|
||||
}
|
||||
componentDidMount() {
|
||||
const { datas = [], columns = [] } = this.props;
|
||||
columns.length > 0 && this.setState(datas.length > 0 ? {datas: this.addKeytoDatas(datas),columns} : {columns})
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
const { columns = [], datas = [], selectedRowKeys = [] } = this.props;
|
||||
const _columns = nextProps.columns || [];
|
||||
const _datas = nextProps.datas || [];
|
||||
const _selectedRowKeys = nextProps.selectedRowKeys || [];
|
||||
!isEqual(columns,_columns) && this.setState({columns: _columns});
|
||||
!isEqual(datas,_datas) && this.setState({datas: this.addKeytoDatas(_datas)});
|
||||
!isEqual(selectedRowKeys,_selectedRowKeys) && this.setState({selectedRowKeys: _selectedRowKeys});
|
||||
}
|
||||
componentDidUpdate() {
|
||||
|
||||
}
|
||||
addKeytoDatas(datas){
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = {...data};
|
||||
_data.key = i
|
||||
return _data
|
||||
})
|
||||
return _datas
|
||||
}
|
||||
render() {
|
||||
const { datas } = this.state;
|
||||
const {tableProps} = this.props;
|
||||
return(
|
||||
<div className="wea-table-edit" >
|
||||
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@qvz5qv`}
|
||||
columns={this.getColumns()}
|
||||
dataSource={datas}
|
||||
pagination={this.getPagination()}
|
||||
{...tableProps}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getColumns(){
|
||||
const { columns } = this.state;
|
||||
let _columns = [].concat(columns);
|
||||
_columns = _columns.map(col => {
|
||||
let _col = { ...col };
|
||||
_col.render || (_col.render = ( text, record, index ) => {
|
||||
return this.getColRender( _col, text, record, index );
|
||||
})
|
||||
return _col
|
||||
});
|
||||
return _columns
|
||||
}
|
||||
getColRender( _col, text, record, index ){
|
||||
const { com } = _col;
|
||||
let _com = [];
|
||||
const {onCreatReq, onCreatDoc} = this.props;
|
||||
com.map((c,i) => {
|
||||
if(typeof c.props === 'object'){
|
||||
_com.push(c);
|
||||
}else{
|
||||
const { key, label = '', type = 'INPUT', options = [], browserConditionParam = {}, innerStyle = {width: "100%"},
|
||||
viewAttr = 2 ,showTime = false ,format = "yyyy-MM-dd",otherParams } = c;
|
||||
const _type = type.toUpperCase();
|
||||
let style = _type === 'BROWSER' ? {...innerStyle}:{...innerStyle, display: 'inline-block'}
|
||||
_com.push(
|
||||
<span >
|
||||
{label && <span style={{marginLeft: 5}}>{label}</span>}
|
||||
{ _type === 'INPUT' &&
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@buaw2o@${i}`}
|
||||
{...otherParams}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
style={style}
|
||||
viewAttr={ viewAttr }
|
||||
onBlur={value => this.onEdit(record, index, key, value)} />
|
||||
}
|
||||
{ _type === 'TEXTAREA' &&
|
||||
<WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@71ebix@${i}`}
|
||||
{...otherParams}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
style={style}
|
||||
viewAttr={ viewAttr }
|
||||
onBlur={value => this.onEdit(record, index, key, value)} />
|
||||
}
|
||||
{ _type === 'DATEPICKER' &&
|
||||
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@eaacfu@${i}`}
|
||||
{...otherParams}
|
||||
showTime = {showTime}
|
||||
format = {format}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
style={style}
|
||||
viewAttr={ viewAttr }
|
||||
onChange={value => this.onEdit(record, index, key, value)} />
|
||||
}
|
||||
{ _type === 'TIMEPICKER' &&
|
||||
<WeaTimePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaTimePicker@rm310j@${i}`}
|
||||
{...otherParams}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
style={style}
|
||||
viewAttr={ viewAttr }
|
||||
onChange={value => this.onEdit(record, index, key, value)} />
|
||||
}
|
||||
{ _type === 'SELECT' &&
|
||||
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@qdxe5o@${i}`}
|
||||
{...otherParams}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
options={options}
|
||||
style={style}
|
||||
viewAttr={ viewAttr }
|
||||
onChange={value => this.onEdit(record, index, key, value)} />
|
||||
}
|
||||
{ _type === 'BROWSER' &&
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@w306tg@${i}`}
|
||||
{...otherParams}
|
||||
replaceDatas={this.getBrowerDatas(record, key)}
|
||||
{...browserConditionParam}
|
||||
inputStyle={style}
|
||||
viewAttr={ viewAttr }
|
||||
onChange={(ids, names, bDatas) => this.onEdit(record, index, key, ids, names, bDatas)} />
|
||||
}
|
||||
{ _type === 'CHECKBOX' &&
|
||||
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@79kacl@${i}`}
|
||||
{...otherParams}
|
||||
style={style}
|
||||
value={record[key]}
|
||||
viewAttr={ viewAttr }
|
||||
onChange={(value) => this.onEdit(record, index, key, value)}
|
||||
/>
|
||||
}
|
||||
{
|
||||
_type == "LINK_WF" &&
|
||||
<span className="prj-link-a">
|
||||
<a onClick={()=>onCreatReq(record.wfid,record.taskId)}>{record[key]}</a>({record.requiredWFCount})
|
||||
<span className="prj-content-must" style={{display:(Number(record.requiredWFCount)<=0 &&record.isNecessary=="1" ) ?"inline-block":"none"}}>!</span>
|
||||
</span>
|
||||
}
|
||||
{
|
||||
_type == "LINK_DOC" &&
|
||||
<span className="prj-link-a">
|
||||
<a onClick={()=>onCreatDoc && onCreatDoc(record.reqDocSecCategory,record.taskId)}>{record[key]}</a>({record.requiredDocCount})
|
||||
<span className="prj-content-must" style={{display:(Number(record.requiredDocCount)<=0 &&record.isNecessary=="1" ) ?"inline-block":"none"}}>!</span>
|
||||
</span>
|
||||
}
|
||||
{
|
||||
_type == "OPERATE" &&
|
||||
<Dropdown ecId={`${this && this.props && this.props.ecId || ''}_Dropdown@a7zea6@${i}`} overlay={this.getMenu(record,options,record["ismanager"])} >
|
||||
<a className="ant-dropdown-link">
|
||||
{getLabel(104,"操作")} <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@lkr5wm@${i}`} type="caret-down" />
|
||||
</a>
|
||||
</Dropdown>
|
||||
}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
{_com}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getBrowerDatas(record, key){
|
||||
let replaceDatas = [];
|
||||
if(record[key + 'span'] !== undefined) {
|
||||
let keys = record[key].split(',');
|
||||
let values = record[key + 'span'].split(',');
|
||||
if(keys.length === values.length){
|
||||
keys.map((k, i) => {
|
||||
if (k != '' && values[i] != '') replaceDatas.push({id: k, name: values[i]});
|
||||
});
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
return replaceDatas
|
||||
}
|
||||
getPagination() {
|
||||
const { pageSize = 0, paginationSize = ''} = this.props;
|
||||
if( !pageSize ) return false;
|
||||
const { current } = this.state;
|
||||
const locale = this.getLocale();
|
||||
let obj = {
|
||||
size: paginationSize,
|
||||
current,
|
||||
pageSize,
|
||||
};
|
||||
return obj
|
||||
}
|
||||
onEdit(record, index, key, value, names, bDatas){
|
||||
const { pageSize = 0 } = this.props;
|
||||
const { datas, current } = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
_datas[pageSize * (current - 1) + index][key] = value;
|
||||
if(names) _datas[pageSize * (current - 1) + index][key + 'span'] = names;
|
||||
this.setState({datas: _datas});
|
||||
this.onChange(_datas,index);
|
||||
}
|
||||
onChange(datas,index){
|
||||
const { columns } = this.state;
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = {...data}
|
||||
delete _data.key
|
||||
return _data
|
||||
})
|
||||
typeof this.props.onChange === 'function' && this.props.onChange(_datas[index], columns);
|
||||
}
|
||||
getMenu(record,options,bool){
|
||||
let menu = [];
|
||||
if(options && bool){
|
||||
options.map(item=>{
|
||||
menu.push(
|
||||
<Menu.Item ecId={`${this && this.props && this.props.ecId || ''}_MenuItem@uvdjgu@${item.key}`}>
|
||||
<a href="javascript:void(0)" key={item.key}>{item.showname}</a>
|
||||
</Menu.Item>
|
||||
)
|
||||
})
|
||||
return <Menu ecId={`${this && this.props && this.props.ecId || ''}_Menu@l8nazv`} onClick={()=>this.onMenuClick(record,options)}>
|
||||
{menu}
|
||||
</Menu>
|
||||
}
|
||||
return menu
|
||||
}
|
||||
onMenuClick=(record,options)=>{
|
||||
typeof this.props.operate == "function" && this.props.operate(record);
|
||||
}
|
||||
}
|
||||
|
||||
export default Main;
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
.wea-table-edit .prj-dropdown-link .ant-dropdown-link {
|
||||
color: #484848
|
||||
}
|
||||
.prj-link-a a:link {
|
||||
color: #484848;
|
||||
}
|
||||
.prj-link-a a:hover {
|
||||
color: #038ef6
|
||||
}
|
||||
|
||||
.prj-content-must{
|
||||
color: red;
|
||||
margin-left: 5px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
import { Icon} from 'antd';
|
||||
import React from 'react';
|
||||
import cloneDeep from 'lodash/cloneDeep'
|
||||
import './index.less'
|
||||
|
||||
|
||||
export class PrjTaskLayout extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showLeft:props.defaultShowLeft || true,
|
||||
isHover:false,
|
||||
leftWidth:props.leftWidth || 250,
|
||||
treeWidth:props.treeWidth || 250
|
||||
//showRight:false
|
||||
}
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
if(this.props.showRight !== nextProps.showRight){
|
||||
// this.showright(nextProps.showRight);
|
||||
this.rightShowCo(nextProps.showRight);
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(props){
|
||||
let $this = $(this.refs._container)
|
||||
let handle = $this.find(this.props.handle)
|
||||
// let isDrag = false;
|
||||
// let _timer =
|
||||
$this.click(function(){
|
||||
rightShowCo(false);
|
||||
});
|
||||
|
||||
}
|
||||
leftShowCo(e){
|
||||
const {showLeft,leftWidth,treeWidth} = this.state;
|
||||
const { onLeftChange,leftCom} = this.props;
|
||||
if(showLeft){
|
||||
jQuery(".three-side-right").animate({width:0},300,"linear",onLeftChange && onLeftChange(false))
|
||||
}else{
|
||||
jQuery(".three-side-right").animate({width:leftCom? leftWidth:treeWidth},300,"linear",onLeftChange && onLeftChange(true))
|
||||
}
|
||||
this.setState({showLeft:!showLeft});
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
e.nativeEvent.preventDefault();
|
||||
}
|
||||
|
||||
rightShowCo(showRight){
|
||||
// const {showLeft,leftWidth,treeWidth} = this.state;
|
||||
const { rightCom,rightWidth} = this.props;
|
||||
if(showRight){
|
||||
jQuery(".prj-layout-right").animate({width:0},300,"linear")
|
||||
}else{
|
||||
jQuery(".prj-layout-right").animate({width:rightCom? rightWidth:0},300,"linear")
|
||||
}
|
||||
//this.setState({showLeft:!showLeft});
|
||||
// e.stopPropagation();
|
||||
// e.preventDefault();
|
||||
// e.nativeEvent.preventDefault();
|
||||
}
|
||||
|
||||
render() {
|
||||
const {leftCom,rightCom,rightWidth} = this.props;
|
||||
return (
|
||||
<div className="wea-prj-task-layout">
|
||||
<div className="prj-layout-right" style={{width: 0}}>
|
||||
<div className="prj-layout-board" style={{width:rightWidth}}>
|
||||
<div style={{background:"#fff",height:"100%"}} style={{width:rightWidth}}>
|
||||
{rightCom && rightCom}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="prj-layout-left">
|
||||
<div className="prj-layout-container" rsf="_container">
|
||||
<div style={{background:"#fff",height:"100%"}}>
|
||||
{leftCom && leftCom}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
|
||||
@coms-prefix:coms-mode;
|
||||
|
||||
@coms-height:46px;
|
||||
@coms-small-height:32px;
|
||||
|
||||
|
||||
.wea-prj-task-layout,
|
||||
.wea-prj-task-layout .prj-layout-left,
|
||||
.wea-prj-task-layout .prj-layout-right{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wea-prj-task-layout{
|
||||
background-color: #e8edf4;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.wea-prj-task-layout .prj-layout-left{
|
||||
border-right: 1px solid #ececec;
|
||||
// position: relative;
|
||||
height: 100%;
|
||||
// float: right;
|
||||
// width: 100%;
|
||||
.prj-layout-container{
|
||||
padding: 0 0px 0 1px;
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.wea-prj-task-layout .prj-layout-right{
|
||||
float: right;
|
||||
background-color: brown;
|
||||
box-shadow: -5px 10px 23px 2px rgba(0,0,0,0.3), 0 3px 6px rgba(0,0,0,.15);
|
||||
z-index: 100;
|
||||
.prj-layout-board{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
float: right;
|
||||
border-right: 1px solid #ececec;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,375 @@
|
|||
import {toJS} from "mobx"
|
||||
import {Table,Icon,Row,Col,Button,Modal,InputNumber,message} from 'antd'
|
||||
import {WeaInput,WeaSelect,WeaBrowser,WeaDialog,WeaNewScroll,WeaLocaleProvider,WeaError} from 'ecCom'
|
||||
import './index.less'
|
||||
import equal from "deep-equal"
|
||||
import PrjDateTime from '../prj-data-time'
|
||||
import {datediff,endDateDiff} from '../../../util'
|
||||
import AddProjectDialog from '../../dialog/addProjectDialog'
|
||||
import {AddProjectStore} from "../../../stores/addProjectStore"
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class PrjTaskListTable extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
showModal:false,
|
||||
clickKey:"",
|
||||
datas:props.datas || [],
|
||||
selectedRowKeys: [],
|
||||
taskViewAttr :props.taskViewAttr||"",
|
||||
}
|
||||
this.remind1 = new Array();
|
||||
this.remind2 = new Array();
|
||||
this.remind3 = new Array();
|
||||
}
|
||||
componentDidMount() {
|
||||
const { datas = [], taskViewAttr} = this.props;
|
||||
const newdatas = this.addKeytoDatas(datas);
|
||||
this.setState({datas: this.changeBeforeTask(newdatas),taskViewAttr: taskViewAttr})
|
||||
}
|
||||
componentShouldUpdate(nextProps,nextState){
|
||||
return !equal(this.state,nextState)||!equal(this.props.nextProps)
|
||||
}
|
||||
componentWillReceiveProps(nextProps,nextState) {
|
||||
const { datas = [], selectedRowKeys = [],taskViewAttr } = this.state;
|
||||
const _datas = nextProps.datas || [];
|
||||
const _selectedRowKeys = nextProps.selectedRowKeys || [];
|
||||
const _taskViewAttr = nextProps.taskViewAttr || "";
|
||||
!equal(datas,_datas) && this.setState({datas: this.addKeytoDatas(_datas)});
|
||||
!equal(taskViewAttr,_taskViewAttr) && this.setState({taskViewAttr: _taskViewAttr});
|
||||
!equal(selectedRowKeys,_selectedRowKeys) && this.setState({selectedRowKeys:_selectedRowKeys})
|
||||
}
|
||||
componentWillUnmount(){
|
||||
|
||||
}
|
||||
addKeytoDatas(datas){
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = {...data};
|
||||
_data.key = i+1;
|
||||
_data.rowIndex = i+1;
|
||||
return _data
|
||||
})
|
||||
return _datas
|
||||
}
|
||||
//change 前置任务
|
||||
changeBeforeTask=(datas)=>{
|
||||
let _datas = [].concat(datas);
|
||||
_datas.map(item=>{
|
||||
if(item.beftaskid && item.beftaskid !== "0"){
|
||||
for(let i = 0 ;i < _datas.length; i++){
|
||||
if(_datas[i].realid == item.beftaskid){
|
||||
item.beftaskid = _datas[i].rowIndex;
|
||||
item.beftaskname = _datas[i].name;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return _datas;
|
||||
}
|
||||
render() {
|
||||
const { datas,showModal,taskViewAttr } = this.state;
|
||||
return(
|
||||
<div className="wea-prj-table-edit" >
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@sx63mp`} className="wea-content" >
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@cda1ng`} span={24}>
|
||||
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@d7n4g1`}
|
||||
columns={this.getColumns()}
|
||||
dataSource={datas}
|
||||
pagination={false}
|
||||
rowSelection={this.getRowSelection()}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@5oqo02`}
|
||||
style={{width: 700,height:450}}
|
||||
visible={showModal}
|
||||
title={getLabel(2233,"前置任务")}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
buttons={this.getButtons()}
|
||||
onCancel={() => this.setState({showModal:false})}
|
||||
|
||||
>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@2yn1pq`} scrollId='wea-prj-table-edit-scroll' height={"100%"}>
|
||||
<div className="wea-prj-table-edit">
|
||||
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@f2menu`}
|
||||
columns={this.getModalColumns()}
|
||||
dataSource={datas}
|
||||
pagination={false}
|
||||
onRowClick={this.onRowClick}
|
||||
/>
|
||||
</div>
|
||||
</WeaNewScroll>
|
||||
</WeaDialog>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getColumns(){
|
||||
const {taskViewAttr } = this.state;
|
||||
const { stageOptions, isTimeShow } = this.props;
|
||||
let dis = true;
|
||||
if(taskViewAttr==2){
|
||||
dis = false;
|
||||
}
|
||||
return [{
|
||||
title: getLabel(15486,"序号"),
|
||||
dataIndex: 'rowIndex',
|
||||
width:"5%",
|
||||
render: (text, record, index ) => {return <span>{text}</span>},
|
||||
}, {
|
||||
title: getLabel(1352,"任务名称"),
|
||||
dataIndex: 'name',
|
||||
width:"20%",
|
||||
render: (text, record, index ) => <span>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@qsxsqs`}
|
||||
ref={(ref) => {
|
||||
this.remind1.push(ref);
|
||||
}}
|
||||
error={getLabel(385869,"此项必填")}
|
||||
tipPosition="top"
|
||||
>
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@3x0rh7`}
|
||||
value={text}
|
||||
viewAttr={3}
|
||||
style={{display: 'inline-block'}}
|
||||
onChange={value => this.onEdit(record, index,"name" , value)}
|
||||
/>
|
||||
</WeaError>
|
||||
</span>,
|
||||
}, {
|
||||
title: getLabel('24902','阶段') ,
|
||||
dataIndex: 'stageid',
|
||||
width:"10%",
|
||||
render: (text, record, index ) => {
|
||||
return <span>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@06fs56`}
|
||||
ref={(ref) => {
|
||||
this.remind2.push(ref);
|
||||
}}
|
||||
error={getLabel(385869,"此项必填")}
|
||||
tipPosition="top"
|
||||
>
|
||||
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@bwp8cv`}
|
||||
options={stageOptions}
|
||||
value={record.stageid == -1 ? "" : record.stageid}
|
||||
viewAttr={3}
|
||||
onChange={value => this.onEdit(record, index,"stageid" , value)}
|
||||
style={{width:80}}
|
||||
/>
|
||||
</WeaError>
|
||||
</span>},
|
||||
}, {
|
||||
title: getLabel(1298,"工期"),
|
||||
dataIndex: 'workday',
|
||||
width:"5%",
|
||||
render:(text, record, index)=><span>
|
||||
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@ia2kye`} disabled={dis} value={text} min={0} max={999999} precision={2} step={1}
|
||||
onChange={value => this.onEdit(record, index,"workday" , value)} />
|
||||
</span>
|
||||
}, {
|
||||
title: getLabel(742,"开始时间"),
|
||||
dataIndex: 'begindate',
|
||||
width:"15%",
|
||||
render:(text, record, index)=><span>
|
||||
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@kzu9r4`} {...{
|
||||
"viewAttr": taskViewAttr,
|
||||
"value":[text,record.begintime || "00:00"],
|
||||
"otherParams":{
|
||||
"noInput":true
|
||||
},
|
||||
"isTimeShow":isTimeShow
|
||||
}}
|
||||
endValue ={ new Date(record["enddate"])}
|
||||
/>
|
||||
</span>//onChange={(v)=>{this.timeComputed(v,"begin",index)}}
|
||||
}, {
|
||||
title: getLabel(743,"结束时间"),
|
||||
dataIndex: 'enddate',
|
||||
width:"15%",
|
||||
render:(text, record, index)=><span>
|
||||
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@25ibhr`} {...{
|
||||
"viewAttr": taskViewAttr,
|
||||
"value": [text,record.endtime || "23:59"],
|
||||
"otherParams":{
|
||||
"noInput":true
|
||||
},
|
||||
"isTimeShow":isTimeShow
|
||||
}}
|
||||
startValue ={ new Date(record["begindate"])}
|
||||
/>
|
||||
</span>//onChange={(v)=>{this.timeComputed(v,"end",index)}}
|
||||
}, {
|
||||
title: getLabel(2233,"前置任务"),
|
||||
dataIndex: 'beftaskid',
|
||||
width:"15%",
|
||||
render:(text, record, index)=><span style={{whiteSpace:"nowrap"}}>
|
||||
<span>
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@pfxwfo`}
|
||||
viewAttr={1}
|
||||
hasBorder={true}
|
||||
value={record.beftaskname}
|
||||
/>
|
||||
</span>
|
||||
{!dis&&<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@h20ka6`} type="search" className="icon-selebeforetask" style={{marginBottom:8}} onClick={()=>this.setState({showModal:true,clickKey:record.key})}/>}
|
||||
</span>
|
||||
},{
|
||||
title: getLabel(2097,"负责人"),
|
||||
dataIndex: 'hrmid',
|
||||
width:"20%",
|
||||
render:(text, record, index)=><span>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@v4ox9q`}
|
||||
ref={(ref) => {
|
||||
this.remind3.push(ref);
|
||||
}}
|
||||
error={getLabel(385869,"此项必填")}
|
||||
tipPosition="top"
|
||||
style={{width:90}}
|
||||
>
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@fbsld9`}
|
||||
viewAttr={3}
|
||||
type={17}
|
||||
isSingle={false}
|
||||
onChange={(ids, names, bDatas) =>{this.onEdit( record, index,"hrmid",ids, names, bDatas)}}
|
||||
replaceDatas={[{id: text, name: record.hrmname}]}
|
||||
/>
|
||||
</WeaError>
|
||||
</span>
|
||||
}];
|
||||
}
|
||||
|
||||
onEdit= (record, index,name , value,names,bDatas) =>{
|
||||
let that = this;
|
||||
const {clickKey,datas} = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
if(name == "hrmid"){
|
||||
_datas[index][name] = value ;
|
||||
_datas[index]["hrmname"] = names ;
|
||||
}else{
|
||||
_datas[index][name] = value ;
|
||||
}
|
||||
if(name == "workday") {
|
||||
let res = "2023-09-09";
|
||||
//接口计算
|
||||
res = endDateDiff(record.begindate,value)
|
||||
_datas[index]["enddate"] = res
|
||||
}
|
||||
|
||||
this.setState({datas : _datas});
|
||||
this.onChange(_datas);
|
||||
}
|
||||
|
||||
getButtons(){
|
||||
let btn = [];
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v9lfoi@clear`} type="primary" onClick={()=>this.onClear()}>{getLabel(311,"清除")}</Button>);
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@zb9ozk@close`} type="primary" onClick={()=>this.setState({showModal:false,clickKey:""})}>{getLabel(309,"关闭")}</Button>);
|
||||
return btn;
|
||||
}
|
||||
getModalColumns(){
|
||||
return [{
|
||||
title: getLabel(15486,"序号"),
|
||||
dataIndex: 'rowIndex',
|
||||
width:"15%",
|
||||
render: (text, record, index ) =><span style={{marginLeft:5}}>{text}</span>,
|
||||
}, {
|
||||
title: getLabel(1352,"任务名称"),
|
||||
dataIndex: 'name',
|
||||
width:"85%",
|
||||
render: (text, record, index ) => <span>{text}</span>,
|
||||
}]
|
||||
}
|
||||
onRowClick=(record, index)=>{
|
||||
let that = this;
|
||||
const {clickKey,datas} = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
if(record.key == clickKey){
|
||||
// Modal.warning({
|
||||
// title: getLabel(15172,"系统提示"),
|
||||
// content: getLabel(24468,"不能把本身设置为前置任务!"),
|
||||
// onOk() {
|
||||
// that.setState({showModal:false,clickKey:""})
|
||||
// }
|
||||
// })
|
||||
message.error(getLabel(24468,"不能把本身设置为前置任务!"));
|
||||
that.setState({showModal:false,clickKey:""});
|
||||
}else{
|
||||
_datas[clickKey-1].beftaskname = record.name;
|
||||
_datas[clickKey-1].beftaskid = record.rowIndex;
|
||||
that.setState({showModal:false,clickKey:"",datas :_datas})
|
||||
this.onChange(_datas);
|
||||
}
|
||||
}
|
||||
|
||||
onClear=()=>{
|
||||
let that = this;
|
||||
const {clickKey,datas} = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
_datas[clickKey-1].beftaskname = "";
|
||||
_datas[clickKey-1].beftaskid = "";
|
||||
that.setState({showModal:false,clickKey:"",datas :_datas})
|
||||
this.onChange(_datas);
|
||||
}
|
||||
|
||||
//计算工期
|
||||
timeComputed= (arg,type,index) =>{
|
||||
const {userid ,isworkday} = this.props;
|
||||
const {datas} = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
let res = "";
|
||||
if(type == "begin"){
|
||||
let time = "";
|
||||
if(!arg[1]){time = "00:00" }else{time = arg[1]}
|
||||
if( _datas[index]["enddate"] && arg[0] ){
|
||||
res = datediff(arg[0],_datas[index]["enddate"],time,_datas[index]["endtime"] || "23:59",userid,isworkday);
|
||||
}
|
||||
_datas[index]["begindate"] = arg[0]
|
||||
_datas[index]["begintime"] = time;
|
||||
}else{
|
||||
let time = "";
|
||||
if(!arg[1]){time = "00:00"}else{time = arg[1]}
|
||||
if(_datas[index]['begindate'] && arg[0] ){
|
||||
res = datediff(_datas[index]['begindate'],arg[0],_datas[index]['begintime'] || "00:00",time,userid,isworkday);
|
||||
}
|
||||
_datas[index]["enddate"] = arg[0]
|
||||
_datas[index]["endtime"] = time;
|
||||
}
|
||||
_datas[index].workday = res;
|
||||
this.setState({datas:_datas})
|
||||
this.onChange(_datas);
|
||||
}
|
||||
|
||||
getRowSelection(){
|
||||
let that = this;
|
||||
const rowSelection = {
|
||||
onChange(selectedRowKeys, selectedRows) {
|
||||
typeof that.props.onRowSelect === 'function' && that.props.onRowSelect(selectedRowKeys);
|
||||
},
|
||||
selectedRowKeys:that.props.selectedRowKeys
|
||||
}
|
||||
return rowSelection
|
||||
}
|
||||
|
||||
onChange(datas){
|
||||
typeof this.props.onChange === 'function' && this.props.onChange(datas);
|
||||
}
|
||||
|
||||
showErrors() {
|
||||
toJS(this.remind1).map(c => {
|
||||
if (c && !c.props.children.props.value && c.props.children.props.viewAttr == "3") {
|
||||
c.showError();
|
||||
}
|
||||
});
|
||||
toJS(this.remind2).map(c => {
|
||||
if (c && !c.props.children.props.value && c.props.children.props.viewAttr == "3") {
|
||||
c.showError();
|
||||
}
|
||||
});
|
||||
toJS(this.remind3).map(c => {
|
||||
if(c&&c.props.children.props.replaceDatas&&(c.props.children.props.replaceDatas[0]?!c.props.children.props.replaceDatas[0].id:!c.props.children.props.replaceDatas[0])&&c.props.children.props.viewAttr=="3"){
|
||||
c.showError();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default PrjTaskListTable;
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
|
||||
.wea-prj-table-edit .ant-table-tbody>tr>td {
|
||||
padding: 10px 8px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.wea-prj-table-edit .ant-table-thead>tr>th {
|
||||
background-color: #f8fcff;
|
||||
}
|
||||
.wea-prj-table-edit .ant-table-thead>tr>th {
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
.wea-prj-table-edit .ant-table-thead th {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
font-weight: 400;
|
||||
}
|
||||
.wea-prj-table-edit .ant-table,.wea-prj-table-edit .ant-table table {
|
||||
border-radius: 0;
|
||||
}
|
||||
.wea-prj-table-edit .icon-selebeforetask:hover{
|
||||
color: #038ef6
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import React from 'react';
|
||||
// import ButtonView from '../view-button';
|
||||
// import { ListItemProps } from '../../stores/mode-app/BaseStore';
|
||||
import classNames from 'classnames';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
// export interface ListItemCompProps {
|
||||
// data: ListItemProps;
|
||||
// onClick?: (key: string,special:any) => void;
|
||||
// showIcon?: boolean;
|
||||
// currentKey?:string
|
||||
// }
|
||||
export default class ListItem extends React.Component {
|
||||
onClick = () => {
|
||||
const { data, onClick } = this.props;
|
||||
onClick && onClick(data.key, data.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { data, currentKey } = this.props;
|
||||
const className = classNames('task-list-item-content');
|
||||
let isCurrent = currentKey && currentKey == data.key;
|
||||
return (
|
||||
<div
|
||||
component="span"
|
||||
className="task-list-item"
|
||||
onClick={this.onClick}
|
||||
>
|
||||
<div style={isCurrent ? { 'background-color': '#def0ff' } : {}}>
|
||||
<div className={className}>
|
||||
{/* <div className="name-state" style={{backgroundColor:data.color}}>{data.state}</div> */}
|
||||
<div className="task-list-item-content-top">
|
||||
<div className="name-wrapper" title={data.subject} dangerouslySetInnerHTML={{__html: data.subject}} ></div>
|
||||
<div className="subname-wrapper">
|
||||
{ data.islandmark ? <span className={"tip "}>{getLabel('19173','里程碑')}</span> : <span className={"tip"}>{getLabel('2086','普通')}</span>}
|
||||
{ data.cnum > 0 && <span className={"tip"}>{data.cfnum}/{data.cnum}</span>}
|
||||
{data.isfinish && <span className={"tip-status finish"}>{getLabel(23774,"已完成")}</span>}
|
||||
{data.islater && <span className={"tip-status later"}>{getLabel('1982','超期') }{data.laterDays > 0 && <span>{data.laterDays}{getLabel('1925','天')}</span>}</span>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
import React from 'react';
|
||||
import { WeaNewScroll, WeaInputSearch } from 'ecCom';
|
||||
import { Pagination } from 'antd';
|
||||
import ListItem from './ListItem';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export default class ListView extends React.Component {
|
||||
|
||||
render() {
|
||||
const { datas, pagination, scrollHeight = document.documentElement.clientHeight, currentKey } = this.props;
|
||||
return (
|
||||
<div className="task-list-view">
|
||||
{/* <WeaInputSearch
|
||||
value={prjValue}
|
||||
style={{ margin: '5px 15px', width: 'calc(100% - 30px)' }}
|
||||
placeholder={getLabel('83788',"请输入关键字搜索")}
|
||||
onSearch={onSearchListItem}
|
||||
onSearchChange={onSearchChange}
|
||||
/> */}
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@j79f6c`}
|
||||
height={scrollHeight - 65}
|
||||
>
|
||||
{datas.length === 0 ?
|
||||
<p style={{ textAlign: 'center', color: '#999', marginTop: 10 }} >
|
||||
<i className='icon-coms-Invalid' /> {getLabel('83553',"暂无数据")}
|
||||
</p>
|
||||
:
|
||||
<div className="task-list-view-content">
|
||||
{
|
||||
datas && datas.length > 0 && datas.map(d => (
|
||||
<ListItem ecId={`${this && this.props && this.props.ecId || ''}_ListItem@9fejh6`} currentKey={currentKey} data={d} onClick={this.props.onItemClick} />
|
||||
))
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</WeaNewScroll>
|
||||
<div >
|
||||
<Pagination ecId={`${this && this.props && this.props.ecId || ''}_Pagination@ufioxb`}
|
||||
{...pagination}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import React from 'react';
|
||||
// import ButtonView from '../view-button';
|
||||
// import { ListItemProps } from '../../stores/mode-app/BaseStore';
|
||||
import classNames from 'classnames';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
// export interface ListItemCompProps {
|
||||
// data: ListItemProps;
|
||||
// onClick?: (key: string,special:any) => void;
|
||||
// showIcon?: boolean;
|
||||
// currentKey?:string
|
||||
// }
|
||||
export default class ListItem extends React.Component {
|
||||
onClick = () => {
|
||||
const { data, onClick } = this.props;
|
||||
onClick && onClick(data.key, data.special);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { data, currentKey } = this.props;
|
||||
const className = classNames('prj-list-item-content');
|
||||
let isCurrent = currentKey && currentKey == data.key;
|
||||
return (
|
||||
<div
|
||||
component="span"
|
||||
className="prj-list-item"
|
||||
onClick={this.onClick}
|
||||
>
|
||||
<div style={isCurrent ? { 'background-color': '#def0ff' } : {}}>
|
||||
<div className={className}>
|
||||
<div className="name-state" style={{backgroundColor:data.color}}>{data.state}</div>
|
||||
<div className="prj-list-item-content-top">
|
||||
<div className="name-wrapper" title={data.name}>{data.name}</div>
|
||||
<div className="subname-wrapper">
|
||||
<span>{`${data.label + " : "+ data.person }`}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
import React from 'react';
|
||||
import { WeaNewScroll, WeaInputSearch } from 'ecCom';
|
||||
import { Pagination } from 'antd';
|
||||
import ListItem from './ListItem';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export default class ListView extends React.Component {
|
||||
|
||||
render() {
|
||||
const { datas, pagination, scrollHeight = document.documentElement.clientHeight, currentKey, onSearchListItem, onSearchChange, prjValue, fromPortal } = this.props;
|
||||
return (
|
||||
<div className="prj-list-view">
|
||||
{
|
||||
!fromPortal&&<WeaInputSearch ecId={`${this && this.props && this.props.ecId || ''}_WeaInputSearch@i01det`}
|
||||
value={prjValue}
|
||||
style={{ margin: '5px 15px', width: 'calc(100% - 30px)' }}
|
||||
placeholder={getLabel('83788',"请输入关键字搜索")}
|
||||
onSearch={onSearchListItem}
|
||||
onSearchChange={onSearchChange}
|
||||
/>
|
||||
}
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@vpun7w`}
|
||||
height={scrollHeight - 140}
|
||||
>
|
||||
{datas.length === 0 ?
|
||||
<p style={{ textAlign: 'center', color: '#999', marginTop: 10 }} >
|
||||
<i className='icon-coms-Invalid' /> {getLabel('83553',"暂无数据")}
|
||||
</p>
|
||||
:
|
||||
<div className="prj-list-view-content">
|
||||
{
|
||||
datas && datas.length > 0 && datas.map(d => (
|
||||
<ListItem ecId={`${this && this.props && this.props.ecId || ''}_ListItem@hifwd6`} currentKey={currentKey} data={d} onClick={this.props.onItemClick} />
|
||||
))
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
</WeaNewScroll>
|
||||
<div >
|
||||
<Pagination ecId={`${this && this.props && this.props.ecId || ''}_Pagination@26ztl6`}
|
||||
{...pagination}
|
||||
size="small"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
|
||||
import dragula from 'react-dragula';
|
||||
import isFunction from 'lodash/isFunction';
|
||||
import findIndex from 'lodash/findIndex';
|
||||
|
||||
class WeaPrjDragula extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.drake = null;
|
||||
}
|
||||
componentDidMount() {
|
||||
this.initDragula();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.drake && this.drake.destroy();
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.props.children;
|
||||
}
|
||||
|
||||
initDragula = () => {
|
||||
let {container,canDrag, onDrop, getKeyFromDom, getKeyFromData} = this.props;
|
||||
if (typeof(container) == "string") {
|
||||
container = jQuery(container, ReactDOM.findDOMNode(this))[0];
|
||||
} else if (isFunction(container)) {
|
||||
container = container();
|
||||
}
|
||||
this.drake = dragula([container], {
|
||||
isContainer: function (el) {
|
||||
return false;
|
||||
},
|
||||
moves: (el, source, handle, sibling) => {
|
||||
return isFunction(canDrag) ? canDrag(handle, el, source, sibling) : canDrag;
|
||||
},
|
||||
mirrorContainer: container
|
||||
});
|
||||
this.drake.on("drop",(el, target, source, sibling) => {
|
||||
|
||||
let {datas} = this.props;
|
||||
if (Array.isArray(datas) && isFunction(getKeyFromDom) && isFunction(getKeyFromData) && isFunction(onDrop)) {
|
||||
let dataKey = getKeyFromDom(el), downKey = sibling ? getKeyFromDom(sibling) : -1;
|
||||
if (downKey == dataKey) {
|
||||
downKey = -1;
|
||||
}
|
||||
let dataIdx = findIndex(datas, (data) => getKeyFromData(data) == dataKey);
|
||||
let downIdx = downKey == -1 ? datas.length : findIndex(datas, (data) => getKeyFromData(data) == downKey);
|
||||
downIdx = downIdx > dataIdx ? downIdx - 1 : downIdx;
|
||||
let data = datas.splice(dataIdx, 1)[0];
|
||||
datas.splice(downIdx, 0, data);
|
||||
|
||||
/*
|
||||
// 遍历并返回新的数据
|
||||
let curData = null;
|
||||
datas = datas.map((data, index) => {
|
||||
if (this.getRowKey(data) == key) {
|
||||
dataIdx = index;
|
||||
curData = data;
|
||||
}
|
||||
if (downKey !== -1 && downKey == this.getRowKey(data)) {
|
||||
downIdx = dataIdx >= 0 ? index - 1 : index;
|
||||
}
|
||||
if (dataIdx == -1 && downIdx == -1) {
|
||||
// 当前与放置的index都没找到,说明未到影响区
|
||||
return data;
|
||||
} else if (dataIdx >=0 && downIdx == -1) {
|
||||
// 找到当前的但没有找到放置位置,需要将下方数据上移一位
|
||||
return index == datas.length - 1 ? datas[dataIdx] : datas[index + 1];
|
||||
} else if (dataIdx == -1 && downIdx >=0) {
|
||||
// 找到放置位置但没有找到当前的,需要将上方数据下移一位
|
||||
return downIdx == index ? null : datas[index - 1];
|
||||
} else {
|
||||
// 都找到之后,如果相等,则做下特殊处理,如果不等,说明已过影响区
|
||||
return index == downIdx ? curData : index == dataIdx ? datas[index - 1] : data;
|
||||
}
|
||||
});
|
||||
// 处理放置位置的数据。
|
||||
datas[downIdx] = curData;*/
|
||||
onDrop(datas, dataIdx, downIdx);
|
||||
} else {
|
||||
isFunction(onDrop) && onDrop(el, sibling, target, source);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
WeaPrjDragula.propTypes = {
|
||||
container: React.PropTypes.any,//可拖拽区域
|
||||
canDrag: React.PropTypes.any,//是否可拖拽,可以传方法,方法的传参为当前点击的节点。
|
||||
onDrop: React.PropTypes.func,//拖拽结束时触发的方法,第1个参数是拖拽的DOM节点,第二个参数是所放下的位置下方的DOM节点。
|
||||
datas: React.PropTypes.array,//数组
|
||||
getKeyFromData: React.PropTypes.func,//从数组中获得key的方法。
|
||||
getKeyFromDom: React.PropTypes.func,//从Dom中获得key的方法
|
||||
};
|
||||
|
||||
export default WeaPrjDragula;
|
||||
|
|
@ -0,0 +1,317 @@
|
|||
import { Table, Icon, Row, Col, Button } from 'antd'
|
||||
import { WeaTools, WeaCascader, WeaSelect, WeaError } from 'ecCom'
|
||||
import equal from 'deep-equal';
|
||||
import isFunction from 'lodash/isFunction';
|
||||
import { Modal } from "antd";
|
||||
import { toJS } from "mobx"
|
||||
import './style/index.css';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class WeaPrjFieldSetTableEdit extends React.Component {
|
||||
|
||||
select = new Array();
|
||||
cascader;
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
columns: [],
|
||||
datas: [],
|
||||
selectedRowKeys: [],
|
||||
current: 1,
|
||||
showGroup: props.showGroup ? props.showGroup : false
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
const { datas = [], columns = [] } = this.props;
|
||||
columns.length > 0 && this.setState(datas.length > 0 ? { datas: this.addKeytoDatas(datas), columns } : { columns })
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextState) {
|
||||
const _columns = nextProps.columns || [];
|
||||
const _showGroup = nextProps.showGroup || false;
|
||||
const _datas = nextProps.datas || [];
|
||||
!equal(_columns, this.props.columns) && this.setState({ columns: _columns });
|
||||
!equal(_showGroup, this.state.showGroup) && this.setState({ showGroup: _showGroup });
|
||||
if (!equal(_datas, this.state.datas)) {
|
||||
this.setState({ datas: this.addKeytoDatas(_datas) });
|
||||
}
|
||||
}
|
||||
addKeytoDatas(datas) {
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = { ...data };
|
||||
_data.key = i;
|
||||
return _data
|
||||
})
|
||||
return _datas
|
||||
}
|
||||
render() {
|
||||
const { datas, showGroup, selectedRowKeys } = this.state;
|
||||
const { title, needAdd } = this.props;
|
||||
return (
|
||||
<div className="wea-cpt-table-edit-wf" >
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@z3eftp`} className="wea-title">
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@k6y05j`} span="20">
|
||||
<div>{title}</div>
|
||||
</Col>
|
||||
{needAdd &&
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@kajxhb`} span="4" style={{ textAlign: "right", paddingRight: 10, fontSize: 12 }}>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@n00gdf`} type="primary" title={getLabel(1421, '新增')} size="small" onClick={this.doAdd}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@p96a4z`} type="plus" /></Button>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ib9xew`} type="primary" disabled={!`${selectedRowKeys}`} title={getLabel(91, '删除')} size="small" onClick={this.doDelete} ><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@eiu3q4`} type="minus" /></Button>
|
||||
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@1al7yy`} type={showGroup ? 'up' : 'down'} onClick={() => this.setState({ showGroup: !showGroup })} />
|
||||
</Col>
|
||||
}
|
||||
</Row>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@tyousk`} className="wea-content" style={{ display: showGroup ? "block" : "none" }}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@rz8upw`} span={24}>
|
||||
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@aaach7`}
|
||||
columns={this.getColumns()}
|
||||
dataSource={datas}
|
||||
pagination={false}
|
||||
rowSelection={needAdd ? this.getRowSelection() : false}
|
||||
ref='edit'
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getColumns() {
|
||||
const { columns } = this.state;
|
||||
let _columns = [].concat(columns);
|
||||
_columns = _columns.map(col => {
|
||||
let _col = { ...col };
|
||||
|
||||
_col.render = (text, record, index) => {
|
||||
return this.getColRender(_col, text, record, index);
|
||||
}
|
||||
return _col
|
||||
});
|
||||
return _columns
|
||||
}
|
||||
|
||||
getColRender(_col, text, record, index) {
|
||||
const { com, isTask = false, useRecord = false, dataIndex, } = _col;
|
||||
const { wftype, notwfid } = this.props;
|
||||
const { datas } = this.state;
|
||||
let _com = [];
|
||||
let list = (useRecord && record.com ? record.com[dataIndex] : com) || [];
|
||||
list.map((c,i) => {
|
||||
if (typeof c.props === 'object') {
|
||||
_com.push(c);
|
||||
} else {
|
||||
let { key, label = '', type = 'INPUT', options = [], browserConditionParam = {}, innerStyle = { width: "100%" },
|
||||
viewAttr = 2, showTime = false, format = "yyyy-MM-dd", compDef, onChange, otherParams, title } = c;
|
||||
const _type = type.toUpperCase();
|
||||
_com.push(
|
||||
<span>
|
||||
{_type === 'TEXT' && <span>{text}</span>
|
||||
}
|
||||
{_type === 'SELECT' && isTask &&//任务字段
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@p15dmf@${i}`}
|
||||
ref={ (ref) => {
|
||||
this.select.push(ref);
|
||||
} }
|
||||
error={getLabel(385869,"此项必填")}
|
||||
tipPosition="top"
|
||||
style={{width:"100%"}}
|
||||
>
|
||||
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@tm2cle@${i}`}
|
||||
{...otherParams}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
options={options}
|
||||
style={innerStyle}
|
||||
viewAttr={viewAttr}
|
||||
hasBorder={true}
|
||||
onChange={value => this.onEdit({ record, index, key, value }, onChange, "getfield")}
|
||||
/>
|
||||
</WeaError>
|
||||
}
|
||||
{_type === 'SELECT' && !isTask &&//wbs字段
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@ph8uvk@${i}`}
|
||||
ref={ (ref) => {
|
||||
this.select.push(ref);
|
||||
} }
|
||||
error={getLabel(385869,"此项必填")}
|
||||
tipPosition="top"
|
||||
style={{width:"100%"}}
|
||||
>
|
||||
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@j06x87@${i}`}
|
||||
{...otherParams}
|
||||
defaultValue={record[key]}
|
||||
value={record[key]}
|
||||
options={options}
|
||||
style={{ width: "95%" }}
|
||||
viewAttr={viewAttr}
|
||||
hasBorder={true}
|
||||
onChange={value => this.onEdit({ record, index, key, value }, onChange)}
|
||||
/>
|
||||
</WeaError>
|
||||
}
|
||||
{_type === 'CASCADER' &&
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@lv3zl5@${i}`}
|
||||
ref={ (ref) => {
|
||||
this.cascader=ref;
|
||||
} }
|
||||
error={getLabel(385869,"此项必填")}
|
||||
tipPosition="top"
|
||||
style={{width:"100%"}}
|
||||
>
|
||||
<WeaCascader ecId={`${this && this.props && this.props.ecId || ''}_WeaCascader@j3bpjr@${i}`}
|
||||
{...otherParams}
|
||||
compDef={toJS(compDef)}
|
||||
values={record[key]}
|
||||
valueIsObject={true}
|
||||
onChange={(value) => this.onEdit({ record, index, key, value }, onChange)}
|
||||
/>
|
||||
</WeaError>
|
||||
}
|
||||
</span>
|
||||
)
|
||||
}
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
{_com}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
getBrowerDatas(record, key) {
|
||||
let replaceDatas = [];
|
||||
if (record[key + 'span'] !== undefined) {
|
||||
let keys = record[key].split(',');
|
||||
let values = record[key + 'span'].split(',');
|
||||
if (keys.length === values.length) {
|
||||
keys.map((k, i) => {
|
||||
replaceDatas.push({ id: k, name: values[i] });
|
||||
});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
return replaceDatas
|
||||
}
|
||||
getRowSelection() {
|
||||
const { columns, selectedRowKeys } = this.state;
|
||||
const { onRowSelect, getRowSelection } = this.props;
|
||||
if (!`${columns}`) return null;
|
||||
let rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (sRowKeys, selectedRows) => {
|
||||
this.setState({ selectedRowKeys: sRowKeys });
|
||||
typeof onRowSelect === 'function' && onRowSelect(sRowKeys, selectedRows);
|
||||
},
|
||||
};
|
||||
if (typeof getRowSelection === 'function') {
|
||||
rowSelection = getRowSelection(rowSelection);
|
||||
}
|
||||
return rowSelection;
|
||||
}
|
||||
|
||||
onEdit({ record, index, key, value, names, bDatas }, onChange, api) {
|
||||
const { pageSize = 0, contentStore } = this.props;
|
||||
const { datas, current } = this.state;
|
||||
let _datas = [].concat(datas);
|
||||
_datas[pageSize * (current - 1) + index][key] = value;
|
||||
if (names) _datas[pageSize * (current - 1) + index][key + 'span'] = names;
|
||||
let fieldname = _datas[index]['taskfield'];
|
||||
const params = {fieldname: fieldname }
|
||||
|
||||
if (api && api == "getfield") {
|
||||
WeaTools.callApi("/api/proj/prjutil/getWbsFieldNum", "POST", { ...params}).then((datas) => {
|
||||
const options = datas.options;
|
||||
_datas[index]["com"] = {
|
||||
..._datas[index]["com"],
|
||||
"wbsfield": [{
|
||||
"label": "",
|
||||
"type": "SELECT",
|
||||
"key": "wbsfield",
|
||||
"editType": "3",
|
||||
"options": options
|
||||
}]
|
||||
}
|
||||
_datas[index]["wbsfield"] = "";
|
||||
this.setState({ datas: _datas });
|
||||
})
|
||||
}
|
||||
this.onChange(_datas);
|
||||
isFunction(onChange) && onChange(value, record, index, key);
|
||||
}
|
||||
|
||||
doAdd = () => {
|
||||
let { datas, columns } = this.state;
|
||||
let _data = {};
|
||||
columns.forEach((col, index) => {
|
||||
const { com = [], useRecord = false, dataIndex } = col;
|
||||
com.map(c => {
|
||||
if (typeof c.props === 'object') {
|
||||
return;
|
||||
}
|
||||
const { key: k, defaultValue } = c;
|
||||
k && (_data[k] = defaultValue || '');
|
||||
});
|
||||
_data.com = {
|
||||
..._data.com,
|
||||
[dataIndex]: com
|
||||
}
|
||||
_data.viewAttr = "3";
|
||||
});
|
||||
let _datas = [].concat(datas);
|
||||
_datas.push(_data);
|
||||
this.setState({ datas: this.addKeytoDatas(_datas) });
|
||||
this.onChange(_datas);
|
||||
}
|
||||
|
||||
doDelete = () => {
|
||||
const { datas, selectedRowKeys } = this.state;
|
||||
const _this = this;
|
||||
if (selectedRowKeys.length > 0) {
|
||||
Modal.confirm({
|
||||
title: getLabel(15172, '系统提示'),
|
||||
content: getLabel(83600, '确定要删除吗?'),
|
||||
onOk() {
|
||||
let _datas = [].concat(datas);
|
||||
selectedRowKeys.map(key => {
|
||||
_datas = _datas.filter(data => data.key !== key)
|
||||
});
|
||||
_datas = _datas.map((data, i) => {
|
||||
let _data = { ...data };
|
||||
_data.key = i;
|
||||
return _data
|
||||
})
|
||||
_this.setState({ datas: _datas, selectedRowKeys: [] });
|
||||
_this.onChange(_datas);
|
||||
typeof _this.props.onRowSelect === 'function' && _this.props.onRowSelect([]);
|
||||
},
|
||||
onCancel() { },
|
||||
});
|
||||
} else {
|
||||
Modal.info({
|
||||
title: getLabel(15172, '系统提示'),
|
||||
content: getLabel(32568, "请选择要删除的记录!")
|
||||
});
|
||||
}
|
||||
}
|
||||
onChange(datas) {
|
||||
const { columns } = this.state;
|
||||
let _datas = datas.map((data, i) => {
|
||||
let _data = { ...data }
|
||||
delete _data.key
|
||||
return _data
|
||||
})
|
||||
typeof this.props.onChange === 'function' && this.props.onChange(_datas, columns);
|
||||
}
|
||||
showErrors() {
|
||||
toJS(this.select).map(c => {
|
||||
if (c && !c.props.children.props.value && c.props.children.props.viewAttr == "3") {
|
||||
c.showError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default WeaPrjFieldSetTableEdit;
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
.wea-cpt-table-edit{
|
||||
padding-top: 20px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
}
|
||||
.wea-cpt-table-edit .wea-title {
|
||||
font-size: 15px;
|
||||
color: #484848;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
border-bottom: solid 1px #ebebeb;
|
||||
}
|
||||
.wea-cpt-table-edit .wea-title i {
|
||||
cursor: pointer;
|
||||
}
|
||||
.wea-cpt-table-edit .wea-title button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.wea-cpt-table-edit .ant-table-tbody>tr>td {
|
||||
padding: 10px 8px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.table-edit-opertion button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.wea-cpt-table-edit .ant-table-thead>tr>th {
|
||||
background-color: #f8fcff;
|
||||
}
|
||||
.wea-cpt-table-edit .ant-table-thead>tr>th {
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
.wea-cpt-table-edit .ant-table-thead th {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
font-weight: 400;
|
||||
}
|
||||
.wea-cpt-table-edit .ant-table,.wea-cpt-table-edit .ant-table table {
|
||||
border-radius: 0;
|
||||
}
|
||||
.wea-cpt-table-edit .ant-btn-sm {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.wea-cpt-table-edit-wf{
|
||||
padding-top: 8px;
|
||||
}
|
||||
|
||||
.wea-cpt-table-edit-wf .wea-title {
|
||||
font-size: 15px;
|
||||
color: #484848;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 10px;
|
||||
border-bottom: solid 1px #ebebeb;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .wea-title i {
|
||||
cursor: pointer;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .wea-title button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .ant-table-tbody>tr>td {
|
||||
padding: 10px 8px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.table-edit-opertion button {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
margin-right: 15px;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .ant-table-thead>tr>th {
|
||||
background-color: #f8fcff;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .ant-table-thead>tr>th {
|
||||
padding-top: 14px;
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .ant-table-thead th {
|
||||
border-bottom: 1px solid #eaeaea;
|
||||
font-weight: 400;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .ant-table,.wea-cpt-table-edit-wf .ant-table table {
|
||||
border-radius: 0;
|
||||
}
|
||||
.wea-cpt-table-edit-wf .ant-btn-sm {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
import { Button, Row, Col} from 'antd';
|
||||
import {WeaDialog ,WeaNewScroll ,WeaLocaleProvider ,WeaBrowser ,WeaSelectGroup ,WeaRightMenu} from 'ecCom';
|
||||
import {observer} from "mobx-react";
|
||||
import _mapValues from 'lodash/mapValues'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class ProjectFieldDetailLogDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {hrmid:'',date:[]};
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps,nextState){
|
||||
return true;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {title,tableStore,store} = this.props;
|
||||
const {fieldDetailLogVisible} = store;
|
||||
const selectLinkageDatas = {
|
||||
"6": {
|
||||
conditionType: "RANGEPICKER",
|
||||
domkey: ["start", "end"]
|
||||
}
|
||||
};
|
||||
const options = [
|
||||
{ key: "0", showname: getLabel(332,"全部") },
|
||||
{ key: "1", showname: getLabel(15537,"今天") },
|
||||
{ key: "2", showname: getLabel(15539,"本周") },
|
||||
{ key: "3", showname: getLabel(15541,"本月") },
|
||||
{ key: "4", showname: getLabel(21904,"本季") },
|
||||
{ key: "5", showname: getLabel(15384,"本年") },
|
||||
{ key: "6", showname: getLabel(32530,"指定日期范围") }
|
||||
];
|
||||
const menu = [
|
||||
{
|
||||
key: '1',
|
||||
icon: <i className='icon-coms-search' />,
|
||||
content: getLabel(388113,'搜索'),
|
||||
onClick: () =>{
|
||||
store.getPrjFieldDetaiLogList({prjid:store.prjid,fieldname:store.field,...this.state});
|
||||
}
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
icon: <i className='icon-coms-go-back' />,
|
||||
content: getLabel(309,"关闭"),
|
||||
onClick: () =>{
|
||||
store.setFieldDetailLogVisible(false)
|
||||
}
|
||||
}
|
||||
];
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ebzzs6`}
|
||||
title={title || getLabel(83,"日志")}
|
||||
visible={fieldDetailLogVisible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-ModelingEngine"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{store.setFieldDetailLogVisible(false)}}
|
||||
style={{width:'700px', height:'400px'}}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@j4cr71`} datas={menu} >
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@yzub0l`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vce74f`} span={3} style={{textAlign:'center',marginTop:16}}>{getLabel(99,'操作者')}</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@l9n2ui`} span={6} style={{marginTop:8,marginBottom:8}}>
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@ml51kw`}
|
||||
type={1}
|
||||
textDecoration={true}
|
||||
inputStyle={{ width: 200 }}
|
||||
onChange={(ids, names, datas) =>{
|
||||
this.setState({hrmid:ids});
|
||||
}
|
||||
}
|
||||
/>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@lkx9jh`} span={1}></Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vrl2zu`} span={3} style={{textAlign:'center',marginTop:16}}>{getLabel(22823,'日期')}</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@wsgtg7`} span={11} style={{marginTop:8,marginBottom:8}}>
|
||||
<WeaSelectGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSelectGroup@jaiswi`}
|
||||
isMobx
|
||||
value={0}
|
||||
options={options}
|
||||
selectLinkageDatas={selectLinkageDatas}
|
||||
onChange={(value, rightKey) => {
|
||||
this.setState({date:value});
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@5f2oua`} height={"calc(100% - 45px)"}>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@yfxb7q`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={false}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
|
||||
getButtons(){
|
||||
const {store} = this.props;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@33vs7m@close`} type="primary" onClick={()=>store.setFieldDetailLogVisible(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProjectFieldDetailLogDialog;
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
import React from 'react';
|
||||
import { Button, Modal } from 'antd';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import { WeaLocaleProvider ,WeaDialog,WeaInput,WeaFormItem,WeaError} from "ecCom"
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
|
||||
@observer
|
||||
export default class SvaeTemplateDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
date: ""
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
onCheck(){
|
||||
const { prjCardStore } = this.props;
|
||||
const {doSaveTemplet,templatename} = prjCardStore;
|
||||
if(templatename.trim()===""){
|
||||
this.refs.weaError.showError();
|
||||
}else{
|
||||
doSaveTemplet();
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { prjCardStore } = this.props;
|
||||
const {prjname,setVisiable,saveTemplateName,doSaveVisible } = prjCardStore;
|
||||
|
||||
return <div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@rtq7vb`}
|
||||
title={getLabel(19468,'另存为模板')}
|
||||
visible={doSaveVisible}
|
||||
onCancel={() => { setVisiable(false) }}
|
||||
icon='icon-coms-project'
|
||||
iconBgcolor='#217346'
|
||||
style={{width: 380, height: 80}}
|
||||
buttons={ [
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vdw755@save`} type="primary" onClick={()=>this.onCheck()}>{getLabel(86,"保存")}</Button>,
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ck17pe@cancel`} type="primary" onClick={()=>setVisiable(false)}>{getLabel(201,"取消")}</Button>]}
|
||||
>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@h13bkr`} label={getLabel('18151',"模板名称")} labelCol={{span: 6}} wrapperCol={{span: 12}} style={{top: 25, left: 40}} >
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@ddh1fk`} tipPosition='bottom'
|
||||
ref='weaError'
|
||||
error={getLabel('127697',"模板名称不能为空")}>
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@rmfvry`}
|
||||
style={{width: 200}}
|
||||
value={prjname}
|
||||
viewAttr="3"
|
||||
stringLength={90}
|
||||
onChange={v =>{
|
||||
saveTemplateName(v);
|
||||
}}
|
||||
/>
|
||||
</WeaError>
|
||||
</WeaFormItem>
|
||||
</WeaDialog>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
import { Button,Spin} from 'antd';
|
||||
import {WeaLocaleProvider, WeaDialog, WeaSelect, WeaFormItem} from "ecCom"
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import ProjectCondition from '../list/projectCondition';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class AddPrjGroupDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
width:1020,
|
||||
height:650,
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {prjGroupStore} = this.props;
|
||||
const {visible,handlePrjGroupDialog,fieldinfo,form,setFormFields,title} = prjGroupStore;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@jhbhzc`}
|
||||
title={title||getLabel(518163,'新建项目分组')}
|
||||
visible={visible}
|
||||
// style= {{width: width, height: dialogHeight}}
|
||||
maskClosable={false}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>handlePrjGroupDialog(false)}
|
||||
buttons={this.getDialogButtons()}
|
||||
>
|
||||
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@x34q5x`} fieldInfo={fieldinfo} form={form} setFormFields={(v)=>{setFormFields(v)}} />
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
|
||||
getDialogButtons(){
|
||||
const {projectPortalStore,prjGroupStore} = this.props;
|
||||
let btn = [];
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@qac3az@save`} type="primary" onClick={()=>{prjGroupStore.savePrjGroupInfo(projectPortalStore);}}>{getLabel(86,"保存")}</Button>);
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@f4666n@clsoe`} type="primary" onClick={()=>prjGroupStore.handlePrjGroupDialog(false)}>{getLabel(309,"关闭")}</Button>);
|
||||
return btn
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default AddPrjGroupDialog;
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
|
||||
import { Button,Spin} from 'antd';
|
||||
import {WeaDialog,WeaTab,WeaNewScroll,WeaRightMenu,WeaLocaleProvider } from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import PrjTaskListTable from '../comp/prjTaskListTable'
|
||||
import ProjectCondition from '../list/projectCondition'
|
||||
import StageList from '../common/stageList';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class AddProjectDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
width:1020,
|
||||
height:650,
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
}
|
||||
render() {
|
||||
const {addProjectStore} = this.props.contentStore;
|
||||
const {title,selectedKey,visible,conditionDatas:{userid,taskinfo,fieldinfo,taskViewAttr},saveListDatas,saveRowKeys,selectedRowKey,spinning} = addProjectStore;
|
||||
const {form,setFormFields,setValidate,isTimeShow} = addProjectStore;
|
||||
const tabs = [{key:"prjinfo",title:getLabel(16290,"项目信息")},{key:"sublist",title:getLabel(18505,"任务列表")}, { key: "stagelist", title: getLabel('387407',"阶段设置") },{ key: "rolelist", title: "角色管理" }];
|
||||
const { width} = this.state;
|
||||
const formParams = form.getFormParams() || {};
|
||||
const {roleIframeUrl} = addProjectStore;
|
||||
let dialogHeight = window.innerHeight - 150;
|
||||
if (dialogHeight > 600) dialogHeight = 600;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@8q3ggi`}
|
||||
title={title}
|
||||
visible={visible}
|
||||
style= {{width: width, height: dialogHeight}}
|
||||
maskClosable={false}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>addProjectStore.handleShareDialog(false)}
|
||||
buttons={this.getDialogButtons()}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@rg25at`} datas={this.getRightMenu()}>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@u3s389`}
|
||||
buttons={this.getButtons()}
|
||||
datas={tabs}
|
||||
selectedKey={selectedKey}
|
||||
keyParam="key" //主键
|
||||
onChange={this.changeTab.bind(this)} />
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@q8bmh0`} height={"calc(100% - 50px)"}>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@y99n9e`} spinning={spinning}>
|
||||
<div style = {{display:selectedKey == "prjinfo"? "block":"none"}}>
|
||||
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@a799e4`} fieldInfo={fieldinfo} form={form} setFormFields={(v)=>{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
|
||||
</div>
|
||||
<div style = {{display:selectedKey == "sublist"? "block":"none"}}>
|
||||
<PrjTaskListTable ecId={`${this && this.props && this.props.ecId || ''}_PrjTaskListTable@kzq9ip`}
|
||||
ref = "PrjTaskListTable"
|
||||
taskViewAttr={taskViewAttr}
|
||||
datas={toJS(taskinfo)}
|
||||
userid = {formParams.manager}
|
||||
isworkday = {formParams.passnoworktime}
|
||||
selectedRowKeys={toJS(selectedRowKey)}
|
||||
onChange={(datas)=>{saveListDatas(datas)}}
|
||||
onRowSelect={(rowkeys)=>{saveRowKeys(rowkeys)}}
|
||||
stageOptions={this.getStageOptions()}
|
||||
isTimeShow={isTimeShow}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ display: selectedKey == "stagelist" ? "block" : "none" }}>
|
||||
<StageList ecId={`${this && this.props && this.props.ecId || ''}_StageList@8uu82g`} ref={el => { this.StageList = el }} contentStore={addProjectStore} />
|
||||
</div>
|
||||
<div style={{ display: selectedKey == "rolelist" ? "block" : "none" }}>
|
||||
<iframe
|
||||
src={roleIframeUrl}
|
||||
width="100%"
|
||||
height={540}
|
||||
/>
|
||||
</div>
|
||||
</Spin>
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
|
||||
</div>)
|
||||
}
|
||||
getButtons(){
|
||||
const {addProjectStore} = this.props.contentStore;
|
||||
const {selectedKey,addNewListDatas,deleListDatas,selectedRowKey,conditionDatas:{userid,taskinfo,fieldinfo,taskViewAttr},stageInfo} = addProjectStore;
|
||||
const isDisabled = !(selectedRowKey.length>0 && `${toJS(selectedRowKey)}`);
|
||||
const stageDisabled = !(stageInfo.selectedRowKeys.length > 0)
|
||||
let btn = [];
|
||||
if(taskViewAttr==2){
|
||||
if(selectedKey == "sublist"){
|
||||
btn = [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@adjhai`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: '#55a1f8', backgroundColor: '#fff' }} type="primary" title={getLabel(611, '添加')} size="small" disabled={0} onClick={() => {
|
||||
addNewListDatas();
|
||||
}}><span className="icon-coms-Add-to-hot" /></Button>),
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@85e37z`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: (isDisabled) ? '#d8d8d8' : '#55a1f8', marginLeft: '-5px', backgroundColor: '#fff' }} type="primary" title={getLabel(91, '删除')} size="small" disabled={isDisabled} onClick={() => {
|
||||
deleListDatas();
|
||||
}} ><span className="icon-coms-form-delete-hot" /></Button>
|
||||
];
|
||||
} else if (selectedKey == "stagelist") {
|
||||
btn = [
|
||||
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@9vrk3o`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: '#55a1f8', backgroundColor: '#fff' }} type="primary" title={getLabel(611, '添加')} size="small" disabled={0} onClick={() => {
|
||||
this.StageList.tableEdit.refs.edit.doAdd()
|
||||
}}><span className="icon-coms-Add-to-hot" /></Button>),
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@6q0hxn`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: (stageDisabled) ? '#d8d8d8' : '#55a1f8', marginLeft: '-5px', backgroundColor: '#fff' }} type="primary" title={getLabel(91, '删除')} size="small" disabled={stageDisabled} onClick={() => {
|
||||
this.StageList.tableEdit.refs.edit.doDelete()
|
||||
}} ><span className="icon-coms-form-delete-hot" /></Button>
|
||||
];
|
||||
}
|
||||
}
|
||||
return btn
|
||||
}
|
||||
getDialogButtons(){
|
||||
const {isreflesh} = this.props;
|
||||
const {addProjectStore} = this.props.contentStore;
|
||||
const {saveAddProject,conditionDatas:{taskViewAttr}} = addProjectStore;
|
||||
let btn = [];
|
||||
if(taskViewAttr==2){
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@kmwp7b`} type="primary" onClick={ ()=>{saveAddProject({isreflesh:isreflesh,checkProps:this.StageList.tableEdit.refs.edit.doRequiredCheck()});this.refs.PrjTaskListTable.showErrors();}}>{getLabel(86,"保存")}</Button>);
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@hd7lss`} type="primary" onClick={()=>addProjectStore.handleShareDialog(false)}>{getLabel(309,"关闭")}</Button>);
|
||||
}else{
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@q4i367`} type="primary" onClick={()=>addProjectStore.handleShareDialog(false)}>{getLabel(309,"关闭")}</Button>);
|
||||
}
|
||||
return btn
|
||||
}
|
||||
|
||||
getRightMenu(){
|
||||
const {isreflesh} = this.props;
|
||||
const {addProjectStore} = this.props.contentStore;
|
||||
const {conditionDatas:{rightMenu}} = addProjectStore;
|
||||
const {selectedKey,saveAddProject,addNewListDatas,deleListDatas,selectedRowKey,conditionDatas:{userid,taskinfo,fieldinfo,taskViewAttr},stageInfo} = addProjectStore;
|
||||
const isDisabled = !(selectedRowKey.length>0 && `${toJS(selectedRowKey)}`);
|
||||
const stageDisabled = !(stageInfo.selectedRowKeys.length > 0)
|
||||
|
||||
let btn = [];
|
||||
if(taskViewAttr==2){
|
||||
if(selectedKey == "prjinfo"){
|
||||
btn.push({
|
||||
key: '1',
|
||||
icon: <i className={"icon-coms-Preservation"} />,
|
||||
content: getLabel(86,"保存"),
|
||||
onClick:(key)=>{
|
||||
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
|
||||
saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
|
||||
}
|
||||
});
|
||||
}
|
||||
if(selectedKey == "sublist"){
|
||||
btn.push({
|
||||
key: '1',
|
||||
icon: <i className={"icon-coms-New-Flow"} />,
|
||||
content: getLabel(611,"添加"),
|
||||
onClick:(key)=>{
|
||||
addNewListDatas();
|
||||
}
|
||||
});
|
||||
btn.push({
|
||||
key: '2',
|
||||
icon: <i className={"icon-coms-delete"} />,
|
||||
content: getLabel(91,"删除"),
|
||||
disabled:isDisabled,
|
||||
onClick:(key)=>{
|
||||
deleListDatas();
|
||||
}
|
||||
});
|
||||
btn.push({
|
||||
key: '3',
|
||||
icon: <i className={"icon-coms-Preservation"} />,
|
||||
content: getLabel(86,"保存"),
|
||||
onClick:(key)=>{
|
||||
this.refs.PrjTaskListTable.showErrors();
|
||||
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
|
||||
saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (selectedKey == "stagelist") {
|
||||
btn.push({
|
||||
key: '1',
|
||||
icon: <i className={"icon-coms-New-Flow"} />,
|
||||
content: getLabel(611, "添加"),
|
||||
onClick: (key) => {
|
||||
this.StageList.tableEdit.refs.edit.doAdd()
|
||||
}
|
||||
});
|
||||
btn.push({
|
||||
key: '2',
|
||||
icon: <i className={"icon-coms-delete"} />,
|
||||
content: getLabel(91, "删除"),
|
||||
disabled: stageDisabled,
|
||||
onClick: (key) => {
|
||||
this.StageList.tableEdit.refs.edit.doDelete()
|
||||
}
|
||||
});
|
||||
btn.push({
|
||||
key: '3',
|
||||
icon: <i className={"icon-coms-Preservation"} />,
|
||||
content: getLabel(86, "保存"),
|
||||
onClick: (key) => {
|
||||
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
|
||||
saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return btn
|
||||
}
|
||||
|
||||
changeTab(key){
|
||||
const {addProjectStore} = this.props.contentStore;
|
||||
addProjectStore.changeTab(key)
|
||||
}
|
||||
|
||||
getStageOptions = () => {
|
||||
const { addProjectStore: { stageInfo: { stageColumns, stageColumnDatas, selectedRowKeys, selectedDatas } } } = this.props.contentStore;
|
||||
let options = [];
|
||||
options.push({ disabled: false, selected: false, showname: " ", key:"", visible: true })
|
||||
stageColumnDatas && stageColumnDatas.length > 0 && stageColumnDatas.map(item => {
|
||||
options.push({ disabled: false, key: item.id, selected: false, showname: item.name, visible: true })
|
||||
})
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
export default AddProjectDialog;
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
import { Button} from 'antd';
|
||||
import {WeaLocaleProvider, WeaDialog} from "ecCom"
|
||||
import {observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import ProjectCondition from '../list/projectCondition';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class AddTaskGroupDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
width:1020,
|
||||
height:650,
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {taskGroupStore} = this.props;
|
||||
const {visible,handleTaskGroupDialog,fieldinfo,form,setFormFields,title} = taskGroupStore;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@xs4eu2`}
|
||||
title={title||getLabel('518194','新建任务分组')}
|
||||
visible={visible}
|
||||
// style= {{width: width, height: dialogHeight}}
|
||||
maskClosable={false}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>handleTaskGroupDialog(false)}
|
||||
buttons={this.getDialogButtons()}
|
||||
>
|
||||
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@yuz6hu`} fieldInfo={fieldinfo} form={form} setFormFields={(v)=>{setFormFields(v)}} />
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
|
||||
getDialogButtons(){
|
||||
const {taskPortalStore,taskGroupStore} = this.props;
|
||||
let btn = [];
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@8kw02t@save`} type="primary" onClick={()=>{taskGroupStore.saveTaskGroupInfo(taskPortalStore);}}>{getLabel(86,"保存")}</Button>);
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@n0i4dk@close`} type="primary" onClick={()=>taskGroupStore.handleTaskGroupDialog(false)}>{getLabel(309,"关闭")}</Button>);
|
||||
return btn
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default AddTaskGroupDialog;
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
import { Button,Spin} from 'antd';
|
||||
import {WeaLocaleProvider, WeaDialog, WeaSelect, WeaFormItem} from "ecCom"
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import ProjectCondition from '../list/projectCondition';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class editPrjFeedBackSetDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
width:1020,
|
||||
height:650,
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {prjGroupStore} = this.props;
|
||||
const {visible,handlePrjGroupDialog,fieldinfo,form,setFormFields,title} = prjGroupStore;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog
|
||||
title={title||getLabel('30747','设置') }
|
||||
visible={visible}
|
||||
// style= {{width: width, height: dialogHeight}}
|
||||
maskClosable={false}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>handlePrjGroupDialog(false)}
|
||||
buttons={this.getDialogButtons()}
|
||||
>
|
||||
<ProjectCondition fieldInfo={fieldinfo} form={form} setFormFields={(v)=>{setFormFields(v)}} />
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
|
||||
getDialogButtons(){
|
||||
const {projectPortalStore,prjGroupStore} = this.props;
|
||||
let btn = [];
|
||||
btn.push(<Button type="primary" onClick={()=>{prjGroupStore.savePrjGroupInfo(projectPortalStore);}}>{getLabel(86,"保存")}</Button>);
|
||||
btn.push(<Button type="primary" onClick={()=>prjGroupStore.handlePrjGroupDialog(false)}>{getLabel(309,"关闭")}</Button>);
|
||||
return btn
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default editPrjFeedBackSetDialog;
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
|
||||
import {Form, Input, Button, } from 'antd';
|
||||
import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaRightMenu,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import _mapValues from 'lodash/mapValues'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class EditPrjTaskDataDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@zlnmaa`}
|
||||
title={getLabel(15284,"编辑任务")}
|
||||
visible={contentStore.showEditTask}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{contentStore.showEditTaskModal(false)}}
|
||||
style={{width:'1000px', height:'600px'}}
|
||||
>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@was71s`} height={"100%"}>
|
||||
<iframe src={"/proj/data/EditProjectTask.jsp?ProjID="+contentStore.prjid+"&e9from=e9&isdialog=1&key="+new Date().getTime()} id="editPrjTaskData" name="editPrjTaskData" className="flowFrame" frameborder="0" width="100%" height="100%" />
|
||||
</WeaNewScroll>
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
|
||||
getButtons(){
|
||||
const {contentStore} = this.props;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3qvrlq@close`} type="primary" onClick={()=>contentStore.showEditTaskModal(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
export default EditPrjTaskDataDialog;
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
import {Form, Input, Button, } from 'antd';
|
||||
import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaRightMenu,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import ExchangePage from "../common/relateExchange"
|
||||
import TabDiscuss from '../common/TabDiscuss'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class ExchangeDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
visible:false
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const {contentStore} = this.props;
|
||||
const {type,visible,title,targetid,handleExchangeDialog} = contentStore;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@127oxj`}
|
||||
title={title}
|
||||
visible={visible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{handleExchangeDialog(false)}}
|
||||
style={{width:'900px', height:'600px'}}
|
||||
>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@54ra5z`} height={"100%"}>
|
||||
{/* <ExchangePage contentStore ={contentStore} callBack={()=>{this.reloadExchanges()}} key={new Date().getTime()} /> */}
|
||||
<TabDiscuss ecId={`${this && this.props && this.props.ecId || ''}_TabDiscuss@wj46e4`} contentStore={contentStore} sortid={targetid}/>
|
||||
</WeaNewScroll>
|
||||
</WeaDialog>
|
||||
|
||||
</div>)
|
||||
}
|
||||
|
||||
getButtons(){
|
||||
const {contentStore,} = this.props;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@59g6sq@close`} type="primary" onClick={()=>contentStore.handleExchangeDialog(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
}
|
||||
|
||||
export default ExchangeDialog;
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
import {Form, Input, Button, } from 'antd';
|
||||
import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaRightMenu,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import _mapValues from 'lodash/mapValues'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class ModifyLogDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
visible:false
|
||||
}
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps,nextState){
|
||||
return true
|
||||
}
|
||||
|
||||
render() {
|
||||
const {title,tableStore} = this.props;
|
||||
const {visible} = this.state;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@bquco7`}
|
||||
title={title || getLabel(83,"日志")}
|
||||
visible={visible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{this.setVisible(false)}}
|
||||
style={{width:'700px', height:'400px'}}
|
||||
>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@717vg5`} height={"100%"}>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@hpw1sn`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={false}
|
||||
getColumns={c=>this.reRenderColumns(c)}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
getButtons(){
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@gqc6mc@close`} type="primary" onClick={()=>this.setVisible(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
setVisible=(bool)=>{
|
||||
this.setState({visible:bool});
|
||||
}
|
||||
|
||||
reRenderColumns(columns){
|
||||
const {store} = this.props;
|
||||
columns.forEach(c=>{
|
||||
if(c.dataIndex=='id'){
|
||||
c.render = function(text, record){
|
||||
if(record.logtype=='m'){
|
||||
return <a href="javascript:void(0)" onClick={() => {store.getPrjFieldLogList({prjid:store.prjid,logid:record.id});store.setFieldLogVisible(true)}}>{getLabel(506390,'点击查看详情')}</a>;
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ModifyLogDialog;
|
||||
|
|
@ -0,0 +1,238 @@
|
|||
|
||||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaFormItem,WeaSearchGroup,WeaLocaleProvider,WeaTools} from "ecCom"
|
||||
import {Button,Modal,message} from "antd"
|
||||
import {WeaTableNew,WeaSwitch} from 'comsMobx';
|
||||
import debounce from 'lodash/debounce';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {toJS} from "mobx"
|
||||
import equal from 'deep-equal'
|
||||
import ProjectCondition from '../list/projectCondition'
|
||||
import * as Prj_Apis from '../../apis/project'
|
||||
import ProjectLogDialog from "./modifyLogDialog"
|
||||
import ProjectFieldLogDialog from './projectFieldLogDialog';
|
||||
import ProjectFieldDetailLogDialog from './ProjectFieldDetailLogDialog';
|
||||
import SaveTemplateDialog from "../dialog/SaveTemplateDialog";
|
||||
|
||||
@observer
|
||||
export default class ProjectDialog extends React.Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
workPlanVisible: false,
|
||||
saveDisabled: false
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { contentStore } = this.props;
|
||||
if (!window.weaWorkplan) {
|
||||
// 异步加载别模块的静态资源
|
||||
eventRegister.loadModule('f_workplan', () => {
|
||||
contentStore.setLoaded(true)
|
||||
}, () => {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
})
|
||||
} else {
|
||||
contentStore.setLoaded(true)
|
||||
}
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
let keyOld = "";
|
||||
let keyNew = "";
|
||||
if( this.props.location && nextProps.location && this.props.location.query && nextProps.location.query){
|
||||
keyOld = this.props.location.query.prjid;
|
||||
keyNew = nextProps.location.query.prjid;
|
||||
}else{
|
||||
keyOld = this.props.prjid;
|
||||
keyNew = nextProps.prjid;
|
||||
}
|
||||
//点击菜单路由刷新组件
|
||||
if (keyOld !== keyNew) {
|
||||
const { contentStore } = nextProps;
|
||||
if (!window.weaWorkplan) {
|
||||
// 异步加载别模块的静态资源
|
||||
eventRegister.loadModule('f_workplan', () => {
|
||||
contentStore.setLoaded(true)
|
||||
}, () => {
|
||||
// 加载文件失败 的业务处理, 网络超时,没文件之类
|
||||
})
|
||||
} else {
|
||||
contentStore.setLoaded(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
render(){
|
||||
let _this = this;
|
||||
const {contentStore} = this.props;
|
||||
const {visible,handleDialog,prjInfo,prjForm,setFormFields,setValidate,prjLogTableStore, prjFieldLogTableStore, prjFieldDetailLogTableStore, fieldname, prjid} = contentStore;
|
||||
const title = getLabel(83808,"编辑项目");
|
||||
const account = WeaTools.ls.getJSONObj('theme-account');
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@zdlktp`}
|
||||
title={title }
|
||||
visible={visible}
|
||||
buttons={this.getBottomButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{handleDialog(false)}}
|
||||
style={{width:1000,height:700}}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@jmhbrz`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@1lj6ex`} height={"100%"}>
|
||||
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@j88ph3`} fieldInfo={prjInfo} form={prjForm} setFormFields={(v)=>{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
|
||||
<ProjectLogDialog ecId={`${this && this.props && this.props.ecId || ''}_ProjectLogDialog@ej3b1r`} ref="projectLogDialog" title={getLabel('33782','项目日志') } tableStore={prjLogTableStore} store={contentStore} />
|
||||
<ProjectFieldLogDialog ecId={`${this && this.props && this.props.ecId || ''}_ProjectFieldLogDialog@l0zxlg`} title={getLabel('82274','字段日志') } tableStore={prjFieldLogTableStore} store={contentStore} />
|
||||
<ProjectFieldDetailLogDialog ecId={`${this && this.props && this.props.ecId || ''}_ProjectFieldDetailLogDialog@3u0cbi`} title={getLabel('82274','字段日志')+"-"+fieldname } tableStore={prjFieldDetailLogTableStore} store={contentStore} />
|
||||
<SaveTemplateDialog ecId={`${this && this.props && this.props.ecId || ''}_SaveTemplateDialog@audzl0`} prjCardStore={contentStore}/>
|
||||
{
|
||||
contentStore.isreload&&window.weaWorkplan && window.weaWorkplan.com && window.weaWorkplan.com.WorkPlanCreate &&
|
||||
(<window.weaWorkplan.com.WorkPlanCreate ecId={`${this && this.props && this.props.ecId || ''}_WorkPlanCreate@69wd75`}
|
||||
type={"create"}//新建为'create',查看为'preview',编辑edit,共享share
|
||||
visible={_this.state.workPlanVisible}//显隐受控
|
||||
doClose={() => { _this.setWorkPlanVisible(false); }}//关闭回调
|
||||
onlyClose={() => { _this.setWorkPlanVisible(false) }}//关闭回调,只做关闭操作
|
||||
workPlanId={""} //日程id,1查看日程时用到
|
||||
createConditionParams={[]}//创建的默认值日期和时间,没有传[]
|
||||
activeKey={""} //查看页面显示的面板1是基本信息,7是相关交流
|
||||
//{(key) => { }}//查看页面切换面板的回调
|
||||
selectUser={account && account.userid}//新建日程的创建人id
|
||||
workPlanTypeOptions={"2"}//客户模块的新建日程,普通新建传'',客户新建传3
|
||||
crmIDs={[]}//通过客户模块新建日程,并自动带出相关客户,[{'id':'','name':''}]
|
||||
projectid={prjid}
|
||||
description={""}//客户模块需求,支持新建时传入的'基本信息-内容'
|
||||
/>)
|
||||
}
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
getBottomButtons(){
|
||||
const {contentStore,dellCallBack,from='mymanagerproject'} = this.props;
|
||||
const {handleDialog,rightMenu,prjid} = contentStore;
|
||||
let btnArr = [];
|
||||
const {saveDisabled} = this.state;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@mkzg0d@${m.type}`} type="primary" disabled={m.type == "BTN_SAVE"?saveDisabled:false}
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_SAVE"){ //保存
|
||||
this.savePrjInfo();
|
||||
}else if(m.type == "BTN_EDIT"){//编辑
|
||||
contentStore.getPrjInfo({viewtype:'edit'});
|
||||
}else if(m.type == "BTN_BACK"){ //返回
|
||||
contentStore.getPrjInfo({viewtype:'view'});
|
||||
}else if(m.type == "BTN_DELETE"){ //删除
|
||||
contentStore.delPrjInfo({method:"del",prjid:prjid,from:from,callBack:dellCallBack});
|
||||
}
|
||||
}}>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0ki525@close`} type="primary" onClick={()=>{handleDialog(false)}}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {contentStore} = this.props;
|
||||
const {rightMenu,isApprove} = contentStore;
|
||||
let btnArr = [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
let disabled = false;
|
||||
if(isApprove){
|
||||
if(m.menuIcon == "icon-coms-Approval"){
|
||||
disabled = true;
|
||||
}
|
||||
}
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName,
|
||||
disabled: disabled
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {contentStore} = this.props;
|
||||
const {handleDialog,rightMenu,prjid} = contentStore;
|
||||
let that = this;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
|
||||
if(fn != ""){
|
||||
fn = fn.substring(0, fn.indexOf('('));
|
||||
if('onNormal' == fn){ //正常
|
||||
contentStore.doPlanOpt({method:'normal',prjid:prjid});
|
||||
}else if('onOver' == fn){ //延期
|
||||
contentStore.doPlanOpt({method:'delay',prjid:prjid});
|
||||
}else if('onFinish' == fn){ //完成
|
||||
contentStore.doPlanOpt({method:'complete',prjid:prjid});
|
||||
}else if('onFrozen' == fn){ //冻结
|
||||
contentStore.doPlanOpt({method:'freeze',prjid:prjid});
|
||||
}else if ('onToggleStatus' == fn) {
|
||||
contentStore.doPlanOpt({ method: 'togglestatus', prjid: prjid, statusid: m.params });
|
||||
}
|
||||
}else{
|
||||
if(m.type == "BTN_EDIT"){ //编辑
|
||||
contentStore.getPrjInfo({viewtype:'edit'});
|
||||
}else if(m.type == "BTN_SAVE"){ //保存
|
||||
this.savePrjInfo();
|
||||
}else if(m.type == "BTN_DELETE"){ //删除
|
||||
contentStore.delPrjInfo({method:"del",prjid:prjid,from:"mymanagerproject"});
|
||||
}else if(m.type == "BTN_NEWREQ"){ //新建流程
|
||||
window.open((window.ecologyContentPath || '')+"/spa/workflow/static/index.html#/main/workflow/add?prjid=" + prjid, "_blank");
|
||||
}else if(m.type == "BTN_NEWDOC"){ //新建文档
|
||||
window.open((window.ecologyContentPath || '')+"/spa/document/static/index.html#/main/document/add?moudleFrom=prj&prjid=" + prjid, "_blank");
|
||||
}else if(m.type == "BTN_NEWRQ"){ //新建日程
|
||||
this.setState({ workPlanVisible: true })
|
||||
}else if(m.type == "BTN_NEWMT"){ //新建会议
|
||||
window.open("(window.ecologyContentPath || '')+/spa/meeting/static/index.html#/main/meeting/dialogsingle?type=create&projectid=" + prjid, "_blank");
|
||||
}else if(m.type == "BTN_LOG"){ //日志
|
||||
this.refs.projectLogDialog.setVisible(true);
|
||||
contentStore.getPrjLogList({ prjid: prjid });
|
||||
}else if(m.type == "BTN_SAVETEMPLET"){ //另存为模板
|
||||
contentStore.setVisiable(true);
|
||||
}else if(m.type == "BTN_BACK"){ //返回
|
||||
contentStore.getPrjInfo({viewtype:'view'});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
savePrjInfo = debounce((params={})=>{
|
||||
const {callBack} = this.props;
|
||||
const {handleDialog,prjForm,prjid,baseParams,validateRules,getPrjInfo} = this.props.contentStore;
|
||||
this.setState({saveDisabled:true});
|
||||
prjForm.validateForm().then(f=>{
|
||||
if(f.isValid){
|
||||
let newParams = {...toJS(prjForm.getFormParams()),method:"edit",prjid:prjid,...params};
|
||||
Prj_Apis.savePrjInfo(newParams).then(data=>{
|
||||
this.setState({saveDisabled:false});
|
||||
if(data.success){
|
||||
getPrjInfo({viewtype:"view"});
|
||||
if(callBack){
|
||||
callBack();
|
||||
}else{
|
||||
window._table.reLoad();
|
||||
}
|
||||
}else{
|
||||
message.error(data.msg);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.setState({saveDisabled:false});
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
},600);
|
||||
|
||||
setWorkPlanVisible = (bool) => {
|
||||
this.setState({ workPlanVisible: bool })
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
import { Button } from 'antd';
|
||||
import {WeaDialog ,WeaNewScroll ,WeaLocaleProvider} from 'ecCom';
|
||||
import {observer} from "mobx-react";
|
||||
import _mapValues from 'lodash/mapValues'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class ProjectFieldLogDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
shouldComponentUpdate(nextProps,nextState){
|
||||
return true;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {title,tableStore,store} = this.props;
|
||||
const {fieldLogVisible} = store;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1nr3a8`}
|
||||
title={title || getLabel(83,"日志")}
|
||||
visible={fieldLogVisible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-ModelingEngine"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{store.setFieldLogVisible(false)}}
|
||||
style={{width:'700px', height:'400px'}}
|
||||
>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@paj6pw`} height={"100%"}>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@sgp7wr`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={false}
|
||||
getColumns={c=>this.reRenderColumns(c)}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
getButtons(){
|
||||
const {store} = this.props;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pp2tdv@close`} type="primary" onClick={()=>store.setFieldLogVisible(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
reRenderColumns(columns){
|
||||
const {store} = this.props;
|
||||
columns.forEach(c=>{
|
||||
if(c.dataIndex=='id'){
|
||||
c.render = function(text, record){
|
||||
return <a href="javascript:void(0)" onClick={() => {
|
||||
store.setField(record.fieldname);
|
||||
store.setFieldName(record.fieldnamespan);
|
||||
store.getPrjFieldDetaiLogList({prjid:store.prjid,fieldname:record.fieldname});
|
||||
store.setFieldDetailLogVisible(true)}
|
||||
}>{getLabel(82278,'查看该字段所有日志')}</a>;
|
||||
}
|
||||
}
|
||||
})
|
||||
return columns;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ProjectFieldLogDialog;
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
|
||||
import {Form, Input, Button, } from 'antd';
|
||||
import {WeaDialog ,WeaTools,WeaFormItem,WeaSearchGroup,WeaLocaleProvider} from 'ecCom';
|
||||
import {WeaSwitch} from "comsMobx"
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class RelateCrmDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
visible:false,
|
||||
conditioninfo: [
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"conditionType": "BROWSER",
|
||||
'rules': 'required|string', // 校验规则
|
||||
"labelcol": 6,
|
||||
"colSpan": 2,
|
||||
"viewAttr": 3,
|
||||
"value": "1",
|
||||
"domkey": [
|
||||
"crmid"
|
||||
],
|
||||
"fieldcol": 16,
|
||||
"label": getLabel(136,"客户"),
|
||||
"browserConditionParam": {
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"title": getLabel(136,"客户"),
|
||||
"linkUrl": "/crm/data/ViewCustomer.jsp?CustomerID=",
|
||||
"isMultCheckbox": false,
|
||||
"hasAdd": false,
|
||||
"viewAttr": 2,
|
||||
"dataParams": {},
|
||||
"hasAdvanceSerach": true,
|
||||
"isSingle": true,
|
||||
"replaceDatas": [],
|
||||
"type": "7"
|
||||
}
|
||||
},{
|
||||
"conditionType": "INPUT",
|
||||
"labelcol":6,
|
||||
"colSpan": 2,
|
||||
"viewAttr": 2,
|
||||
"value": "",
|
||||
"domkey": [
|
||||
"reasondesc"
|
||||
],
|
||||
"fieldcol": 16,
|
||||
"label": getLabel(433,"描述"),
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
|
||||
const {relateCrmform} = this.props.contentStore;
|
||||
relateCrmform.initFormFields(this.state.conditioninfo);
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const {contentStore,} = this.props;
|
||||
const {crmType,crmVisible,handleRelateCrmDialog} = contentStore;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1otdig`}
|
||||
title={crmType=="add" ?getLabel(83878,"添加相关客户"):getLabel(83879,"编辑相关客户")}
|
||||
visible={crmVisible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{handleRelateCrmDialog(false)}}
|
||||
style={{width:'500px', height:'220px'}}
|
||||
>
|
||||
{this.getSearchs()}
|
||||
</WeaDialog>
|
||||
|
||||
</div>)
|
||||
}
|
||||
|
||||
getButtons(){
|
||||
const {contentStore,} = this.props;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@uo1mr6`} type="primary" onClick={()=>{contentStore.saveRelateCrm()}}>{getLabel(86,"保存")}</Button>)
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5tfnm0`} type="primary" onClick={()=>contentStore.handleRelateCrmDialog(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getSearchs() {
|
||||
const { relateCrmform } = this.props.contentStore;
|
||||
const {isFormInit} = relateCrmform;
|
||||
let group = [];
|
||||
isFormInit && this.state.conditioninfo.map((c,i) =>{
|
||||
let items = [];
|
||||
c.items.map((field,index) => {
|
||||
items.push({
|
||||
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@3r9f2r@${index}`}
|
||||
label={`${field.label}`}
|
||||
labelCol={{span: `${field.labelcol}`}}
|
||||
error={relateCrmform.getError(field)}
|
||||
wrapperCol={{span: `${field.fieldcol}`}}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@eirw1z@${index}`} fieldConfig={field} form={relateCrmform} />
|
||||
</WeaFormItem>),
|
||||
colSpan:1
|
||||
})
|
||||
});
|
||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@aajm14@${i}`} needTigger={true} title={getLabel(1361,"基本信息")} col={1} showGroup={true} items={items}/>)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RelateCrmDialog;
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
|
||||
import {Modal, Input, Button,Table } from 'antd';
|
||||
import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaFormItem,WeaProgress,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import {toJS} from 'mobx';
|
||||
import _mapValues from 'lodash/mapValues'
|
||||
import {WeaTableNew,WeaSwitch} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class RelateListDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
visible:false
|
||||
}
|
||||
}
|
||||
shouldComponentUpdate(nextProps,nextState){
|
||||
return true
|
||||
}
|
||||
|
||||
render() {
|
||||
const {relateListStore} = this.props.contentStore;
|
||||
const {visible,title,handleRelateDialog,tableStore,doSearch,type,modalStyle,visibleDatas,compareVisible} = relateListStore;
|
||||
const columns = [{
|
||||
title: getLabel(83890,"版本\比较对象"),
|
||||
dataIndex: 'col1',
|
||||
key: 'col1',
|
||||
width:"20%",
|
||||
}, {
|
||||
title: getLabel(22172,"计划工期"),
|
||||
dataIndex: 'col2',
|
||||
key: 'col2',
|
||||
width:"10%",
|
||||
}, {
|
||||
title: getLabel(22169,"计划开始时间"),
|
||||
dataIndex: 'col3',
|
||||
key: 'col3',
|
||||
width:"20%",
|
||||
}, {
|
||||
title: getLabel(22171,"计划结束时间"),
|
||||
dataIndex: 'col4',
|
||||
key: 'col4',
|
||||
width:"20%",
|
||||
}, {
|
||||
title: getLabel(847,"进度"),
|
||||
dataIndex: 'col5',
|
||||
key: 'col5',
|
||||
width:"30%",
|
||||
render: (text,record,index) => {if(index < 3){return <div><WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@tow077`} percent={Number(text) || 0} strokeColor={record.col5_color} /></div>}else{return <div></div>}},
|
||||
}];
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@8hhu9i`}
|
||||
title={title || getLabel(1044,"相关流程")}
|
||||
visible={visible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{handleRelateDialog(false)}}
|
||||
style={toJS(modalStyle)}
|
||||
>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@xmb98s`} height={"100%"}>
|
||||
{
|
||||
(type == "request" || type == "doc" || type == "cowork") &&
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@ybnatw`}
|
||||
searchType={['base']}
|
||||
onSearch={v=>{doSearch({name:v})}}
|
||||
/>
|
||||
}
|
||||
{
|
||||
type !== "notice" &&
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@rdmj2g`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={true}
|
||||
/>
|
||||
}
|
||||
{
|
||||
type == "notice" &&
|
||||
this.getNoticeForm()
|
||||
}
|
||||
</WeaNewScroll>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@zzqekm`}
|
||||
title={visibleDatas.compareTitle || ""}
|
||||
visible={compareVisible}
|
||||
buttons={[<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@djurhd`} type="primary" onClick={()=>relateListStore.compareVersion(false)}>{getLabel(309,"关闭")}</Button>]}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{relateListStore.compareVersion(false)}}
|
||||
style={{width:'900px', height:'300px'}}>
|
||||
<div style={{padding:"0"}} className="wea-prj-table-customsize">
|
||||
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@oz6zgn`}
|
||||
rowKey="id"
|
||||
loading={visibleDatas.visibleLoading}
|
||||
columns={columns}
|
||||
dataSource={toJS(visibleDatas.visibleData)}
|
||||
pagination={false} />
|
||||
</div>
|
||||
</WeaDialog>
|
||||
</WeaDialog>
|
||||
</div>)
|
||||
}
|
||||
getButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {relateListStore} = contentStore;
|
||||
const {type,tableStore,noticeMember,compareVersion } = relateListStore;
|
||||
const {selectedRowKeys} = tableStore;
|
||||
let btnArr = [];
|
||||
{
|
||||
type == "history" && //disabled={!(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`)}
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@zi5pt9`} disabled={!(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`)} type="primary" onClick={()=>{
|
||||
if(selectedRowKeys.length == 2){
|
||||
compareVersion(true,`${toJS(selectedRowKeys)}`)
|
||||
}else{
|
||||
Modal.info({
|
||||
title:getLabel(15172,"系统提示"),
|
||||
content:getLabel(83932,"请选择2个历史版本进行对比!")
|
||||
})
|
||||
}
|
||||
}}>{getLabel(18553,"版本对比")}</Button>)
|
||||
}
|
||||
{
|
||||
type == "notice" &&
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ifoqam`} type="primary" onClick={()=>{noticeMember()}}>{getLabel(615,"提交")}</Button>)
|
||||
}
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@9tvmip`} type="primary" onClick={()=>relateListStore.handleRelateDialog(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getNoticeForm=()=>{
|
||||
const {relateListStore} = this.props.contentStore;
|
||||
const {noticeCondition,form} = relateListStore;
|
||||
const {isFormInit} = form;
|
||||
let group = [];
|
||||
isFormInit && toJS(noticeCondition).map((c,i) =>{
|
||||
let items = [];
|
||||
c.items.map((fields,index) => {
|
||||
items.push({
|
||||
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@jl6u4k@${index}`}
|
||||
label={`${fields.label}`}
|
||||
labelCol={{span: `${fields.labelcol}`}}
|
||||
error={form.getError(fields)}
|
||||
tipPosition={"bottom"}
|
||||
wrapperCol={{span: `${fields.fieldcol}`}}>
|
||||
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@gcb5w2@${index}`} fieldConfig={fields} form={form} />
|
||||
</WeaFormItem>),
|
||||
colSpan:1,
|
||||
})
|
||||
});
|
||||
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@753sk2@${i}`} needTigger={true} col={1} title={c.title} showGroup={c.defaultshow} items={items}/>)
|
||||
});
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
export default RelateListDialog;
|
||||
|
|
@ -0,0 +1,685 @@
|
|||
|
||||
import {Form, Input, Button, } from 'antd';
|
||||
import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaRightMenu,WeaLocaleProvider} from 'ecCom';
|
||||
import {inject, observer} from "mobx-react";
|
||||
import { observable,toJS } from 'mobx';
|
||||
import _mapValues from 'lodash/mapValues'
|
||||
import {WeaTableNew} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import * as Apis from '../../apis/project';
|
||||
|
||||
@observer
|
||||
class ShareDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
visible:false
|
||||
}
|
||||
}
|
||||
@observable shareCondition = [
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharetype"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(21956,"对象类型"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(179,"人力资源")
|
||||
}, {
|
||||
"key": "5",
|
||||
"selected": false,
|
||||
"showname": getLabel(141,"分部")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(124,"部门")
|
||||
}, {
|
||||
"key": "11",
|
||||
"selected": false,
|
||||
"showname": getLabel(6086,"岗位")
|
||||
}, {
|
||||
"key": "3",
|
||||
"selected": false,
|
||||
"showname": getLabel(122,"角色")
|
||||
}, {
|
||||
"key": "4",
|
||||
"selected": false,
|
||||
"showname": getLabel(1340,"所有人")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}, {
|
||||
"2": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "57",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106,"对象"),
|
||||
"labelcol": 7,
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683,"安全级别"),
|
||||
"labelcol": 7,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385,"权限"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564,"查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93,getLabel(93,"编辑"))
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"5": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "194",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106,"对象"),
|
||||
"labelcol": 7,
|
||||
"value": 3,
|
||||
"viewAttr": 2
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683,"安全级别"),
|
||||
"labelcol": 7,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385,"权限"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564,"查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93,"编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"1": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "17",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106,"对象"),
|
||||
"labelcol": 7,
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385,"权限"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564,"查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93,"编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"11": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "278",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106,"对象"),
|
||||
"labelcol": 7,
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT_LINKAGE",
|
||||
"domkey": [
|
||||
"joblevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(28169,"岗位级别"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "0",
|
||||
"selected": true,
|
||||
"showname": getLabel(140,"总部")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(19437,"指定分部")
|
||||
}, {
|
||||
"key": "1",
|
||||
"selected": false,
|
||||
"showname": getLabel(19438,"指定部门")
|
||||
}
|
||||
],
|
||||
"selectLinkageDatas": {
|
||||
"1": {
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "57",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"jobtitledepartment"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": "",
|
||||
"labelcol": 7,
|
||||
"viewAttr": 3
|
||||
},
|
||||
"2": {
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "194",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"jobtitlesubcompany"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": "",
|
||||
"labelcol": 7,
|
||||
"viewAttr": 3
|
||||
}
|
||||
},
|
||||
"viewAttr": 2
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385,"权限"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564,"查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93,"编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"4": [[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683,"安全级别"),
|
||||
"labelcol": 7,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385,"权限"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564,"查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93,"编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
],
|
||||
"3": [[
|
||||
{
|
||||
"browserConditionParam": {
|
||||
"completeParams": {},
|
||||
"conditionDataParams": {},
|
||||
"dataParams": {},
|
||||
"destDataParams": {},
|
||||
"hasAddBtn": false,
|
||||
"hasAdvanceSerach": true,
|
||||
"idSeparator": ",",
|
||||
"isAutoComplete": 1,
|
||||
"isDetail": 0,
|
||||
"isMultCheckbox": false,
|
||||
"isSingle": false,
|
||||
"pageSize": 10,
|
||||
"quickSearchName": "",
|
||||
"type": "65",
|
||||
"viewAttr": 3
|
||||
},
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"domkey": [
|
||||
"relatedshareid"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(106,"对象"),
|
||||
"labelcol": 7,
|
||||
"viewAttr": 3
|
||||
}, {
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"rolelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(139,"级别"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "0",
|
||||
"selected": true,
|
||||
"showname": getLabel(124,"部门")
|
||||
}, {
|
||||
"key": "1",
|
||||
"selected": false,
|
||||
"showname": getLabel(141,"分部")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(140,"总部")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "INPUT_INTERVAL",
|
||||
"needDefaultValue":false,
|
||||
"domkey": [
|
||||
"seclevel",
|
||||
"seclevelMax"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(683,"安全级别"),
|
||||
"labelcol": 7,
|
||||
"value": [
|
||||
0,
|
||||
''
|
||||
],
|
||||
"viewAttr": 3
|
||||
}
|
||||
],[
|
||||
{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"sharelevel"
|
||||
],
|
||||
"fieldcol": 17,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(385,"权限"),
|
||||
"labelcol": 7,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": true,
|
||||
"showname": getLabel(33564,"查看")
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": false,
|
||||
"showname": getLabel(93,"编辑")
|
||||
}
|
||||
],
|
||||
"viewAttr": 2
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
];
|
||||
componentDidMount(){
|
||||
Apis.getDetachable().then(data=>{
|
||||
if(data.appDetachDisableAll){//禁用所有人选项
|
||||
let temp =this.shareCondition[0];
|
||||
temp.options.splice(5,1);
|
||||
this.shareCondition[0] = temp ;
|
||||
}
|
||||
});
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
}
|
||||
render() {
|
||||
const {shareStore,} = this.props.contentStore;
|
||||
const {type,visible,title,targetid,tableStore} = shareStore;
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@2531rd`}
|
||||
title={title || getLabel(2112,"共享设置")}
|
||||
visible={visible}
|
||||
buttons={this.getButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{shareStore.handleShareDialog(false)}}
|
||||
style={{width:'700px', height:'400px'}}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@ao33zs`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@vj8hym`} height={"100%"}>
|
||||
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@llil49`}
|
||||
comsWeaTableStore={tableStore}
|
||||
hasOrder={true}
|
||||
needScroll={false}
|
||||
onOperatesClick={this.onOperatesClick.bind(this)}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
<WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@kxzw32`}
|
||||
visible={this.state.visible}
|
||||
conditions={toJS(this.shareCondition)}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
title={getLabel(2112,"共享设置")}
|
||||
onOk={v => {
|
||||
shareStore.addShare(v,type);
|
||||
this.setState({ visible: false });
|
||||
}}
|
||||
onCancel={() => {
|
||||
this.setState({ visible: false });
|
||||
}}
|
||||
/>
|
||||
</div>)
|
||||
}
|
||||
|
||||
getButtons(){
|
||||
const {shareStore,} = this.props.contentStore;
|
||||
const {rightMenu,tableStore} = shareStore;
|
||||
let btnArr = [];
|
||||
let {selectedRowKeys} = tableStore;
|
||||
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@mxymza@${m.type}`} type="primary"
|
||||
disabled={isDisabled && m.isControl == "1"}
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_APPEND"){ //
|
||||
this.setState({visible:true})
|
||||
}else if(m.type == "BTN_DELETEBATCH"){
|
||||
shareStore.delBatchShare(`${toJS(selectedRowKeys)}`,shareStore.type);
|
||||
}
|
||||
}}>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@7zk31t@close`} type="primary" onClick={()=>shareStore.handleShareDialog(false)}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {shareStore,} = this.props.contentStore;
|
||||
const {rightMenu,tableStore} = shareStore;
|
||||
let btnArr = [];
|
||||
let {selectedRowKeys} = tableStore;
|
||||
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName,
|
||||
disabled: isDisabled && m.isControl == "1"
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {shareStore,} = this.props.contentStore;
|
||||
const {rightMenu,tableStore,type} = shareStore;
|
||||
let that = this;
|
||||
let {selectedRowKeys} = tableStore;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
if(m.type == "BTN_APPEND"){ //
|
||||
this.setState({visible:true})
|
||||
}else if(m.type == "BTN_DELETEBATCH"){
|
||||
shareStore.delBatchShare(`${toJS(selectedRowKeys)}`,type);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
onOperatesClick=(record,index,operate,flag)=>{
|
||||
const {shareStore,} = this.props.contentStore;
|
||||
const {type} = shareStore;
|
||||
let _href = operate && operate.href ? operate.href : "";
|
||||
let fn = _href.replace("javascript:","");
|
||||
fn = fn.substring(0,fn.indexOf('('));
|
||||
let that = this;
|
||||
if(fn != ""){
|
||||
if('onDel' == fn){ //删除
|
||||
shareStore.delBatchShare(record.id,type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default ShareDialog;
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
import React from 'react';
|
||||
import { Button, Row, Col, Modal } from 'antd';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {WeaLocaleProvider, WeaDialog, WeaNewScroll, WeaSelect, WeaFormItem, WeaTableEditable} from "ecCom"
|
||||
import {WeaTableNew,WeaSwitch} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {toJS} from "mobx"
|
||||
|
||||
@observer
|
||||
export default class TaskBatchEditDialog extends React.Component{
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false,
|
||||
titleBatchModify: getLabel('383518','批量编辑')
|
||||
}
|
||||
const {contentStore,prjid} = this.props;
|
||||
contentStore.setPrjid(prjid);
|
||||
}
|
||||
|
||||
render(){
|
||||
const {contentStore,prjid} = this.props;
|
||||
const {visible, setVisible, bmOptions, bmDatas, bmSelectedDatas, bmSelectedRowKeys, appendBmData, bmOptionValue, fieldChange} = contentStore;
|
||||
const bmColumns = [
|
||||
{
|
||||
title: getLabel(685, "字段名称"), // 列名
|
||||
dataIndex: 'showname', // 列的id 对应数据
|
||||
key: 'showname', // 前端渲染key值
|
||||
com: [
|
||||
{ label: '', type: 'TEXT' },
|
||||
],
|
||||
width : "33%"
|
||||
},{
|
||||
title: getLabel('124937','数据库字段名称') ,
|
||||
dataIndex: 'fieldname',
|
||||
key: 'fieldname',
|
||||
com: [
|
||||
{ label: '', type: 'TEXT' },
|
||||
],
|
||||
width : "33%"
|
||||
},{
|
||||
title: getLabel('500549','更改值') ,
|
||||
dataIndex: 'valuespan',
|
||||
key: 'valuespan',
|
||||
com: [
|
||||
{ label: '', type: 'TEXT' },
|
||||
],
|
||||
width : "33%"
|
||||
},
|
||||
];
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@gk3bvh`}
|
||||
title={this.state.titleBatchModify}
|
||||
visible={visible}
|
||||
buttons={this.getBmBottomButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{setVisible(false)}}
|
||||
style={{width:1000,height:700}}>
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@g2zlpr`} height={"100%"}>
|
||||
<div className="prj-bm-top">
|
||||
<div className="top-form">
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@8mt1gk`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ojrilh`} span={11}>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@5hbuyn`} label={getLabel(685, "字段名称")} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }}>
|
||||
{ bmOptions.length > 0 &&<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@dk70e1`}
|
||||
value={bmOptionValue}
|
||||
options={bmOptions}
|
||||
onChange={(v, showname)=> { fieldChange(v,showname,prjid)} }
|
||||
width={"100%"}
|
||||
/>}
|
||||
</WeaFormItem>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@fk4j44`} span={2}>
|
||||
<i className="icon-coms-replace" style={{fontSize:"29px",color:"#2db7f5"}}/>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@w9gw0e`} span={11}>
|
||||
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@z549r8`} labelCol={{ span: 0 }} wrapperCol={{ span: 22 }}>
|
||||
{this.getFormCondition()}
|
||||
</WeaFormItem>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<div className="top-add">
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@du138t`} style={{ padding: "8px"}}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@impms6`} span={22}></Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@6roi6m`} span={2}>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@x5dpui`} type="primary" disabled={typeof(bmOptionValue) == "number" || bmOptionValue == ""} size={"large"} onClick={() => {appendBmData()}}>{getLabel(611, "添加")}</Button>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="prj-bm-center">
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@3abk9f`} style={{ padding: "8px"}}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@7wxa0e`} span={10}>
|
||||
{getLabel('500364','已设变更字段') }
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
<div className="prj-bm-bottom">
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@81r8rg`}
|
||||
height={"100%"}
|
||||
onScroll={(e)=>{
|
||||
this.setState({
|
||||
scrollTop:e.target.scrollTop,
|
||||
})
|
||||
}}>
|
||||
<WeaTableEditable ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEditable@7w7j2o`}
|
||||
ref={el => {this.tableEdit = el}}
|
||||
columns={bmColumns}
|
||||
datas={toJS(bmDatas)}
|
||||
selectedData={bmSelectedDatas}
|
||||
selectedRowKeys={bmSelectedRowKeys}
|
||||
onChange={this.bmOnChange}
|
||||
onRowSelect={this.bmOnRowSelect}
|
||||
showDelete={true}
|
||||
showAdd={false}
|
||||
showCopy={false}
|
||||
/>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</WeaNewScroll>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
|
||||
getBmBottomButtons() {
|
||||
const { bmDatas,setVisible,submitBatchModify } = this.props.contentStore;
|
||||
const count = toJS(bmDatas).length;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@fyjr85`} type="primary" onClick={() => {
|
||||
submitBatchModify(this.props.selectedRowKeys);
|
||||
if(this.props.reset){
|
||||
this.props.reset();
|
||||
}
|
||||
}}
|
||||
disabled={count == 0}
|
||||
>{getLabel(615, '提交')}</Button>)
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jpqg3n`} type="primary" onClick={() => {
|
||||
setVisible(false)
|
||||
}}>{getLabel(309, '关闭')}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
|
||||
getFormCondition = () => {
|
||||
const basicToolBar = {
|
||||
uploadUrl: (window.ecologyContentPath || '')+"/api/blog/fileupload/uploadimage",
|
||||
startupFocus: false,
|
||||
toolbar: [
|
||||
{ name: 'markdown', items: ['Markdown'] },
|
||||
{ name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview', '-', 'Templates'] },
|
||||
{ name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
|
||||
{ name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'] },
|
||||
{ name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
|
||||
{ name: 'colors', items: ['TextColor', 'BGColor'] },
|
||||
{ name: 'tools', items: ['Maximize', 'ShowBlocks'] },
|
||||
{ name: 'insert', items: ['Image', 'Table', 'Smiley'] }
|
||||
],
|
||||
};
|
||||
const {bmform,bmCondition} = this.props.contentStore;
|
||||
const {isFormInit} = bmform;
|
||||
let items = [];
|
||||
isFormInit && bmCondition.map(c =>{
|
||||
c.items.map((fields,index) => {
|
||||
if (fields.conditionType == "RICHTEXT") { //多行文本
|
||||
items.push(<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@oih18l@${index}`} fieldConfig={{...fields,ckConfig:basicToolBar}} form={bmform}/>)
|
||||
}else{
|
||||
items.push(<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@k8xseb@${index}`} fieldConfig={fields} form={bmform}/>)
|
||||
}
|
||||
});
|
||||
});
|
||||
return items;
|
||||
}
|
||||
|
||||
bmOnChange = (datas, other) => {
|
||||
const {onBmChange} = this.props.contentStore;
|
||||
onBmChange(datas);
|
||||
}
|
||||
|
||||
bmOnRowSelect = (selectedRowKeys,selectComs) => {
|
||||
const {onBmRowSelect} = this.props.contentStore;
|
||||
onBmRowSelect(selectedRowKeys,selectComs);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
|
||||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaLocaleProvider} from "ecCom"
|
||||
import {Button,Modal} from "antd"
|
||||
import {WeaTableNew,WeaSwitch} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {toJS} from "mobx"
|
||||
import CptInfo from './cptInfo'
|
||||
|
||||
@observer
|
||||
export default class CptEdit extends React.Component{
|
||||
componentWillReceiveProps(nextProps){
|
||||
}
|
||||
shouldComponentUpdate(){
|
||||
return true;
|
||||
}
|
||||
render(){
|
||||
const {contentStore,isdata} = this.props;
|
||||
const {showEditDialog,cptForm,cptInfo} = this.props.contentStore;
|
||||
return (
|
||||
<WeaDialog
|
||||
title={isdata == "2" ?"编辑资产" :"编辑资产资料" }
|
||||
visible={showEditDialog}
|
||||
buttons={this.getBottomButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{contentStore.showCptInfo(false)}}
|
||||
style={{width:1000,height:700}}>
|
||||
<WeaRightMenu datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaNewScroll height={"100%"}>
|
||||
{showEditDialog && <CptInfo form={cptForm} condition={cptInfo} />}
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
getBottomButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {cptInfo,saveCptInfo,capitalid,showCptInfo} = this.props.contentStore;
|
||||
let btnArr = [];
|
||||
let rightMenu = toJS(cptInfo.rightMenus) || [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button type="primary"
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_SUBMIT"){ //
|
||||
saveCptInfo();
|
||||
}else if(m.type == "BTN_EDIT"){
|
||||
showCptInfo(true,{capitalid:capitalid,viewtype:'edit'});
|
||||
}
|
||||
}}>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
btnArr.push(<Button type="primary" onClick={()=>{contentStore.showCptInfo(false)}}>关闭</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {contentStore} = this.props;
|
||||
const {cptInfo,} = this.props.contentStore;
|
||||
let btnArr = [];
|
||||
let rightMenu = toJS(cptInfo.rightMenus) || [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {contentStore} = this.props;
|
||||
const {cptInfo,saveCptInfo,capitalid,showCptInfo,onCptDel,doMend,onGiveback} = this.props.contentStore;
|
||||
let rightMenu = toJS(cptInfo.rightMenus) || [];
|
||||
let that = this;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
if(m.type == "BTN_SUBMIT"){ //验收
|
||||
saveCptInfo();
|
||||
}else if(m.type == 'BTN_BACK'){ //返回
|
||||
showCptInfo(true,{capitalid:capitalid,viewtype:'edit'});
|
||||
}else if(m.type == "BTN_EDIT"){
|
||||
showCptInfo(true,{capitalid:capitalid,viewtype:'edit'});
|
||||
}else if(m.type == "BTN_DELETE"){
|
||||
Modal.confirm({
|
||||
title: '您确认要删除吗?',
|
||||
content: '',
|
||||
onOk() {
|
||||
onCptDel({capitalid:capitalid,viewtype:'cptdel'});
|
||||
showCptInfo(false);
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}else if(m.type == "BTN_GIVEBACK"){ //归还
|
||||
let params = {viewtype:'cptbackone',capitalid:capitalid}
|
||||
Modal.confirm({
|
||||
title: '您确认要归还吗?',
|
||||
content: '',
|
||||
onOk() {
|
||||
onGiveback(params);
|
||||
},
|
||||
onCancel() {},
|
||||
});
|
||||
}else if(m.type == "BTN_MEND"){ //送修
|
||||
doMend(true,{capitalid:capitalid})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
|
||||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaFormItem,WeaSearchGroup,WeaLocaleProvider} from "ecCom"
|
||||
import {Button,message, Spin} from "antd"
|
||||
import {WeaTableNew,WeaSwitch} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {toJS} from "mobx"
|
||||
import equal from 'deep-equal'
|
||||
import TaskInfo from '../common/taskInfo'
|
||||
import * as Task_Apis from '../../apis/task'
|
||||
|
||||
@observer
|
||||
export default class TaskDialog extends React.Component{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false,
|
||||
}
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
}
|
||||
shouldComponentUpdate(){
|
||||
return true;
|
||||
}
|
||||
render(){
|
||||
const {contentStore} = this.props;
|
||||
const {visible,taskForm,taskInfo,title,handleDialog} = contentStore;
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@2wg3ls`}
|
||||
title={title }
|
||||
visible={visible}
|
||||
buttons={this.getBottomButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{handleDialog(false)}}
|
||||
style={{width:1000,height:700}}>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@0bwnkl`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@5hfoke`} height={"100%"}>
|
||||
<TaskInfo ecId={`${this && this.props && this.props.ecId || ''}_TaskInfo@d1nn6g`} listStore = {contentStore} form={taskForm} />
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
getBottomButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {handleDialog,rightMenu} = contentStore;
|
||||
let btnArr = [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@r6qjcz@${m.type}`} type="primary"
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_SAVE"){ //保存
|
||||
this.saveTaskInfo();
|
||||
}
|
||||
}}
|
||||
disabled = {this.state.loading}
|
||||
>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@e8ikk2@close`} type="primary" disabled = {this.state.loading} onClick={()=>{handleDialog(false)}}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {contentStore} = this.props;
|
||||
const {handleDialog,rightMenu} = contentStore;
|
||||
let btnArr = [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName,
|
||||
disabled : this.state.loading
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
const {contentStore} = this.props;
|
||||
const {handleDialog,rightMenu} = contentStore;
|
||||
let that = this;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
if(m.type == "BTN_SAVE"){ //验收
|
||||
this.saveTaskInfo();
|
||||
}else if(m.type == 'BTN_BACK'){ //返回
|
||||
//showCptInfo(true,{capitalid:capitalid,viewtype:'edit'});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
saveTaskInfo= (params={})=>{
|
||||
const {prjid,contentStore,callBack} = this.props;
|
||||
const {handleDialog,taskForm,taskInfo,type,taskid,baseParams,validateRules} = contentStore;
|
||||
taskForm.validateForm().then(f=>{
|
||||
if(f.isValid){
|
||||
this.setState({loading:true});
|
||||
let newParams = {...baseParams,...toJS(taskForm.getFormParams()),method:type,taskid:taskid,prjid:prjid||"",...params};
|
||||
const {field18} = newParams;
|
||||
Task_Apis.getCheckRole({roleid:field18}).then(data=>{
|
||||
if(data.data.isAccess){
|
||||
Task_Apis.saveTaskInfo(newParams).then(data=>{
|
||||
if(data.success){
|
||||
handleDialog(false);
|
||||
message.success(getLabel(18758, "保存成功"));
|
||||
if(callBack){
|
||||
callBack();
|
||||
}else{
|
||||
window._table.reLoad();
|
||||
}
|
||||
}else{
|
||||
message.error(getLabel(383746,"请求失败")+": "+data.msgcode);
|
||||
}
|
||||
this.setState({loading:false});
|
||||
})
|
||||
}else{
|
||||
message.error("审批人选择角色下不存在人员!");
|
||||
this.setState({loading:false});
|
||||
}
|
||||
})
|
||||
// Task_Apis.saveTaskInfo(newParams).then(data=>{
|
||||
// if(data.success){
|
||||
// handleDialog(false);
|
||||
// message.success(getLabel(18758, "保存成功"));
|
||||
// if(callBack){
|
||||
// callBack();
|
||||
// }else{
|
||||
// window._table.reLoad();
|
||||
// }
|
||||
// }else{
|
||||
// message.error(getLabel(383746,"请求失败")+": "+data.msgcode);
|
||||
// }
|
||||
// this.setState({loading:false});
|
||||
// })
|
||||
}else{
|
||||
f.showErrors();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaFormItem,WeaSearchGroup,WeaLocaleProvider} from "ecCom"
|
||||
import {Button,Modal} from "antd"
|
||||
import {WeaTableNew,WeaSwitch} from 'comsMobx';
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
import {toJS} from "mobx"
|
||||
import equal from 'deep-equal'
|
||||
import TaskList from "../common/TaskList"
|
||||
|
||||
@observer
|
||||
export default class TaskListDialog extends React.Component{
|
||||
componentWillReceiveProps(nextProps){
|
||||
}
|
||||
shouldComponentUpdate(){
|
||||
return true;
|
||||
}
|
||||
render(){
|
||||
const {contentStore} = this.props;
|
||||
const {listVisible,showTaskLiskModal} = contentStore;
|
||||
return (
|
||||
<WeaDialog
|
||||
title={getLabel(18505,"任务列表")}
|
||||
visible={listVisible}
|
||||
buttons={this.getBottomButtons()}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>{showTaskLiskModal(false)}}
|
||||
style={{width:1100,height:700}}>
|
||||
<WeaRightMenu datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
|
||||
<WeaNewScroll height={"100%"}>
|
||||
<TaskList contentStore={contentStore} />
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
)
|
||||
}
|
||||
getBottomButtons(){
|
||||
const {contentStore }= this.props;
|
||||
const {rightMenu,taskInfoStore,prjid,prjCardStore} = contentStore;
|
||||
let btnArr = [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
|
||||
<Button type="primary"
|
||||
onClick={()=>{
|
||||
if(m.type == "BTN_ADDTASK"){ //添加任务
|
||||
taskInfoStore.handleDialog(true,"add",'',{prjid:prjid,parentid:""});
|
||||
}else if(m.type == 'BTN_EDIT'){ //编辑
|
||||
|
||||
}else if(m.type == 'BTN_DOSUBMIT'){ //提交执行
|
||||
prjCardStore.doPlanOpt_task({method:'approveplan',prjid:prjid});
|
||||
}else if(m.type == 'BTN_APPSUBMIT'){ //提交执行(审批)
|
||||
prjCardStore.doPlanOpt_task({method:'submitplan',prjid:prjid});
|
||||
}
|
||||
}}>
|
||||
{m.menuName}
|
||||
</Button>
|
||||
);
|
||||
});
|
||||
btnArr.push(<Button type="primary" onClick={()=>{showTaskLiskModal(false)}}>{getLabel(309,"关闭")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {contentStore }= this.props;
|
||||
const {rightMenu} = contentStore;
|
||||
let btnArr = [];
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
|
||||
btnArr.push({
|
||||
icon: <i className={m.menuIcon} />,
|
||||
content: m.menuName
|
||||
})
|
||||
});
|
||||
return btnArr
|
||||
}
|
||||
onRightMenuClick(key){
|
||||
let that = this;
|
||||
const {contentStore }= this.props;
|
||||
const {rightMenu,prjid,taskInfoStore,relateListStore,prjCardStore} = contentStore;
|
||||
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
|
||||
if(Number(key) == i){
|
||||
if(m.type == "BTN_ADDTASK"){ //添加任务
|
||||
taskInfoStore.handleDialog(true,"add",'',{prjid:prjid,parentid:""});
|
||||
}else if(m.type == 'BTN_EDIT'){ //编辑
|
||||
|
||||
}else if(m.type == 'BTN_DOSUBMIT'){ //提交执行
|
||||
prjCardStore.doPlanOpt_task({method:'approveplan',prjid:prjid});
|
||||
}else if(m.type == 'BTN_APPSUBMIT'){ //提交执行(审批)
|
||||
prjCardStore.doPlanOpt_task({method:'submitplan',prjid:prjid});
|
||||
}else if(m.type == 'BTN_TASKEXPORT'){ //导出任务
|
||||
prjCardStore.doTaskExcelExp({prjid:prjid});
|
||||
}else if(m.type == 'BTN_SAVEPLAN'){ //存为计划版本
|
||||
prjCardStore.saveasplan({method:'saveasplan',prjid:prjid});
|
||||
}else if(m.type == 'BTN_TASKHISTORY'){ //历史版本
|
||||
relateListStore.handleRelateDialog(true,"history",prjid)
|
||||
}else if(m.type == 'BTN_NOTEMEMBER'){ //通知成员
|
||||
relateListStore.handleRelateDialog(true,"notice",prjid)
|
||||
}else if(m.type == 'BTN_ONREQUEST'){ //相关流程
|
||||
relateListStore.handleRelateDialog(true,"request",prjid)
|
||||
}else if(m.type == 'BTN_ONDOC'){ //相关文档
|
||||
relateListStore.handleRelateDialog(true,"doc",prjid)
|
||||
}else if(m.type == 'BTN_ONCOWORK'){ //相关协作
|
||||
relateListStore.handleRelateDialog(true,"cowork",prjid)
|
||||
}else if(m.type == 'BTN_LOG'){ //日志
|
||||
relateListStore.handleRelateDialog(true,"log",prjid)
|
||||
}
|
||||
if(m.type == "BTN_COLUMN"){ //显示定制
|
||||
prjCardStore.onShowColumn();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
|
||||
import {Button,Modal,message,Spin} from 'antd';
|
||||
import {WeaDialog,WeaTab,WeaNewScroll,WeaRightMenu,WeaLocaleProvider,WeaFormItem,WeaInput,WeaSearchGroup } from 'ecCom';
|
||||
import {observer} from "mobx-react";
|
||||
import * as Apis from '../../apis/project';
|
||||
import WbsFieldSet from '../common/wbsFieldSet'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@observer
|
||||
class WbsFieldSetDialog extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
width:700,
|
||||
height:500,
|
||||
isDisabled: false
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
this.computedWH();
|
||||
}
|
||||
computedWH=()=>{
|
||||
const screenWidth = document.body.clientWidth;
|
||||
const screenHeight = document.body.clientHeight;
|
||||
if(screenWidth <= 700){
|
||||
this.setState({width:screenWidth,})
|
||||
}
|
||||
if(screenHeight <= 500){
|
||||
this.setState({ height :screenHeight})
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const prjImportStore = this.props.contentStore;
|
||||
const {visible} = prjImportStore;
|
||||
const { width,height} = this.state;
|
||||
return (
|
||||
<div>
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@k0kdtr`}
|
||||
title= {getLabel(516151,"WBS导入字段配置")}
|
||||
visible={visible}
|
||||
style= {{width: width, height: document.body.clientHeight -270}}
|
||||
maskClosable={false}
|
||||
icon="icon-coms-project"
|
||||
iconBgcolor="#217346"
|
||||
onCancel={()=>prjImportStore.handleDialog(false)}
|
||||
buttons={this.getDialogButtons()}
|
||||
>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@oldees`} datas={this.getRightMenu()} >
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@nqpdgl`} height={document.body.clientHeight - 300+"px"}>
|
||||
<WbsFieldSet ecId={`${this && this.props && this.props.ecId || ''}_WbsFieldSet@74fnoj`} ref={el => {this.wbs = el}} wbsStore={prjImportStore}/>
|
||||
</WeaNewScroll>
|
||||
</WeaRightMenu>
|
||||
</WeaDialog>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
getDialogButtons(){
|
||||
const {contentStore} = this.props;
|
||||
const {saveVisible} = contentStore;
|
||||
let btn = [];
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@m3d981@save`} type="primary" disabled={saveVisible} onClick={()=>{this.wbs.wbsFieldSet.showErrors();contentStore.saveTaskWbsField();}}>{getLabel(86,"保存")}</Button>);
|
||||
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@rue8y4@close`} type="primary" onClick={()=>contentStore.handleDialog(false)}>{getLabel(309,"关闭")}</Button>);
|
||||
return btn
|
||||
}
|
||||
|
||||
getRightMenu() {
|
||||
const {contentStore} = this.props;
|
||||
const {saveVisible} = contentStore;
|
||||
let btns = [];
|
||||
btns.push({
|
||||
key: "taskwbssave",
|
||||
icon: <i className='icon-coms-Preservation' />,
|
||||
content: getLabel(86,"保存"),
|
||||
disabled: saveVisible,
|
||||
onClick : () => {
|
||||
this.wbs.wbsFieldSet.showErrors();
|
||||
contentStore.saveTaskWbsField();
|
||||
}
|
||||
});
|
||||
btns.push({
|
||||
key: "taskwbsadd",
|
||||
icon: <i className='icon-coms-Batch-add' />,
|
||||
content: getLabel(611,"添加"),
|
||||
onClick: () => {
|
||||
this.wbs.wbsFieldSet.doAdd();
|
||||
}
|
||||
});
|
||||
btns.push({
|
||||
key: "taskwbsdel",
|
||||
icon: <i className='icon-coms-delete' />,
|
||||
content: getLabel(91,"删除"),
|
||||
onClick: () => {
|
||||
this.wbs.wbsFieldSet.doDelete();
|
||||
}
|
||||
});
|
||||
return btns;
|
||||
}
|
||||
}
|
||||
|
||||
export default WbsFieldSetDialog;
|
||||
|
|
@ -0,0 +1,339 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {toJS} from "mobx"
|
||||
import {WeaSearchGroup,WeaBrowser,WeaUpload,WeaLocaleProvider,WeaError} from "ecCom"
|
||||
import { Button ,Row,Col,Spin} from 'antd';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject('prjImportStore')
|
||||
@observer
|
||||
class PrjImport extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
const {prjImportStore } = this.props;
|
||||
const {initDatas,} = prjImportStore;
|
||||
initDatas({imptype:'prj',isdata:'1'});
|
||||
}
|
||||
|
||||
getCircle() {
|
||||
let style = {
|
||||
width: 20,
|
||||
height: 20,
|
||||
backgroundColor: '#D8D8D8',
|
||||
webkitBorderRadius: 10,
|
||||
mozBorderRadius: 10,
|
||||
msBorderRadius: 10,
|
||||
oBorderRadius: 10,
|
||||
borderRadius: 10,
|
||||
textAlign: 'center',
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
getForm() {
|
||||
const{ prjImportStore} = this.props;
|
||||
const{isuse,mandstr,otherstr,prjmsg,imp_totalCount,imp_successCount} = prjImportStore;
|
||||
let prjcode = "";
|
||||
if(isuse==2){
|
||||
prjcode = getLabel(17852,"项目编码");
|
||||
}
|
||||
const require = "<span>"+getLabel(18019,"必填")+": "+getLabel(195,"名称")+" "+getLabel(586,"项目类型")+" "+prjcode+" "+getLabel(144,"经理")+" "+getLabel(18628,"项目成员")+" "+mandstr+" </span>";
|
||||
const other = "<span>"+getLabel(375,"其他")+": "+getLabel(15486,"序号")+" "+getLabel(432,"工作类型")+" "+getLabel(783,"相关客户")+" "+
|
||||
getLabel(15263,"客户可见")+" "+getLabel(624,"成员可见")+" "+getLabel(636,"上级项目")+" "+getLabel(637,"评价书")+" "+getLabel(638,"确认书")+" "+getLabel(639,"建议书")+" "+otherstr+" </span>";
|
||||
let condition =
|
||||
[{
|
||||
"title": getLabel(24893, "基础信息"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"checkbox": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"detailtype": 1,
|
||||
"domkey": ["prjtype"],
|
||||
"fieldcol": 18,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(586,"项目类型"),
|
||||
"labelcol": 5,
|
||||
"length": 0,
|
||||
"precision": 0,
|
||||
"showOrder": 0,
|
||||
"stringLength": 0,
|
||||
"tipPosition": "bottom",
|
||||
"viewAttr": 2,
|
||||
"value":""
|
||||
}, {
|
||||
"checkbox": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "RESOURCEIMG",
|
||||
"detailtype": 1,
|
||||
"domkey": ["excelfile"],
|
||||
"fieldcol": 18,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(16699, "Excel文件"),
|
||||
"labelcol": 5,
|
||||
"length": 0,
|
||||
"precision": 0,
|
||||
"showOrder": 0,
|
||||
"stringLength": 0,
|
||||
"tipPosition": "bottom",
|
||||
"viewAttr": 2
|
||||
}]
|
||||
}, {
|
||||
"title": getLabel(19010,"操作说明"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"index": 1,
|
||||
"value": getLabel(28447, "第一步,请先")
|
||||
}, {
|
||||
"index": 2,
|
||||
"value": getLabel(32986,"第二步,下载后,填写内容,注意,要填写的内容在下边的说明中有详细的说明,请一定要确定你的Excel文档的格式是模板中的格式,而没有被修改掉")
|
||||
}, {
|
||||
"index": 3,
|
||||
"value": getLabel(32987,"第三步,选择填写好的Excel文档,点击提交按钮进行批量导入")
|
||||
}, {
|
||||
"index": 4,
|
||||
"value": getLabel(32988,"第四步,如果以上步骤和Excel文档正确的话,数据会被正确的导入,导入成功会有提示。如果有问题,则会提示Excel文档的错误之处")
|
||||
}]
|
||||
}, {
|
||||
"title": getLabel(24962,"字段说明"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"index": 1,
|
||||
"value": getLabel(18617,"请按下列顺序排列需导入的EXCEL文档中各字段的顺序,其中红色的部分为必填字段,不能为空!")
|
||||
}, {
|
||||
"index": 2,
|
||||
"value":require
|
||||
}, {
|
||||
"index": 3,
|
||||
"value":other
|
||||
}]
|
||||
}, {
|
||||
"title": getLabel(502196,"注意事项"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"index": 1,
|
||||
"value": getLabel(521941,"若要给已存在的项目导入子项目时,则需要在Excel模板中的上级项目字段输入已存在的项目,格式为:name_项目名称或者key_项目id")
|
||||
}]
|
||||
}]
|
||||
let _arr = [];
|
||||
|
||||
condition.map((c, i) => {
|
||||
let arr = [];
|
||||
if (i == 0) { //基本信息
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@9gvgcj@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@njxvor@${index}`} span={1} offset={4}>
|
||||
<div style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}><div style={{ paddingTop: 2 }}>{index + 1}</div></div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@dls3wy@${index}`} span={17}>
|
||||
<div style={{ marginTop: 15 }}>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@4dhi9n@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vrmca5@${index}`} span={field.labelcol}>{field.label}:</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@lz6soa@${index}`} span={field.fieldcol}>
|
||||
{this.getDom(field)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1,
|
||||
})
|
||||
})
|
||||
//导入提示信息
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@q7m2b0`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@qa9yz0`} offset={4}>
|
||||
<div style={{color:"red"}} >
|
||||
<div className="card-call" dangerouslySetInnerHTML={{__html:prjmsg}}></div>
|
||||
{ prjmsg!=""&&(parseInt(imp_totalCount)>0&&<span className="card-call" > {getLabel(128217,"总记录数")}{imp_totalCount}{getLabel(18256,"条")} ,{getLabel(128219,"成功导入")}{imp_successCount}{getLabel(18256,"条")},{getLabel(25009,"失败")}{parseInt(imp_totalCount) - parseInt(imp_successCount)}{getLabel(18256,"条")}。 </span>) }
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1,
|
||||
})
|
||||
}
|
||||
if (i == 1) { //导入说明
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@0l4zwi@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@rr7cvr@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}>
|
||||
<div style={{ paddingTop: 2 }}>{index + 1}</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@76emty@${index}`} span={17} style={{ marginTop: 15 }}>
|
||||
{this.getIllustration(field.value, field.link, index, field)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
if (i == 2) { //字段说明
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@usfngx@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@9yp78z@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}>
|
||||
<div style={{ paddingTop: 2 }}>{index + 1}</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@qouyby@${index}`} span={17} style={{ marginTop: 15 }}>
|
||||
{this.getIllustration1(field.value, field.link, index, field)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
if (i == 3) { //注意事项
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@8mch6v@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vjk2sw@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}>
|
||||
<div style={{ paddingTop: 2 }}>{index + 1}</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2ykdvp@${index}`} span={17} style={{ marginTop: 15 }}>
|
||||
<p><div dangerouslySetInnerHTML={{ __html: field.value }} /></p>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
_arr.push(<div><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@ki7nqj@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>)
|
||||
});
|
||||
return _arr;
|
||||
}
|
||||
|
||||
getDom(field) {
|
||||
const { prjImportStore} = this.props;
|
||||
const {filelist,replaceDatas} = prjImportStore;
|
||||
let dom;
|
||||
let domkey = field.domkey;
|
||||
if (domkey&&domkey[0] == 'excelfile') {
|
||||
dom = (<div>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@0x0xki`}
|
||||
ref={ref => { prjImportStore.prjremind = ref } }
|
||||
error={getLabel(126186,"未")+getLabel(82694,"选择Excel文件")}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<div style={{ float: 'left', marginTop: -10 }}>
|
||||
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@touxwq`}
|
||||
uploadUrl={`${window.ecologyContentPath || ''}/api/doc/upload/uploadFile`}
|
||||
category='string'
|
||||
limitType='xls'
|
||||
maxFilesNumber={1}
|
||||
datas={filelist}
|
||||
onChange={(ids, list) => {
|
||||
this.setFileId(ids, list)
|
||||
}
|
||||
} >
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@2sormu`}>{getLabel(125333,"选择文件")}</Button>
|
||||
</WeaUpload>
|
||||
</div>
|
||||
<div style={{ float: 'left', paddingLeft: 10 }}>
|
||||
{filelist.length == 0 ? <p>{getLabel(384040,"未选择任何文件")}</p> : filelist.map(file => <p>{file.filename}</p>)}
|
||||
</div>
|
||||
</WeaError>
|
||||
</div>)
|
||||
} else {
|
||||
dom = <div>
|
||||
<span style={{display:"inline-block",float:"left",width:"35%",marginRight:10}}>
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@acwx3u`} style={{display:"inline"}} replaceDatas={toJS(replaceDatas)} type={244} hasAdvanceSerach={true} title={getLabel(586,"项目类型")}
|
||||
onChange={(ids, names, datas)=>{
|
||||
prjImportStore.savePrjType(ids,datas,'prj');
|
||||
}}/>
|
||||
</span>
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@nlsn35`} style={{display:"inline",marginBottom:"5px"}} type="primary" onClick={()=>this.regenTemplate()}>{getLabel(83555,"重生成模板")}</Button>
|
||||
</div>
|
||||
}
|
||||
return dom;
|
||||
}
|
||||
|
||||
getIllustration(val, url, index, link) {
|
||||
const { prjImportStore} = this.props;
|
||||
const {isrefresh,isuse } = prjImportStore;
|
||||
let tempurl = "";
|
||||
if(isuse == 0 || isuse == 1){
|
||||
tempurl = (window.ecologyContentPath || '')+"/proj/imp/prjimp_xlsnew.xls?V="+isrefresh;
|
||||
}else{
|
||||
tempurl = (window.ecologyContentPath || '')+"/proj/imp/prjimp_xlsnew1.xls?V="+isrefresh;
|
||||
}
|
||||
let p;
|
||||
if (index == 0) {
|
||||
p = (<p>{val}:<a href={tempurl}>{getLabel(28446,"下载EXCEL文档模板")}</a></p>);
|
||||
} else {
|
||||
p = (<p><div dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
getIllustration1(val, url, index, link) {
|
||||
let p;
|
||||
if (index == 0) {
|
||||
p = (<p><div style={{fontWeight:700}} dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
} else if(index==1){
|
||||
p = (<p><div style={{color:"red"}} dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
} else{
|
||||
p = (<p><div dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
render(){
|
||||
const { prjImportStore } = this.props;
|
||||
const { spinning } = prjImportStore;
|
||||
return (
|
||||
<div>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@pik1x9`} spinning={spinning}>
|
||||
{this.getForm()}
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
setFileId(ids, list) {
|
||||
const {prjImportStore} = this.props;
|
||||
prjImportStore.excelfile = ids;
|
||||
prjImportStore.filelist = list;
|
||||
}
|
||||
|
||||
regenTemplate=(key)=>{
|
||||
const{ prjImportStore} = this.props;
|
||||
prjImportStore.regenTemplate();
|
||||
}
|
||||
}
|
||||
|
||||
export default PrjImport;
|
||||
|
|
@ -0,0 +1,393 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {toJS} from "mobx"
|
||||
import {WeaSearchGroup,WeaBrowser,WeaSelect,WeaUpload,WeaLocaleProvider,WeaError} from "ecCom"
|
||||
import { Button ,Row,Col,Spin} from 'antd';
|
||||
import WbsFieldSet from "../dialog/wbsFieldSetDialog"
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject('prjImportStore')
|
||||
@observer
|
||||
class TaskImport extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state={
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
const {prjImportStore} = this.props;
|
||||
const {initTaskDatas,} = prjImportStore;
|
||||
initTaskDatas({imptype:'task',isdata:'2'});
|
||||
}
|
||||
getCircle() {
|
||||
let style = {
|
||||
width: 20,
|
||||
height: 20,
|
||||
backgroundColor: '#D8D8D8',
|
||||
webkitBorderRadius: 10,
|
||||
mozBorderRadius: 10,
|
||||
msBorderRadius: 10,
|
||||
oBorderRadius: 10,
|
||||
borderRadius: 10,
|
||||
textAlign: 'center',
|
||||
}
|
||||
return style;
|
||||
}
|
||||
|
||||
getForm() {
|
||||
const{ prjImportStore} = this.props;
|
||||
const{taskmandstr,taskotherstr,filetype,taskwbsfieldstr,taskmsg,imp_totalCount,imp_successCount} = prjImportStore;
|
||||
const require = "<span>"+getLabel(18019,"必填")+": "+getLabel(1352,"任务名称")+" "+getLabel(2097,"负责人")+" "+getLabel(26797,"项目阶段")+" "+ taskmandstr + "</span>";
|
||||
let other = "<span>"+getLabel(375,"其他")+": "+getLabel(15486,"序号")+" "+getLabel(23785,"上级任务")+" "+getLabel(1322,"起始日期")+" "+
|
||||
getLabel(741,"结束日期")+" "+getLabel(15274,"项目预算")+" "+getLabel(2232,"里程碑任务")+" "+getLabel(2233,"前置任务")+" "+getLabel(2240,"任务说明")+" "+taskotherstr+" </span>";
|
||||
let str2 = getLabel(32986,"第二步,下载后,填写内容,注意,要填写的内容在下边的说明中有详细的说明,请一定要确定你的Excel文档的格式是模板中的格式,而没有被修改掉");
|
||||
let str3 = getLabel(32987,"第三步,选择填写好的Excel文档,点击提交按钮进行批量导入");
|
||||
let str4 = getLabel(32988,"第四步,如果以上步骤和Excel文档正确的话,数据会被正确的导入,导入成功会有提示。如果有问题,则会提示Excel文档的错误之处");
|
||||
let str5 = getLabel(18617,"请按下列顺序排列需导入的EXCEL文档中各字段的顺序,其中红色的部分为必填字段,不能为空!");
|
||||
if(filetype==='2'){
|
||||
str2 = getLabel(516145,"第二步,配置任务字段后,按照字段格式以及任务必填字段维护好WBS文档内容");
|
||||
str3 = getLabel(516146,"第三步,选择填写好的WBS文档,点击提交按钮进行批量导入");
|
||||
str4 = getLabel(516147,"第四步,如果以上步骤和WBS文档正确的话,数据会被正确的导入,导入成功会有提示。如果有问题,则会提示WBS文档的错误之处");
|
||||
str5 = getLabel(516148,"请按下列已配置字段关系维护WBS文档,其中红色的部分为必填字段,不能为空!");
|
||||
other = "<span>"+getLabel(516149,"已配置:")+taskwbsfieldstr+" </span>";
|
||||
}
|
||||
|
||||
let condition =
|
||||
[{
|
||||
"title": getLabel(24893, "基础信息"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"checkbox": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "BROWSER",
|
||||
"detailtype": 1,
|
||||
"domkey": ["prjtype"],
|
||||
"fieldcol": 18,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(522069 ,"选择项目"),
|
||||
"labelcol": 5,
|
||||
"length": 0,
|
||||
"precision": 0,
|
||||
"showOrder": 0,
|
||||
"stringLength": 0,
|
||||
"tipPosition": "bottom",
|
||||
"viewAttr": 2,
|
||||
"value":""
|
||||
},{
|
||||
"colSpan": 2,
|
||||
"conditionType": "SELECT",
|
||||
"domkey": [
|
||||
"filetype"
|
||||
],
|
||||
"fieldcol": 18,
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(24863,"导入类型"),
|
||||
"labelcol": 5,
|
||||
"options": [
|
||||
{
|
||||
"key": "1",
|
||||
"selected": filetype==1?true:false,
|
||||
"showname": "Excel"
|
||||
}, {
|
||||
"key": "2",
|
||||
"selected": filetype==2?true:false,
|
||||
"showname": "WBS"
|
||||
}
|
||||
],
|
||||
"viewAttr": 3
|
||||
}, {
|
||||
"checkbox": false,
|
||||
"colSpan": 2,
|
||||
"conditionType": "RESOURCEIMG",
|
||||
"detailtype": 1,
|
||||
"domkey": ["excelfile"],
|
||||
"fieldcol": 18,
|
||||
"hasBorder": false,
|
||||
"helpfulTipProps": {},
|
||||
"isQuickSearch": false,
|
||||
"label": getLabel(18493, "文件"),
|
||||
"labelcol": 5,
|
||||
"length": 0,
|
||||
"precision": 0,
|
||||
"showOrder": 0,
|
||||
"stringLength": 0,
|
||||
"tipPosition": "bottom",
|
||||
"viewAttr": 2
|
||||
}]
|
||||
}, {
|
||||
"title": getLabel(19010,"操作说明"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"index": 1,
|
||||
"value": getLabel(28447, "第一步,请先")
|
||||
}, {
|
||||
"index": 2,
|
||||
"value": str2
|
||||
}, {
|
||||
"index": 3,
|
||||
"value": str3
|
||||
}, {
|
||||
"index": 4,
|
||||
"value": str4
|
||||
}]
|
||||
}, {
|
||||
"title": getLabel(24962,"字段说明"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"index": 1,
|
||||
"value": str5
|
||||
}, {
|
||||
"index": 2,
|
||||
"value":require
|
||||
}, {
|
||||
"index": 3,
|
||||
"value":other
|
||||
}]
|
||||
}, {
|
||||
"title": getLabel(502196,"注意事项"),
|
||||
"defaultshow": true,
|
||||
"items": [{
|
||||
"index": 1,
|
||||
"value": getLabel(521942,"若要给已存在的任务导入子任务或后置任务时,则需要在Excel模板中的上级任务或前置任务字段输入已存在的任务,格式为:name_任务名称或者key_任务id")
|
||||
}]
|
||||
}]
|
||||
|
||||
|
||||
let _arr = [];
|
||||
|
||||
condition.map((c, i) => {
|
||||
let arr = [];
|
||||
if (i == 0) { //基本信息
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@bniaso@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@baatmf@${index}`} span={1} offset={4}>
|
||||
<div style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}><div style={{ paddingTop: 2 }}>{index + 1}</div></div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@pt7stn@${index}`} span={17}>
|
||||
<div style={{ marginTop: 15 }}>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@o71noz@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@pvize3@${index}`} span={field.labelcol}>{field.label}:</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@4jn6f5@${index}`} span={field.fieldcol}>
|
||||
{this.getDom(field)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1,
|
||||
})
|
||||
})
|
||||
//导入提示信息
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@fpks44`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vh5bnz`} offset={4}>
|
||||
<div style={{color:"red"}} >
|
||||
<div className="card-call" dangerouslySetInnerHTML={{__html:taskmsg}}></div>
|
||||
{ taskmsg!=""&&(parseInt(imp_totalCount)>0&&<span className="card-call" > {getLabel(128217,"总记录数")}{imp_totalCount}{getLabel(18256,"条")} ,{getLabel(128219,"成功导入")}{imp_successCount}{getLabel(18256,"条")},{getLabel(25009,"失败")}{parseInt(imp_totalCount) - parseInt(imp_successCount)}{getLabel(18256,"条")}。 </span>) }
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1,
|
||||
})
|
||||
}
|
||||
if (i == 1) { //导入说明
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@3faf6p@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@wy08a4@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}>
|
||||
<div style={{ paddingTop: 2 }}>{index + 1}</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@h67eq7@${index}`} span={17} style={{ marginTop: 15 }}>
|
||||
{this.getIllustration(field.value, field.link, index, field)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
if (i == 2) { //字段说明
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@iptdy6@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@utadbb@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}>
|
||||
<div style={{ paddingTop: 2 }}>{index + 1}</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@5cvjsp@${index}`} span={17} style={{ marginTop: 15 }}>
|
||||
{this.getIllustration1(field.value, field.link, index, field)}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
if (i == 3) { //注意事项
|
||||
c.items.map((field, index) => {
|
||||
arr.push({
|
||||
com: (
|
||||
<div>
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@a6nr6e@${index}`}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@eao5k6@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
|
||||
<div style={this.getCircle()}>
|
||||
<div style={{ paddingTop: 2 }}>{index + 1}</div>
|
||||
</div>
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@in8y92@${index}`} span={17} style={{ marginTop: 15 }}>
|
||||
<p><div dangerouslySetInnerHTML={{ __html: field.value }} /></p>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
),
|
||||
colSpan: 1
|
||||
})
|
||||
})
|
||||
}
|
||||
_arr.push(<div><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@68s39q@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>)
|
||||
});
|
||||
return _arr;
|
||||
}
|
||||
|
||||
getDom(field) {
|
||||
const { prjImportStore} = this.props;
|
||||
const {taskfilelist,taskreplaceDatas,filetype,readonly,taskDataParams} = prjImportStore;
|
||||
let dom;
|
||||
let domkey = field.domkey;
|
||||
if (domkey&&domkey[0] == 'excelfile') {
|
||||
dom = (<div>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@02trjn`}
|
||||
ref={ref => { prjImportStore.taskremind = ref } }
|
||||
error={getLabel(384040,"未选择任何文件")}
|
||||
tipPosition="bottom"
|
||||
>
|
||||
<div style={{ float: 'left', marginTop: -10 }}>
|
||||
{filetype==='1'&&<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@950tgn`}
|
||||
uploadUrl={`${window.ecologyContentPath || ''}/api/doc/upload/uploadFile`}
|
||||
category='string'
|
||||
limitType="xls"
|
||||
maxFilesNumber={1}
|
||||
datas={taskfilelist}
|
||||
onChange={(ids, list) => {
|
||||
this.setFileId(ids, list)
|
||||
}
|
||||
} >
|
||||
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@llrtxc`}>{getLabel(125333,"选择文件")}</Button>
|
||||
</WeaUpload>}
|
||||
{filetype==='2'&&<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@141udu`}
|
||||
uploadUrl={`${window.ecologyContentPath || ''}/api/doc/upload/uploadFile`}
|
||||
category='string'
|
||||
limitType="mpp"
|
||||
maxFilesNumber={1}
|
||||
datas={taskfilelist}
|
||||
onChange={(ids, list) => {
|
||||
this.setFileId(ids, list)
|
||||
}
|
||||
} ><Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0w2qky`}>{getLabel(125333,"选择文件")}</Button></WeaUpload>
|
||||
}
|
||||
</div>
|
||||
<div style={{ float: 'left', paddingLeft: 10 }}>
|
||||
{taskfilelist.length == 0 ? <p>{getLabel(384040,"未选择任何文件")}</p> : taskfilelist.map(file => <p>{file.filename}</p>)}
|
||||
</div>
|
||||
</WeaError>
|
||||
</div>)
|
||||
}else if (domkey&&domkey[0] == 'filetype') {
|
||||
dom = <span style={{display:"inline-block",width:"20%",marginRight:10}}>
|
||||
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@jplibo`} {...field} onChange={value => prjImportStore.saveFileType(value)}/>
|
||||
</span>
|
||||
} else {
|
||||
dom = <span style={{display:readonly?"bolck":"inline-block",width:"35%",marginRight:10}}>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@tz0il1`}
|
||||
ref={ref => { prjImportStore.selectremind = ref } }
|
||||
error={getLabel(383859,"请选择项目!")}
|
||||
tipPosition="bottom"
|
||||
style={{display:"inline-block",width:"100%"}}
|
||||
>
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@6rqxgy`} type={8} viewAttr={readonly?1:3} title={getLabel(101,"项目")} hasAdvanceSerach={true} replaceDatas={toJS(taskreplaceDatas) } dataParams={taskDataParams} completeParams={taskDataParams}
|
||||
onChange={(ids,names,datas)=>{
|
||||
prjImportStore.savePrjType(ids,datas,'task');
|
||||
}}/>
|
||||
</WeaError>
|
||||
</span>
|
||||
}
|
||||
return dom;
|
||||
}
|
||||
|
||||
getIllustration(val, url, index, link) {
|
||||
const{ prjImportStore} = this.props;
|
||||
const{taskisrefresh,filetype} = prjImportStore;
|
||||
let tempurl = (window.ecologyContentPath || '')+"/proj/imp/prjtskimp_xlsnew.xls?V="+taskisrefresh;
|
||||
let p;
|
||||
if (index == 0) {
|
||||
if(filetype==='1'){
|
||||
p = (<p>{val}:<a href={tempurl}>{getLabel(28446,"下载EXCEL文档模板")}</a></p>);
|
||||
}else{
|
||||
p = (<p>{val}{getLabel(516144,"请配置任务字段与WBS自定义字段对关系:")}<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@du7r9q`} type="primary" style={{paddingLeft:8,paddingRight:8,paddingTop:3,paddingBottom:3}}onClick={()=>{this.setWbsFiled();}}>{getLabel(516367,"字段配置")} </Button></p>);
|
||||
}
|
||||
|
||||
} else {
|
||||
p = (<p><div dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
getIllustration1(val, url, index, link) {
|
||||
let p;
|
||||
if (index == 0) {
|
||||
p = (<p><div style={{fontWeight:700}} dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
} else if(index==1){
|
||||
p = (<p><div style={{color:"red"}} dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
} else{
|
||||
p = (<p><div dangerouslySetInnerHTML={{ __html: val }} /></p>);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
render(){
|
||||
const { prjImportStore } = this.props;
|
||||
const { spinning } = prjImportStore;
|
||||
return (
|
||||
<div>
|
||||
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@9l8un5`} spinning={spinning}>
|
||||
{this.getForm()}
|
||||
</Spin>
|
||||
<WbsFieldSet ecId={`${this && this.props && this.props.ecId || ''}_WbsFieldSet@4racfc`} contentStore={prjImportStore}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
setFileId(ids, list) {
|
||||
const {prjImportStore} = this.props;
|
||||
prjImportStore.taskexcelfile = ids;
|
||||
prjImportStore.taskfilelist = list;
|
||||
}
|
||||
|
||||
setWbsFiled(){
|
||||
const {prjImportStore} = this.props;
|
||||
prjImportStore.handleDialog(true);
|
||||
}
|
||||
}
|
||||
|
||||
export default TaskImport;
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
import React from 'react';
|
||||
import { inject, observer } from 'mobx-react';
|
||||
import {WeaRightMenu,WeaTop,WeaTab,WeaErrorPage,WeaTools,WeaNewScroll,WeaLocaleProvider} from "ecCom"
|
||||
import { Button } from 'antd';
|
||||
import PrjImport from './PrjImport'
|
||||
import TaskImport from './TaskImport'
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject('prjImportStore')
|
||||
@observer
|
||||
class ProjectImport extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
componentWillReceiveProps(nextProps){
|
||||
if(this.props.location.key !== nextProps.location.key){
|
||||
const { location,prjImportStore } = nextProps;
|
||||
prjImportStore.clearStatus();
|
||||
}
|
||||
}
|
||||
componentWillUnmount(){
|
||||
const {prjImportStore } = this.props;
|
||||
prjImportStore.clearStatus();
|
||||
}
|
||||
render(){
|
||||
const title = getLabel(81757,"项目导入");
|
||||
const topTab = [
|
||||
{key: 'prjimport',title: getLabel(81757,"项目导入")},
|
||||
{key: 'taskimport', title: getLabel(383858,"任务导入")},
|
||||
];
|
||||
const {prjImportStore} = this.props;
|
||||
const {loading,selectTabkey,reflesh} = prjImportStore;
|
||||
return (
|
||||
<div>
|
||||
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@6vxonf`} datas={this.getRightMenu()} >
|
||||
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@iyo9sg`}
|
||||
title={title}
|
||||
icon={<i className='icon-coms-project' />}
|
||||
iconBgcolor='#217346'
|
||||
buttons={this.getTopButtons()}
|
||||
buttonSpace={10}
|
||||
showDropIcon={true}
|
||||
dropMenuDatas={this.getRightMenu()}
|
||||
onDropMenuClick={this.onRightMenuClick}
|
||||
>
|
||||
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@h54chk`}
|
||||
datas={topTab}
|
||||
keyParam="key" //主键
|
||||
selectedKey={ selectTabkey }
|
||||
onChange={ this.changeTab }
|
||||
/>
|
||||
<div className="prj-import-content">
|
||||
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@q4ob8r`} scrollId='prj-content-main-scroll' height='100%'>
|
||||
<div style={{display:selectTabkey == "prjimport" ? "block":"none"}}>
|
||||
<PrjImport ecId={`${this && this.props && this.props.ecId || ''}_PrjImport@dt9pqt`} key={reflesh}/>
|
||||
</div>
|
||||
<div style={{display:selectTabkey == "taskimport" ? "block":"none"}}>
|
||||
<TaskImport ecId={`${this && this.props && this.props.ecId || ''}_TaskImport@xq9ko0`} key={reflesh}/>
|
||||
</div>
|
||||
</WeaNewScroll>
|
||||
</div>
|
||||
</WeaTop>
|
||||
</WeaRightMenu>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
getTopButtons(){
|
||||
const {doImport,disabled} = this.props.prjImportStore;
|
||||
let btnArr = [];
|
||||
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@cyvilw@submit`} type="primary" disabled={disabled} onClick={()=>doImport()}>{getLabel(615,"提交")}</Button>)
|
||||
return btnArr;
|
||||
}
|
||||
getRightMenu(){
|
||||
const {doImport,disabled} = this.props.prjImportStore;
|
||||
let btnArr = [];
|
||||
btnArr.push({
|
||||
key: '1',
|
||||
icon: <i className={"icon-coms-Approval"} />,
|
||||
disabled: disabled,
|
||||
content: getLabel(615,"提交"),
|
||||
onClick:(key)=>{doImport()}
|
||||
});
|
||||
return btnArr;
|
||||
}
|
||||
changeTab=(key)=>{
|
||||
const {prjImportStore} = this.props;
|
||||
prjImportStore.changeTab(key);
|
||||
}
|
||||
}
|
||||
|
||||
export default WeaTools.tryCatch(React,
|
||||
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@4a9vbm`} msg={ props.error ? props.error : getLabel(383324,"'对不起,该页面异常,请联系管理员")} />,
|
||||
{error: ""}
|
||||
)(ProjectImport);
|
||||
|
|
@ -0,0 +1,525 @@
|
|||
import { toJS } from "mobx";
|
||||
import * as React from 'react';
|
||||
import { Input, Tooltip, message, Dropdown, Menu, Row, Col } from 'antd';
|
||||
import { WeaInput, WeaBrowser, WeaDatePicker, WeaLocaleProvider, WeaError } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
export default class KanbanGroup extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
visible: false,
|
||||
taskInfo: {
|
||||
taskName: "",
|
||||
hrmid: "",
|
||||
startDate: this.getNowFormatDate(),
|
||||
endDate: this.getNowFormatDate(),
|
||||
hrmname: ""
|
||||
},
|
||||
userInfo: {
|
||||
userid: "",
|
||||
username: "",
|
||||
usericons: ""
|
||||
},
|
||||
groupName: "",
|
||||
baseGroupName:"",
|
||||
editGroupNameVisible: false,
|
||||
}
|
||||
}
|
||||
componentDidMount() {
|
||||
if (this.head && this.body && this.footer) {
|
||||
this.body.style.height = `${this.container.clientHeight - 20 - this.head.clientHeight - this.footer.clientHeight}px`
|
||||
}
|
||||
const { userInfo, title } = this.props;
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
taskName: "",
|
||||
hrmid: userInfo.userid,
|
||||
hrmname: userInfo.username,
|
||||
startDate: this.getNowFormatDate(),
|
||||
endDate: this.getNowFormatDate(),
|
||||
},
|
||||
userInfo: {
|
||||
userid: userInfo.userid,
|
||||
username: userInfo.username,
|
||||
usericons: userInfo.usericons
|
||||
},
|
||||
groupName: title,
|
||||
editGroupNameVisible: false,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
const { title } = this.props;
|
||||
this.setState({
|
||||
groupName: title,
|
||||
baseGroupName : title,
|
||||
editGroupNameVisible: false,
|
||||
});
|
||||
}
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
// if (this.head && this.body && this.footer) {
|
||||
// debugger;
|
||||
// this.body.style.height = `${this.container.clientHeight - 20 - this.head.clientHeight }px`
|
||||
// }
|
||||
}
|
||||
componentWillUpdate(nextProps, nextState) {
|
||||
|
||||
}
|
||||
componentWillReceiveProps(nextProps, nextState) {
|
||||
|
||||
if (this.props.groupid !== nextProps.groupid || this.props.userInfo !== nextProps.userInfo) {
|
||||
const { userInfo, title } = nextProps;
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
taskName: "",
|
||||
hrmid: userInfo.userid,
|
||||
hrmname: userInfo.username,
|
||||
startDate: this.getNowFormatDate(),
|
||||
endDate: this.getNowFormatDate(),
|
||||
},
|
||||
userInfo: {
|
||||
userid: userInfo.userid,
|
||||
username: userInfo.username,
|
||||
usericons: userInfo.usericons
|
||||
},
|
||||
groupName: title,
|
||||
editGroupNameVisible: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
checkGroupRepeat = (name, id) => {
|
||||
let checked = true;
|
||||
const stages = toJS(this.props.columns);
|
||||
stages.map(item => {
|
||||
if (item.id !== id && item.title == name) {
|
||||
checked = false;
|
||||
}
|
||||
});
|
||||
return checked;
|
||||
}
|
||||
|
||||
editGropName = (visible) => {
|
||||
if (!visible) {
|
||||
if (!this.state.groupName) {
|
||||
message.error("阶段名称必填!");
|
||||
} else {
|
||||
if(this.state.groupName !== this.state.baseGroupName){
|
||||
const repeat = this.checkGroupRepeat(this.state.groupName, this.props.groupid);
|
||||
if (repeat) {
|
||||
this.props.saveGroupName(this.state.groupName, this.props.groupid);
|
||||
this.setState({ editGroupNameVisible: visible });
|
||||
} else {
|
||||
message.error(getLabel('387703',"阶段名称重复!"));
|
||||
}
|
||||
}else{
|
||||
this.setState({ editGroupNameVisible: visible });
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setState({ editGroupNameVisible: visible });
|
||||
}
|
||||
|
||||
}
|
||||
render() {
|
||||
const { title, extra, value, canEditBoard, canAddTask } = this.props;
|
||||
let taskName = "";
|
||||
const menu = (
|
||||
<Menu ecId={`${this && this.props && this.props.ecId || ''}_Menu@fct2wf`}>
|
||||
<Menu.Item ecId={`${this && this.props && this.props.ecId || ''}_MenuItem@00fd8z`} key="0">
|
||||
<span onClick={() => this.editGropName(true)}>{getLabel('387705', "修改阶段名称")}</span>
|
||||
</Menu.Item>
|
||||
<Menu.Divider ecId={`${this && this.props && this.props.ecId || ''}_MenuDivider@s8js2p`} />
|
||||
<Menu.Item ecId={`${this && this.props && this.props.ecId || ''}_MenuItem@9ddzgn`} key="1">
|
||||
<span onClick={() => this.props.delGrop(this.props.groupid)}>{getLabel('387706', "删除阶段")}</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
return (
|
||||
<div data-value={value} className="kanban-group" ref={ref => this.container = ref} onClick={()=>{this.editGropName(false)}}>
|
||||
<div ref={ref => this.head = ref} className="kanban-group-head" onMouseDown={this.handleHeadMouseDown}>
|
||||
<div className="kanban-group-head-wrapper">
|
||||
<div className="kanban-group-head-title" onClick={(e)=>{e.stopPropagation();this.editGropName(true)}}>
|
||||
{!this.state.editGroupNameVisible && this.state.groupName}
|
||||
{
|
||||
this.state.editGroupNameVisible &&
|
||||
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@t9x1dh`}
|
||||
// helpfulTip="测试"
|
||||
className="updateStageName"
|
||||
autofocus="autofocus"
|
||||
style={{ top: '6px' }}
|
||||
value={this.state.groupName}
|
||||
onChange={value => {
|
||||
this.setState({ groupName: value })
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</div>
|
||||
<div className="kanban-group-head-extra" style={{ display: canEditBoard ? this.state.editGroupNameVisible ? "none" : "" : "none" }}>
|
||||
<Dropdown ecId={`${this && this.props && this.props.ecId || ''}_Dropdown@azu1jz`} overlay={menu}>
|
||||
<span className="icon-coms-List column-header-menu"></span>
|
||||
</Dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ref={ref => this.body = ref} className="kanban-group-body">
|
||||
{React.Children.map(this.props.children, (child) => {
|
||||
return React.cloneElement(child, { root: this.props.root, xScroller: this.props.scroller, yScroller: this.body });
|
||||
})}
|
||||
</div>
|
||||
<div ref={ref => this.footer = ref} className="kanban-group-footer" >
|
||||
<div style={{ display: canAddTask ? "" : "none",height: "100%" }} >
|
||||
<div className="btnBottomNew" onClick={() => { this.showAddComs() }} >+{getLabel('84046', "新任务")}</div>
|
||||
<div className="footer-card" style={{ display: !this.state.visible ? "none" : "" }}>
|
||||
<div className="card-content">
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@26vqez`} style={{ lineHeight: "30px", padding: "6px 17px" }}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@8q012z`} span={8}>
|
||||
{getLabel('1352', "任务名称")}:
|
||||
</Col>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@k215c4`} span={14}>
|
||||
<div className={this.state.taskInfo.taskName ? "" : "required"} >
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@4vd6an`} tipPosition='bottom'
|
||||
ref='taskname'
|
||||
error={getLabel('387696', "任务名称未填写!")}>
|
||||
<Input ecId={`${this && this.props && this.props.ecId || ''}_Input@vk0k8g`}
|
||||
// ref={"area_"+this.props.groupid}
|
||||
ref={(input) => { this.textInput = input; }}
|
||||
type="textarea"
|
||||
// disabled={disabled}
|
||||
autofocus="autofocus"
|
||||
autosize={{ minRows: "1", maxRows: "1" }}
|
||||
value={this.state.taskInfo.taskName}
|
||||
id={"area_" + this.props.groupid}
|
||||
onChange={(v) => this.setTaskValue("subject", v)}
|
||||
// onBlur={()=>{ this.showAddComs() }}
|
||||
placeholder={getLabel('1352', "任务名称")}
|
||||
/>
|
||||
</WeaError>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
<div className="clearFix" />
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@iu08pe`} style={{ lineHeight: "30px", padding: "6px 17px", width:400 }}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@cwpqjn`} span={8} style={{width:77.98}}>
|
||||
{getLabel('2097', "负责人")}:
|
||||
</Col>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@956ov5`} tipPosition='bottom'
|
||||
ref='taskhrm'
|
||||
error={getLabel('387699', "任务负责人未选择!")}
|
||||
style={{width:"64%"}}
|
||||
>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@bu07ih`} span={14}>
|
||||
<div className="kanban-group-manager managericons" >
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@r5r2c7`} placement="left" title={this.props.username}>
|
||||
{/* <a href={'javaScript:openhrm(' + this.props.userid + ');'} onClick={e => window.pointerXY(e)} >
|
||||
<img src={this.props.usericons} className="kanban-group-manager-img" />
|
||||
</a> */}
|
||||
<div className={this.state.taskInfo.hrmid ? "" : "required"} >
|
||||
|
||||
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@he1goy`}
|
||||
type={17}
|
||||
// customized
|
||||
key={this.state.taskInfo.hrmname}
|
||||
replaceDatas={[{ id: this.state.taskInfo.hrmid, name: this.state.taskInfo.hrmname }]}
|
||||
textDecoration={true}
|
||||
isSingle={false}
|
||||
onChange={(ids, names, datas) => this.setTaskValue("hrmid", { hrmid: ids, hrmname: names })}
|
||||
>
|
||||
{/* <Tooltip placement="bottom" title={this.state.taskInfo.hrmname == "" ? "请选择任务负责人" : this.state.taskInfo.hrmname}>
|
||||
<img src={"/messager/images/icon_w_wev8.jpg"} className="kanban-group-manager-img" />
|
||||
</Tooltip> */}
|
||||
</WeaBrowser>
|
||||
</div>
|
||||
</Tooltip>
|
||||
</div>
|
||||
{/* <div style={{marginLeft:"50px"}}>{this.state.taskInfo.hrmname}</div> */}
|
||||
</Col>
|
||||
</WeaError>
|
||||
</Row>
|
||||
<div className="clearFix" />
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@rfhdub`} style={{ lineHeight: "30px", padding: "6px 17px", width:400 }}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@hz080a`} span={8} style={{width:77.98}}>
|
||||
{getLabel('24979', "开始时间")}:
|
||||
</Col>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@vr2xuh`} tipPosition='bottom'
|
||||
ref='taskstart'
|
||||
error={getLabel('387697', "任务开始时间未选择!")}
|
||||
style={{width:"64%"}}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@wrom2s`} span={14}>
|
||||
<div className="content-landmark" >
|
||||
{/* <WeaRangePicker
|
||||
value={[this.state.taskInfo.startDate, this.state.taskInfo.endDate]}
|
||||
onChange={v => this.setTaskValue("startendDate",v)}
|
||||
/> */}
|
||||
|
||||
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@mrvzs3`}
|
||||
noInput
|
||||
value={this.state.taskInfo.startDate}
|
||||
onChange={v => this.setTaskValue("startDate", v)}
|
||||
key={this.state.taskInfo.startDate}
|
||||
/>
|
||||
|
||||
</div>
|
||||
</Col>
|
||||
</WeaError>
|
||||
</Row>
|
||||
<div className="clearFix" />
|
||||
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@vihujq`} style={{ lineHeight: "30px", padding: "6px 17px", width:400 }}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@92zokn`} span={8} style={{width:77.98}}>
|
||||
{getLabel('743', "结束时间")}:
|
||||
</Col>
|
||||
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@f229jb`} tipPosition='bottom'
|
||||
ref='taskend'
|
||||
error={getLabel('387698', "任务结束时间未选择!")}
|
||||
style={{width:"64%"}}>
|
||||
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@f4s8vq`} span={14}>
|
||||
<div className="content-landmark" >
|
||||
{/* <WeaRangePicker
|
||||
value={[this.state.taskInfo.startDate, this.state.taskInfo.endDate]}
|
||||
onChange={v => this.setTaskValue("startendDate",v)}
|
||||
/> */}
|
||||
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@imtuw0`}
|
||||
noInput
|
||||
value={this.state.taskInfo.endDate}
|
||||
onChange={v => this.setTaskValue("endDate", v)}
|
||||
key={this.state.taskInfo.endDate}
|
||||
/>
|
||||
</div>
|
||||
</Col>
|
||||
</WeaError>
|
||||
</Row>
|
||||
</div>
|
||||
<div className="btnBottomSubmit" onClick={() => { this.closeAddComs() }} >{getLabel('31129', "取消")}</div>
|
||||
<div className="btnBottomSubmit" onClick={() => { this.showAddComs() }} >{getLabel('33703', "确认")}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
getNowFormatDate() {
|
||||
var date = new Date();
|
||||
var seperator1 = "-";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
closeAddComs = (bool) => {
|
||||
const { userInfo } = this.props;
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
taskName: "",
|
||||
hrmid: userInfo.userid,
|
||||
hrmname: userInfo.username,
|
||||
startDate: this.getNowFormatDate(),
|
||||
endDate: this.getNowFormatDate(),
|
||||
},
|
||||
userInfo: {
|
||||
userid: userInfo.userid,
|
||||
username: userInfo.username,
|
||||
usericons: userInfo.usericons
|
||||
},
|
||||
});
|
||||
this.setState({ visible: !this.state.visible });
|
||||
|
||||
}
|
||||
|
||||
showAddComs = () => {
|
||||
let checked = true;
|
||||
const that = this;
|
||||
if (this.state.visible) {
|
||||
if (!this.state.taskInfo.taskName) {
|
||||
this.refs.taskname.showError();
|
||||
checked = false;
|
||||
} else if (!this.state.taskInfo.hrmid) {
|
||||
this.refs.taskhrm.showError();
|
||||
checked = false;
|
||||
} else if (!this.state.taskInfo.startDate) {
|
||||
this.refs.taskstart.showError();
|
||||
checked = false;
|
||||
} else if (!this.state.taskInfo.endDate) {
|
||||
this.refs.taskend.showError();
|
||||
checked = false;
|
||||
} else if (this.state.taskInfo.endDate < this.state.taskInfo.startDate) {
|
||||
message.error(getLabel('387700', "任务结束时间必须大于任务开始时间!"));
|
||||
checked = false;
|
||||
}
|
||||
if (checked) {
|
||||
this.props.saveTask({
|
||||
stageid: this.props.groupid,
|
||||
subject: this.state.taskInfo.taskName,
|
||||
begindate: this.state.taskInfo.startDate,
|
||||
enddate: this.state.taskInfo.endDate,
|
||||
hrmid: this.state.taskInfo.hrmid,
|
||||
});
|
||||
const { userid, username, usericons } = this.props;
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
taskName: "",
|
||||
hrmid: userid,
|
||||
startDate: "",
|
||||
endDate: ""
|
||||
},
|
||||
userInfo: {
|
||||
userid: userid,
|
||||
username: username,
|
||||
usericons: usericons
|
||||
}
|
||||
});
|
||||
this.setState({ visible: !this.state.visible });
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
checked && this.setState({ visible: !this.state.visible });
|
||||
// jQuery("#area_"+this.props.groupid).focus()
|
||||
// this.refs.area+this.props.groupid.focus();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
setTaskValue = (fieldname, v) => {
|
||||
if (fieldname == "startDate") {
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
...this.state.taskInfo,
|
||||
startDate: v,
|
||||
},
|
||||
});
|
||||
} else if (fieldname == "endDate") {
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
...this.state.taskInfo,
|
||||
endDate: v,
|
||||
},
|
||||
});
|
||||
} else if (fieldname == "subject") {
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
...this.state.taskInfo,
|
||||
taskName: jQuery("#area_" + this.props.groupid).val()
|
||||
},
|
||||
});
|
||||
} else if (fieldname == "hrmid") {
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
...this.state.taskInfo,
|
||||
hrmid: v.hrmid,
|
||||
hrmname: v.hrmname,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setDate = (date) => {
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
...this.state.taskInfo,
|
||||
startDate: date[0],
|
||||
endDate: date[1]
|
||||
},
|
||||
});
|
||||
}
|
||||
setTaskName = () => {
|
||||
let taskName = jQuery("#area_" + this.props.groupid).val();
|
||||
this.setState({
|
||||
taskInfo: {
|
||||
...this.state.taskInfo,
|
||||
taskName: taskName,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
handleHeadMouseDown = (ev) => {
|
||||
const { canEditBoard } = this.props;
|
||||
this.offset = {
|
||||
left: this.container.offsetLeft - jQuery(this.container).closest('.kanban-scroller')[0].scrollLeft,
|
||||
top: this.container.offsetTop,
|
||||
height: this.container.clientHeight,
|
||||
width: this.container.clientWidth,
|
||||
startX: ev.clientX,
|
||||
startY: ev.clientY
|
||||
};
|
||||
this.startScrollX =jQuery(this.container).closest('.kanban-scroller')[0].scrollLeft;
|
||||
canEditBoard && document.addEventListener('mousemove', this.handleMouseMove);
|
||||
canEditBoard && document.addEventListener('mouseup', this.handleMouseUp);
|
||||
}
|
||||
handleMouseMove = (ev) => {
|
||||
let diffX = ev.clientX - this.offset.startX;
|
||||
const f = jQuery(this.container).closest('.kanban-scroller')[0].scrollWidth / jQuery(this.container).closest('.kanban-scroller')[0].clientWidth;
|
||||
if (Math.abs(diffX) > 5) {
|
||||
this.props.root.moving = true;
|
||||
this.moving = true;
|
||||
this.container.style.position = 'absolute';
|
||||
this.container.style.width = this.offset.width + 'px';
|
||||
this.container.style.height = this.offset.height + 'px';
|
||||
this.container.style.left = (this.offset.left - 10 + diffX) + 'px';
|
||||
this.container.style.top = (this.offset.top - 10) + 'px';
|
||||
this.container.style.zIndex = 1000;
|
||||
jQuery(this.container).addClass('moving');
|
||||
this.props.root.showPlace(this.offset, this.container);
|
||||
if (diffX < 0) {
|
||||
jQuery(this.container).prevAll('.kanban-group').each((index, ele) => {
|
||||
const offset = jQuery(ele).offset();
|
||||
const width = jQuery(ele).width();
|
||||
const height = jQuery(ele).height();
|
||||
const offset1 = jQuery(this.container).offset();
|
||||
const width1 = jQuery(this.container).width();
|
||||
const middle = offset.left + width / 2 - offset1.left;
|
||||
if (middle > 0 && (middle < width1 || index === 0)) {
|
||||
this.props.root.showPlace({ width, height }, ele);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const nextAll = jQuery(this.container).nextAll('.kanban-group');
|
||||
nextAll.each((index, ele) => {
|
||||
const offset = jQuery(ele).offset();
|
||||
const width = jQuery(ele).width();
|
||||
const height = jQuery(ele).height();
|
||||
const offset1 = jQuery(this.container).offset();
|
||||
const width1 = jQuery(this.container).width();
|
||||
const middle = offset1.left + width1 - offset.left - width / 2;
|
||||
if (middle > 0 && (middle < width / 2 || index === nextAll.length - 1)) {
|
||||
this.props.root.showPlace({ width, height }, ele, true);
|
||||
}
|
||||
})
|
||||
}
|
||||
jQuery(this.container).closest('.kanban-scroller')[[0]].scrollLeft = this.startScrollX + diffX * f;
|
||||
}
|
||||
}
|
||||
handleMouseUp = () => {
|
||||
document.removeEventListener('mousemove', this.handleMouseMove);
|
||||
document.removeEventListener('mouseup', this.handleMouseUp);
|
||||
if (this.moving) {
|
||||
this.container.style.removeProperty('position');
|
||||
this.container.style.removeProperty('width');
|
||||
this.container.style.removeProperty('height');
|
||||
this.container.style.removeProperty('left');
|
||||
this.container.style.removeProperty('top');
|
||||
this.container.style.removeProperty('z-index');
|
||||
this.props.root.moving = false;
|
||||
this.moving = false;
|
||||
jQuery(this.container).removeClass('moving');
|
||||
this.props.root.container.insertBefore(this.container, this.props.root.place);
|
||||
this.props.root.hidePlace();
|
||||
this.props.root.onChange();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,257 @@
|
|||
import * as React from 'react';
|
||||
import { WeaPopoverHrm } from 'ecCom';
|
||||
import { Tooltip, Button, Icon } from 'antd';
|
||||
import QueueAnim from 'rc-queue-anim';
|
||||
import { WeaLocaleProvider } from 'ecCom';
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
export default class Item extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
handleMouseDown = (ev) => {
|
||||
const { canEditBoard } = this.props;
|
||||
this.offset = {
|
||||
left: this.container.offsetLeft,
|
||||
top: this.container.offsetTop - jQuery(this.container).closest('.kanban-group-body')[0].scrollTop,
|
||||
height: this.container.clientHeight,
|
||||
width: this.container.clientWidth,
|
||||
startX: ev.clientX,
|
||||
startY: ev.clientY
|
||||
};
|
||||
this.startScrollX = jQuery(this.container).closest('.kanban-group-body')[0].scrollLeft;
|
||||
this.startScrollY = {};
|
||||
jQuery(this.container).closest('.kanban-container').find('kanban-group').each((index, ele) => {
|
||||
const dataValue = jQuery(ele).attr('data-value');
|
||||
this.startScrollY[dataValue] = jQuery(ele).find('.kanban-group-body').scrollTop();
|
||||
});
|
||||
canEditBoard && document.addEventListener('mousemove', this.handleMouseMove);
|
||||
canEditBoard && document.addEventListener('mouseup', this.handleMouseUp);
|
||||
}
|
||||
handleMouseMove = (ev) => {
|
||||
const diffX = ev.clientX - this.offset.startX;
|
||||
const diffY = ev.clientY - this.offset.startY;
|
||||
const fy = jQuery(this.container).closest('.kanban-group-body')[0].scrollHeight / jQuery(this.container).closest('.kanban-group-body')[0].clientHeight;
|
||||
if (Math.abs(diffX) > 5 || Math.abs(diffY) > 5) {
|
||||
this.moving = true;
|
||||
this.props.root.moving = true;
|
||||
this.container.style.position = 'absolute';
|
||||
this.container.style.width = this.offset.width + 'px';
|
||||
this.container.style.height = this.offset.height + 'px';
|
||||
this.container.style.left = (this.offset.left - 10 + diffX) + 'px';
|
||||
this.container.style.top = (this.offset.top - 10 + diffY) + 'px';
|
||||
this.container.style.zIndex = 1000;
|
||||
this.container.style.transform = "rotate(5deg)";
|
||||
jQuery(this.container).addClass('moving');
|
||||
this.props.root.showItemPlace(this.offset, this.container);
|
||||
let isFound = false;
|
||||
let currentGroup = null;
|
||||
if (diffX < 0) {
|
||||
const thisGroup = jQuery(this.container).closest('.kanban-group');
|
||||
const prevAll = thisGroup.prevAll('.kanban-group');
|
||||
prevAll.each((index, ele) => {
|
||||
const offset = jQuery(ele).offset();
|
||||
const width = jQuery(ele).width();
|
||||
const offset1 = jQuery(this.container).offset();
|
||||
const width1 = jQuery(this.container).width();
|
||||
const middle = offset.left + width / 2 - offset1.left;
|
||||
if (middle > 0 && (middle < width1 || index === 0)) {
|
||||
isFound = true;
|
||||
currentGroup = jQuery(ele);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const nextAll = jQuery(this.container).closest('.kanban-group').nextAll('.kanban-group');
|
||||
nextAll.each((index, ele) => {
|
||||
const offset = jQuery(ele).offset();
|
||||
const width = jQuery(ele).width();
|
||||
const offset1 = jQuery(this.container).offset();
|
||||
const width1 = jQuery(this.container).width();
|
||||
const middle = offset1.left + width1/2 - offset.left - width/2;
|
||||
if (middle > 0 && (middle < width / 2 || index === nextAll.length - 1)) {
|
||||
isFound = true;
|
||||
currentGroup = jQuery(ele);
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!isFound || !currentGroup) {
|
||||
currentGroup = jQuery(this.container).closest('.kanban-group');
|
||||
isFound = true;
|
||||
}
|
||||
if (isFound && currentGroup) {
|
||||
const items = currentGroup.find('.kanban-item');
|
||||
if (items.length === 0) {
|
||||
//this.props.root.showItemPlace(this.offset, currentGroup);
|
||||
currentGroup.find('.kanban-group-body').append(this.props.root.itemPlace);
|
||||
}
|
||||
items.each((i, item) => {
|
||||
const itemOffset = jQuery(item).offset();
|
||||
const itemHeight = jQuery(item).height();
|
||||
const itemOffset1 = jQuery(this.container).offset();
|
||||
const top = itemOffset.top - itemOffset1.top;
|
||||
if (top > 0 && (top < itemHeight || i === 0)) {
|
||||
this.props.root.showItemPlace(this.offset, item);
|
||||
} else {
|
||||
if (top < 0 && i < items.length) {
|
||||
this.props.root.showItemPlace(this.offset, item, true);
|
||||
}
|
||||
}
|
||||
})
|
||||
const dataValue = currentGroup.attr('data-value');
|
||||
currentGroup.find('.kanban-group-body')[0].scrollTop = (this.startScrollY[dataValue] || 0) + diffY * fy;
|
||||
}
|
||||
}
|
||||
}
|
||||
handleMouseUp = () => {
|
||||
document.removeEventListener('mousemove', this.handleMouseMove);
|
||||
document.removeEventListener('mouseup', this.handleMouseUp);
|
||||
if (this.moving) {
|
||||
this.container.style.removeProperty('position');
|
||||
this.container.style.removeProperty('width');
|
||||
this.container.style.removeProperty('height');
|
||||
this.container.style.removeProperty('left');
|
||||
this.container.style.removeProperty('top');
|
||||
this.container.style.removeProperty('z-index');
|
||||
this.container.style.removeProperty("transform");
|
||||
|
||||
this.props.root.moving = false;
|
||||
this.moving = false;
|
||||
jQuery(this.container).removeClass('moving');
|
||||
jQuery(this.props.root.itemPlace).before(this.container);
|
||||
this.props.root.hidePlace();
|
||||
this.props.root.onChange();
|
||||
}
|
||||
}
|
||||
setLandMark = (id, value, e) => {
|
||||
this.props.setLandMark(id, value);
|
||||
e.stopPropagation();
|
||||
}
|
||||
onTaskClick = (value, e) => {
|
||||
this.props.onTaskClick(value);
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { value, prefix, avatar, title, description, islandmark, action, finish, colors, managerid, managericon, managername, allnum, finishnum, status } = this.props;
|
||||
return (
|
||||
<div ref={ref => this.container = ref} key={value} className="kanban-item" data-value={value} onClick={(e) => this.onTaskClick(value, e)} onMouseDown={this.handleMouseDown}>
|
||||
<div className="kanban-item-finish">
|
||||
<div className="kanban-item-finish-status" style={{ backgroundColor: colors, height: finish + "%" }}>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="kanban-item-extra-wrapper">
|
||||
|
||||
<div className="kanban-item-main" style={{ width: `calc(100% )` }}>
|
||||
<div className="kanban-item-main-meta">
|
||||
<div style={{ display: avatar ? 'inline-block' : 'none' }} className="kanban-item-main-meta-avatar">
|
||||
{avatar}
|
||||
</div>
|
||||
<div className="kanban-item-main-meta-content">
|
||||
<div className="kanban-item-main-meta-title">
|
||||
<div class="title-content" id={"titleContent"}>
|
||||
<div style={{ color: "red", display: this.state.show ? "none" : "inline-block" }} > {prefix} </div>{!this.state.show && title}
|
||||
</div>
|
||||
|
||||
|
||||
{
|
||||
<div className="kanban-item-manager-list">
|
||||
<QueueAnim ecId={`${this && this.props && this.props.ecId || ''}_QueueAnim@jj7mh4`} delay={10} className="queue-simple" type={["right", "right"]}>
|
||||
{this.getManagers()}
|
||||
</QueueAnim>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
<div className="kanban-item-main-meta-description">
|
||||
|
||||
</div>
|
||||
<div className="kanban-item-main-meta-description">
|
||||
{description}
|
||||
</div>
|
||||
<div className="kanban-item-main-meta-description">
|
||||
{allnum > 0 && getLabel('2098',"子任务")+" " + finishnum + "/" + allnum}
|
||||
</div>
|
||||
</div>
|
||||
{action && action.length > 0 && <ul className="kanban-item-action">
|
||||
{
|
||||
action.map((ac, i) => (
|
||||
<li>
|
||||
{ac}
|
||||
{i < action.length - 1 && <em className="kanban-item-action-split" />}
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>}
|
||||
</div>
|
||||
</div>
|
||||
{/* {extra && <div className="kanban-item-extra">
|
||||
{extra}
|
||||
</div>} */}
|
||||
|
||||
</div>
|
||||
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@v57y3l`} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
getManagers = () => {
|
||||
const { managerid, managername, managericon, islandmark, value, canAddTask, status } = this.props;
|
||||
let managers = [];
|
||||
if (managerid && managerid.length > 1) {
|
||||
if (this.state.show) {
|
||||
managers.push(
|
||||
<div className="kanban-item-icon" key={"other"}>
|
||||
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@l76xfn`} type="circle-o-right" onClick={(e) => { this.setState({ show: !this.state.show }), e.stopPropagation(); }} />
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
managers.push(
|
||||
<div className="kanban-item-icon" key={"other"}>
|
||||
<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@htucum`} type="circle-o-left" onClick={(e) => { this.setState({ show: !this.state.show }), e.stopPropagation(); }} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
if (canAddTask && status==0) {
|
||||
managers.push(<div className="kanban-item-landmark" >
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@1g44cl`} placement="bottom" title={islandmark == "1" ? getLabel('387701',"取消里程碑任务") : getLabel('387702',"设为里程碑任务")}>
|
||||
<span className="icon-coms-Flag" style={{ color: islandmark == "1" ? "#2db7f5" : "" }} onClick={(e) => { this.setLandMark(value, islandmark == "1" ? "0" : "1", e); }} />
|
||||
</Tooltip>
|
||||
</div>)
|
||||
}else{
|
||||
managers.push(<div className="kanban-item-landmark" >
|
||||
<span className="icon-coms-Flag" style={{ color: islandmark == "1" ? "#2db7f5" : "" }} />
|
||||
</div>)
|
||||
}
|
||||
|
||||
|
||||
this.state.show && managerid && managerid.length > 0 && managerid.map((m, i) => {
|
||||
managers.push(<div className="kanban-item-manager" key={i}>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@9q28mz@${i}`} placement="bottom" title={managername[i]}>
|
||||
<a href={'javaScript:openhrm(' + m + ');'} onClick={e => window.pointerXY(e)} >
|
||||
<img src={managericon[i]} className="kanban-item-manager-img" />
|
||||
</a>
|
||||
</Tooltip>
|
||||
</div>)
|
||||
})
|
||||
!this.state.show && managerid && managerid.length > 0 &&
|
||||
managers.push(<div className="kanban-item-manager" key={0}>
|
||||
<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@17g0gh`} placement="bottom" title={managername[0]}>
|
||||
<a href={'javaScript:openhrm(' + managerid[0] + ');'} onClick={e => window.pointerXY(e)} >
|
||||
<img src={managericon[0]} className="kanban-item-manager-img" />
|
||||
</a>
|
||||
</Tooltip>
|
||||
</div>)
|
||||
|
||||
|
||||
|
||||
|
||||
return managers;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue