diff --git a/pc4backstage/prj/apis/basemanger.js b/pc4backstage/prj/apis/basemanger.js new file mode 100644 index 0000000..eec6f38 --- /dev/null +++ b/pc4backstage/prj/apis/basemanger.js @@ -0,0 +1,61 @@ +import { WeaTools } from 'ecCom'; + +//项目基础设置-查询条件 +export const getBaseMangerCondition = params => { + return WeaTools.callApi('/api/proj/baseManager/getBaseCondition', 'GET', params); +} + +//项目基础设置-列表 +export const getBaseMangerList = params => { + return WeaTools.callApi('/api/proj/baseManager/getBaseMangerList', 'GET', params); +} + +//项目基础设置-项目类型form +export const getPrjTypeFormField = params => { + return WeaTools.callApi('/api/proj/baseManager/getPrjTypeFormField', 'GET', params); +} + +//项目基础设置-工作类型form +export const getWorkTypeFormField = params => { + return WeaTools.callApi('/api/proj/baseManager/getWorkTypeFormField', 'GET', params); +} + +//项目基础设置-项目状态form +export const getPrjStatusFormField = params => { + return WeaTools.callApi('/api/proj/baseManager/getPrjStatusFormField', 'GET', params); +} + +//项目基础设置-项目类型共享设置 +export const getPrjTypeShareList = params => { + return WeaTools.callApi('/api/proj/baseManager/getPrjTypeShareList', 'GET', params); +} + +//项目基础设置-项目类型操作(增、删、改) +export const doPrjTypeOpt = params => { + return WeaTools.callApi('/api/proj/baseManager/doPrjTypeOpt', 'GET', params); +} + +//项目基础设置-工作类型操作(增、删、改) +export const doWorkTypeOpt = params => { + return WeaTools.callApi('/api/proj/baseManager/doWorkTypeOpt', 'GET', params); +} + +//项目基础设置-项目状态操作(增、删、改) +export const doPrjStatusOpt = params => { + return WeaTools.callApi('/api/proj/baseManager/doPrjStatusOpt', 'GET', params); +} + +//项目基础设置-项目类型权限(增、删、改) +export const doPrjTypeShareOpt = params => { + return WeaTools.callApi('/api/proj/baseManager/doPrjTypeShareOpt', 'POST', params); +} + +//项目基础设置-项目编码 +export const doPrjCodeInit = params => { + return WeaTools.callApi('/api/proj/baseManager/doPrjCodeInit', 'GET', params); +} + +//项目基础设置-项目编码 +export const doPrjCodeOpt = params => { + return WeaTools.callApi('/api/proj/baseManager/doPrjCodeOpt', 'GET', params); +} \ No newline at end of file diff --git a/pc4backstage/prj/apis/custom.js b/pc4backstage/prj/apis/custom.js new file mode 100644 index 0000000..ec2367a --- /dev/null +++ b/pc4backstage/prj/apis/custom.js @@ -0,0 +1,60 @@ +import { WeaTools } from 'ecCom'; + +//自定义字段-项目类型树 +export const getPrjTypeTree = params => { + return WeaTools.callApi('/api/proj/custom/getFieldPrjTypeTreeData', 'GET', params); +} + +//项目卡片显示栏目数据初始化 +export const loadGroupData = params => { + return WeaTools.callApi('/api/proj/custom/loadGroupData', 'GET', params); +} + + +//项目卡片显示栏目数据保存 +export const saveCardTabSet = params => { + return WeaTools.callApi('/api/proj/custom/saveCardTabSet', 'POST', params); +} + + +//项目自定义字段Tab数据加载 +export const getPrjFieldTab = params => { + return WeaTools.callApi('/api/proj/custom/getPrjFieldTab', 'GET', params); +} + +//项目自定义字段数据加载 +export const getPrjFieldData = params => { + return WeaTools.callApi('/api/proj/custom/getPrjFieldData', 'GET', params); +} + + +//项目自定义字段显示名设置数据加载 +export const getFieldLanguageData = params => { + return WeaTools.callApi('/api/proj/custom/getFieldLanguageData', 'GET', params); +} + +//项目自定义字段分组设置数据加载 +export const getFieldGroupData = params => { + return WeaTools.callApi('/api/proj/custom/getFieldGroupData', 'GET', params); +} + +//项目自定义字段分组设置数据加载 +export const saveFieldGroupData = params => { + return WeaTools.callApi('/api/proj/custom/saveFieldGroupData', 'POST', params); +} + +//项目自定义字段显示名设置数据保存 +export const saveFieldLanguageCmd = params => { + return WeaTools.callApi('/api/proj/custom/saveFieldLanguageCmd', 'POST', params); +} + +//公共选择框options +export const getSelectCommonOptions = params => { + return WeaTools.callApi('/api/proj/custom/getSelectCommonOptions', 'POST', params); +} + +// 获取加密字段设置 +export const getFieldSet = params => WeaTools.callApi('/api/prj/encrypt/fieldset/getFieldSet', 'POST', params); + +// 保存加密字段设置 +export const saveFieldSet = params => WeaTools.callApi('/api/prj/encrypt/fieldset/saveFieldSet', 'POST', params); \ No newline at end of file diff --git a/pc4backstage/prj/apis/prjappset.js b/pc4backstage/prj/apis/prjappset.js new file mode 100644 index 0000000..7868eb0 --- /dev/null +++ b/pc4backstage/prj/apis/prjappset.js @@ -0,0 +1,11 @@ +import { WeaTools } from 'ecCom'; + +//应用设置-基础信息 +export const getPrjAppSetInfo = params => { + return WeaTools.callApi('/api/proj/appset/getPrjAppSetInfo', 'GET', params); +} + +//应用设置-编辑保存 +export const doPrjAppSet = params => { + return WeaTools.callApi('/api/proj/appset/doPrjAppSet', 'GET', params); +} diff --git a/pc4backstage/prj/apis/prjremind.js b/pc4backstage/prj/apis/prjremind.js new file mode 100644 index 0000000..b661dbd --- /dev/null +++ b/pc4backstage/prj/apis/prjremind.js @@ -0,0 +1,26 @@ +import {WeaTools} from 'ecCom' + +// 项目类型-树形 +export const getPrjTypeTreePageList = params => { + return WeaTools.callApi('/api/proj/pcproject/getPrjTypeTree', 'GET', params); +} + +// 根据项目类型获取提醒列表 +export const getRemindListByPrjType = params => { + return WeaTools.callApi('/api/proj/remind/getRemindListByPrjType', 'GET', params); +} + +// 根据remindId获取提醒信息 +export const getRemindInfoByRemindId = params => { + return WeaTools.callApi('/api/proj/remind/getRemindInfoByRemindId', 'GET', params); +} + +// 增加or更新提醒信息 +export const saveOrUpdateRemindInfo = params => { + return WeaTools.callApi('/api/proj/remind/saveOrUpdateRemindInfo', 'POST', params); +} + +// 获取条件字段 +export const getConditionField = params => { + return WeaTools.callApi('/api/proj/remind/getConditionField', 'POST', params); +} \ No newline at end of file diff --git a/pc4backstage/prj/apis/prjwfset.js b/pc4backstage/prj/apis/prjwfset.js new file mode 100644 index 0000000..00eb156 --- /dev/null +++ b/pc4backstage/prj/apis/prjwfset.js @@ -0,0 +1,45 @@ +import { WeaTools } from 'ecCom'; +//流程设置-查询条件 +export const getPrjWfSetCondition = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWfSetCondition', 'GET', params); +} + +//流程设置-列表 +export const getPrjWfSetList = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWfSetList', 'GET', params); +} + +//流程设置-基础信息表单 +export const getPrjWfSetForm = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWfSetForm', 'GET', params); +} + +//流程设置-根据流程获取表单信息 +export const getPrjWorkflowInfo = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWorkflowInfo', 'GET', params); +} + +//流程设置-根据项目类型初始化表单 +export const getInitformByPrjtype = params => { + return WeaTools.callApi('/api/proj/wfset/getInitformByPrjtype', 'GET', params); +} + +//流程设置-字段设置 +export const getPrjWfSetField = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWfSetField', 'GET', params); +} + +//流程设置-字段设置 +export const getPrjWfActionSet = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWfActionSet', 'GET', params); +} + +//流程设置-保存 +export const doPrjWfOperation = params => { + return WeaTools.callApi('/api/proj/wfset/doPrjWfOperation', 'GET', params); +} + +//流程设置-Tab +export const getWfSetTab = params => { + return WeaTools.callApi('/api/proj/wfset/getPrjWfSetTab', 'GET', params); +} \ No newline at end of file diff --git a/pc4backstage/prj/apis/projectlog.js b/pc4backstage/prj/apis/projectlog.js new file mode 100644 index 0000000..e8a6907 --- /dev/null +++ b/pc4backstage/prj/apis/projectlog.js @@ -0,0 +1,11 @@ +import { WeaTools } from 'ecCom'; + +//项目日志-查询条件 +export const getPrjLogCondition = params => { + return WeaTools.callApi('/api/proj/log/getPrjLogCondition', 'GET', params); +} + +//项目日志-列表 +export const getPrjLogList = params => { + return WeaTools.callApi('/api/proj/log/getPrjLogList', 'GET', params); +} \ No newline at end of file diff --git a/pc4backstage/prj/apis/templet.js b/pc4backstage/prj/apis/templet.js new file mode 100644 index 0000000..e7427b5 --- /dev/null +++ b/pc4backstage/prj/apis/templet.js @@ -0,0 +1,88 @@ +import { WeaTools } from 'ecCom'; + +//模板维护-项目类型树 +export const getTempletPrjTypeTree = params => { + return WeaTools.callApi('/api/proj/templet/getTempletPrjTypeTree', 'GET', params); +} + +//模板维护-模板列表 +export const getTempletByPrjTypeList = params => { + return WeaTools.callApi('/api/proj/templet/getTempletByPrjTypeList', 'GET', params); +} + +//模板表单 +export const getPrjTempletForm = params => { + return WeaTools.callApi('/api/proj/templet/getPrjTempletForm', 'GET', params); +} + +//模板新建 +export const doPrjTempletOpertaion = params => { + return WeaTools.callApi('/api/proj/templet/doPrjTempletOpertaion', 'POST', params); +} + +//模板任务列表 +export const getPrjTempletTaskList = params => { + return WeaTools.callApi('/api/proj/templet/getPrjTempletTaskList', 'GET', params); +} + +//模板阶段设置 +export const getPrjTempletStageList = params => { + return WeaTools.callApi('/api/proj/templet/getPrjTempletStageList', 'GET', params); +} + +//模板阶段设置 +export const savePrjTempletStage = params => { + return WeaTools.callApi('/api/proj/templet/savePrjTempletStage', 'POST', params); +} + +//模板任务表单 +export const getTaskTempletForm = params => { + return WeaTools.callApi('/api/proj/templet/getTaskTempletForm', 'GET', params); +} + +//模板任务表单 +export const getTaskTempletReference = params => { + return WeaTools.callApi('/api/proj/templet/getTaskTempletRefList', 'GET', params); +} + +//模板任务--相关流程、文档必须操作 +export const doDspTaskTempletReqOpt = params => { + return WeaTools.callApi('/api/proj/templet/doDspTaskTempletReqOpt', 'GET', params); +} + +//模板任务--相关文档操作 +export const doDspTaskTempletRefOpt = params => { + return WeaTools.callApi('/api/proj/templet/doDspTaskTempletRefOpt', 'GET', params); +} + +//模板任务--任务操作 +export const doPrjTaskTempletOpt = params => { + return WeaTools.callApi('/api/proj/templet/doPrjTaskTempletOpt', 'POST', params); +} + +//模板任务--导入初始化 +export const getTaskTempletImp = params => { + return WeaTools.callApi('/api/proj/templet/getTaskTempletImp', 'GET', params); +} + +//模板任务--导入 +export const doPrjimpopt = params => { + return WeaTools.callApi('/api/proj/prjutil/doprjimpopt', 'POST', params); +} + +//模板审批 +export const getTempletApproveForm = params => { + return WeaTools.callApi('/api/proj/templet/getTempletApproveForm', 'GET', params); +} + +//模板审批-审批保存 +export const doTempletApproveSave = params => { + return WeaTools.callApi('/api/proj/templet/doTempletApproveSave', 'GET', params); +} + +//模板审批-提交流程 +export const doApprovetemplate = params => { + return WeaTools.callApi('/api/proj/templet/doApprovetemplate', 'GET', params); +} + + diff --git a/pc4backstage/prj/components/Demo.js b/pc4backstage/prj/components/Demo.js new file mode 100644 index 0000000..fa03591 --- /dev/null +++ b/pc4backstage/prj/components/Demo.js @@ -0,0 +1,67 @@ +import React from 'react'; +import { Button, Tabs , Tree, Menu, TopTitle} from 'antd'; +import { inject, observer } from 'mobx-react'; +import {WeaTop ,WeaLeftRightLayout} from "ecCom" + + +class Demo extends React.Component { + constructor(props) { + super(props); + this.state = { + time: 0 + } + } + componentDidMount() { + jQuery(window).resize(() => { + if (this.timer) { + clearTimeout(this.timer); + } + this.timer = setTimeout(() => { + this.forceUpdate(); + }, 200); + }); + } + handleClick = () => { + + } + render() { + return ( +
+ + fffff
} + leftWidth={25}> + {/* { contentDiv } */} + + + + ) + } +} + +export default Demo; + + +{/* + + + + + { this.setState({ time: this.state.time + 2 }) }} /> + + + + + + + + */} \ No newline at end of file diff --git a/pc4backstage/prj/components/Home.js b/pc4backstage/prj/components/Home.js new file mode 100644 index 0000000..0f3bbb8 --- /dev/null +++ b/pc4backstage/prj/components/Home.js @@ -0,0 +1,16 @@ +import { WeaPopoverHrm ,WeaLocaleProvider} from 'ecCom'; + +class Home extends React.Component { + render() { + return ( +
+ + + {this.props.children} + +
+ ) + } +} + +export default Home diff --git a/pc4backstage/prj/components/appSet/index.js b/pc4backstage/prj/components/appSet/index.js new file mode 100644 index 0000000..bb4fc4d --- /dev/null +++ b/pc4backstage/prj/components/appSet/index.js @@ -0,0 +1,241 @@ +import {WeaTop,WeaTools,WeaErrorPage,WeaRightMenu,WeaSearchGroup,WeaFormItem,WeaAlertPage,WeaHelpfulTip,WeaLocaleProvider,WeaCheckbox } from "ecCom" +import { Button ,InputNumber,Radio} from "antd"; +import {WeaSwitch} from "comsMobx"; +import {inject, observer } from 'mobx-react'; +import {toJS} from "mobx" +const RadioGroup = Radio.Group; +const getLabel = WeaLocaleProvider.getLabel; + +@inject('prjAppSetStore') +@observer +class AppSet extends React.Component{ + constructor(props){ + super(props) + } + componentDidMount(){ + const {prjAppSetStore} = this.props; + prjAppSetStore.initData(); + } + componentWillReceiveProps(nextProps) { + const {prjAppSetStore} = this.props; + if(this.props.location.key !== nextProps.location.key) { + prjAppSetStore.clearStatus(); + prjAppSetStore.initData(); + } + } + componentWillUnmount(){ + const {prjAppSetStore} = this.props; + prjAppSetStore.clearStatus(); + } + + render(){ + const {prjAppSetStore} = this.props; + const {fieldinfo,isright} = prjAppSetStore; + if (!isright) { + return( + +
+ {getLabel(2012,"对不起,您暂时没有权限!")} +
+
+ ) + } + return ( + + } + iconBgcolor='#217346' + buttons={this.getButtons()} + buttonSpace={10} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + > + {this.getBasicInfo()} + + + ) + } + + getBasicInfo() { + const {prjAppSetStore, } = this.props; + const {fieldinfo,form,setFormFields,setValidate,setMenuValue,vmenu} = prjAppSetStore; + const {isFormInit} = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && toJS(fieldinfo).map((c,i) =>{ + let hide = false; + let items = []; + c.items.map(field => { + let dom = ; + if(field.domkey[0] == "prj_gnt_warningday"){ + dom = {setFormFields({[field.domkey[0]]:{value:v}})}}/> + }else if(field.domkey[0] == "tsk_approval_type"){ + if(formParams["tsk_approval"]!="1"){ + hide = true; + } + dom = [ + setFormFields({[field.domkey[0]]:{value:e.target.value}})}> + {getLabel(84826,"项目经理审批")} + {getLabel(84827,"上级任务负责人审批")} + , + ] + }else if(field.domkey[0] == "tsk_modify_type"){ + if(formParams["tsk_approval"]!="1"){ + hide = true; + } + }else if(field.conditionType == "BROWSER"){ + if((field.domkey[0]=="prj_dsc_accsec"&&formParams["prj_dsc_acc"]!="1") + ||(field.domkey[0]=="tsk_dsc_accsec"&&formParams["tsk_dsc_acc"]!="1") + ||(field.domkey[0]=="prj_accsec"&&formParams["prj_acc"]!="1") + ||(field.domkey[0]=="tsk_accsec"&&formParams["tsk_acc"]!="1")){ + hide = true; + } + }else if(field.domkey[0] == "prj_acc_isright"){ + dom = [ + , + + ] + if(field.domkey[0]=="prj_acc_isright"&&formParams["prj_acc"]!="1"){ + hide = true; + } + }else if(field.domkey[0] == "tsk_acc_isright"){ + dom = [ + , + + ] + if(field.domkey[0]=="tsk_acc_isright"&&formParams["tsk_acc"]!="1"){ + hide = true; + } + }else if(field.domkey[0] == "tsk_timefield"){ + dom = [ + , + + ] + }else if(field.domkey[0] == "workflow_filter"){ + dom = [ + , + + ] + } + items.push({ + com: ( + {dom} + ), + col: 1, + hide:hide + }); + + //项目任务菜单控制 + if(field.domkey[0] == "prj_feedback"){ + let pmenus = prjAppSetStore.pmenu||[]; + let pdom = []; + pmenus && toJS(pmenus).map(m =>{ + pdom.push({setMenuValue({[m.id]:v})}} />) + }); + items.push({ + com: ( + {pdom} + ), + col: 1, + hide:hide + }); + + let tmenus = prjAppSetStore.tmenu||[]; + let tdom = []; + tmenus && toJS(tmenus).map(m =>{ + tdom.push({setMenuValue({[m.id]:v})}}/>) + }); + items.push({ + com: ( + {tdom} + ), + col: 1, + hide:hide + }); + + let ptmenus = prjAppSetStore.ptmenu||[]; + let ptdom = []; + ptmenus && toJS(ptmenus).map(m =>{ + ptdom.push({setMenuValue({[m.id]:v})}}/>) + }); + items.push({ + com: ( + {ptdom} + ), + col: 1, + hide:hide + }); + } + }); + group.push() + }); + return group; + } + + getButtons(){ + const {prjAppSetStore} = this.props; + const {rightMenu} = prjAppSetStore; + let btnArr = []; + rightMenu && rightMenu.length>0 && rightMenu.map(m=>{ + m.isTop == '1' && btnArr.length < 4 && btnArr.push( + + ); + }); + return btnArr; + } + + getRightMenu(){ + const {prjAppSetStore }= this.props; + const {rightMenu,tableStore} = prjAppSetStore; + let btnArr = []; + rightMenu && rightMenu.length>0 && rightMenu.map(m=>{ + btnArr.push({ + icon: , + content: m.menuName, + }) + }); + return btnArr + } + onRightMenuClick(key){ + const {prjAppSetStore} = this.props; + const {rightMenu} = prjAppSetStore; + 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_SAVE"){ + prjAppSetStore.doPrjAppSet({method:'edit'}); + } + } + }); + } + +} + +export default WeaTools.tryCatch(React, + props => , + {error: ""} +)(AppSet); \ No newline at end of file diff --git a/pc4backstage/prj/components/baseManager/BaseManagerList.js b/pc4backstage/prj/components/baseManager/BaseManagerList.js new file mode 100644 index 0000000..a6afd06 --- /dev/null +++ b/pc4backstage/prj/components/baseManager/BaseManagerList.js @@ -0,0 +1,216 @@ +import React from 'react'; +import { inject, observer } from 'mobx-react'; +import { Button, Tabs,Card,Pagination,Row,Col,Modal } from 'antd'; +const confirm = Modal.confirm; +import {toJS} from "mobx"; +import {WeaTableNew} from 'comsMobx'; +import {WeaRightMenu,WeaTop,WeaTab,WeaErrorPage,WeaTools,WeaLocaleProvider} from 'ecCom'; +const WeaTable = WeaTableNew.WeaTable; +const getLabel = WeaLocaleProvider.getLabel; +import {Condition,getAdButtons} from '../list/listCondition'; +import PrjTypeDialog from '../dialog/prjtypeDialog' +import WorkTypeDialog from '../dialog/worktypeDialog' + +@inject('baseManagerStore') +@observer +class BaseManagerList extends React.Component { + constructor(props) { + super(props); + } + componentDidMount(){ + const {baseManagerStore,params } = this.props; + const {initData} = baseManagerStore; + initData(params); + } + componentWillReceiveProps(nextProps){ + const keyOld = this.props.location.key; + const keyNew = nextProps.location.key; + const oldParams = this.props.params.bmtype; + const newParams = nextProps.params.bmtype; + if(keyOld !== keyNew || oldParams !== newParams) { + const {baseManagerStore,params } = nextProps; + const {initData} = baseManagerStore; + baseManagerStore.clearStatus(); + baseManagerStore.resetTable(); + baseManagerStore.setShowSearchAd(false); + initData(params); + } + } + componentWillUnmount(){ + const {baseManagerStore,params } = this.props; + baseManagerStore.clearStatus(); + baseManagerStore.resetTable(); + } + render(){ + const {baseManagerStore} = this.props; + const {title,loading,form,showSearchAd,tableStore,reLoad,prjtypeStore,worktypeStore} = baseManagerStore; + const formParams = form.getFormParams() || {}; + return ( + + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + buttonSpace={10} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + onDropMenuClick={this.onRightMenuClick.bind(this)} + > + {baseManagerStore.setShowSearchAd(bool)}} + hideSearchAd={()=> baseManagerStore.setShowSearchAd(false)} + searchsAd={ +
+ } + showSearchAd={showSearchAd} + onSearch={v=>{baseManagerStore.doSearch()}} + onSearchChange={v=>{baseManagerStore.setFormFields({name:{value:v}})}} + advanceHeight={100} + /> + this.reRenderColumns(c)} + register_table={()=>reLoad()} + onOperatesClick={this.onOperatesClick.bind(this)} + /> +
+ + +
+ ) + } + getTopButtons(){ + const {baseManagerStore,} = this.props; + const {rightMenu,tableStore,prjtypeStore,worktypeStore,basetype} = baseManagerStore; + 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( + + ); + }); + return btnArr; + } + + reRenderColumns(columns){ + const {baseManagerStore }= this.props; + const {prjtypeStore} = baseManagerStore; + + columns.forEach(c=>{ + if(c.dataIndex=='fullname_edit'){ + c.render = (text, record)=>{ + let valueSpan = record[c.dataIndex]; + return { + prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:record['randomFieldId']}) + }} > + } + } else { + c.render = function(text, record){ + let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex]; + return + } + } + }) + return columns; + } + + getRightMenu(){ + const {baseManagerStore }= this.props; + const {rightMenu,tableStore} = baseManagerStore; + let {selectedRowKeys} = tableStore; + let btnArr = []; + const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`); + rightMenu && rightMenu.length>0 && rightMenu.map(m=>{ + btnArr.push({ + icon: , + content: m.menuName, + disabled:isDisabled && m.isControl == "1" + }) + }); + return btnArr + } + + onRightMenuClick(key){ + const {baseManagerStore,}= this.props; + const {rightMenu,tableStore,prjtypeStore,worktypeStore,basetype} = baseManagerStore; + 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"){ //定制列 + baseManagerStore.onShowColumn(); + }else if(m.type == "BTN_CREATE"){ + if(basetype=='prjtype'){ + prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:""}) + }else{ + worktypeStore.handleShareDialog(true,{id:"",formtype:basetype}); + } + }else if(m.type == "BTN_DELETEBATCH"){ + baseManagerStore.delPrjTypeBatch(`${toJS(selectedRowKeys)}`); + }else if(m.type == "BTN_SEARCH"){ + baseManagerStore.doSearch(); + } + } + }); + } + + onOperatesClick(record,index,operate,flag){ + const {baseManagerStore,baseManagerStore:{prjtypeStore,worktypeStore,basetype}} = 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("onEdit"==fn){ //编辑项目类型 + if(basetype=='prjtype'){ + prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:record.randomFieldId}); + }else{ + worktypeStore.handleShareDialog(true,{id:record.randomFieldId,formtype:basetype}); + } + }else if('onDel' == fn){ //项目类型删除 + baseManagerStore.delPrjType(record.randomFieldId); + }else if('onCreate' == fn){ //项目类型创建权限 + prjtypeStore.handleShareDialog(true,"addshare",{prjtypeid:record.randomFieldId}) + }else if('onShare' == fn){ //项目类型共享权限 + prjtypeStore.handleShareDialog(true,"share",{prjtypeid:record.randomFieldId}) + } + } + } + + onEnterSearch=() =>{ + const {baseManagerStore} = this.props; + baseManagerStore.doSearch(); + baseManagerStore.setShowSearchAd(false); + + } + +} + +export default WeaTools.tryCatch(React, + props => , + {error: ""} +)(BaseManagerList); \ No newline at end of file diff --git a/pc4backstage/prj/components/baseManager/prjCode.js b/pc4backstage/prj/components/baseManager/prjCode.js new file mode 100644 index 0000000..003a7db --- /dev/null +++ b/pc4backstage/prj/components/baseManager/prjCode.js @@ -0,0 +1,322 @@ +import {WeaTop,WeaTools,WeaErrorPage,WeaRightMenu,WeaSearchGroup,WeaFormItem,WeaSelect,WeaInput,WeaAlertPage,WeaLocaleProvider,WeaCheckbox} from "ecCom" +import { Button ,Switch,InputNumber,Spin,Radio} from "antd"; +import {inject, observer } from 'mobx-react'; +import {toJS} from "mobx" +import WeaPrjDragula from '../comp/weaDragula' +import '../../style/coding.less' +const RadioGroup = Radio.Group; +const getLabel = WeaLocaleProvider.getLabel; + +export const TempForm = observer(({ prjCodeStore }) => { + const { form,prjDatas,changeCodeType } = prjCodeStore; + return prjCodeStore.condition.map((fields,index) => { + const getDom = () => { + if(fields.conditionType == "SWITCH"){ + + if(fields.showName=='445'){ + return
+ {/* form.$(fields.domkey[0]).value = checked ? '1' : '0'} + /> */} + form.$(fields.domkey[0]).value = checked} + /> +     changeCodeType({yearViewNum:value})} + />
+ }else{ + // return form.$(fields.domkey[0]).value = checked ? '1' : '0'} + // /> + return form.$(fields.domkey[0]).value = checked} + /> + } + }else if(fields.conditionType == "INPUTNUMBER"){ + return form.$(fields.domkey[0]).value = v }/> + }else{ + return form.$(fields.domkey[0]).value = v }/> + } + } + return (
+ {`${fields.label}`}} + labelCol={{ span: `${fields.labelcol}` }} + wrapperCol={{ span: `${fields.fieldcol}` }}> + {getDom()} +
) + }) +}) + +@inject('prjCodeStore') +@observer +class PrjCode extends React.Component{ + constructor(props){ + super(props) + } + componentDidMount(){ + const {prjCodeStore} = this.props; + prjCodeStore.initData(); + } + componentWillReceiveProps(nextProps) { + const { prjCodeStore } = this.props; + if(this.props.location.key !== nextProps.location.key) { + prjCodeStore.clearStatus(); + prjCodeStore.initData(); + } + } + componentWillUnmount(){ + const {prjCodeStore} = this.props; + prjCodeStore.clearStatus(); + } + render(){ + const {prjCodeStore} = this.props; + const {prjDatas,formloading,condition,isright} = prjCodeStore; + + if (!isright) { + return( + +
+ {getLabel(2012,"对不起,您暂时没有权限!")} +
+
+ ) + } + + const {codeType,prjtypeflow,worktypeflow,modifyStartCode,startCode,buydate,buydateselect} = prjDatas; + const style = { + height:"50px",lineHeight:"50px" + } + + return ( + + } + iconBgcolor='#217346' + buttons={this.getButtons()} + buttonSpace={10} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + > + + + this.onChange({codeType:value})} + /> + + +
+ + jQuery(clickDom).hasClass("icon-coms-move")} + datas={toJS(condition)} + getKeyFromData={this.getRowKey} + getKeyFromDom={this.getKeyFromDom} + onDrop={this.onDrop} + > + +
+ f.domkey.join('')).join('_')}/> +
+
+
+
+ + + {/* this.onChange({prjtypeflow: checked ? '1' : '0'})} + /> */} + this.onChange({prjtypeflow: checked })} + /> + + + {/* this.onChange({worktypeflow: checked ? '1' : '0'})} + /> */} + this.onChange({worktypeflow: checked })} + /> + + + {/* this.onChange({buydate: checked ? '1' : '0'})} + /> */} + this.onChange({buydate: checked })} + /> +     + this.onChange({buydateselect: e.target.value})}> + {getLabel(445,"年")} + {getLabel(6076,"月")} + {getLabel(390,"日")} + + + + + {/* this.onChange({modifyStartCode: checked ? '1' : '0'})} + /> */} + this.onChange({modifyStartCode: checked })} + /> + + { + modifyStartCode == "1" && + + this.onChange({startCode:value})} /> + + } + + +
+ + {this.showCodeView()} +
+
+
+
+
+
+ ) + } + getRightMenu(){ + let btns = []; + const {doSubmit} = this.props.prjCodeStore; + btns.push({ + icon: , + content: getLabel(86,"保存"), + key:"1", + onClick:(key)=>{doSubmit()} + }); + return btns + } + getButtons(){ + const {doSubmit} = this.props.prjCodeStore; + let btnArr = []; + btnArr.push(); + return btnArr + } + + getKeyFromDom = (dom) => { + return jQuery(".icon-coms-move",dom).attr("data-index"); + } + + getRowKey = (record, index) => { + return typeof record['id'] !== 'undefined' ? record['id'] : index; + } + + onDrop = (datas) => { + datas.length>0 && toJS(datas).map((fields,index) =>{ + datas[index].order = index; + }); + const {prjCodeStore} = this.props; + prjCodeStore.savecondition(datas); + } + + onChange=(value)=>{ + const {prjCodeStore} = this.props; + prjCodeStore.changeCodeType(value) + } + + showCodeView(){ + const {prjCodeStore } = this.props; + const {condition,form,prjDatas} = prjCodeStore; + var colors= new Array ("#6633CC","#FF33CC","#666633","#CC00FF","#996666") ; + let group = []; + condition.length>0 && toJS(condition).map((item,index)=>{ + let dom ; + if(item.conditionType.toUpperCase() == "SWITCH"){ + if(form.$(item.domkey[0]).values() == "0"){ + return "" + }else{ + let numstr = "****"; + if(item.showName=='6076'||item.showName=='16889'||(item.showName=='445'&&prjDatas.yearViewNum==0)){ + numstr = "**"; + } + dom = + {item.label} + + {numstr} + + } + }else if(item.conditionType.toUpperCase() == "INPUTNUMBER"){ + dom = + {item.label} + + {this.createFlowNum(form.$(item.domkey[0]).values())} + + }else{ + dom = + {item.label} + + {form.$(item.domkey[0]).values()} + + } + group.push( {dom}
) + }) + return group + } + + createFlowNum=(num)=>{ + let str = ""; + if(Number(num) <= 0){ + str ="***" + }else if(Number(num) == 1){ + str = 1 + }else{ + for(let i=0;i , + {error: ""} +)(PrjCode); \ No newline at end of file diff --git a/pc4backstage/prj/components/common/projectInfo.js b/pc4backstage/prj/components/common/projectInfo.js new file mode 100644 index 0000000..dcec9a9 --- /dev/null +++ b/pc4backstage/prj/components/common/projectInfo.js @@ -0,0 +1,39 @@ + +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 {hasRight,fieldInfo,form,setFormFields,setValidate } = this.props.formStore; + if (!hasRight) { + return ( +
+ {getLabel(2012,"对不起,您暂时没有权限!")} +
+
+ ) + } + if (hasRight) { + return ( +
+ {setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} /> +
) + } + return
+ } + +} + diff --git a/pc4backstage/prj/components/common/relateDocument.js b/pc4backstage/prj/components/common/relateDocument.js new file mode 100644 index 0000000..6070d53 --- /dev/null +++ b/pc4backstage/prj/components/common/relateDocument.js @@ -0,0 +1,225 @@ + +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,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', 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', + }, + ]; + return ( +
+ + + + + + + +
) + } + getButtons(){ + const {contentStore} = this.props; + const {relateList:{canRef}} = contentStore; + let btn = []; + if(canRef){ + btn.push( + this.addDocType(ids, names, datas)} customized={true} > + + + ); + } + return btn; + } + getRelateButtons(){ + const {contentStore} = this.props; + const {taskDocStore,relateList:{canRelated}} = contentStore; + const {selectedRowKeys} = taskDocStore; + let btn = []; + if(canRelated){ + btn.push(this.addDocument(ids, names, datas)} customized={true} > + + ); + btn.push( ); + } + 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'); + } + //删除 + 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() { }, + }) + } + } + } + +} + diff --git a/pc4backstage/prj/components/common/relateWorkFlow.js b/pc4backstage/prj/components/common/relateWorkFlow.js new file mode 100644 index 0000000..7484d6a --- /dev/null +++ b/pc4backstage/prj/components/common/relateWorkFlow.js @@ -0,0 +1,140 @@ + +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 {relateList,relateList:{canRef}} = 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', 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', + }, + ]; + return ( +
+ + + +
) + } + getButtons(){ + const {contentStore} = this.props; + const {relateList:{canRef}} = contentStore; + let btn = []; + if(canRef){ + btn.push( + this.addWorkFlowType(ids, names, datas)} customized={true} > + + + ); + } + return btn; + } + + //编辑 + onChange=(data)=>{ + const {contentStore} = this.props; + const {doDspTaskRequiredOpt,taskid,} = contentStore; + doDspTaskRequiredOpt({ + method:'modifyRequiredWFN', + taskid : taskid, + wfid : data.wfid, + 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.wfid + },'req'); + }, + onCancel() { }, + }) + + } +} + diff --git a/pc4backstage/prj/components/common/stageList.js b/pc4backstage/prj/components/common/stageList.js new file mode 100644 index 0000000..632a664 --- /dev/null +++ b/pc4backstage/prj/components/common/stageList.js @@ -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 ( +
+ {stageColumns && stageColumns.length>0 && {this.tableEdit = el}} + />} +
) + + } + + 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; + } + +} + diff --git a/pc4backstage/prj/components/common/taskInfo.js b/pc4backstage/prj/components/common/taskInfo.js new file mode 100644 index 0000000..920cd02 --- /dev/null +++ b/pc4backstage/prj/components/common/taskInfo.js @@ -0,0 +1,240 @@ +import { WeaSearchGroup, WeaFormItem, WeaTools, WeaUpload, WeaProgress, WeaLocaleProvider, WeaInputEncrypt } from 'ecCom'; +import { 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' +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 { + + render() { + const { taskInfo, setFormFields, setValidate } = this.props.listStore; + const { form } = this.props; + const { isFormInit } = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && toJS(taskInfo.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 = + + { setFormFields({ begindate: { value: v[0] } }); this.workdayComputed(v, "begin") }} /> + + + } else if (fields.domkey[0] == "enddate") { + dom = + + { + if (taskInfo.maxSubTaskEndDate == "" || typeof (taskInfo.maxSubTaskEndDate) == "undefined") { + setFormFields({ enddate: { value: v[0] } }); + this.workdayComputed(v, "end") + } else { + if (new Date(v[0]) < new Date(taskInfo.maxSubTaskEndDate)) { + // Modal.warning({ + // title: getLabel(15172, "系统提示"), + // content: getLabel(83887, "任务完成的最后时间小于其子任务完成的最后时间!"), + // }); + message.error(getLabel(83887, "任务完成的最后时间小于其子任务完成的最后时间!")); + setFormFields({ enddate: { value: [taskInfo.maxSubTaskEndDate] } }); + this.workdayComputed([taskInfo.maxSubTaskEndDate, formParams.endtime], "end") + } else { + setFormFields({ enddate: { value: v[0] } }); + this.workdayComputed(v, "end") + } + } + }} /> + + + } else if (fields.domkey[0] == "actualbegindate") { + dom = + + { setFormFields({ actualbegindate__actualbegintime: { value: v } }); this.onActualComputed(v, "begin") }} /> + + + } else if (fields.domkey[0] == "actualenddate") { + dom = + + { setFormFields({ actualenddate__actualendtime: { value: v } }); this.onActualComputed(v, "end") }} /> + + + } else if (fields.domkey[0] == "finish") { + if (fields.viewAttr == "1") { + dom = + + + + + } else { + dom = + + { this.checkProgress(v); }} /> + % + + + } + } else if (fields.conditionType == "RICHTEXT") { //多行文本 + if(fields.viewAttr == "1"){ + dom = WeaTools.EncryBase.desensitization(fields.value)? : +
+ }else{ + dom = + } + } else if (fields.domkey[0] == "accessory") { + let domkey = fields.domkey[0]; + dom = + + + {dom} + ), + colSpan: 1, + hide: hide + }); + } else { + items.push({ + com: ( + {dom} + ), + colSpan: 1, + hide: hide + }); + } + }); + group.push() + }); + return group; + } + + workdayComputed = (arg, type) => { + const { setFormFields, taskInfo: { passnoworktime, userid } } = 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, "00:00", "23:59", userid, passnoworktime); + } + } else { + if (arg[0] && formParams.begindate) { + res = datediff(formParams.begindate, arg[0], "00:00", "23:59", userid, passnoworktime); + } + } + setFormFields({ workday: { value: res } }); + } + onActualComputed = (arg, type) => { //maxSubTaskEndDate + const { setFormFields, taskInfo: { passnoworktime, userid } } = 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, arg[1] || "00:00", formParams.actualendtime || "23:59", userid, passnoworktime); + } + } else { + if (arg[0] && formParams.actualbegindate) { + res = datediff(formParams.actualbegindate, arg[0], formParams.actualbegintime || "00:00", arg[1] || "23:59", userid, passnoworktime); + } + } + setFormFields({ realmandays: { value: res } }) + } + checkProgress = (value) => { //进度编辑校验 + const { taskInfo, setFormFields } = this.props.listStore; + if (Number(taskInfo.finishmax) == 99) { + if (value > 99) { + // Modal.warning({ + // title: getLabel(15172, "系统提示"), + // content: getLabel(383829, "该任务所必须的相关文档或者相关流程不存在,任务不能完成100%。"), + // }); + 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 } }); + } + } + } +} + diff --git a/pc4backstage/prj/components/common/taskList.js b/pc4backstage/prj/components/common/taskList.js new file mode 100644 index 0000000..a7c98dc --- /dev/null +++ b/pc4backstage/prj/components/common/taskList.js @@ -0,0 +1,78 @@ + +import {WeaProgress} from 'ecCom'; +import {inject, observer} from "mobx-react"; +import {WeaTableNew} from 'comsMobx'; +const WeaTable = WeaTableNew.WeaTable; +import TaskInfoDialog from '../dialog/taskDialog' + +@observer +export default class TaskList extends React.Component { + constructor(props) { + super(props); + } + + render() { + const {formStore }= this.props; + const {taskListTableStore,taskInfoStore,reLoad,prjid,refTaskList,tskOnRowSelect} = formStore; + // 通过 rowSelection 对象表明需要行选择 + const rowSelection = { + onChange(selectedRowKeys, selectedRows) { + taskInfoStore.onRowSelect(selectedRowKeys); + } + }; + return ( +
+ reLoad()} + getColumns={c=>this.reRenderColumns(c)} + onOperatesClick={this.onOperatesClick.bind(this)} + rowSelection={rowSelection} + /> + {{refTaskList()}} />} + {/* */} +
) + + + } + reRenderColumns(columns){ + columns.forEach((c,i)=>{ + if(c.dataIndex=='finish'){ + c.render = function(text, record){ + return + + + } + // } else { + // c.render = function(text, record){ + // let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex]; + // return + // } + } + }) + return columns; + } + + onOperatesClick(record,index,operate,flag){ + let that = this; + const {formStore }= this.props; + const {taskInfoStore,prjid} = formStore; + let _href = operate && operate.href ? operate.href : ""; + let fn = _href.replace("javascript:",""); + fn = fn.substring(0,fn.indexOf('(')); + if(fn != ""){ + if('onEditTask' == fn){ //编辑 + taskInfoStore.handleDialog(true,"edit",record.randomFieldId); + }else if('onDelTask' == fn){ //删除 + taskInfoStore.delTask("del",record.randomFieldId); + }else if('onAddSubTask' == fn){ //删除 + taskInfoStore.handleDialog(true,"add",record.randomFieldId,{parentid:record.randomFieldId,templetId:prjid}); + } + } + } + +} + diff --git a/pc4backstage/prj/components/common/wfActionSet.js b/pc4backstage/prj/components/common/wfActionSet.js new file mode 100644 index 0000000..f349388 --- /dev/null +++ b/pc4backstage/prj/components/common/wfActionSet.js @@ -0,0 +1,42 @@ +import {WeaTableEdit} from 'ecCom'; +import {toJS} from "mobx" +import {observer} from 'mobx-react'; + +@observer +export default class WfActionSet extends React.Component{ + constructor(props) { + super(props); + } + render(){ + const {fieldInfo,onChangeAction,settype} = this.props; + let d = toJS(fieldInfo); + return ( +
+ { this.tableEdit = ref } } + isModalEdit={false} + columns={d.columns} + datas={d.datas} + title={fieldInfo.title} + draggable={false} + showCopy={false} + onChange={onChangeAction} + rowKey = {"actionid"} + showAdd = {settype=="1"||settype=="4"||settype=="5"?false:true} + showDelete = {settype=="1"||settype=="4"||settype=="5"?false:true} + getRowSelection={this.getRowSelection} + /> +
+ ) + } + + getRowSelection = (rowSelection) => { + const {fieldInfo,onChangeAction,settype} = this.props; + if(settype=="1"){ + return null; + }else{ + const sel = { ...rowSelection }; + return sel; + } + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/common/wfFieldSet.js b/pc4backstage/prj/components/common/wfFieldSet.js new file mode 100644 index 0000000..be4c02b --- /dev/null +++ b/pc4backstage/prj/components/common/wfFieldSet.js @@ -0,0 +1,101 @@ +import { WeaSearchGroup,WeaFormItem ,WeaHelpfulTip,WeaLocaleProvider} from 'ecCom'; +import { Row,Col } from 'antd'; +import {toJS} from "mobx" +import {WeaSwitch} from "comsMobx" +import {observer} from 'mobx-react'; +const getLabel = WeaLocaleProvider.getLabel; + +@observer +export default class WfFieldSet extends React.Component{ + constructor(props) { + super(props); + } + getCircle() { + let style = { + height: 30, + textAlign: 'center', + } + return style; + } + render(){ + const { fieldInfo, form,settype } = this.props; + const {isFormInit} = form; + let group = []; + let items = []; + const formParams = form.getFormParams(); + isFormInit && toJS(fieldInfo).map((c,i) =>{ + items = []; + c.items.map((fields,index) => { + items.push({ + com:( +
+
+ +
+ +
), + colSpan:1, + }); + }); + if(settype=='1'||settype=='5'){ + group.push() + } + + }); + if(settype=='1'||settype=='5'){ + return
+
+ + +
+
{getLabel(15551,"项目字段")}
+
+ + +
+
{getLabel(21903,"字段设置")}
+
+ +
+
+ {group} +
; + }else{ + return
+
+ + +
+
{getLabel(15551,"项目字段")}
+
+ + +
+
{getLabel(21903,"字段设置")}
+
+ +
+
+ + {items.map(d=>d.com)} + +
; + } + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/common/wfsetList.js b/pc4backstage/prj/components/common/wfsetList.js new file mode 100644 index 0000000..50b4bfd --- /dev/null +++ b/pc4backstage/prj/components/common/wfsetList.js @@ -0,0 +1,86 @@ + +import {Button} from 'antd'; +import {WeaProgress,WeaLocaleProvider} from 'ecCom'; +import {observer} from "mobx-react"; +import {WeaTableNew} from 'comsMobx'; +const WeaTable = WeaTableNew.WeaTable; +const getLabel = WeaLocaleProvider.getLabel; + +@observer +export default class WfSetList extends React.Component { + constructor(props) { + super(props); + } + componentDidMount(){ + const {contentStore,wftype} = this.props; + contentStore.getWfSetList({wftype:wftype}); + } + componentWillReceiveProps(nextProps) { + + } + render() { + const {contentStore} = this.props; + const {wfsetListStore,reLoad} = contentStore; + + return ( +
+ reLoad(wfsetListStore)} + getColumns={c=>this.reRenderColumns(c)} + onOperatesClick={this.onOperatesClick.bind(this)} + /> +
) + } + + getAdButtons = () => { + const {contentStore} = this.props; + const {getWfSetList,wftype,setShowSearchAd,clearFormFields} = contentStore; + return [ + (), + (), + () + ]; + } + reRenderColumns(columns){ + columns.forEach((c,i)=>{ + if(c.dataIndex=='finish'){ + c.render = function(text, record){ + return + + + } + } else { + c.render = function(text, record){ + let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex]; + return + } + } + }) + return columns; + } + onOperatesClick(record,index,operate,flag){ + const {contentStore} = this.props; + const {prjWfSetStore,wftype} = contentStore; + let _href = operate && operate.href ? operate.href : ""; + let fn = _href.replace("javascript:",""); + fn = fn.substring(0,fn.indexOf('(')); + let that = this; + if(fn != ""){ + if('onEdit' == fn){ //编辑 + prjWfSetStore.handleShareDialog(true,"edit",wftype,"baseinfo",{wfsetid:record.randomFieldId}); + }else if('onDel' == fn){ + contentStore.deleteWfSet(record.randomFieldId); + }else if('onWfset' == fn){ + window.open((window.ecologyContentPath || '')+"/spa/workflow/static4engine/engine.html#/main/workflowengine/path/pathSet/pathDetail/baseSet/baseInfo?workflowId="+record.wfid+"&showLeftTree=false","+blank") + }else if('onUse' == fn){ + contentStore.toggleuse(record.randomFieldId,"1"); + }else if('onNouse' == fn){ + contentStore.toggleuse(record.randomFieldId,"0"); + } + } + } +} + diff --git a/pc4backstage/prj/components/comp/prj-data-time/index.js b/pc4backstage/prj/components/comp/prj-data-time/index.js new file mode 100644 index 0000000..e865fb1 --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-data-time/index.js @@ -0,0 +1,53 @@ +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=""}=this.props; + + return( +
+ + + +
+ ); + } +} + +export default Main; \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/prj-left-right-layout/index.js b/pc4backstage/prj/components/comp/prj-left-right-layout/index.js new file mode 100644 index 0000000..aa277b3 --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-left-right-layout/index.js @@ -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 ( +
+ { + leftCom && +
+
+ {leftCom} +
+
+ } +
+ { + leftCom && +
this.setState({isHover:true})} + onMouseLeave={()=>this.setState({isHover:false})} + style={{background: `url('${window.ecologyContentPath || ''}/cloudstore/images/e9/leftTree-${showLeft ? "show" : "hide"}${isHover ? "-hover" : ""}.png') no-repeat -2px 0`}} + >
+ } +
+
+ {children} +
+
+
+
+ ) + } +} + +export default LeftRightLayout; \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/prj-left-right-layout/index.less b/pc4backstage/prj/components/comp/prj-left-right-layout/index.less new file mode 100644 index 0000000..7abc5d4 --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-left-right-layout/index.less @@ -0,0 +1,55 @@ + +@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; + height: 100%; + .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%; +} + diff --git a/pc4backstage/prj/components/comp/prj-show-group/index.js b/pc4backstage/prj/components/comp/prj-show-group/index.js new file mode 100644 index 0000000..856d5f9 --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-show-group/index.js @@ -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 ( +
+ + +
{leftComponent}
+ + + {rightComponent} + this.setState({showGroup:!showGroup})}/> + +
+ + { + children + } + +
+ ) + } + +} + +export default PrjShowGroup \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/prj-show-group/index.less b/pc4backstage/prj/components/comp/prj-show-group/index.less new file mode 100644 index 0000000..a4abc69 --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-show-group/index.less @@ -0,0 +1,33 @@ +.prj-exchange-title{ + height: 50px; + line-height: 50px; + 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; +} \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/prj-table-edit/index.js b/pc4backstage/prj/components/comp/prj-table-edit/index.js new file mode 100644 index 0000000..ed4069d --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-table-edit/index.js @@ -0,0 +1,274 @@ +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 = [],canRef } = this.props; + columns.length > 0 && this.setState(datas.length > 0 ? {datas: this.addKeytoDatas(datas),columns} : {columns}) + } + componentWillReceiveProps(nextProps) { + const { columns = [], datas = [], selectedRowKeys = [],canRef=true } = this.props; + const _columns = nextProps.columns || []; + const _datas = nextProps.datas || []; + const _selectedRowKeys = nextProps.selectedRowKeys || []; + const _canRef = nextProps.canRef || true; + !isEqual(columns,_columns) && this.setState({columns: _columns}); + !isEqual(canRef,_canRef) && this.setState({canRef: _canRef}); + !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( +
+ + + ) + } + 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; + const { canRef } = this.props; + let viewAttr = 2; + if(!canRef){ + viewAttr = 1; + } + let _com = []; + com.map((c,i) => { + if(typeof c.props === 'object'){ + _com.push(c); + }else{ + const { key, label = '', type = 'INPUT', options = [], browserConditionParam = {}, innerStyle = {width: "100%"}, + showTime = false ,format = "yyyy-MM-dd",otherParams } = c; + const _type = type.toUpperCase(); + let style = _type === 'BROWSER' ? {...innerStyle}:{...innerStyle, display: 'inline-block'} + _com.push( + + {label && {label}} + { _type === 'INPUT' && + this.onEdit(record, index, key, value)} /> + } + { _type === 'TEXTAREA' && + this.onEdit(record, index, key, value)} /> + } + { _type === 'DATEPICKER' && + this.onEdit(record, index, key, value)} /> + } + { _type === 'TIMEPICKER' && + this.onEdit(record, index, key, value)} /> + } + { _type === 'SELECT' && + this.onEdit(record, index, key, value)} /> + } + { _type === 'BROWSER' && + this.onEdit(record, index, key, ids, names, bDatas)} /> + } + { _type === 'CHECKBOX' && + this.onEdit(record, index, key, value)} + /> + } + { + _type == "LINK_WF" && + + {record[key]} + + } + { + _type == "LINK_DOC" && + + {record[key]} + + } + { + _type == "OPERATE" && + + + {getLabel(104,"操作")} + + + } + + ) + } + }); + return ( +
+ {_com} +
+ ) + } + 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( + + {item.showname} + + ) + }) + return this.onMenuClick(record,options)}> + {menu} + + } + return menu + } + onMenuClick=(record,options)=>{ + typeof this.props.operate == "function" && this.props.operate(record); + } +} + +export default Main; + diff --git a/pc4backstage/prj/components/comp/prj-table-edit/index.less b/pc4backstage/prj/components/comp/prj-table-edit/index.less new file mode 100644 index 0000000..f062b40 --- /dev/null +++ b/pc4backstage/prj/components/comp/prj-table-edit/index.less @@ -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; +} \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/prjTaskListTable/index.js b/pc4backstage/prj/components/comp/prjTaskListTable/index.js new file mode 100644 index 0000000..7943d1c --- /dev/null +++ b/pc4backstage/prj/components/comp/prjTaskListTable/index.js @@ -0,0 +1,324 @@ +import {Table,Icon,Row,Col,Button,Modal,InputNumber,message} from 'antd' +import {WeaInput,WeaBrowser,WeaDialog,WeaNewScroll,WeaLocaleProvider,WeaSelect} from 'ecCom' +import './index.less' +import equal from "deep-equal" +import PrjDateTime from '../prj-data-time' +import {datediff} from '../../../util' +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||"", + } + } + 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"){ + //let befRealid = item.realid; + 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( +
+ +
+
+ + + this.setState({showModal:false})} + + > + +
+
+ + + + + ) + } + getColumns(){ + const {taskViewAttr } = this.state; + const { stageOptions } = this.props; + let dis = true; + if(taskViewAttr==2){ + dis = false; + } + return [{ + title: getLabel(15486,"序号"), + dataIndex: 'rowIndex', + width:"5%", + render: (text, record, index ) => {return {text}}, + }, { + title: getLabel(1352,"任务名称"), + dataIndex: 'name', + width:"20%", + render: (text, record, index ) => + this.onEdit(record, index,"name" , value)} + /> + , + }, { + title: "阶段", + dataIndex: 'name', + width:"10%", + render: (text, record, index ) => + this.onEdit(record, index,"stageid" , value)} + /> + , + }, { + title: getLabel(1298,"工期"), + dataIndex: 'workday', + width:"5%", + render:(text, record, index)=> + + + }, { + title: getLabel(742,"开始时间"), + dataIndex: 'begindate', + width:"15%", + render:(text, record, index)=> + {this.timeComputed(v,"begin",index)}} /> + + }, { + title: getLabel(743,"结束时间"), + dataIndex: 'enddate', + width:"15%", + render:(text, record, index)=> + {this.timeComputed(v,"end",index)}} /> + + }, { + title: getLabel(2233,"前置任务"), + dataIndex: 'beftaskid', + width:"15%", + render:(text, record, index)=> + + + + {!dis&&this.setState({showModal:true,clickKey:record.key})}/>} + + }, + { + title: getLabel(2097,"负责人"), + dataIndex: 'hrmid', + width:"20%", + render:(text, record, index)=> + {this.onEdit( record, index,"hrmid",ids, names, bDatas)}} + replaceDatas={[{id: text, name: record.hrmname}]} + /> + + }]; + } + + 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 ; + } + this.setState({datas : _datas}); + this.onChange(_datas); + } + + getButtons(){ + let btn = []; + btn.push(); + btn.push(); + return btn; + } + getModalColumns(){ + return [{ + title: getLabel(15486,"序号"), + dataIndex: 'rowIndex', + width:"15%", + render: (text, record, index ) =>{text}, + }, { + title: getLabel(1352,"任务名称"), + dataIndex: 'name', + width:"85%", + render: (text, record, index ) => {text}, + }] + } + 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) { + //that.setState({selectedRowKeys:selectedRowKeys}); + typeof that.props.onRowSelect === 'function' && that.props.onRowSelect(selectedRowKeys); + }, + selectedRowKeys:that.props.selectedRowKeys + } + return rowSelection + } + + onChange(datas){ + // let _datas = datas.map((data, i) => { + // let _data = {...data} + // delete _data.key + // return _data + // }) + typeof this.props.onChange === 'function' && this.props.onChange(datas); + } +} + +export default PrjTaskListTable; diff --git a/pc4backstage/prj/components/comp/prjTaskListTable/index.less b/pc4backstage/prj/components/comp/prjTaskListTable/index.less new file mode 100644 index 0000000..6d21867 --- /dev/null +++ b/pc4backstage/prj/components/comp/prjTaskListTable/index.less @@ -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 +} \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/view-list/ListItem.js b/pc4backstage/prj/components/comp/view-list/ListItem.js new file mode 100644 index 0000000..7d79cba --- /dev/null +++ b/pc4backstage/prj/components/comp/view-list/ListItem.js @@ -0,0 +1,40 @@ +import React from 'react'; +import classNames from 'classnames'; +import { WeaLocaleProvider } from 'ecCom'; +const getLabel = WeaLocaleProvider.getLabel; + +export default class ListItem extends React.Component { + onClick = () => { + const { data, onClick } = this.props; + onClick && onClick(data.id); + } + + render() { + const { data, currentKey } = this.props; + const className = classNames('prj-list-item-content'); + let isCurrent = currentKey && currentKey == data.id; + return ( +
+
+
+ {/*
{'已启用'}
*/} +
+
{data.name}
+
+ {data.desc } +
+
+
+
+ +
+ + + ) + } +} + diff --git a/pc4backstage/prj/components/comp/view-list/index.js b/pc4backstage/prj/components/comp/view-list/index.js new file mode 100644 index 0000000..aae1203 --- /dev/null +++ b/pc4backstage/prj/components/comp/view-list/index.js @@ -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, onItemClick, pagination, scrollHeight = document.documentElement.clientHeight, currentKey, onSearchListItem, onSearchChange, prjValue } = this.props; + return ( +
+ + + {datas.length === 0 ? +

+ {getLabel('83553',"暂无数据")} +

+ : +
+ { + datas && datas.length > 0 && datas.map(d => ( + + )) + } +
+ } + +
+
+ +
+
+ ) + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/comp/weaDragula/index.js b/pc4backstage/prj/components/comp/weaDragula/index.js new file mode 100644 index 0000000..eeb2929 --- /dev/null +++ b/pc4backstage/prj/components/comp/weaDragula/index.js @@ -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; \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/FieldCommonSelect.js b/pc4backstage/prj/components/custom/FieldCommonSelect.js new file mode 100644 index 0000000..f289ba2 --- /dev/null +++ b/pc4backstage/prj/components/custom/FieldCommonSelect.js @@ -0,0 +1,70 @@ +import { WeaSelect, WeaLocaleProvider, WeaBrowser, WeaError } from 'ecCom'; +import { inject, observer } from 'mobx-react'; +const getLabel = WeaLocaleProvider.getLabel; + +@inject('prjFieldConfigStore') +@observer +export default class FieldCommonSelect extends React.Component { + constructor(props) { + super(props); + } + + render() { + const { selectCommonList } = this.props.prjFieldConfigStore; + const { fieldId, canDel='y' } = this.props; + let options=[],variable=true,value='',replaceDatas=[]; + for (const selectCommon of selectCommonList) { + if (fieldId == selectCommon.fieldid) { + variable = selectCommon.variable; + options = selectCommon.options; + value = selectCommon.value; + replaceDatas = selectCommon.replaceDatas; + break; + } + } + return ( + variable && + + {this.addError(fieldId,ref)}} + error={getLabel(385869,"此项必填")}> + {this.onChange(fieldId,datas)}} + /> + + + + + ); + } + + onChange = (fieldId, datas) => { + const store = this.props.prjFieldConfigStore; + store.setSelectCommonList(fieldId, datas); + } + + addError = (id,ref) =>{ + if(ref!=null){ + const { errors } = this.props.prjFieldConfigStore; + let flag = true; + for (const error of errors) { + if (id == error.id) { + error.ref = ref; + flag = false; + break; + } + } + if(flag){ + errors.push({id:id,ref:ref}) + } + } + } + +} \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/FieldConfig.js b/pc4backstage/prj/components/custom/FieldConfig.js new file mode 100644 index 0000000..22c0431 --- /dev/null +++ b/pc4backstage/prj/components/custom/FieldConfig.js @@ -0,0 +1,105 @@ +import { toJS } from 'mobx'; +import { inject, observer } from "mobx-react"; +import React from 'react'; +import {Spin,Modal } from "antd"; +import {WeaTableEdit,WeaRightMenu,WeaAlertPage} from 'ecCom'; + +@inject('prjFieldConfigStore') +@observer +export default class FieldConfig extends React.Component{ + constructor(props){ + super(props); + } + + getStore() { + return this.props.prjFieldConfigStore; + } + + componentWillMount(){ + this.getStore().componentWillMount(this); + } + + componentDidMount(){ + this.getStore().componentDidMount(this.props.params.fieldtype,this.props.prjtypeid); + } + + componentWillReceiveProps(nextProps){ + if(this.props.params.fieldtype!=nextProps.params.fieldtype){ + this.props.prjFieldConfigStore.componentDidMount(nextProps.params.fieldtype,nextProps.prjtypeid); + }else if(this.props.prjtypeid!=nextProps.prjtypeid){ + this.props.prjFieldConfigStore.componentDidMount(nextProps.params.fieldtype,nextProps.prjtypeid); + } + + } + + componentWillUnmount(){ + this.getStore().componentWillUnmount(); + } + + render(){ + const store = this.getStore(); + const {responseData,setSelectedKeys,setSelectedData,columnDta,columnDef,selectedData,rightMenus,title,canEdit,loading} = store; + // const loading = Object.keys(responseData).length == 0; + let content = []; + if(loading){ + const loadingCom =
; + content = [loadingCom]; + }else{ + const {status} = responseData; + if(status == "success"){ + + const {rightMenus,title,canEdit} = responseData; + let tProps = {}; + tProps.ref = "tableObj"; + tProps.isModalEdit = false; + tProps.columns = toJS(columnDef); + tProps.datas = toJS(columnDta); + tProps.title = title; + tProps.showAdd = false; + tProps.showDelete = false; + tProps.showCopy = false; + tProps.selectedData = toJS(selectedData); + if(canEdit){ + tProps.draggable = true; + tProps.onChange = this.onChange; + tProps.getRowSelection = this.getRowSelection; + }else{ + tProps.draggable = false; + tProps.getRowSelection = ()=>{return undefined}; + } + content.push( +
+ +
+ ); + }else{ + const {errorMsg} = responseData; + content = [(
{errorMsg}
)]; + } + } + return content; + } + + onChange=(columnDta)=>{ + const store = this.getStore(); + store.setColumnDta(columnDta); + } + + getRowSelection = (rowSelection) => { + let sel = {...rowSelection}; + sel.getCheckboxProps = (record) => { + return {disabled: record.canDel == 'n'}; + } + return sel; + } + + + onRowSelect=(keys, record, dataIndex,selectedDatas)=>{ + const store = this.getStore(); + if(typeof(dataIndex) == "undefined"){ + store.setSelectedKeys(keys); + }else{ + store.setSelectedData(dataIndex,selectedDatas); + } + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/FieldGroup.js b/pc4backstage/prj/components/custom/FieldGroup.js new file mode 100644 index 0000000..17025e8 --- /dev/null +++ b/pc4backstage/prj/components/custom/FieldGroup.js @@ -0,0 +1,92 @@ +import { toJS } from 'mobx'; +import { inject, observer } from "mobx-react"; +import React from 'react'; +import {Spin,Modal } from "antd"; +import {WeaTableEdit,WeaRightMenu,WeaAlertPage} from 'ecCom'; + +@inject('prjFieldGroupStore') +@observer +export default class FieldGroup extends React.Component{ + constructor(props){ + super(props); + } + + getStore() { + return this.props.prjFieldGroupStore; + } + + componentWillMount(){ + this.getStore().componentWillMount(this); + } + + componentDidMount(){ + this.getStore().componentDidMount(this.props.params.fieldtype); + } + + componentWillUnmount(){ + this.getStore().componentWillUnmount(); + } + + render(){ + const store = this.getStore(); + const {responseData} = store; + const loading = Object.keys(responseData).length == 0; + let content = []; + if(loading){ + const loadingCom =
; + content = [loadingCom]; + }else{ + const {status} = responseData; + if(status == "1"){ + const {columnDef,columnDta,rightMenus,title,canEdit} = responseData; + let tProps = {}; + tProps.ref = "tableObj"; + tProps.isModalEdit = false; + tProps.columns = toJS(columnDef); + tProps.datas = toJS(columnDta); + tProps.title = title; + tProps.showAdd = false; + tProps.showDelete = false; + tProps.showCopy = false; + tProps.copyFilterProps = ["id"] + if(canEdit){ + tProps.draggable = true; + tProps.onChange = this.onChange; + tProps.onRowSelect = this.onRowSelect; + tProps.getRowSelection = this.getRowSelection; + }else{ + tProps.draggable = false; + tProps.getRowSelection = ()=>{return undefined}; + } + content.push( +
+ +
+ ); + }else{ + const {errorMsg} = responseData; + content = [(
{errorMsg}
)]; + } + } + return content; + } + + onChange=(columnDta)=>{ + const store = this.getStore(); + store.setColumnDta(columnDta); + } + + onRowSelect=(sRowKeys)=>{ + const store = this.getStore(); + const {setSelectedData,setSelectedKeys,columnDta} = store; + setSelectedKeys(sRowKeys); + } + + getRowSelection = (rowSelection) => { + let sel = {...rowSelection}; + sel.getCheckboxProps= (record) => { + return {disabled: record.canDel == 'n'}; + } + return sel; + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/FieldLanguage.js b/pc4backstage/prj/components/custom/FieldLanguage.js new file mode 100644 index 0000000..dd998b4 --- /dev/null +++ b/pc4backstage/prj/components/custom/FieldLanguage.js @@ -0,0 +1,76 @@ +import { toJS } from 'mobx'; +import { inject, observer } from "mobx-react"; +import React from 'react'; +import {Spin } from "antd"; +import {WeaTableEdit,WeaRightMenu,WeaAlertPage,WeaSearchGroup } from 'ecCom'; + +@inject('prjFieldLanguageStore') +@observer +export default class FieldLanguage extends React.Component{ + constructor(props){ + super(props); + } + + getStore() { + return this.props.prjFieldLanguageStore; + } + + componentWillMount(){ + this.getStore().componentWillMount(this); + } + + componentDidMount(){ + this.getStore().componentDidMount(this.props.params.fieldtype,this.props.prjtypeid); + } + + componentWillUnmount(){ + this.getStore().componentWillUnmount(); + } + + render(){ + const store = this.getStore(); + const {responseData} = store; + const loading = false; + let content = []; + let contentWrap = []; + if(loading){ + const loadingCom =
; + contentWrap = [loadingCom]; + }else{ + const {status} = responseData; + if(status == "1"){ + const {columns,groups} = responseData; + content.push(
{return undefined}}/>
); + toJS(groups).map(group =>{ + let tProps = {}; + tProps.isModalEdit = false; + tProps.columns = toJS(columns); + tProps.datas = toJS(group.columnsData); + tProps.draggable = false; + tProps.showAdd = false; + tProps.showDelete = false; + tProps.showCopy = false; + tProps.tableProps = {showHeader:false}; + tProps.getRowSelection = ()=>{return undefined}; + tProps.onChange = (newData) => {this.onChange(newData,group)}; + let items = []; + items.push({ + com:(), + col:1, + }); + content.push() + store.putData(group.id,toJS(group.columnsData)); + }); + contentWrap = [
{content}
]; + }else{ + //contentWrap = [
{responseData.errorMsg}
]; + } + } + return contentWrap; + } + + onChange=(newData,group)=>{ + const store = this.getStore(); + store.putData(group.id,newData); + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/FieldOptionManage.js b/pc4backstage/prj/components/custom/FieldOptionManage.js new file mode 100644 index 0000000..655a89c --- /dev/null +++ b/pc4backstage/prj/components/custom/FieldOptionManage.js @@ -0,0 +1,205 @@ +import { Button, Modal, message } from 'antd' +import { WeaNewScroll, WeaDialog, WeaTableEdit, WeaSelect, WeaLocaleProvider } from 'ecCom'; +import isEqual from 'lodash/isEqual'; +import isFunction from 'lodash/isFunction'; +import { inject, observer } from 'mobx-react'; +const getLabel = WeaLocaleProvider.getLabel; + +const columns = [ + { + title: getLabel(384287, "可选项标识"), + dataIndex: 'id', + key: 'id', + width: "20%", + com: [ + { + type: 'input', + viewAttr: 1, + key: 'id' + } + ] + },{ + title: getLabel(19113, "值"), + dataIndex: 'value', + key: 'value', + width: "20%", + com: [ + { + type: 'input', + viewAttr: 1, + key: 'value' + } + ] + }, + { + title: getLabel(15442, "可选项文字"), + dataIndex: 'showname', + key: 'showname', + width: "50%", + com: [ + { + type: 'input', + viewAttr: 3, + key: 'showname', + } + ] + }, { + title: getLabel(19206, "默认值"), + dataIndex: 'isdefault', + key: 'isdefault', + width: "15%", + com: [ + { + type: 'checkbox', + viewAttr: 2, + key: 'isdefault', + } + ] + }, + { + title: '', + dataIndex: 'blank', + key: 'blank', + width: "5%", + com: [ + { + type: 'input', + viewAttr: 1, + key: 'blank', + } + ] + } +] + +@inject('prjFieldConfigStore') +@observer +export default class FieldOptionManage extends React.Component { + constructor(props) { + super(props); + this.state = { + visible: false + } + } + + componentWillReceiveProps(nextProps) { + + } + + render() { + const { visible } = this.state; + const { selectDefineList } = this.props.prjFieldConfigStore; + const { fieldId } = this.props; + let variable = true; + let options = []; + for (const selectDefine of selectDefineList) { + if (fieldId == selectDefine.fieldid) { + variable = selectDefine.variable; + options = selectDefine.options; + break; + } + } + let defaultOption = ""; + for (let option of options) { + if (option.isdefault == "1") { + defaultOption = option.key + "" + break; + } else { + defaultOption = options.length > 0 ? options[0].key + "" : "0"; + } + } + return ( + variable && + this.onClick(fieldId)}>{getLabel( 32714 ,'选项维护')} + { }} /> + {this.onCancel(fieldId)}} + visible={visible} + buttons={[ + , + + ]}> + + { this.onChange(fieldId, datas) }} showCopy={false} onRowSelect={this.onRowSelect} /> + + + + ); + } + onClick = (fieldId) => { + const store = this.props.prjFieldConfigStore; + for (let temp of store.tempOptionList) { + if (fieldId == temp.fieldid){ + this.setState({ visible: true }); //已备份,直接打开 + return; + } + } + for (let d of store.selectDefineList) { //无备份,以List的数据做备份 + if (fieldId == d.fieldid){ + store.saveTemOption(fieldId,d.options);//非新建数据 + this.setState({ visible: true }); + return; + } + } + store.saveTemOption(fieldId,[]);//List无数据,备份空数组 + this.setState({ visible: true }); + } + onCancel = (fieldId) => { + const store = this.props.prjFieldConfigStore; + store.resetSelectDefineList(fieldId); + this.setState({ visible: false }); + } + + onChange = (fieldId, datas) => { + const store = this.props.prjFieldConfigStore; + store.setSelectDefineList(fieldId, datas); + } + + saveOptions(fieldId) { + const store = this.props.prjFieldConfigStore; + let defaultId = ""; + for (let d of store.selectDefineList) { + if (d.fieldid == fieldId) {//d.fieldid是主表字段id fieldId 是selectItem表中选项的fieldId + for (let option of d.options) { + const value = option.showname; + if (value == "" || typeof (value) == "undefined") { + this.refs.editTable.refs.edit.doRequiredCheck(); + return; + } + let count = 0; + for (let optionTemp of d.options) { + if (value == optionTemp.showname) { + count++; + } + } + if (count > 1) { + message.error(getLabel(22356, "选项不能重复!")); + return; + } + if (option.isdefault == "1") { + defaultId = option.id; + } + } + store.saveTemOption(fieldId,d.options); + break; + } + } + //重新给默认选项赋值 + for (let c of store.columnDta) { + if (c.id == fieldId) { + c.fieldDbType[2] = defaultId; + } + } + this.setState({ visible: false }); + } + + getRowSelection = (rowSelection) => { + let sel = { ...rowSelection }; + sel.getCheckboxProps = (record) => { + return { disabled: record.canDel == 'n' }; + } + return sel; + } +} \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/FieldTab.js b/pc4backstage/prj/components/custom/FieldTab.js new file mode 100644 index 0000000..b6d3f30 --- /dev/null +++ b/pc4backstage/prj/components/custom/FieldTab.js @@ -0,0 +1,314 @@ +import React from 'react'; +import { inject, observer } from 'mobx-react'; +import { WeaTop, WeaTab, WeaRightMenu, WeaTools, WeaErrorPage, WeaNewScroll, WeaLeftTree, WeaAlertPage, WeaLocaleProvider, WeaDialog, WeaSwitch, WeaFormItem, WeaSearchGroup } from 'ecCom'; +import { Button } from "antd"; +import { toJS } from 'mobx'; +import FieldLanguage from "./FieldLanguage" +import FieldGroup from './FieldGroup' +import FieldConfig from './FieldConfig' +import LeftRightLayout from '../comp/prj-left-right-layout' +const getLabel = WeaLocaleProvider.getLabel; +import './style/prjField.less' + +@inject("prjFieldTabStore", "prjFieldLanguageStore", "prjFieldGroupStore", "prjFieldConfigStore") +@observer +class FieldTab extends React.Component { + + constructor(props) { + super(props); + this.state = { + searchValue: "" + } + } + + doInit(props) { + const { prjFieldTabStore } = props; + prjFieldTabStore.initTreeDatas(); + prjFieldTabStore.initDatas(); + } + + componentDidMount() { + this.doInit(this.props); + } + + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key) { + const { prjFieldTabStore } = this.props; + prjFieldTabStore.clearStatus(); + prjFieldTabStore.initTreeDatas(); + this.setState({ + searchValue: "" + }) + } + } + shouldComponentUpdate(nextProps, nextState) { + return true; + } + + componentWillUnmount() { + const { prjFieldTabStore } = this.props; + prjFieldTabStore.clearStatus(); + } + + // 更多按钮 + getMoreBtn = (btns) => { + let btnArr = []; + Array.isArray(btns) && btns.forEach((res) => { + let icon = ; + if (res.key.indexOf('save') > -1) { + icon = ; + } + btnArr.push({ + key: res.key, + icon, + content: res.props ? res.props.children : '', + onClick: res.props ? res.props.onClick : null, + }); + }); + return btnArr; + } + + // 字段加密设置弹出框 + getEncryptFieldSetDialog = () => { + const {prjFieldConfigStore} = this.props; + let { encryptFieldSetVisible, setParams, saveEncryptFieldSet, currentClickRecord,encryptFieldSetForm: { loading } } = prjFieldConfigStore; + let btns = [ + , + ]; + let { fieldLabel = '' } = currentClickRecord; + let title = getLabel('527160', '加密设置(字段:#[fieldName])').replace('#[fieldName]', fieldLabel); + const label = getLabel('524355', '提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!'); + return ( + setParams({ encryptFieldSetVisible: false })} + visible={encryptFieldSetVisible} + buttons={btns} + style={{ width: 600, height: 200 }} + moreBtn={{ datas: this.getMoreBtn(btns) }} + hasScroll + loading={loading} + > +
{label}
+ {this.getEncryptFieldSetInfo()} +
+ ); + } + + // 加密设置表单 + getEncryptFieldSetInfo =() => { + let group = []; + const {prjFieldConfigStore} = this.props; + const { encryptFieldSetForm: { fieldForm, conditioninfo } } = prjFieldConfigStore; + const { isFormInit } = fieldForm; + isFormInit && conditioninfo.map((c, i) => { + let arr = []; + c.items.map((field, index) => { + const itemProps = { + key: index, + label: field.label, + labelCol: { span: 9, offset: 6 }, + error: fieldForm.getError(field), + tipPosition: 'bottom', + wrapperCol: { span: 6 }, + }; + // 二次身份校验仅在脱敏显示时,可以开启 + let newField = { ...field }; + if (field.domkey && field.domkey instanceof Array && field.domkey[0] === 'secondauth') { + const { desensitization, secondauth } = fieldForm.getFormParams(); + if (desensitization == '1') { + newField = { ...newField, viewAttr: 2 }; + } else { + if (secondauth != '0') { + fieldForm.updateFields({ secondauth: { value: 0 } }, false); + } + newField = { ...newField, viewAttr: 1, disabled: true }; + } + } + + let coms = ; + arr.push({ + com: ( + + {coms} + + ), + col: 1, + }); + }); + group.push(); + }); + return group; + } + + render() { + const { prjFieldTabStore } = this.props; + const { selectedKey, tabData, treeInfo, noRight } = prjFieldTabStore; + const { leftTree, leftTreeCount, selectedTreeKey, typeTitle } = this.props.prjFieldTabStore; + const { setShowSearchAd, clearFormFields, setTreeInfo, setSelectedTreeKey } = this.props.prjFieldTabStore; + const fieldtype = this.props.params.fieldtype; + let title = getLabel(34154, "通用项目字段") + getLabel(18075, "定义"); + let title_type = typeTitle != "" ? typeTitle : getLabel(34153, "项目类型字段") + getLabel(18075, "定义"); + let title_task = getLabel(81856, "任务卡片字段定义"); + title = fieldtype == "prjtype" ? title_type : (fieldtype == "prjtsk" ? title_task : title); + + if (noRight) { + return ( +
+ {getLabel(2012, "对不起,您暂时没有权限!")} +
+
+ ) + } else { + return ( + + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + buttonSpace={10} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + getHeight={this.resetHeight.bind(this)} + > + { + this.setState({ + searchValue: v + }) + }} + onSearchLabelClick={() => { + setShowSearchAd(false); + clearFormFields(); + setSelectedTreeKey(""); + setTreeInfo({ prjtypeid: "", prjtypename: "" }); + }} + onSelect={(key, topTabCount, countsType) => { + setShowSearchAd(false); + clearFormFields(); + setSelectedTreeKey(key); + setTreeInfo({ + prjtypeid: topTabCount.keyid, + prjtypename: countsType.selectedNodes[0].props.name, + }); + }} + /> + } + showLeft={true} + onCollapse={showLeft => { }} + col={2} + children={ +
+ + + { //当加载资产类型树结构时 判断树结构是否加载完成 加载完成再加载字段定义数据 + (selectedKey == "1" && ("prjtype" == fieldtype ? (leftTree.length > 0 ? true : false) : true)) && + } + { + selectedKey == "2" && + } + { + selectedKey == "3" && + } + { this.getEncryptFieldSetDialog() } + +
+ } + > + +
+ {/* */} +
+
+ ) + } + } + + + resetHeight(height) { + jQuery(".prj-query-condition").height(height - 48); + } + + + getRightMenu() { + const { prjFieldTabStore, prjFieldConfigStore, prjFieldLanguageStore, prjFieldGroupStore } = this.props; + const sKey = prjFieldTabStore.selectedKey; + let arr = []; + if (sKey == "1") { + arr = prjFieldConfigStore.getRightMenus(); + } else if (sKey == "2") { + arr = prjFieldLanguageStore.getRightMenus(); + } else if (sKey == "3") { + arr = prjFieldGroupStore.getRightMenus(); + } + return arr; + } + + + onOperatesClick = (record, index, operate, flag, argumentString) => { + + } + + getTopButtons() { + let btns = []; + + + return btns; + } + + getButtons() { + const { prjFieldTabStore, prjFieldLanguageStore, prjFieldGroupStore, prjFieldConfigStore } = this.props; + const { selectedKey } = prjFieldTabStore; + let btnArr = []; + { + selectedKey == "1" && prjFieldConfigStore.canEdit && + btnArr.push( + // + prjFieldConfigStore.getTopButtons() + // + ) + } + { + selectedKey == "2" && prjFieldLanguageStore.canEdit && + btnArr.push( + // + prjFieldLanguageStore.getTopButtons() + // + ) + } + { + selectedKey == "3" && prjFieldGroupStore.canEdit && + btnArr.push( + // + prjFieldGroupStore.getTopButtons() + // + ) + } + + return btnArr; + } +} + +export default WeaTools.tryCatch(React, + props => , + { error: "" } +)(FieldTab); \ No newline at end of file diff --git a/pc4backstage/prj/components/custom/ListCondition.js b/pc4backstage/prj/components/custom/ListCondition.js new file mode 100644 index 0000000..9175468 --- /dev/null +++ b/pc4backstage/prj/components/custom/ListCondition.js @@ -0,0 +1,40 @@ +import { WeaSearchGroup,WeaFormItem ,WeaSwitch,WeaLocaleProvider} from 'ecCom'; +import { Button } from 'antd'; +import {toJS} from "mobx" +const getLabel = WeaLocaleProvider.getLabel; + +class Condition extends React.Component{ + render(){ + const { condition, form } = this.props.listStore; + const {isFormInit} = form; + let group = []; + const formParams = form.getFormParams(); + isFormInit && toJS(condition).map(c =>{ + let items = []; + c.items.map(fields => { + items.push({ + com:( + + ), + colSpan:1 + }) + }); + group.push() + }); + return group; + } +} + +const getAdButtons = (listStore) => { + const {doSearch,setShowSearchAd,clearFormFields,setConditionByTree} = listStore; + return [ + (), + (), + () + ]; +} + +export {Condition,getAdButtons} diff --git a/pc4backstage/prj/components/custom/PrjCardTabSet.js b/pc4backstage/prj/components/custom/PrjCardTabSet.js new file mode 100644 index 0000000..793a677 --- /dev/null +++ b/pc4backstage/prj/components/custom/PrjCardTabSet.js @@ -0,0 +1,191 @@ +import React from 'react'; +import { inject, observer } from 'mobx-react'; +import { toJS } from "mobx" +import { Button, Spin } from 'antd' +import { WeaDialog, WeaBrowser, WeaTop, WeaUpload, WeaTableEdit, WeaRightMenu, WeaAlertPage, WeaLocaleProvider } from "ecCom" +const getLabel = WeaLocaleProvider.getLabel; + +@inject("prjCardTabSetStore") +@observer +class PrjCardTabSet extends React.Component { + static defaultProps = { + + } + constructor(props) { + super(props); + this.state = { + selectRowKeysLenth: 0 + } + + } + componentWillUnMount() { + const { getColumnsInfo } = this.props.prjCardTabSetStore; + getColumnsInfo(); + } + componentDidMount() { + const { getColumnsInfo } = this.props.prjCardTabSetStore; + const tabtype = this.props.params.tabtype; + getColumnsInfo({tabtype:tabtype}); + } + componentWillReceiveProps(nextProps) { + if (this.props.location.key !== nextProps.location.key || this.props.params.tabtype !== nextProps.params.tabtype) { + const { getColumnsInfo } = this.props.prjCardTabSetStore; + const tabtype = nextProps.params.tabtype; + getColumnsInfo({tabtype:tabtype}); + } + } + onClick = (e) => { + // alert("自定义组件——详细信息"); + } + onChange = (datas) => { + const { setColumnDatas } = this.props.prjCardTabSetStore; + setColumnDatas(datas); + } + + onRowSelect = (keys, record, dataIndex, selectedDatas) => { + const store = this.props.prjCardTabSetStore; + if (typeof (dataIndex) == "undefined") { + store.setSelectedKeys(keys); + } else { + store.setSelectedData(selectedDatas); + } + } + + render() { + const { isModalEdit, columnDef, columnDatas, noRight, status, selectedData, loading } = this.props.prjCardTabSetStore; + if (noRight) { + return ( +
+ {getLabel(2012, "对不起,您暂时没有权限!")} +
+
+ ) + } else { + return ( +
+ + } + iconBgcolor='#217346' + buttons={this.getTopButtons()} + buttonSpace={10} + showDropIcon={true} + dropMenuDatas={this.getRightMenu()} + > +
+ + {status && this.onCopy(keys, datas)} + />} + +
+
+
+
+ ) + } + } + + getRowSelection = (rowSelection) => { + let sel = { ...rowSelection }; + sel.getCheckboxProps = (record) => { + return { disabled: record.issystem == '1' }; + } + return sel; + } + + getTopButtons() { + let btns = []; + const { saveCardTabSet, selectedKeys, setSelectedKeys } = this.props.prjCardTabSetStore; + btns.push(); + btns.push(); + btns.push(); + btns.push(); + + return btns; + } + + onCopy = (keys , datas) => { + const store = this.props.prjCardTabSetStore; + const { setSelectedData, selectedData, selectedKeys, columnDatas } = store; + let d = selectedData.isopen ? selectedData.isopen : []; + let r = []; + selectedKeys.map((item,key)=>{ + if((selectedData.isopen+"").indexOf(item)>-1){ + r.push(keys[key]); + } + }) + d = d.concat(r); + setSelectedData({ + ...selectedData, + isopen : d + }); + } + + getRightMenu() { + const { saveCardTabSet, selectedKeys, setSelectedKeys } = this.props.prjCardTabSetStore; + let btns = []; + btns.push({ + key: "save", + icon: , + content: getLabel(86, "保存"), + onClick: key => { + this.refs.tableEdit.refs.edit.doRequiredCheck(); + saveCardTabSet() + } + }); + + btns.push({ + key: "addRow", + icon: , + content: getLabel(21690, "添加行"), + onClick: key => { + this.refs.tableEdit.refs.edit.doAdd(); + } + }); + btns.push({ + key: "delRow", + icon: , + content: getLabel(16182, "删除行"), + disabled : selectedKeys.length == 0, + onClick: key => { + selectedKeys.length > 0 && this.refs.tableEdit.refs.edit.doDelete(); + setSelectedKeys([]); + } + }); + + btns.push({ + key: "copyRow", + icon: , + content: getLabel(77, "复制") + getLabel(18620, "行"), + disabled : selectedKeys.length == 0, + onClick: key => { + selectedKeys.length > 0 && this.refs.tableEdit.refs.edit.doCopy(); + } + }); + + return btns; + } +} + +export default PrjCardTabSet; + + + diff --git a/pc4backstage/prj/components/custom/style/prjField.less b/pc4backstage/prj/components/custom/style/prjField.less new file mode 100644 index 0000000..a05561b --- /dev/null +++ b/pc4backstage/prj/components/custom/style/prjField.less @@ -0,0 +1,69 @@ +.prj-table-edit-nonetop{ + .wea-table-edit .wea-table-edit-title { + padding: 0; + border-bottom: 0px solid #e9e9e9; + } +} +.prj-table-edit-nonecontent{ + .ant-table-placeholder { + display: none; + } +} +.prj-search-group-nonepadding{ + .wea-search-group { + padding: 0; + } +} + +.prj-table-edit-nonetop{ + .wea-table-edit { + .wea-table-edit-title { + padding: 0; + border-bottom: 0 solid #e9e9e9; + } + } +} + +.prj-encrypt-setting{ + color:#00A9FF; + cursor: pointer; + padding-left: 8px; +} + +.bs-prj-define-encrypt-dialog .data_security_tip_info{ + width: 100%; + height: 30px; + line-height: 30px; + padding: 0px 8px; + color: #FF9200; + background-color: #FFF3DC; + border: 1px solid #FFD073; + border-left: none; + border-right: none; + /* i { + position: relative; + margin-right: 8px; + font-size: 20px; + top: 4px; + } */ +} + +.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-checked.ant-switch-disabled { +background: #D8EFD1; +border-color: #D8EFD1; +} +.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-checked.ant-switch-disabled:after { +background: #A5D397; +cursor: not-allowed; +border-color: #A5D397; +} +.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-disabled { +cursor: not-allowed; +background: #DADADA; +border-color: #DADADA; +} +.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-disabled:after { +background: #EDEDED; +cursor: not-allowed; +border-color: #EDEDED; +} \ No newline at end of file diff --git a/pc4backstage/prj/components/dialog/addPrjTempletDialog.js b/pc4backstage/prj/components/dialog/addPrjTempletDialog.js new file mode 100644 index 0000000..4e8ebdb --- /dev/null +++ b/pc4backstage/prj/components/dialog/addPrjTempletDialog.js @@ -0,0 +1,223 @@ + +import { Button, Spin } from 'antd'; +import { WeaDialog, WeaTab, WeaNewScroll, WeaRightMenu, WeaLocaleProvider } from 'ecCom'; +import { 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 AddPrjTempletDialog extends React.Component { + constructor(props) { + super(props); + this.state = { + width: 1020, + height: 650, + } + } + componentDidMount() { + + } + computedWH = () => { + } + componentWillReceiveProps(nextProps) { + + } + render() { + const { addPrjTempletStore } = this.props.contentStore; + const { title, selectedKey, visible, conditionDatas: { userid, taskinfo, fieldinfo, taskViewAttr }, saveListDatas, saveRowKeys, selectedRowKey, spinning } = addPrjTempletStore; + const { form, setFormFields, setValidate } = addPrjTempletStore; + const tabs = [{ key: "prjinfo", title: getLabel(16290, "项目信息") }, { key: "sublist", title: getLabel(18505, "任务列表") }, { key: "stagelist", title: getLabel('387407',"阶段设置") }]; + const { width, } = this.state; + const formParams = form.getFormParams() || {}; + let dialogHeight = window.innerHeight - 150; + if (dialogHeight > 600) dialogHeight = 600; + return ( +
+ addPrjTempletStore.handleShareDialog(false)} + buttons={this.getDialogButtons()} + > + + + + +
+ { setFormFields(v) }} setValidate={(v) => { setValidate(v) }} /> +
+
+ { saveListDatas(datas) }} + onRowSelect={(rowkeys) => { saveRowKeys(rowkeys) }} + stageOptions={this.getStageOptions()} + /> +
+
+ { this.StageList = el }} contentStore={addPrjTempletStore} /> +
+
+
+
+
+ +
) + } + + getDialogButtons() { + const { isreflesh } = this.props; + const { addPrjTempletStore } = this.props.contentStore; + const { saveAddProject, conditionDatas: { taskViewAttr } } = addPrjTempletStore; + let btn = []; + if (taskViewAttr == 2) { + btn.push(); + btn.push(); + } else { + btn.push(); + } + return btn + } + + getButtons() { + const { addPrjTempletStore } = this.props.contentStore; + const { selectedKey, addNewListDatas, deleListDatas, conditionDatas: { taskViewAttr }, selectedRowKey, stageInfo } = addPrjTempletStore; + const isDisabled = !(selectedRowKey.length > 0 && `${toJS(selectedRowKey)}`); + const stageDisabled = !(stageInfo.selectedRowKeys.length > 0) + let btn = []; + if (taskViewAttr == 2) { + if (selectedKey == "sublist") { + btn = [ + (), + + ]; + } else if (selectedKey == "stagelist") { + btn = [ + (), + + ]; + } + } + return btn + } + + getRightMenu() { + const { isreflesh } = this.props; + const { addPrjTempletStore } = this.props.contentStore; + const { selectedKey, saveAddProject, addNewListDatas, deleListDatas, conditionDatas: { taskViewAttr }, selectedRowKey, stageInfo } = addPrjTempletStore; + const stageDisabled = !(stageInfo.selectedRowKeys.length > 0) + const isDisabled = !(selectedRowKey.length > 0 && `${toJS(selectedRowKey)}`); + let btn = []; + if (taskViewAttr == 2) { + if (selectedKey == "prjinfo") { + btn.push({ + key: '1', + icon: , + 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: , + content: getLabel(611, "添加"), + onClick: (key) => { + addNewListDatas(); + } + }); + btn.push({ + key: '2', + icon: , + content: getLabel(91, "删除"), + disabled: isDisabled, + onClick: (key) => { + deleListDatas(); + } + }); + btn.push({ + key: '3', + icon: , + content: getLabel(86, "保存"), + onClick: (key) => { + const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck(); + saveAddProject({ isreflesh: isreflesh, checkProps: checkProps }); + } + }); + } + + if (selectedKey == "stagelist") { + btn.push({ + key: '1', + icon: , + content: getLabel(611, "添加"), + onClick: (key) => { + this.StageList.tableEdit.refs.edit.doAdd() + } + }); + btn.push({ + key: '2', + icon: , + content: getLabel(91, "删除"), + disabled: stageDisabled, + onClick: (key) => { + this.StageList.tableEdit.refs.edit.doDelete() + } + }); + btn.push({ + key: '3', + icon: , + content: getLabel(86, "保存"), + onClick: (key) => { + const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck(); + saveAddProject({ isreflesh: isreflesh, checkProps: checkProps }); + } + }); + } + } + return btn + } + + changeTab(key) { + const { addPrjTempletStore } = this.props.contentStore; + addPrjTempletStore.changeTab(key) + } + + getStageOptions = () => { + const { addPrjTempletStore: { stageInfo: { stageColumns, stageColumnDatas, selectedRowKeys, selectedDatas } } } = this.props.contentStore; + let options = []; + 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 AddPrjTempletDialog; \ No newline at end of file diff --git a/pc4backstage/prj/components/dialog/editPrjTaskDataDialog.js b/pc4backstage/prj/components/dialog/editPrjTaskDataDialog.js new file mode 100644 index 0000000..6cfba5d --- /dev/null +++ b/pc4backstage/prj/components/dialog/editPrjTaskDataDialog.js @@ -0,0 +1,48 @@ + +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 {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 ( +
+ {contentStore.showEditTaskModal(false)}} + style={{width:'1000px', height:'600px'}} + > + +