初始化

This commit is contained in:
Chengliang 2023-03-09 15:01:55 +08:00
parent 5acff56c29
commit 9ea044dc94
109 changed files with 16468 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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 (
<div>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@5yp2cd`}
title={"title"}
loading={false}
icon={"icon-coms-crm"}
iconBgcolor={"red"}
buttons={[]}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={[]}
>
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@x4ei9a`} defaultShowLeft={true}
leftCom={<div>fffff</div>}
leftWidth={25}>
{/* { contentDiv } */}
</WeaLeftRightLayout>
</WeaTop>
</div>
)
}
}
export default Demo;
{/* <Tabs>
<Tabs.TabPane key="1" tab="项目信息">
</Tabs.TabPane>
<Tabs.TabPane key="2" tab="日报">
<StateLessComponent text={this.state.time} onClick={() => { this.setState({ time: this.state.time + 2 }) }} />
</Tabs.TabPane>
<Tabs.TabPane key="3" tab="资源">
</Tabs.TabPane>
<Tabs.TabPane key="4" tab="看板">
</Tabs.TabPane>
<Tabs.TabPane key="5" tab="甘特图">
</Tabs.TabPane>
</Tabs> */}

View File

@ -0,0 +1,16 @@
import { WeaPopoverHrm ,WeaLocaleProvider} from 'ecCom';
class Home extends React.Component {
render() {
return (
<div style={{height:"100%"}}>
<WeaPopoverHrm ecId={`${this && this.props && this.props.ecId || ''}_WeaPopoverHrm@temh5q`} />
<WeaLocaleProvider ecId={`${this && this.props && this.props.ecId || ''}_WeaLocaleProvider@suvq4r`}>
{this.props.children}
</WeaLocaleProvider>
</div>
)
}
}
export default Home

View File

@ -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(
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@suazx2`}>
<div style={{color : '#000'}}>
{getLabel(2012,"对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@urw511`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@7inot1`}
title={getLabel(31811,"应用设置")}
loading={true}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
>
{this.getBasicInfo()}
</WeaTop>
</WeaRightMenu>
)
}
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 = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@xh99gx@${field.domkey[0]}`} fieldConfig={field} form={form} formParams={formParams}/>;
if(field.domkey[0] == "prj_gnt_warningday"){
dom = <InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@ioh1iq@${field.domkey[0]}`} min={0} precision={0} defaultValue={formParams[field.domkey[0]]} onChange={(v)=>{setFormFields({[field.domkey[0]]:{value:v}})}}/>
}else if(field.domkey[0] == "tsk_approval_type"){
if(formParams["tsk_approval"]!="1"){
hide = true;
}
dom = [
<RadioGroup ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@acc4if@${field.domkey[0]}`} style={{marginTop:5} }value={formParams[field.domkey[0]]} onChange={e => setFormFields({[field.domkey[0]]:{value:e.target.value}})}>
<Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@xalake@${field.domkey[0]}`} value={"1"}>{getLabel(84826,"项目经理审批")}</Radio>
<Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@9ruvn6@${field.domkey[0]}`} value={"2"}>{getLabel(84827,"上级任务负责人审批")}</Radio>
</RadioGroup>,
<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@dlhkay@${field.domkey[0]}`} placement="bottom" title={prjAppSetStore.approval_title}/>]
}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 = [
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@64auel@${field.domkey[0]}`} fieldConfig={field} form={form} formParams={formParams}/>,
<span className={"prj-setting-tip"}><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@xemibz@${field.domkey[0]}`} title={getLabel('521653','开启后,项目卡片中附件字段在系统有文档的入口的地方都可以查看。如果关闭,需要在项目模块中有附件权限,需要在项目后端高级设置中开启关联授权。')}/></span>
]
if(field.domkey[0]=="prj_acc_isright"&&formParams["prj_acc"]!="1"){
hide = true;
}
}else if(field.domkey[0] == "tsk_acc_isright"){
dom = [
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@mtbtqd@${field.domkey[0]}`} fieldConfig={field} form={form} formParams={formParams}/>,
<span className={"prj-setting-tip"}><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@4kahma@${field.domkey[0]}`} title={getLabel('521654','开启后,任务卡片中附件字段在系统有文档的入口的地方都可以查看。如果关闭,需要在项目模块中有附件权限,需要在项目后端高级设置中开启关联授权。')}/></span>
]
if(field.domkey[0]=="tsk_acc_isright"&&formParams["tsk_acc"]!="1"){
hide = true;
}
}else if(field.domkey[0] == "tsk_timefield"){
dom = [
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@mgs8g3@${field.domkey[0]}`} fieldConfig={field} form={form} formParams={formParams}/>,
<span className={"prj-setting-tip"}><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@frixj4@${field.domkey[0]}`} title={getLabel('510270','开启后,任务卡片中系统日期字段会显示时间')}/></span>
]
}else if(field.domkey[0] == "workflow_filter"){
dom = [
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@30ku28@${field.domkey[0]}`} fieldConfig={field} form={form} formParams={formParams}/>,
<span className={"prj-setting-tip"}><WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@014n6a@${field.domkey[0]}`} title={getLabel('510269','开启后,赋予流程下一节点操作人项目查看权限')}/></span>
]
}
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@zzqttb@${field.domkey[0]}`}
error={form.getError(field)}
tipPosition="bottom"
label={`${field.label}`}
labelCol={{ span: 5 }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{dom}
</WeaFormItem>),
col: 1,
hide:hide
});
//项目任务菜单控制
if(field.domkey[0] == "prj_feedback"){
let pmenus = prjAppSetStore.pmenu||[];
let pdom = [];
pmenus && toJS(pmenus).map(m =>{
pdom.push(<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@08q2ya@${field.domkey[0]}`} viewAttr={2} id={m.id} value={vmenu[m.id]} content={m.content} onChange={(v)=>{setMenuValue({[m.id]:v})}} />)
});
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@6obcfu@${field.domkey[0]}`}
label={getLabel('520443','项目菜单操作')}
labelCol={{ span: 5 }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{pdom}
</WeaFormItem>),
col: 1,
hide:hide
});
let tmenus = prjAppSetStore.tmenu||[];
let tdom = [];
tmenus && toJS(tmenus).map(m =>{
tdom.push(<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@wmol0v@${field.domkey[0]}`} viewAttr={2} id={m.id} value={vmenu[m.id]} content={m.content} onChange={(v)=>{setMenuValue({[m.id]:v})}}/>)
});
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@pzlrln@${field.domkey[0]}`}
label={getLabel('520444','任务菜单操作')}
labelCol={{ span: 5 }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{tdom}
</WeaFormItem>),
col: 1,
hide:hide
});
let ptmenus = prjAppSetStore.ptmenu||[];
let ptdom = [];
ptmenus && toJS(ptmenus).map(m =>{
ptdom.push(<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@khiwlx@${field.domkey[0]}`} viewAttr={2} id={m.id} value={vmenu[m.id]} content={m.content} onChange={(v)=>{setMenuValue({[m.id]:v})}}/>)
});
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@x9babe@${field.domkey[0]}`}
label={getLabel('521688','项目任务列表操作')}
labelCol={{ span: 5 }}
wrapperCol={{ span: `${field.fieldcol}` }}>
{ptdom}
</WeaFormItem>),
col: 1,
hide:hide
});
}
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@wm8xx9@${i}`} needTigger={true} title={c.title} showGroup={true} items={items} />)
});
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(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ah1xph@${m.type}`} type="primary"
onClick={()=>{
if(m.type == "BTN_SAVE"){ ////类型编辑
prjAppSetStore.doPrjAppSet({method:'add'});
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
getRightMenu(){
const {prjAppSetStore }= this.props;
const {rightMenu,tableStore} = prjAppSetStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
btnArr.push({
icon: <i className={m.menuIcon} />,
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 => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@f726gg`} msg={ props.error ? props.error : getLabel(383324,"对不起,该页面异常,请联系管理员")} />,
{error: ""}
)(AppSet);

View File

@ -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 (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@h5maya`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@cgqwmd`}
title={title||getLabel(586,"项目类型")}
loading={loading}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getTopButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
onDropMenuClick={this.onRightMenuClick.bind(this)}
>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@zr5hw5`}
buttonsAd={getAdButtons(baseManagerStore,this.props.ecId || '')}
searchType={['base','advanced']}
searchsBaseValue={formParams.name}
setShowSearchAd={bool=>{baseManagerStore.setShowSearchAd(bool)}}
hideSearchAd={()=> baseManagerStore.setShowSearchAd(false)}
searchsAd={
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@71zc52`} listStore={baseManagerStore} form={form} onEnterSearch={this.onEnterSearch} ></Condition></div>
}
showSearchAd={showSearchAd}
onSearch={v=>{baseManagerStore.doSearch()}}
onSearchChange={v=>{baseManagerStore.setFormFields({name:{value:v}})}}
advanceHeight={100}
/>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@hwbh2z`}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true}
getColumns={c=>this.reRenderColumns(c)}
register_table={()=>reLoad()}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
</WeaTop>
<PrjTypeDialog ecId={`${this && this.props && this.props.ecId || ''}_PrjTypeDialog@6vrq01`} prjtypeStore={prjtypeStore} />
<WorkTypeDialog ecId={`${this && this.props && this.props.ecId || ''}_WorkTypeDialog@l320wn`} worktypeStore={worktypeStore} />
</WeaRightMenu>
)
}
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(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@drw6up@${m.type}`} type="primary"
disabled={isDisabled && m.isControl == "1"}
onClick={()=>{
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)}`);
}
}}>
{m.menuName}
</Button>
);
});
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 <span dangerouslySetInnerHTML={{__html: valueSpan}} style={{cursor:"pointer"}} onClick={()=>{
prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:record['randomFieldId']})
}} ></span>
}
} else {
c.render = function(text, record){
let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
}
}
})
return columns;
}
getRightMenu(){
const {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: <i className={m.menuIcon} />,
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 => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@76g0jn`} msg={ props.error ? props.error : getLabel(383324,"对不起,该页面异常,请联系管理员")} />,
{error: ""}
)(BaseManagerList);

View File

@ -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 <div style={{whiteSpace:'nowrap'}}>
{/* <Switch
checked={form.$(fields.domkey[0]).values() == "1"}
onChange={checked => form.$(fields.domkey[0]).value = checked ? '1' : '0'}
/> */}
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@du0c9r`}
value={form.$(fields.domkey[0]).values()}
display="switch"
style={{display: 'inline'}}
onChange={checked => form.$(fields.domkey[0]).value = checked}
/>
&nbsp;&nbsp;&nbsp;<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@hbb5sy`}
options={[
{key: '0', selected: false, showname: '2-'+getLabel(15933,"年份")},
{key: '1', selected: false, showname: '4-'+getLabel(15933,"年份")},
]}
value={prjDatas.yearViewNum}
style={{width: '100px'}}
onChange={value => changeCodeType({yearViewNum:value})}
/></div>
}else{
// return <Switch
// checked={form.$(fields.domkey[0]).values() == "1"}
// onChange={checked => form.$(fields.domkey[0]).value = checked ? '1' : '0'}
// />
return <WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@0njtno`}
value={form.$(fields.domkey[0]).values()}
display="switch"
style={{display: 'inline'}}
onChange={checked => form.$(fields.domkey[0]).value = checked}
/>
}
}else if(fields.conditionType == "INPUTNUMBER"){
return <InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@8a9xgp@${index}`} min={0} max={9} precision={0} defaultValue={form.$(fields.domkey[0]).values()} onChange={v => form.$(fields.domkey[0]).value = v }/>
}else{
return <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@q2z00q@${index}`} defaultValue={form.$(fields.domkey[0]).values()} onChange={v => form.$(fields.domkey[0]).value = v }/>
}
}
return (<div className={"prj-move-index"}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@7ibivm@${index}`}
className={"prj-formitem-move"}
label={<span><span data-index={fields.id } className="icon-coms-move prj-cursor-pointer" />{`${fields.label}`}</span>}
labelCol={{ span: `${fields.labelcol}` }}
wrapperCol={{ span: `${fields.fieldcol}` }}>
{getDom()}
</WeaFormItem></div>)
})
})
@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(
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@toehom`}>
<div style={{color : '#000'}}>
{getLabel(2012,"对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
const {codeType,prjtypeflow,worktypeflow,modifyStartCode,startCode,buydate,buydateselect} = prjDatas;
const style = {
height:"50px",lineHeight:"50px"
}
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@capv89`} datas={this.getRightMenu()} >
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@196ace`}
title={getLabel(17852,"项目编码")}
loading={true}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@r05801`} title={getLabel(83545,"编码方式")} fontSize={14} needTigger={true} showGroup={true}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@vtmuz1`} label={getLabel(83545,"编码方式")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@5a2dmb`}
options={[
{key: '1', selected: false, showname: getLabel(83546,"自动编码")},
{key: '2', selected: false, showname: getLabel(383882,"手动编码")},
{key: '0', selected: false, showname: getLabel(83552,"不使用编码")}
]}
value={codeType}
style={{width: '100px'}}
onChange={value => this.onChange({codeType:value})}
/>
</WeaFormItem>
</WeaSearchGroup>
<div style = {{display:`${codeType == "1" ? "block":"none"}`}}>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@hc1xjv`} title={getLabel(83549,"编号组成")} fontSize={14} needTigger={true} showGroup={true}>
<WeaPrjDragula ecId={`${this && this.props && this.props.ecId || ''}_WeaPrjDragula@g103ev`}
container=".container"
canDrag={(clickDom) => jQuery(clickDom).hasClass("icon-coms-move")}
datas={toJS(condition)}
getKeyFromData={this.getRowKey}
getKeyFromDom={this.getKeyFromDom}
onDrop={this.onDrop}
>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@6sv7hd`} spinning={formloading}>
<div className='container'>
<TempForm ecId={`${this && this.props && this.props.ecId || ''}_TempForm@2nc737`} prjCodeStore={prjCodeStore} key={prjCodeStore.condition.map(f=>f.domkey.join('')).join('_')}/>
</div>
</Spin>
</WeaPrjDragula>
</WeaSearchGroup>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@hzti2q`} title={getLabel(83550,"流水规则")} fontSize={14} needTigger={true} showGroup={true}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@oejk52`} label={getLabel(586,"项目类型")+getLabel(82782,"单独流水")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
{/* <Switch
checked={prjtypeflow == "1"}
onChange={checked => this.onChange({prjtypeflow: checked ? '1' : '0'})}
/> */}
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@jgz4wx`}
value={prjtypeflow}
display="switch"
style={{display: 'inline'}}
onChange={checked => this.onChange({prjtypeflow: checked })}
/>
</WeaFormItem>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4xh86b`} label={getLabel(432,"工作类型")+getLabel(82782,"单独流水")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
{/* <Switch
checked={worktypeflow == "1"}
onChange={checked => this.onChange({worktypeflow: checked ? '1' : '0'})}
/> */}
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@7brhfi`}
value={worktypeflow}
display="switch"
style={{display: 'inline'}}
onChange={checked => this.onChange({worktypeflow: checked })}
/>
</WeaFormItem>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@8hl93w`} label={getLabel(19418,"日期单独流水")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
{/* <Switch
checked={buydate == "1"}
onChange={checked => this.onChange({buydate: checked ? '1' : '0'})}
/> */}
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@l21urr`}
value={buydate}
display="switch"
style={{display: 'inline'}}
onChange={checked => this.onChange({buydate: checked })}
/>
&nbsp;&nbsp;&nbsp;
<RadioGroup ecId={`${this && this.props && this.props.ecId || ''}_RadioGroup@97ggbe`} value={buydateselect} onChange={e => this.onChange({buydateselect: e.target.value})}>
<Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@pse8nh`} value={"1"}>{getLabel(445,"年")}</Radio>
<Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@xeg1qo`} value={"2"}>{getLabel(6076,"月")}</Radio>
<Radio ecId={`${this && this.props && this.props.ecId || ''}_Radio@kecbj3`} value={"3"}>{getLabel(390,"日")}</Radio>
</RadioGroup>
</WeaFormItem>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@dwbd9u`} label={getLabel(103,"修改")+getLabel(20578,"起始编号")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
{/* <Switch
checked={modifyStartCode == "1"}
onChange={checked => this.onChange({modifyStartCode: checked ? '1' : '0'})}
/> */}
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@eh0ili`}
value={modifyStartCode}
display="switch"
style={{display: 'inline'}}
onChange={checked => this.onChange({modifyStartCode: checked })}
/>
</WeaFormItem>
{
modifyStartCode == "1" &&
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@1w5y1p`} label={getLabel(20578,"起始编号")} labelCol={{span: 6}} wrapperCol={{span: 16}}>
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@e5avb3`} min={0} defaultValue={startCode} precision={0} onChange={(value)=>this.onChange({startCode:value})} />
</WeaFormItem>
}
</WeaSearchGroup>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@qpm39x`} title={getLabel(221,"预览")} fontSize={14} needTigger={true} showGroup={true}>
<div style={{marginLeft:30}}>
<table className="prj-code-table-container" cellspacing="0" cellpadding="0">
<tr>{this.showCodeView()}</tr>
</table>
</div>
</WeaSearchGroup>
</div>
</WeaTop>
</WeaRightMenu>
)
}
getRightMenu(){
let btns = [];
const {doSubmit} = this.props.prjCodeStore;
btns.push({
icon: <i className='icon-coms-Approval '/>,
content: getLabel(86,"保存"),
key:"1",
onClick:(key)=>{doSubmit()}
});
return btns
}
getButtons(){
const {doSubmit} = this.props.prjCodeStore;
let btnArr = [];
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5yedqh@save`} type="primary"
onClick={()=>{doSubmit()}}>{getLabel(86,"保存")}</Button>);
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 = <tbody>
<tr><td><font color={colors[index%5]}>{item.label}</font></td></tr>
<tr style={{height:"1px"}}><td style={{borderTop:"1px solid #000"}}></td></tr>
<tr><td><font color={colors[index%5]}>{numstr}</font></td></tr>
</tbody>
}
}else if(item.conditionType.toUpperCase() == "INPUTNUMBER"){
dom = <tbody>
<tr><td><font color={colors[index%5]}>{item.label}</font></td></tr>
<tr style={{height:"1px"}}><td style={{borderTop:"1px solid #000"}}></td></tr>
<tr><td><font color={colors[index%5]}>{this.createFlowNum(form.$(item.domkey[0]).values())}</font></td></tr>
</tbody>
}else{
dom = <tbody>
<tr><td><font color={colors[index%5]}>{item.label}</font></td></tr>
<tr style={{height:"1px"}}><td style={{borderTop:"1px solid #000"}}></td></tr>
<tr><td><font color={colors[index%5]}>{form.$(item.domkey[0]).values()}</font></td></tr>
</tbody>
}
group.push(<td><table className="prj-code-table" cellspacing="0" cellpadding="0"> {dom} </table></td>)
})
return group
}
createFlowNum=(num)=>{
let str = "";
if(Number(num) <= 0){
str ="***"
}else if(Number(num) == 1){
str = 1
}else{
for(let i=0;i<Number(num)-1;i++){
str += 0;
}
str +="1"
}
return str
}
}
export default WeaTools.tryCatch(React,
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@16mmmz`} msg={ props.error ? props.error : getLabel(383324,"对不起,该页面异常,请联系管理员")} />,
{error: ""}
)(PrjCode);

View File

@ -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 (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@kfinuu`} >
<div style={{color : '#000'}}>
{getLabel(2012,"对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
if (hasRight) {
return (
<div style={{height:"100%"}}>
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@zhf58z`} fieldInfo={fieldInfo} form={form} setFormFields={(v)=>{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
</div>)
}
return <div></div>
}
}

View File

@ -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 (
<div className="prj-exchange">
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@jxcjae`}
leftComponent= {getLabel(83873,"所需文档")}
rightComponent={this.getButtons()}
>
<PrjTableEdit ecId={`${this && this.props && this.props.ecId || ''}_PrjTableEdit@zkbtsb`}
columns={columns}
datas={toJS(relateList.needList)}
canRef={canRef}
onChange={this.onChange}
onRowSelect={null}
pagination={false}
viewAttr={1}
tableProps={{rowSelection:null}}
getRowSelection={this.getRowSelection}
operate ={this.handleOperate}
/>
</PrjShowGroup>
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@tx9g6i`}
leftComponent= {getLabel(857,"相关文档")}
rightComponent={this.getRelateButtons()}
btnspace={10}
>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@3x0mdn`}
comsWeaTableStore={taskDocStore}
hasOrder={true}
needScroll={true}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
</PrjShowGroup>
</div>)
}
getButtons(){
const {contentStore} = this.props;
const {relateList:{canRef}} = contentStore;
let btn = [];
if(canRef){
btn.push(
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@pz5iar`} type={"doccategory"} title={getLabel(16398,"文档目录")} hasAdvanceSerach={true} isSingle={true} onChange ={(ids, names, datas)=>this.addDocType(ids, names, datas)} customized={true} >
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vnkxwz@add`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@r2kju8`} type="plus" /></Button>
</WeaBrowser>
);
}
return btn;
}
getRelateButtons(){
const {contentStore} = this.props;
const {taskDocStore,relateList:{canRelated}} = contentStore;
const {selectedRowKeys} = taskDocStore;
let btn = [];
if(canRelated){
btn.push(<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@3z2eoj`} type={"9"} title={getLabel(58,"文档")} hasAdvanceSerach={true} isSingle={true} onChange ={(ids, names, datas)=>this.addDocument(ids, names, datas)} customized={true} >
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bepyr9@add`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@86qjto`} type="plus" /></Button>
</WeaBrowser>);
btn.push( <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@go0gk7@del`} type="primary" className="prj-btn-small" title={getLabel(91,"删除")} disabled={!(selectedRowKeys.length>0)} size="small" onClick={this.deleteDocument}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@ekwq2c`} type="minus" /></Button>);
}
return btn;
}
//编辑
onChange=(data)=>{
const {contentStore} = this.props;
const {doDspTaskRequiredOpt,taskid,} = contentStore;
doDspTaskRequiredOpt({
method:'modifyRequiredDocN',
taskid : taskid,
secID : data.reqDocSecCategory,
isNecessary:data.isNecessary
},'doc');
}
//新增所需文档
addDocType=(ids, names, datas)=>{
const {contentStore} = this.props;
const {doDspTaskRequiredOpt,taskid,} = contentStore;
doDspTaskRequiredOpt({
method:'addRequiredDoc',
taskid : taskid,
secID : ids
},'doc');
}
//删除
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() { },
})
}
}
}
}

View File

@ -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 (
<div className="prj-exchange">
<PrjShowGroup ecId={`${this && this.props && this.props.ecId || ''}_PrjShowGroup@2wning`}
leftComponent= {getLabel(83870,"所需流程")}
rightComponent={this.getButtons()}
>
<PrjTableEdit ecId={`${this && this.props && this.props.ecId || ''}_PrjTableEdit@r0o5ur`}
columns={columns}
datas={toJS(relateList.needList)}
canRef={canRef}
onChange={this.onChange}
onRowSelect={null}
pagination={false}
viewAttr={1}
tableProps={{rowSelection:null}}
getRowSelection={this.getRowSelection}
operate ={this.handleOperate}
/>
</PrjShowGroup>
</div>)
}
getButtons(){
const {contentStore} = this.props;
const {relateList:{canRef}} = contentStore;
let btn = [];
if(canRef){
btn.push(
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@o353xe`} type={"-99991"} title={getLabel(18499,"路径")} hasAdvanceSerach={true} isSingle={false} onChange ={(ids, names, datas)=>this.addWorkFlowType(ids, names, datas)} customized={true} >
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@cw5dcl@add`} type="primary" className="prj-btn-small" title={getLabel(611,"添加")} size="small" onClick={()=>{}}><Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@fh89d0`} type="plus" /></Button>
</WeaBrowser>
);
}
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() { },
})
}
}

View File

@ -0,0 +1,47 @@
import { observer } from "mobx-react";
import React from 'react';
import { WeaTableEdit } from 'ecCom';
import { toJS } from 'mobx';
@observer
export default class StageList extends React.Component {
constructor(props) {
super(props);
}
render() {
const { contentStore } = this.props;
const { stageInfo : { stageColumns, stageColumnDatas, selectedDatas, selectedRowKeys,canedit }, onRowSelect, onChange } = contentStore;
return (
<div >
{stageColumns && stageColumns.length>0 &&<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@uzfmcn`}
draggable={canedit}
showTitle={false}
columns={toJS(stageColumns)}
datas={stageColumnDatas}
onChange={onChange}
onRowSelect={onRowSelect}
selectedData={selectedDatas}
selectedRowKeys={selectedRowKeys}
getRowSelection={this.getRowSelection}
copyFilterProps={["id"]}
rowKey={"id"}
ref={el => {this.tableEdit = el}}
/>}
</div>)
}
getRowSelection = (rowSelection) => {
const { contentStore } = this.props;
const { stageInfo : { canedit }} = contentStore;
let sel = { ...rowSelection };
sel.getCheckboxProps = (record) => {
return { disabled: record.candel == false };
}
return canedit ? sel:null;
}
}

View File

@ -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 = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ofliam@${fields.domkey[0]}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@zd5htz@${fields.domkey[0]}`} span={24} style={stylecss}>
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@4paiwa@${fields.domkey[0]}`}
{...fields}
endValue={formParams.enddate ? new Date(formParams.enddate) : null}
value={[formParams.begindate]}
onChange={(v) => { setFormFields({ begindate: { value: v[0] } }); this.workdayComputed(v, "begin") }} />
</Col>
</Row>
} else if (fields.domkey[0] == "enddate") {
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@hdd0zn@${fields.domkey[0]}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@fumu3t@${fields.domkey[0]}`} span={24} style={stylecss}>
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@irc42f@${fields.domkey[0]}`}
{...fields}
value={[formParams.enddate, formParams.endtime]}
startValue={formParams.begindate ? new Date(formParams.begindate) : null}
onChange={(v) => {
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")
}
}
}} />
</Col>
</Row>
} else if (fields.domkey[0] == "actualbegindate") {
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ndmkwy@${fields.domkey[0]}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@7o5n22@${fields.domkey[0]}`} span={24} style={stylecss}>
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@l5h6vk@${fields.domkey[0]}`}
endValue={formParams.actualenddate ? new Date(formParams.actualenddate) : null}
{...fields}
value={[formParams.actualbegindate, formParams.actualbegintime]}
onChange={(v) => { setFormFields({ actualbegindate__actualbegintime: { value: v } }); this.onActualComputed(v, "begin") }} />
</Col>
</Row>
} else if (fields.domkey[0] == "actualenddate") {
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@q8fl2n@${fields.domkey[0]}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@aj2uce@${fields.domkey[0]}`} span={24} style={stylecss}>
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@hqiyrk`} startValue={formParams.actualbegindate ? new Date(formParams.actualbegindate) : null} {...fields}
value={[formParams.actualenddate, formParams.actualendtime]}
onChange={(v) => { setFormFields({ actualenddate__actualendtime: { value: v } }); this.onActualComputed(v, "end") }} />
</Col>
</Row>
} else if (fields.domkey[0] == "finish") {
if (fields.viewAttr == "1") {
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@yhjdua`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@qkj2y3`} span={12} style={stylecss}>
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@sjk17c`} percent={fields.value || 0} strokeColor={fields.strokeColor} status="active" />
</Col>
</Row>
} else {
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@xdjf8w`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2rvsky`} span={24} style={stylecss}>
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@sx0q62`} min={0} value={formParams.finish}
onChange={(v) => { this.checkProgress(v); }} />
<span style={{ marginLeft: 5 }}>%</span>
</Col>
</Row>
}
} else if (fields.conditionType == "RICHTEXT") { //多行文本
if(fields.viewAttr == "1"){
dom = WeaTools.EncryBase.desensitization(fields.value)? <WeaInputEncrypt ecId={`${this && this.props && this.props.ecId || ''}_WeaInputEncrypt@c2sqas`} value={fields.value} type={'TEXTAREA'} />:
<div className='view_basicToolBar'><WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@41o4y6`} fieldConfig={{...fields,ckConfig:view_basicToolBar}} form={form}/></div>
}else{
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@wqs6hk`} fieldConfig={{...fields,ckConfig:basicToolBar}} form={form}/>
}
} else if (fields.domkey[0] == "accessory") {
let domkey = fields.domkey[0];
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@dh3ut6`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@gkxejp`} span={24} style={stylecss}>
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@1w65ni`}
uploadId={[domkey]}
uploadUrl={(window.ecologyContentPath || '')+"/api/proj/prjutil/fileUpload?accsec=" + fields.accsec}
category={fields.accsec}
autoUpload={true}
showBatchLoad={false}
showClearAll={false}
multiSelection={true}
datas={fields.datas}
maxUploadSize={fields.accsize}
onChange={v => { setFormFields({ [domkey]: { value: v } }) }}
viewAttr={fields.viewAttr}
// onUploading={(state)=>{}}
/>
</Col>
</Row>
} else {
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@fmnsxf`} fieldConfig={fields} form={form} />;
}
if (hasunderline) {
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@dpe57c@${fields.domkey[0]}`}
label={`${fields.label}`}
labelCol={{ span: `${fields.labelcol}` }}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{ span: `${fields.fieldcol}` }} underline>
{dom}
</WeaFormItem>),
colSpan: 1,
hide: hide
});
} else {
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@uri1md@${fields.domkey[0]}`}
label={`${fields.label}`}
labelCol={{ span: `${fields.labelcol}` }}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{ span: `${fields.fieldcol}` }} >
{dom}
</WeaFormItem>),
colSpan: 1,
hide: hide
});
}
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@yi9hcs@${i}`} needTigger={true} title={c.title} col={1} showGroup={c.defaultshow} items={items} />)
});
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 } });
}
}
}
}

View File

@ -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 (
<div >
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@zqwhy1`}
comsWeaTableStore={taskListTableStore}
childrenColumnName="subListspan"
hasOrder={true}
needScroll={true}
register_table={()=>reLoad()}
getColumns={c=>this.reRenderColumns(c)}
onOperatesClick={this.onOperatesClick.bind(this)}
rowSelection={rowSelection}
/>
{<TaskInfoDialog ecId={`${this && this.props && this.props.ecId || ''}_TaskInfoDialog@qwqsi2`} contentStore={taskInfoStore} prjid={prjid} callBack={()=>{refTaskList()}} />}
{/* <EditPrjTaskDataDialog ref="editPrjTaskData" contentStore = {contentStore} visible={showEditTask} /> */}
</div>)
}
reRenderColumns(columns){
columns.forEach((c,i)=>{
if(c.dataIndex=='finish'){
c.render = function(text, record){
return <span className='wea-prj-progressStyle' >
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@ttgehc@${i}`} percent={record.finish||0} strokeColor={record.finishspan} />
</span>
}
// } else {
// c.render = function(text, record){
// let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
// return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
// }
}
})
return columns;
}
onOperatesClick(record,index,operate,flag){
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});
}
}
}
}

View File

@ -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 (
<div>
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@iradcc`}
ref = { ref =>{ 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}
/>
</div>
)
}
getRowSelection = (rowSelection) => {
const {fieldInfo,onChangeAction,settype} = this.props;
if(settype=="1"){
return null;
}else{
const sel = { ...rowSelection };
return sel;
}
}
}

View File

@ -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:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@2y1xzu@${index}`}
colon={false}
label={fields.label+" :"}
labelCol={{span: `${7}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${14}`}} >
<div style={{whiteSpace:"nowrap",}}>
<div style={{width:250,display:"inline-block",paddingRight:"10px"}}><WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@lju39i@${index}`} fieldConfig={fields} form={form} formParams={formParams} /></div>
<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@qc0oc4@${index}`} width = {100} title={fields.tipspan||getLabel('503284','项目模板浏览按钮') }/>
</div>
</WeaFormItem>),
colSpan:1,
});
});
if(settype=='1'||settype=='5'){
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@bjc0xv@${i}`} needTigger={true} title={c.title} col={1} showGroup={true} items={items}/>)
}
});
if(settype=='1'||settype=='5'){
return <div>
<div style={{
'margin-bottom':'1px',
'background': '#F9F9F9',
'border-bottom-width':'2px',
'border-bottom-style':'solid',
'border-bottom-color':'#B7E0FE'}}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@4ftg3r`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@h51hrn`} span={6} >
<div style={{ marginTop: 10 }}>
<div style={this.getCircle()}>{getLabel(15551,"项目字段")}</div>
</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@xetoio`} span={12} >
<div style={{ marginTop: 10 }}>
<div style={this.getCircle()}>{getLabel(21903,"字段设置")}</div>
</div>
</Col>
</Row>
</div>
{group}
</div>;
}else{
return <div>
<div style={{
'margin-bottom':'1px',
'background': '#F9F9F9',
'border-bottom-width':'2px',
'border-bottom-style':'solid',
'border-bottom-color':'#B7E0FE'}}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@bw3s1v`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@tzaqk9`} span={6} >
<div style={{ marginTop: 10 }}>
<div style={this.getCircle()}>{getLabel(15551,"项目字段")}</div>
</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@wel5yg`} span={12} >
<div style={{ marginTop: 10 }}>
<div style={this.getCircle()}>{getLabel(21903,"字段设置")}</div>
</div>
</Col>
</Row>
</div>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@npk9lq`} needTigger={false} showGroup={true}>
{items.map(d=>d.com)}
</WeaSearchGroup>
</div>;
}
}
}

View File

@ -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 (
<div >
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@3eptke`}
comsWeaTableStore={wfsetListStore}
hasOrder={true}
needScroll={true}
register_table={()=>reLoad(wfsetListStore)}
getColumns={c=>this.reRenderColumns(c)}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
</div>)
}
getAdButtons = () => {
const {contentStore} = this.props;
const {getWfSetList,wftype,setShowSearchAd,clearFormFields} = contentStore;
return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@4t5brx@search`} type="primary" onClick={()=>{getWfSetList({wftype:wftype});setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pbsmps@reset`} type="ghost" onClick={()=>{clearFormFields();}}>{getLabel(2022,"重置")}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ja2t6l@cancel`} type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
];
}
reRenderColumns(columns){
columns.forEach((c,i)=>{
if(c.dataIndex=='finish'){
c.render = function(text, record){
return <span className='wea-prj-progressStyle' >
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@6n6tcc@${i}`} percent={record.finish||0} strokeColor={record.finishspan} />
</span>
}
} else {
c.render = function(text, record){
let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
}
}
})
return columns;
}
onOperatesClick(record,index,operate,flag){
const {contentStore} = 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");
}
}
}
}

View File

@ -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(
<div className='prj-date-time'>
<span>
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@qdtwi5`} startValue={startValue} endValue={endValue} viewAttr={viewAttr} formatPattern={2} value={dateValue} {...otherParams} onChange={this.onChangeDate.bind(this)}/>
</span>
</div>
);
}
}
export default Main;

View File

@ -0,0 +1,69 @@
import { Icon} from 'antd';
import cloneDeep from 'lodash/cloneDeep'
import './index.less'
class LeftRightLayout extends React.Component {
constructor(props) {
super(props);
this.state = {
showLeft:props.defaultShowLeft || true,
isHover:false,
leftWidth:props.leftWidth || 250,
treeWidth:props.treeWidth || 250
// showRight:false
}
}
componentWillReceiveProps(nextProps){
if(this.props.showRight !== nextProps.showRight){
this.showright(nextProps.showRight);
}
}
leftShowCo(e){
const {showLeft,leftWidth,treeWidth} = this.state;
const { onLeftChange,leftCom} = this.props;
if(showLeft){
jQuery(".three-side-left").animate({width:0},300,"linear",onLeftChange && onLeftChange(false))
}else{
jQuery(".three-side-left").animate({width:leftCom? leftWidth:treeWidth},300,"linear",onLeftChange && onLeftChange(true))
}
this.setState({showLeft:!showLeft});
e.stopPropagation();
e.preventDefault();
e.nativeEvent.preventDefault();
}
render() {
const {showLeft,height,isHover,leftWidth,treeWidth} = this.state;
const {children,leftCom,rightCom,showRight} = this.props;
return (
<div className="wea-left-middle-right-layout" >
{
leftCom &&
<div className="three-side-left" style={{width:leftCom ? leftWidth :treeWidth}}>
<div style={{width:treeWidth,height:"100%"}} className="three-side-left-left" >
{leftCom}
</div>
</div>
}
<div className="three-side-right">
{
leftCom &&
<div className='wea-three-side-layout-show-left'
onClick={this.leftShowCo.bind(this)}
onMouseEnter={()=>this.setState({isHover:true})}
onMouseLeave={()=>this.setState({isHover:false})}
style={{background: `url('${window.ecologyContentPath || ''}/cloudstore/images/e9/leftTree-${showLeft ? "show" : "hide"}${isHover ? "-hover" : ""}.png') no-repeat -2px 0`}}
></div>
}
<div className="three-side-right-container">
<div style={{background:"#fff",height:"100%"}}>
{children}
</div>
</div>
</div>
</div>
)
}
}
export default LeftRightLayout;

View File

@ -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%;
}

View File

@ -0,0 +1,37 @@
import {Row, Col, Icon} from 'antd';
import './index.less'
class PrjShowGroup extends React.Component {
constructor(props) {
super(props);
this.state = {
showGroup: props.showGroup ? props.showGroup : true
}
}
render() {
const {title,leftComponent=[],rightComponent=[], children,btnspace} = this.props;
const {showGroup} = this.state;
return (
<div className={`${this.props.className || ''}`}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@7aqxu0`} className="prj-exchange-title">
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@uomxmy`} span="20" className="prj-exchange-title-left">
<div>{leftComponent}</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@41kkox`} span="4" className="prj-exchange-title-right" >
<span style={{marginRight:"10px"}}>{rightComponent}</span>
<i className={showGroup ? 'icon-coms-up' : 'icon-coms-down'} onClick={()=>this.setState({showGroup:!showGroup})}/>
</Col>
</Row>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@k8ihdn`} className="prj-exchange-content" style={{display:showGroup ? "block":"none"} }>
{
children
}
</Row>
</div>
)
}
}
export default PrjShowGroup

View File

@ -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;
}

View File

@ -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(
<div className="wea-table-edit" >
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@rfw33c`}
columns={this.getColumns()}
dataSource={datas}
pagination={this.getPagination()}
{...tableProps}
/>
</div>
)
}
getColumns(){
const { columns } = this.state;
let _columns = [].concat(columns);
_columns = _columns.map(col => {
let _col = { ...col };
_col.render || (_col.render = ( text, record, index ) => {
return this.getColRender( _col, text, record, index );
})
return _col
});
return _columns
}
getColRender( _col, text, record, index ){
const { com } = _col;
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(
<span >
{label && <span style={{marginLeft: 5}}>{label}</span>}
{ _type === 'INPUT' &&
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@zpbhfe@${i}`}
{...otherParams}
defaultValue={record[key]}
value={record[key]}
style={style}
viewAttr={ viewAttr }
onBlur={value => this.onEdit(record, index, key, value)} />
}
{ _type === 'TEXTAREA' &&
<WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@6yrykr@${i}`}
{...otherParams}
defaultValue={record[key]}
value={record[key]}
style={style}
viewAttr={ viewAttr }
onBlur={value => this.onEdit(record, index, key, value)} />
}
{ _type === 'DATEPICKER' &&
<WeaDatePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaDatePicker@spxwfr@${i}`}
{...otherParams}
showTime = {showTime}
format = {format}
defaultValue={record[key]}
value={record[key]}
style={style}
viewAttr={ viewAttr }
onChange={value => this.onEdit(record, index, key, value)} />
}
{ _type === 'TIMEPICKER' &&
<WeaTimePicker ecId={`${this && this.props && this.props.ecId || ''}_WeaTimePicker@jg23hh@${i}`}
{...otherParams}
defaultValue={record[key]}
value={record[key]}
style={style}
viewAttr={ viewAttr }
onChange={value => this.onEdit(record, index, key, value)} />
}
{ _type === 'SELECT' &&
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@i68ajd@${i}`}
{...otherParams}
defaultValue={record[key]}
value={record[key]}
options={options}
style={style}
viewAttr={ viewAttr }
onChange={value => this.onEdit(record, index, key, value)} />
}
{ _type === 'BROWSER' &&
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@wdaure@${i}`}
{...otherParams}
replaceDatas={this.getBrowerDatas(record, key)}
{...browserConditionParam}
inputStyle={style}
viewAttr={ viewAttr }
onChange={(ids, names, bDatas) => this.onEdit(record, index, key, ids, names, bDatas)} />
}
{ _type === 'CHECKBOX' &&
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@mrr274@${i}`}
{...otherParams}
style={style}
value={record[key]}
viewAttr={ viewAttr }
onChange={(value) => this.onEdit(record, index, key, value)}
/>
}
{
_type == "LINK_WF" &&
<span className="prj-link-a">
{record[key]}
</span>
}
{
_type == "LINK_DOC" &&
<span className="prj-link-a">
{record[key]}
</span>
}
{
_type == "OPERATE" &&
<Dropdown ecId={`${this && this.props && this.props.ecId || ''}_Dropdown@e4wtlz@${i}`} overlay={this.getMenu(record,options,record["ismanager"])} >
<a className="ant-dropdown-link" href="#">
{getLabel(104,"操作")} <Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@uixrvn@${i}`} type="caret-down" />
</a>
</Dropdown>
}
</span>
)
}
});
return (
<div>
{_com}
</div>
)
}
getBrowerDatas(record, key){
let replaceDatas = [];
if(record[key + 'span'] !== undefined) {
let keys = record[key].split(',');
let values = record[key + 'span'].split(',');
if(keys.length === values.length){
keys.map((k, i) => {
if (k != '' && values[i] != '') replaceDatas.push({id: k, name: values[i]});
});
}else{
}
}
return replaceDatas
}
getPagination() {
const { pageSize = 0, paginationSize = ''} = this.props;
if( !pageSize ) return false;
const { current } = this.state;
const locale = this.getLocale();
let obj = {
size: paginationSize,
current,
pageSize,
};
return obj
}
onEdit(record, index, key, value, names, bDatas){
const { pageSize = 0 } = this.props;
const { datas, current } = this.state;
let _datas = [].concat(datas);
_datas[pageSize * (current - 1) + index][key] = value;
if(names) _datas[pageSize * (current - 1) + index][key + 'span'] = names;
this.setState({datas: _datas});
this.onChange(_datas,index);
}
onChange(datas,index){
const { columns } = this.state;
let _datas = datas.map((data, i) => {
let _data = {...data}
delete _data.key
return _data
})
typeof this.props.onChange === 'function' && this.props.onChange(_datas[index], columns);
}
getMenu(record,options,bool){
let menu = [];
if(options && bool){
options.map(item=>{
menu.push(
<Menu.Item ecId={`${this && this.props && this.props.ecId || ''}_undefined@1ljqd6@${item.key}`}>
<a href="javascript:void(0)" key={item.key}>{item.showname}</a>
</Menu.Item>
)
})
return <Menu ecId={`${this && this.props && this.props.ecId || ''}_Menu@gjkf0a`} onClick={()=>this.onMenuClick(record,options)}>
{menu}
</Menu>
}
return menu
}
onMenuClick=(record,options)=>{
typeof this.props.operate == "function" && this.props.operate(record);
}
}
export default Main;

View File

@ -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;
}

View File

@ -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(
<div className="wea-prj-table-edit" >
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@h9ddbe`} className="wea-content" >
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@q1jbm6`} className="wea-form-cell" span={24}>
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@s8o3ef`}
columns={this.getColumns()}
dataSource={datas}
pagination={false}
rowSelection={this.getRowSelection()}
/>
</Col>
</Row>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@x5z3zr`}
style={{width: 700,height:450}}
visible={showModal}
title={getLabel(2233,"前置任务")}
icon="icon-coms-project"
iconBgcolor="#217346"
buttons={this.getButtons()}
onCancel={() => this.setState({showModal:false})}
>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@l0b6t5`} scrollId='wea-prj-table-edit-scroll' height={"100%"}>
<div className="wea-prj-table-edit">
<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@i486tk`}
columns={this.getModalColumns()}
dataSource={datas}
pagination={false}
onRowClick={this.onRowClick}
/>
</div>
</WeaNewScroll>
</WeaDialog>
</div>
)
}
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 <span>{text}</span>},
}, {
title: getLabel(1352,"任务名称"),
dataIndex: 'name',
width:"20%",
render: (text, record, index ) => <span>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@d6ftei`}
value={text}
viewAttr={taskViewAttr}
style={{display: 'inline-block'}}
onChange={value => this.onEdit(record, index,"name" , value)}
/>
</span>,
}, {
title: "阶段",
dataIndex: 'name',
width:"10%",
render: (text, record, index ) => <span>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@86qbdy`}
options={stageOptions}
value={record.stageid}
viewAttr={taskViewAttr}
onChange={value => this.onEdit(record, index,"stageid" , value)}
/>
</span>,
}, {
title: getLabel(1298,"工期"),
dataIndex: 'workday',
width:"5%",
render:(text, record, index)=><span>
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@uyplsw`} disabled={dis} value={text} min={0} max={999999} step={0.01} />
</span>
}, {
title: getLabel(742,"开始时间"),
dataIndex: 'begindate',
width:"15%",
render:(text, record, index)=><span>
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@mjhnz6`} {...{
"viewAttr": taskViewAttr,
"value":[text,record.begintime || "00:00"],
"otherParams":{
"noInput":true
}
}}
endValue ={ new Date(record["enddate"])}
onChange={(v)=>{this.timeComputed(v,"begin",index)}} />
</span>
}, {
title: getLabel(743,"结束时间"),
dataIndex: 'enddate',
width:"15%",
render:(text, record, index)=><span>
<PrjDateTime ecId={`${this && this.props && this.props.ecId || ''}_PrjDateTime@pu5iad`} {...{
"viewAttr": taskViewAttr,
"value": [text,record.endtime || "23:59"],
"otherParams":{
"noInput":true
}
}}
startValue ={ new Date(record["begindate"])}
onChange={(v)=>{this.timeComputed(v,"end",index)}} />
</span>
}, {
title: getLabel(2233,"前置任务"),
dataIndex: 'beftaskid',
width:"15%",
render:(text, record, index)=><span style={{whiteSpace:"nowrap"}}>
<span>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@tdsp9a`}
viewAttr={1}
hasBorder={true}
value={record.beftaskname}
/>
</span>
{!dis&&<Icon ecId={`${this && this.props && this.props.ecId || ''}_Icon@dvxw7z`} type="search" className="icon-selebeforetask" style={{marginBottom:8}} onClick={()=>this.setState({showModal:true,clickKey:record.key})}/>}
</span>
},
{
title: getLabel(2097,"负责人"),
dataIndex: 'hrmid',
width:"20%",
render:(text, record, index)=><span>
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@dd45an`}
viewAttr={taskViewAttr}
type={17}
isSingle={false}
onChange={(ids, names, bDatas) =>{this.onEdit( record, index,"hrmid",ids, names, bDatas)}}
replaceDatas={[{id: text, name: record.hrmname}]}
/>
</span>
}];
}
onEdit= (record, index,name , value,names,bDatas) =>{
let that = this;
const {clickKey,datas} = this.state;
let _datas = [].concat(datas);
if(name == "hrmid"){
_datas[index][name] = value ;
_datas[index]["hrmname"] = names ;
}else{
_datas[index][name] = value ;
}
this.setState({datas : _datas});
this.onChange(_datas);
}
getButtons(){
let btn = [];
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@lxgrlz@clear`} type="primary" onClick={()=>this.onClear()}>{getLabel(311,"清除")}</Button>);
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1g6xa2@close`} type="primary" onClick={()=>this.setState({showModal:false,clickKey:""})}>{getLabel(309,"关闭")}</Button>);
return btn;
}
getModalColumns(){
return [{
title: getLabel(15486,"序号"),
dataIndex: 'rowIndex',
width:"15%",
render: (text, record, index ) =><span style={{marginLeft:5}}>{text}</span>,
}, {
title: getLabel(1352,"任务名称"),
dataIndex: 'name',
width:"85%",
render: (text, record, index ) => <span>{text}</span>,
}]
}
onRowClick=(record, index)=>{
let that = this;
const {clickKey,datas} = this.state;
let _datas = [].concat(datas);
if(record.key == clickKey){
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(24468,"不能把本身设置为前置任务!"),
// onOk() {
// that.setState({showModal:false,clickKey:""})
// }
// })
message.error(getLabel(24468,"不能把本身设置为前置任务!"));
that.setState({showModal:false,clickKey:""});
}else{
_datas[clickKey-1].beftaskname = record.name;
_datas[clickKey-1].beftaskid = record.rowIndex;
that.setState({showModal:false,clickKey:"",datas :_datas})
this.onChange(_datas);
}
}
onClear=()=>{
let that = this;
const {clickKey,datas} = this.state;
let _datas = [].concat(datas);
_datas[clickKey-1].beftaskname = "";
_datas[clickKey-1].beftaskid = "";
that.setState({showModal:false,clickKey:"",datas :_datas})
this.onChange(_datas);
}
//计算工期
timeComputed= (arg,type,index) =>{
const {userid ,isworkday} = this.props;
const {datas} = this.state;
let _datas = [].concat(datas);
let res = "";
if(type == "begin"){
let time = "";
if(!arg[1]){time = "00:00" }else{time = arg[1]}
if( _datas[index]["enddate"] && arg[0] ){
res = datediff(arg[0],_datas[index]["enddate"],time,_datas[index]["endtime"] || "23:59",userid,isworkday);
}
_datas[index]["begindate"] = arg[0]
_datas[index]["begintime"] = time;
}else{
let time = "";
if(!arg[1]){time = "00:00"}else{time = arg[1]}
if(_datas[index]['begindate'] && arg[0] ){
res = datediff(_datas[index]['begindate'],arg[0],_datas[index]['begintime'] || "00:00",time,userid,isworkday);
}
_datas[index]["enddate"] = arg[0]
_datas[index]["endtime"] = time;
}
_datas[index].workday = res;
this.setState({datas:_datas})
this.onChange(_datas);
}
getRowSelection(){
let that = this;
const rowSelection = {
onChange(selectedRowKeys, selectedRows) {
//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;

View File

@ -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
}

View File

@ -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 (
<div
component="span"
className="prj-list-item"
onClick={this.onClick}
>
<div style={isCurrent ? { 'background-color': '#def0ff' } : {}}>
<div className={className}>
{/* <div className="name-state" style={{backgroundColor:data.color}}>{'已启用'}</div> */}
<div className="prj-list-item-content-top">
<div className="name-wrapper" title={data.name}>{data.name}</div>
<div className="subname-wrapper">
<span>{data.desc }</span>
</div>
</div>
</div>
</div>
</div>
)
}
}

View File

@ -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 (
<div className="prj-list-view">
<WeaInputSearch ecId={`${this && this.props && this.props.ecId || ''}_WeaInputSearch@t52dgg`}
value={prjValue}
style={{ margin: '5px 15px', width: 'calc(100% - 30px)' }}
placeholder={getLabel('83788',"请输入关键字搜索")}
onSearch={onSearchListItem}
onSearchChange={onSearchChange}
/>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@w2lzcf`}
height={scrollHeight - 90}
>
{datas.length === 0 ?
<p style={{ textAlign: 'center', color: '#999', marginTop: 10 }} >
<i className='icon-coms-Invalid' /> {getLabel('83553',"暂无数据")}
</p>
:
<div className="prj-list-view-content">
{
datas && datas.length > 0 && datas.map(d => (
<ListItem ecId={`${this && this.props && this.props.ecId || ''}_ListItem@7q4zsc`} currentKey={currentKey} data={d} onClick={onItemClick} />
))
}
</div>
}
</WeaNewScroll>
<div >
<Pagination ecId={`${this && this.props && this.props.ecId || ''}_Pagination@2mx1zt`}
{...pagination}
size="small"
/>
</div>
</div>
)
}
}

View File

@ -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;

View File

@ -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 && <span>
<span>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@pb0u5t`}
tipPosition='top'
ref={ref => {this.addError(fieldId,ref)}}
error={getLabel(385869,"此项必填")}>
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@8888vf`}
type='fieldCommonCheck'
viewAttr={canDel=='y'?'3':'1'}
value={value}
replaceDatas={replaceDatas?replaceDatas:[]}
hasAdvanceSerach={true}
title={getLabel(124930, '公共选择框')}
onChange={(datas) =>{this.onChange(fieldId,datas)}}
/>
</WeaError>
</span>
<span style={{marginLeft:variable ? "10px" : "0px",position:"absolute"}}><WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@dllnho`} key={new Date()} options={options} viewAttr={2} /></span>
</span>
);
}
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})
}
}
}
}

View File

@ -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 = <div style={{position:"absolute",width:"100%",top:"48%",textAlign:"center"}}><Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@9hq893`} spinning={loading}></Spin></div>;
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(
<div className="prj-table-edit-nonetop">
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@8ggcwc`} {...tProps} copyFilterProps={["id"]} onRowSelect={this.onRowSelect}/>
</div>
);
}else{
const {errorMsg} = responseData;
content = [(<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@52v8rj`} ><div style={{color:'#000'}}>{errorMsg}</div></WeaAlertPage>)];
}
}
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);
}
}
}

View File

@ -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 = <div style={{position:"absolute",width:"100%",top:"48%",textAlign:"center"}}><Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@c5wpkc`} spinning={loading}></Spin></div>;
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(
<div className="prj-table-edit-nonetop">
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@hs91zj`} {...tProps}/>
</div>
);
}else{
const {errorMsg} = responseData;
content = [(<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@k5jn2i`} ><div style={{color:'#000'}}>{errorMsg}</div></WeaAlertPage>)];
}
}
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;
}
}

View File

@ -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 = <div style={{position:"absolute",width:"100%",top:"48%",textAlign:"center"}}><Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@338dlc`} spinning={loading}></Spin></div>;
contentWrap = [loadingCom];
}else{
const {status} = responseData;
if(status == "1"){
const {columns,groups} = responseData;
content.push(<div className="prj-table-edit-nonecontent"><WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@xe5uq8`} columns={toJS(columns)} datas={[]} showAdd={false} showDelete={false} showCopy={false} getRowSelection={()=>{return undefined}}/></div>);
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:(<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@vuu6kq`} {...tProps}/>),
col:1,
});
content.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@a2tznj`} needTigger={true} title={group.title} showGroup={true} items={items}/>)
store.putData(group.id,toJS(group.columnsData));
});
contentWrap = [<div className="prj-table-edit-nonetop prj-search-group-nonepadding">{content}</div>];
}else{
//contentWrap = [<WeaAlertPage ><div style={{color:'#000'}}>{responseData.errorMsg}</div></WeaAlertPage>];
}
}
return contentWrap;
}
onChange=(newData,group)=>{
const store = this.getStore();
store.putData(group.id,newData);
}
}

View File

@ -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 && <span>
<span><a onClick={() => this.onClick(fieldId)}>{getLabel( 32714 ,'选项维护')}</a></span>
<span style={{marginLeft:variable ? "10px" : "0px"}}><WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@4xgdjk`} options={options} viewAttr={2} value={defaultOption} onChange={(v) => { }} /></span>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@7huz4r`}
icon="icon-coms-crm"
iconBgcolor="#96358a"
title={getLabel(32714, "选项维护")}
onCancel={() => {this.onCancel(fieldId)}}
visible={visible}
buttons={[
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@k4on6u@confirm`} type="primary" onClick={() => { this.saveOptions(fieldId) }}>{getLabel(826, "确定")}</Button>,
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@rvb4ng@cancel`} type="primary" onClick={() => { this.onCancel( fieldId) }}>{getLabel(201, "取消")}</Button>
]}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@mijsrc`} ref="modelingengine" height={"100%"}>
<WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@sz03ut`} ref="editTable" getRowSelection={this.getRowSelection.bind(this)} draggable={true} columns={columns} datas={options} onChange={(datas) => { this.onChange(fieldId, datas) }} showCopy={false} onRowSelect={this.onRowSelect} />
</WeaNewScroll>
</WeaDialog>
</span>
);
}
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;
}
}

View File

@ -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 = <i className="icon-coms-edit" />;
if (res.key.indexOf('save') > -1) {
icon = <i className="icon-coms-Save-as" />;
}
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 = [
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@7uc7wk@encryptSave`} type="primary" key="encryptSet-field-save" onClick={saveEncryptFieldSet}>{getLabel(86, '保存')}</Button>,
];
let { fieldLabel = '' } = currentClickRecord;
let title = getLabel('527160', '加密设置(字段:#[fieldName]').replace('#[fieldName]', fieldLabel);
const label = getLabel('524355', '提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!');
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@0zsjqg`}
title={title}
{...ecCom.WeaTools.getIconBGC('currency')}
className="bs-prj-define-encrypt-dialog"
onCancel={() => setParams({ encryptFieldSetVisible: false })}
visible={encryptFieldSetVisible}
buttons={btns}
style={{ width: 600, height: 200 }}
moreBtn={{ datas: this.getMoreBtn(btns) }}
hasScroll
loading={loading}
>
<div className={'data_security_tip_info'}><i className="icon-coms-Invalid" />{label}</div>
{this.getEncryptFieldSetInfo()}
</WeaDialog>
);
}
// 加密设置表单
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 = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@l9m4a1@${field.domkey[0]}`} fieldConfig={newField} form={fieldForm} />;
arr.push({
com: (
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@wvqmfo@${field.domkey[0]}`} {...itemProps} >
{coms}
</WeaFormItem>
),
col: 1,
});
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@v4uzim@${i}`} showGroup={c.defaultshow} items={arr} />);
});
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 (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@4pa3ee`} >
<div style={{ color: '#000' }}>
{getLabel(2012, "对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
} else {
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@2hxxb8`} datas={this.getRightMenu()} >
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@vwhhrk`}
title={title}
loading={false}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getTopButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
getHeight={this.resetHeight.bind(this)}
>
<LeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_LeftRightLayout@j2tbso`}
isNew={true}
leftCom={
fieldtype == "prjtype" && <WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@kgqh35`}
datas={toJS(leftTree)}
counts={toJS(leftTreeCount)}
//countsType={toJS(leftTreeCountType)}
key={this.props.location.key}
selectedKeys={[selectedTreeKey]}
searchValue={this.state.searchValue}
onSearchChange={v => {
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={
<div className="prj-query-condition">
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@f7xslv`}
selectedKey={selectedKey}
keyParam="key" //主键
onChange={prjFieldTabStore.changeTabKey}
datas={toJS(tabData)}
buttons={this.getButtons()}
/>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@2m0eym`} height="100%">
{ //当加载资产类型树结构时 判断树结构是否加载完成 加载完成再加载字段定义数据
(selectedKey == "1" && ("prjtype" == fieldtype ? (leftTree.length > 0 ? true : false) : true)) && <FieldConfig ecId={`${this && this.props && this.props.ecId || ''}_FieldConfig@ob60uy`} params={this.props.params} key={this.props.location.key} prjtypeid={treeInfo.prjtypeid} />
}
{
selectedKey == "2" && <FieldLanguage ecId={`${this && this.props && this.props.ecId || ''}_FieldLanguage@k11854`} params={this.props.params} prjtypeid={treeInfo.prjtypeid} />
}
{
selectedKey == "3" && <FieldGroup ecId={`${this && this.props && this.props.ecId || ''}_FieldGroup@soz5k2`} params={this.props.params} prjtypeid={treeInfo.prjtypeid} />
}
{ this.getEncryptFieldSetDialog() }
</WeaNewScroll>
</div>
}
>
</LeftRightLayout>
{/* </div> */}
</WeaTop>
</WeaRightMenu>
)
}
}
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(
// <ButtonGroup>
prjFieldConfigStore.getTopButtons()
// </ButtonGroup>
)
}
{
selectedKey == "2" && prjFieldLanguageStore.canEdit &&
btnArr.push(
// <ButtonGroup>
prjFieldLanguageStore.getTopButtons()
// </ButtonGroup>
)
}
{
selectedKey == "3" && prjFieldGroupStore.canEdit &&
btnArr.push(
// <ButtonGroup>
prjFieldGroupStore.getTopButtons()
// </ButtonGroup>
)
}
return btnArr;
}
}
export default WeaTools.tryCatch(React,
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@h1xe19`} msg={props.error ? props.error : getLabel(383324, "对不起,该页面异常,请联系管理员")} />,
{ error: "" }
)(FieldTab);

View File

@ -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:(<WeaFormItem
label={`${fields.label}`}
labelCol={{span: `${fields.labelcol}`}}
wrapperCol={{span: `${fields.fieldcol}`}}>
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
</WeaFormItem>),
colSpan:1
})
});
group.push(<WeaSearchGroup needTigger={true} title={c.title} showGroup={c.defaultshow} items={items}/>)
});
return group;
}
}
const getAdButtons = (listStore) => {
const {doSearch,setShowSearchAd,clearFormFields,setConditionByTree} = listStore;
return [
(<Button type="primary" onClick={()=>{doSearch();setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
(<Button type="ghost" onClick={()=>{clearFormFields();setConditionByTree();}}>{getLabel(2022,"重置")}</Button>),
(<Button type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
];
}
export {Condition,getAdButtons}

View File

@ -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 (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@7i69nb`} >
<div style={{ color: '#000' }}>
{getLabel(2012, "对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
} else {
return (
<div>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@c52p2d`} spinning={loading}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@47j9wp`}
title={getLabel(6002, "显示栏目")}
loading={true}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getTopButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
>
<div className="prj-table-edit-nonetop">
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@dx6fbb`} datas={this.getRightMenu()}>
{status && <WeaTableEdit ecId={`${this && this.props && this.props.ecId || ''}_WeaTableEdit@7urg2y`}
isModalEdit={isModalEdit}
columns={toJS(columnDef)}
datas={toJS(columnDatas)}
onChange={this.onChange}
ref="tableEdit"
rowKey={"groupid"}
onRowSelect={this.onRowSelect}
getRowSelection={this.getRowSelection}
selectedData={toJS(selectedData)}
showCopy={false}
draggable={true}
showDelete={false}
showAdd={false}
rowSelection={{}}
copyFilterProps={["groupid"]}
onCopy={(keys, datas)=>this.onCopy(keys, datas)}
/>}
</WeaRightMenu>
</div>
</WeaTop>
</Spin>
</div>
)
}
}
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(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0a7p9j@add`} type="primary" onClick={() => this.refs.tableEdit.refs.edit.doAdd()}>{getLabel(611, "添加")}</Button>);
btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@yt1fd3@del`} type="primary" disabled={selectedKeys==0} onClick={() => {this.refs.tableEdit.refs.edit.doDelete();setSelectedKeys([])}}>{getLabel(91, "删除")}</Button>);
btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bz4qil@copy`} type="primary" disabled={selectedKeys==0} onClick={() => {this.refs.tableEdit.refs.edit.doCopy() }}>{getLabel(77, "复制")}</Button>);
btns.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@d94q18@save`} type="primary" onClick={() =>{this.refs.tableEdit.refs.edit.doRequiredCheck();saveCardTabSet();} }>{getLabel(86, "保存")}</Button>);
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: <i className='icon-coms-Approval' />,
content: getLabel(86, "保存"),
onClick: key => {
this.refs.tableEdit.refs.edit.doRequiredCheck();
saveCardTabSet()
}
});
btns.push({
key: "addRow",
icon: <i className='icon-coms-Batch-add' />,
content: getLabel(21690, "添加行"),
onClick: key => {
this.refs.tableEdit.refs.edit.doAdd();
}
});
btns.push({
key: "delRow",
icon: <i className='icon-coms-delete' />,
content: getLabel(16182, "删除行"),
disabled : selectedKeys.length == 0,
onClick: key => {
selectedKeys.length > 0 && this.refs.tableEdit.refs.edit.doDelete();
setSelectedKeys([]);
}
});
btns.push({
key: "copyRow",
icon: <i className='icon-coms-form-copy' />,
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;

View File

@ -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;
}

View File

@ -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 (
<div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@8q4vg7`}
title={title || getLabel(83977, "新建项目模板")}
visible={visible}
style={{ width: width, height: dialogHeight }}
maskClosable={false}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={() => addPrjTempletStore.handleShareDialog(false)}
buttons={this.getDialogButtons()}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@qn1zwg`} datas={this.getRightMenu()}>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@i6ji5o`}
buttons={this.getButtons()}
datas={tabs}
selectedKey={selectedKey}
keyParam="key" //主键
onChange={this.changeTab.bind(this)} />
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@8mkuon`} height={"calc(100% - 50px)"}>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@paf6s4`} spinning={spinning}>
<div style={{ display: selectedKey == "prjinfo" ? "block" : "none" }}>
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@prqt5t`} fieldInfo={fieldinfo} form={form} setFormFields={(v) => { setFormFields(v) }} setValidate={(v) => { setValidate(v) }} />
</div>
<div style={{ display: selectedKey == "sublist" ? "block" : "none" }}>
<PrjTaskListTable ecId={`${this && this.props && this.props.ecId || ''}_PrjTaskListTable@1hxems`}
taskViewAttr={taskViewAttr}
datas={toJS(taskinfo)}
userid={userid}
isworkday={formParams.passnoworktime}
selectedRowKeys={toJS(selectedRowKey)}
onChange={(datas) => { saveListDatas(datas) }}
onRowSelect={(rowkeys) => { saveRowKeys(rowkeys) }}
stageOptions={this.getStageOptions()}
/>
</div>
<div style={{ display: selectedKey == "stagelist" ? "block" : "none" }}>
<StageList ecId={`${this && this.props && this.props.ecId || ''}_StageList@edhcz8`} ref={el => { this.StageList = el }} contentStore={addPrjTempletStore} />
</div>
</Spin>
</WeaNewScroll>
</WeaRightMenu>
</WeaDialog>
</div>)
}
getDialogButtons() {
const { isreflesh } = this.props;
const { addPrjTempletStore } = this.props.contentStore;
const { saveAddProject, conditionDatas: { taskViewAttr } } = addPrjTempletStore;
let btn = [];
if (taskViewAttr == 2) {
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@9083l6@save`} type="primary" onClick={() => { saveAddProject({ isreflesh: isreflesh, checkProps: this.StageList.tableEdit.refs.edit.doRequiredCheck() }); }}>{getLabel(86, "保存")}</Button>);
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pomdru@close`} type="primary" onClick={() => addPrjTempletStore.handleShareDialog(false)}>{getLabel(309, "关闭")}</Button>);
} else {
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@xj72wx@close`} type="primary" onClick={() => addPrjTempletStore.handleShareDialog(false)}>{getLabel(309, "关闭")}</Button>);
}
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 = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ix9mle@add`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: '#55a1f8', backgroundColor: '#fff' }} type="primary" title={getLabel(611, '添加')} size="small" disabled={0} onClick={() => {
addNewListDatas();
}}><span className="icon-coms-Add-to-hot" /></Button>),
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3drehc@del`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: (isDisabled) ? '#d8d8d8' : '#55a1f8', marginLeft: '-5px', backgroundColor: '#fff' }} type="primary" title={getLabel(91, '删除')} size="small" disabled={isDisabled} onClick={() => {
deleListDatas();
}} ><span className="icon-coms-form-delete-hot" /></Button>
];
} else if (selectedKey == "stagelist") {
btn = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@8a1uch@add`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: '#55a1f8', backgroundColor: '#fff' }} type="primary" title={getLabel(611, '添加')} size="small" disabled={0} onClick={() => {
this.StageList.tableEdit.refs.edit.doAdd()
}}><span className="icon-coms-Add-to-hot" /></Button>),
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@xss0gl@del`} style={{ border: 'none', padding: '0px', fontSize: '20px', lineHeight: '1', color: (stageDisabled) ? '#d8d8d8' : '#55a1f8', marginLeft: '-5px', backgroundColor: '#fff' }} type="primary" title={getLabel(91, '删除')} size="small" disabled={stageDisabled} onClick={() => {
this.StageList.tableEdit.refs.edit.doDelete()
}} ><span className="icon-coms-form-delete-hot" /></Button>
];
}
}
return btn
}
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: <i className={"icon-coms-Preservation"} />,
content: getLabel(86, "保存"),
onClick: (key) => {
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
}
});
}
if (selectedKey == "sublist") {
btn.push({
key: '1',
icon: <i className={"icon-coms-New-Flow"} />,
content: getLabel(611, "添加"),
onClick: (key) => {
addNewListDatas();
}
});
btn.push({
key: '2',
icon: <i className={"icon-coms-delete"} />,
content: getLabel(91, "删除"),
disabled: isDisabled,
onClick: (key) => {
deleListDatas();
}
});
btn.push({
key: '3',
icon: <i className={"icon-coms-Preservation"} />,
content: getLabel(86, "保存"),
onClick: (key) => {
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
}
});
}
if (selectedKey == "stagelist") {
btn.push({
key: '1',
icon: <i className={"icon-coms-New-Flow"} />,
content: getLabel(611, "添加"),
onClick: (key) => {
this.StageList.tableEdit.refs.edit.doAdd()
}
});
btn.push({
key: '2',
icon: <i className={"icon-coms-delete"} />,
content: getLabel(91, "删除"),
disabled: stageDisabled,
onClick: (key) => {
this.StageList.tableEdit.refs.edit.doDelete()
}
});
btn.push({
key: '3',
icon: <i className={"icon-coms-Preservation"} />,
content: getLabel(86, "保存"),
onClick: (key) => {
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
}
});
}
}
return btn
}
changeTab(key) {
const { 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;

View File

@ -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 (
<div>
<WeaDialog
title={getLabel(15284,"编辑任务")}
visible={contentStore.showEditTask}
buttons={this.getButtons()}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={()=>{contentStore.showEditTaskModal(false)}}
style={{width:'1000px', height:'600px'}}
>
<WeaNewScroll height={"100%"}>
<iframe src={"/proj/data/EditProjectTask.jsp?ProjID="+contentStore.prjid+"&e9from=e9&isdialog=1&key="+new Date().getTime()} id="editPrjTaskData" name="editPrjTaskData" className="flowFrame" frameborder="0" width="100%" height="100%" />
</WeaNewScroll>
</WeaDialog>
</div>)
}
getButtons(){
const {contentStore} = this.props;
let btnArr = [];
btnArr.push(<Button type="primary" onClick={()=>contentStore.showEditTaskModal(false)}>{getLabel(309,"关闭")}</Button>)
return btnArr;
}
}
export default EditPrjTaskDataDialog;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,250 @@
import {Button,Modal,message,Spin} from 'antd';
import {WeaDialog,WeaTab,WeaNewScroll,WeaRightMenu,WeaLocaleProvider,WeaFormItem,WeaInput,WeaSearchGroup } from 'ecCom';
import {observer} from "mobx-react";
import * as Apis from '../../apis/prjwfset';
import WfsetCondtion from '../list/wfsetCondtion'
import WfFieldSet from '../common/wfFieldSet'
import WfActionSet from '../common/wfActionSet'
const getLabel = WeaLocaleProvider.getLabel;
@observer
class PrjWfSetDialog extends React.Component {
constructor(props) {
super(props);
this.state={
width:700,
height:500,
formname:"",
isDisabled: false
}
}
componentDidMount(){
this.computedWH();
}
computedWH=()=>{
const screenWidth = document.body.clientWidth;
const screenHeight = document.body.clientHeight;
if(screenWidth <= 700){
this.setState({width:screenWidth,})
}
if(screenHeight <= 500){
this.setState({ height :screenHeight})
}
}
render() {
const prjwfsetStore = this.props.contentStore;
const {title,fieldinfo,fieldinfo1,fieldinfo2,visible,formvisible,handleFormnameDialog,selectTabKey,form,fieldSetform,setFormFields,setValidate,viewtype,wftype,onChangeAction} = prjwfsetStore;
const tabs = [{key:"baseinfo",title:getLabel(24893,"基础信息")},{key:"fieldsel",title:getLabel(82827,"字段对应")},{key:"actionset",title:getLabel(33085,"动作设置")}];
const { width,height} = this.state;
return (
<div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@bk8zu1`}
title={title||(getLabel(19867,"项目流程")+getLabel(125,"创建"))}
visible={visible}
style= {{width: width, height: document.body.clientHeight -270}}
maskClosable={false}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={()=>prjwfsetStore.handleShareDialog(false)}
buttons={this.getDialogButtons()}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@vfckj2`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
{viewtype=='edit'&&<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@jqs9ru`}
// buttons={this.getButtons()}
datas={tabs}
selectedKey={selectTabKey}
keyParam="key" //主键
onChange={this.changeTab.bind(this)} />}
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@rnh82p`} height={document.body.clientHeight - 350+"px"}>
{selectTabKey=='baseinfo'&&<WfsetCondtion ecId={`${this && this.props && this.props.ecId || ''}_WfsetCondtion@ta5h94`} viewtype={viewtype} fieldInfo={fieldinfo} form={form} settype={wftype} setFormFields={(v)=>{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} handleFormnameDialog={handleFormnameDialog}/>}
{selectTabKey=='fieldsel'&&<WfFieldSet ecId={`${this && this.props && this.props.ecId || ''}_WfFieldSet@rlbaaa`} fieldInfo={fieldinfo1} form={fieldSetform} settype={wftype}/>}
{selectTabKey=='actionset'&&<WfActionSet ecId={`${this && this.props && this.props.ecId || ''}_WfActionSet@t8o3c5`} ref = { ref => { this.WfActionSet = ref } } fieldInfo={fieldinfo2} onChangeAction={onChangeAction} settype={wftype}/>}
</WeaNewScroll>
</WeaRightMenu>
</WeaDialog>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@5gf26q`}
title={getLabel(19867,"填写表单名称")}
visible={formvisible}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={()=>{handleFormnameDialog(false)}}
style={{width:400,height:200}}
buttons={this.getFormDialogButtons()}
>
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@gxnwzh`} needTigger={false} showGroup={true}>
<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@cjp1u4`}
label={getLabel(19867,"表单名称")}
labelCol={{span: 6}}
tipPosition="bottom"
wrapperCol={{span: 16}} >
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@drzew5`}
id='formname'
viewAttr="3"
otherParams={
{ inputType:'multilang',isBase64:true}
}
value={this.state.formname}
onChange={value => {
this.setState({formname:value })
}}
/>
</WeaFormItem>
</WeaSearchGroup>
</WeaDialog>
</div>
)
}
getDialogButtons(){
const {contentStore} = this.props;
const {selectTabKey,saveBaseInfo,saveFieldSel,saveActionSet,viewtype} = contentStore;
let btn = [];
if(viewtype=='add'){
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ajt611@save`} type="primary" onClick={ ()=>{saveBaseInfo();}}>{getLabel(86,"保存")}</Button>);
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@8dhmqd@save2`} type="primary" title={getLabel(32159,"保存并进入详细设置")} onClick={ ()=>{saveBaseInfo({saveAndSet:true});}}>{getLabel(32159,"保存并进入详细设置")}</Button>);
}else{
if(selectTabKey=="baseinfo"){
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ff4pju@save`} type="primary" onClick={ ()=>{saveBaseInfo();}}>{getLabel(86,"保存")}</Button>);
}else if(selectTabKey=="fieldsel"){
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@p2ccvq@save`} type="primary" onClick={ ()=>{saveFieldSel();}}>{getLabel(86,"保存")}</Button>);
}else if(selectTabKey=="actionset"){
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v6kke0@save`} type="primary" onClick={ ()=>{this.WfActionSet.tableEdit.refs.edit.doRequiredCheck();saveActionSet();}}>{getLabel(86,"保存")}</Button>);
}
}
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@x8zelz@close`} type="primary" onClick={()=>contentStore.handleShareDialog(false)}>{getLabel(309,"关闭")}</Button>);
return btn
}
getFormDialogButtons(){
let btn = [];
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@t4uhoi@confirm`} type="primary" disabled={this.state.isDisabled} onClick={()=>{this.doSaveFormname();}}>{getLabel(826,"确定")}</Button>);
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@1qc9p2@close`} type="primary" disabled={this.state.isDisabled} onClick={()=>{this.doFormnameDialogClose();}}>{getLabel(309,"关闭")}</Button>);
return btn
}
doFormnameDialogClose(){
const {contentStore} = this.props;
contentStore.handleFormnameDialog(false);
this.setState({formname:"",isDisabled:false})
}
doSaveFormname(){
let _this = this;
const {contentStore} = this.props;
const {form} = contentStore;
let _formname = this.state.formname;
const formParams = form.getFormParams();
var newParams = {prjtype:formParams.prjtype,formname:_formname};
if(_formname){
this.setState({isDisabled:true});
Apis.getInitformByPrjtype(newParams).then(data=>{
if (data.msg) {
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
this.setState({isDisabled:false});
}else{
const {formid,formname} = data;
form.updateFields({
formid: {
value: formid.toString() || '',
valueSpan: formname || '',
valueObj: [{
id: formid.toString() || '',
name: formname || ''
}]
}
})
message.success(getLabel(18758,"保存成功"));
_this.doFormnameDialogClose();
}
})
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
message.error(getLabel(15859,"必要信息不完整!"));
}
}
getButtons(){
const {contentStore} = this.props;
const {rightMenu,selectTabKey,saveBaseInfo,saveFieldSel,saveActionSet,viewtype} = contentStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vpkwc7@${m.type}`} type="primary"
onClick={()=>{
if(selectTabKey == 'baseinfo'){
if(m.type == "BTN_SAVE"){
saveBaseInfo();
}else if(m.type=='BTN_SAVE_TO'){
saveBaseInfo({saveAndSet:true});
}
}else if(selectTabKey == 'fieldsel'){
if(m.type == "BTN_SAVE"){
saveFieldSel();
}
}else if(selectTabKey=="acitonset"){
if(m.type == "BTN_SAVE"){
saveActionSet();
}
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
getRightMenu(){
const prjwfsetStore = this.props.contentStore;
const {rightMenu,selectTabKey,saveBaseInfo,viewtype} = prjwfsetStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
})
});
return btnArr
}
onRightMenuClick(key){
const prjwfsetStore = this.props.contentStore;
const {rightMenu,selectTabKey,saveBaseInfo,saveFieldSel,saveActionSet,viewtype} = prjwfsetStore;
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
if(Number(key) == i){
if(selectTabKey == 'baseinfo'){
if(m.type == "BTN_SAVE"){
saveBaseInfo();
}else if(m.type=='BTN_SAVETOSET'){
saveBaseInfo({saveAndSet:true})
}
}else if(selectTabKey == 'fieldsel'){
if(m.type == "BTN_SAVE"){
saveFieldSel();
}
}else if(selectTabKey=="actionset"){
if(m.type == "BTN_SAVE"){
this.WfActionSet.tableEdit.refs.edit.doRequiredCheck();
saveActionSet();
}
}
}
});
}
changeTab(key){
const prjwfsetStore = this.props.contentStore;
prjwfsetStore.changeTab(key)
}
}
export default PrjWfSetDialog;

View File

@ -0,0 +1,124 @@
import React from 'react';
import {observer } from 'mobx-react';
import {WeaDialog,WeaRightMenu,WeaNewScroll,WeaLocaleProvider} from "ecCom"
import {Button,message} from "antd"
import {toJS} from "mobx"
import TaskInfo from '../common/taskInfo'
import * as Task_Apis from '../../apis/templet'
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class TaskDialog extends React.Component{
constructor(props) {
super(props);
this.state = {
canSave: true
}
}
componentWillReceiveProps(nextProps){
}
shouldComponentUpdate(){
return true;
}
render(){
const {contentStore} = this.props;
const {visible,taskForm,taskInfo,title,handleDialog} = contentStore;
return (
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ljyk1j`}
title={title||getLabel(15284,"编辑任务")}
visible={visible}
buttons={this.getBottomButtons()}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={()=>{handleDialog(false)}}
style={{width:1000,height:700}}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@fzuxmu`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@4c9hr7`} height={"100%"}>
<TaskInfo ecId={`${this && this.props && this.props.ecId || ''}_TaskInfo@if73gs`} listStore = {contentStore} form={taskForm} />
</WeaNewScroll>
</WeaRightMenu>
</WeaDialog>
)
}
getBottomButtons(){
const {contentStore} = this.props;
const {handleDialog,rightMenu} = contentStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@v0gv2w@${m.type}`} type="primary"
onClick={()=>{
if(m.type == "BTN_SAVE"){ //保存
this.setState({canSave:false});
this.saveTaskInfo();
}
}}
disabled={!this.state.canSave}
>
{m.menuName}
</Button>
);
});
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jsiys7@close`} type="primary" onClick={()=>{handleDialog(false)}}>{getLabel(309,"关闭")}</Button>)
return btnArr;
}
getRightMenu(){
const {contentStore} = this.props;
const {handleDialog,rightMenu} = contentStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName
})
});
return btnArr
}
onRightMenuClick(key){
const {contentStore} = this.props;
const {handleDialog,rightMenu} = contentStore;
let that = this;
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
if(Number(key) == i){
if(m.type == "BTN_SAVE"){ //验收
this.saveTaskInfo();
}else if(m.type == 'BTN_BACK'){ //返回
//showCptInfo(true,{capitalid:capitalid,viewtype:'edit'});
}
}
});
}
saveTaskInfo= (params={})=>{
const {prjid,contentStore,callBack} = this.props;
const {handleDialog,taskForm,taskInfo,type,taskid,baseParams,validateRules} = contentStore;
taskForm.validate().then(f=>{
if(f.isValid){
let newParams = {...baseParams,...toJS(taskForm.getFormParams()),method:type,templetTaskId:taskid,prjid:prjid||"",...params};
Task_Apis.doPrjTaskTempletOpt(newParams).then(data=>{
if(data.success){
handleDialog(false);
if(callBack){
callBack();
}else{
window._table.reLoad();
}
}else{
message.error(getLabel(383746,"请求失败")+""+data.msgcode);
}
this.setState({canSave:true});
})
}else{
f.showErrors();
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
// message.error(getLabel(15859,"必要信息不完整!"));
}
});
}
}

View File

@ -0,0 +1,378 @@
import React from 'react';
import { observer } from 'mobx-react';
import { WeaDialog, WeaRightMenu, WeaFormItem, WeaLocaleProvider, WeaNewScroll, WeaUpload, WeaSearchGroup, WeaSelect, WeaInput, WeaError } from "ecCom"
import { Button, Spin, Row, Col } from 'antd';
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class TaskTempletImpDialog extends React.Component {
constructor(props) {
super(props);
}
componentWillUnmount() {
const { prjImportStore } = this.props;
prjImportStore.clearStatus();
}
getCircle() {
let style = {
width: 20,
height: 20,
backgroundColor: '#D8D8D8',
webkitBorderRadius: 10,
mozBorderRadius: 10,
msBorderRadius: 10,
oBorderRadius: 10,
borderRadius: 10,
textAlign: 'center',
}
return style;
}
getForm() {
const { prjImportStore } = this.props;
const {templetname,taskmsg,taskotherstr,imp_totalCount,imp_successCount} = prjImportStore;
const other = "<span>" + getLabel(375, "其他") + ": " + getLabel(15486, "序号") + " " + getLabel(1352, "任务名称") + " " + getLabel(2097, "负责人") + " " + getLabel(26797, "项目阶段") + " " + getLabel(23785, "上级任务") + " " + getLabel(1322, "起始日期") + " " +
getLabel(741, "结束日期") + " " + getLabel(15274, "项目预算") + " " + getLabel(2232, "里程碑任务") + " " + getLabel(2233, "前置任务") + " " + getLabel(2240, "任务说明") + " " + taskotherstr + " </span>";
const require = "<span></span>";
let condition =
[{
"title": getLabel(24893, "基础信息"),
"defaultshow": true,
"items": [{
"checkbox": false,
"colSpan": 2,
"conditionType": "INPUT",
"detailtype": 1,
"domkey": ["templetname"],
"fieldcol": 18,
"hasBorder": false,
"helpfulTipProps": {},
"isQuickSearch": false,
"label": getLabel(28050, "模板名称"),
"labelcol": 6,
"length": 0,
"precision": 0,
"showOrder": 0,
"stringLength": 0,
"tipPosition": "bottom",
"viewAttr": 1,
"value":templetname
}, {
"checkbox": false,
"colSpan": 2,
"conditionType": "RESOURCEIMG",
"detailtype": 1,
"domkey": ["excelfile"],
"fieldcol": 18,
"hasBorder": false,
"helpfulTipProps": {},
"isQuickSearch": false,
"label": getLabel(16699, "Excel文件"),
"labelcol": 6,
"length": 0,
"precision": 0,
"showOrder": 0,
"stringLength": 0,
"tipPosition": "bottom",
"viewAttr": 2
}]
}, {
"title": getLabel(19010,"操作说明"),
"defaultshow": true,
"items": [{
"index": 1,
"value": getLabel(28447, "第一步,请先")
}, {
"index": 2,
"value": getLabel(32986,"第二步下载后填写内容注意要填写的内容在下边的说明中有详细的说明请一定要确定你的Excel文档的格式是模板中的格式而没有被修改掉")
}, {
"index": 3,
"value": getLabel(32987,"第三步选择填写好的Excel文档点击提交按钮进行批量导入")
}, {
"index": 4,
"value": getLabel(32988,"第四步如果以上步骤和Excel文档正确的话数据会被正确的导入导入成功会有提示。如果有问题则会提示Excel文档的错误之处")
}]
}, {
"title": getLabel(24962,"字段说明"),
"defaultshow": true,
"items": [{
"index": 1,
"value": getLabel(18617,"请按下列顺序排列需导入的EXCEL文档中各字段的顺序其中红色的部分为必填字段不能为空")
}, {
"index": 2,
"value":other
}]
}]
let _arr = [];
condition.map((c, i) => {
let arr = [];
if (i == 0) { //基本信息
c.items.map((field, index) => {
if(index=0){
arr.push({
com: (
<div>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@l8axav@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@c75puh@${index}`} span={1} offset={4}>
<div style={{ marginTop: 15 }}>
<div style={this.getCircle()}><div style={{ paddingTop: 2 }}>{index + 1}</div></div>
</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@vc8u0h@${index}`} span={14}>
<div style={{ marginTop: 15 }}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@xpji52@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@ezxdwv@${index}`} span={field.labelcol}>{field.label}:</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@jamrdm@${index}`} span={field.fieldcol}>
{this.getDom(field)}
</Col>
</Row>
</div>
</Col>
</Row>
</div>
),
colSpan: 1,
})
}else{
arr.push({
com: (
<div>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@8mfwrc@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@sizxzg@${index}`} span={1} offset={4}>
<div style={{ marginTop: 15 }}>
<div style={this.getCircle()}><div style={{ paddingTop: 2 }}>{index + 1}</div></div>
</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@hvv1y7@${index}`} span={14}>
<div style={{ marginTop: 15 }}>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@ja9p2h@${index}`} style={{ width:600 }}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@u5fngi@${index}`} span={field.labelcol} style={{ width:113.75 }}>{field.label}:</Col>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@n0v9g6@${index}`}
ref="import"
error={getLabel(126186,"未")+getLabel(82694,"选择Excel文件")}
tipPosition="bottom"
style={{ width:455 }}
>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@r5umcx@${index}`} span={field.fieldcol}>
{this.getDom(field)}
</Col>
</WeaError>
</Row>
</div>
</Col>
</Row>
</div>
),
colSpan: 1,
})
}
})
//导入提示信息
arr.push({
com: (
<div>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@vdm9jn`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@0ize0n`} offset={4}>
<div style={{color:"red"}} >
<div className="card-call" dangerouslySetInnerHTML={{__html:taskmsg}}></div>
{ taskmsg!=""&&(parseInt(imp_totalCount)>0&&<span className="card-call" > {getLabel(128217,"总记录数")}{imp_totalCount}{getLabel(18256,"条")} {getLabel(128219,"成功导入")}{imp_successCount}{getLabel(18256,"条")}{getLabel(498,"失败")}{parseInt(imp_totalCount) - parseInt(imp_successCount)}{getLabel(18256,"条")} </span>) }
</div>
</Col>
</Row>
</div>
),
colSpan: 1,
})
}
if (i == 1) { //导入说明
c.items.map((field, index) => {
arr.push({
com: (
<div>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@4c2bbr@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@2qppa8@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
<div style={this.getCircle()}>
<div style={{ paddingTop: 2 }}>{index + 1}</div>
</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@6yh21x@${index}`} span={17} style={{ marginTop: 15 }}>
{this.getIllustration(field.value, field.link, index, field)}
</Col>
</Row>
</div>
),
colSpan: 1
})
})
}
if (i == 2) { //字段说明
c.items.map((field, index) => {
arr.push({
com: (
<div>
<Row ecId={`${this && this.props && this.props.ecId || ''}_Row@lfdt8f@${index}`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@xll16s@${index}`} span={1} offset={4} style={{ marginTop: 15 }}>
<div style={this.getCircle()}>
<div style={{ paddingTop: 2 }}>{index + 1}</div>
</div>
</Col>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@zvzbe3@${index}`} span={17} style={{ marginTop: 15 }}>
{this.getIllustration1(field.value, field.link, index, field)}
</Col>
</Row>
</div>
),
colSpan: 1
})
})
}
_arr.push(<div><WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@sxjahm@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={arr} col={1} /></div>)
});
return _arr;
}
getDom(field) {
const { prjImportStore} = this.props;
const {filelist } = prjImportStore;
let dom;
let domkey = field.domkey;
if (domkey&&domkey[0] == 'excelfile') {
dom = (<div>
<div style={{ float: 'left', marginTop: -10 }}>
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@9wal3j`}
uploadUrl={`${window.ecologyContentPath || ''}/api/doc/upload/uploadFile`}
category='string'
limitType='xls'
maxFilesNumber={1}
datas={filelist}
onChange={(ids, list) => {
this.setFileId(ids, list)
}
} >
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@lmpd71`}>{getLabel(125333,"选择文件")}</Button>
</WeaUpload>
</div>
<div style={{ float: 'left', paddingLeft: 10 }}>
{filelist.length == 0 ? <p>{getLabel(384040,"未选择任何文件")}</p> : filelist.map(file => <p>{file.filename}</p>)}
</div>
</div>)
} else {
dom = <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@urmx5r`} hasBorder={true} viewAttr={1} value={field.value} />
}
return dom;
}
getIllustration(val, url, index, link) {
const { prjImportStore} = this.props;
const {taskisrefresh } = prjImportStore;
let tempurl = "/proj/imp/prjtskTempletimp_xlsnew.xls?V=" + taskisrefresh;
let p;
if (index == 0) {
p = (<p>{val}<a href={tempurl}>{getLabel(28446,"下载EXCEL文档模板")}</a></p>);
} else {
p = (<p><div dangerouslySetInnerHTML={{ __html: val }} /></p>);
}
return p;
}
getIllustration1(val, url, index, link) {
let p;
if (index == 0) {
p = (<p><div style={{fontWeight:700}} dangerouslySetInnerHTML={{ __html: val }} /></p>);
} else if(index==1){
p = (<p><div dangerouslySetInnerHTML={{ __html: val }} /></p>);
} else{
p = (<p><div style={{color:"red"}} dangerouslySetInnerHTML={{ __html: val }} /></p>);
}
return p;
}
render() {
const { prjImportStore } = this.props;
const { spinning,visible } = prjImportStore;
let dialogHeight = window.innerHeight - 150;
if (dialogHeight > 600) dialogHeight = 600;
return (
<div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1gamtj`}
title={getLabel(18375, "项目模板")+getLabel(1332, "任务") + getLabel(26601, "批量导入")}
visible={visible}
buttons={this.getBottomButtons()}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={() => { this.doClose() }}
style={{ width: 870, height: dialogHeight }}>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@utlzhm`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@0lo8ue`} spinning={spinning}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@d3cq4s`} height={dialogHeight} ref="scrollBar">
{this.getForm()}
</WeaNewScroll>
</Spin>
</WeaRightMenu>
</WeaDialog>
</div>
)
}
setFileId(ids, list) {
const {prjImportStore} = this.props;
prjImportStore.excelfile = ids;
prjImportStore.filelist = list;
}
doClose = () => {
const { prjImportStore } = this.props;
const { handleDialog, clearStatus } = prjImportStore;
handleDialog(false);
clearStatus();
}
getBottomButtons() {
const { prjImportStore,refTaskList } = this.props;
const { rightMenu, } = prjImportStore;
let btnArr = [];
rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@mr3iqj@submit`} type="primary"
onClick={() => {
if (m.type == "BTN_SUBMIT") { //提交
prjImportStore.doImport(refTaskList);
}
}}>
{m.menuName}
</Button>
);
});
btnArr.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@ljbww7@close`} type="primary" onClick={() => { this.doClose() }}>{getLabel(309, "关闭")}</Button>)
return btnArr;
}
getRightMenu() {
const { prjImportStore } = this.props;
const { rightMenu } = prjImportStore;
let btnArr = [];
rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName
})
});
return btnArr
}
onRightMenuClick(key) {
const { prjImportStore,refTaskList } = this.props;
const { rightMenu } = prjImportStore;
let that = this;
rightMenu && rightMenu.length > 0 && rightMenu.map((m, i) => {
if (Number(key) == i) {
if (m.type == "BTN_SUBMIT") {
prjImportStore.doImport(refTaskList);
}
}
});
}
}

View File

@ -0,0 +1,155 @@
import { Button,Row,Col} from 'antd';
import {WeaDialog, WeaSearchGroup ,WeaTab,WeaNewScroll,WeaAlertPage,WeaRightMenu,WeaLocaleProvider } from 'ecCom';
import {inject, observer} from "mobx-react";
import {toJS} from 'mobx';
import {WeaTableNew} from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
import {WeaSwitch} from 'comsMobx';
import ProjectCondition from '../list/projectCondition'
const getLabel = WeaLocaleProvider.getLabel;
@observer
class WorkTypeDialog extends React.Component {
constructor(props) {
super(props);
this.state={
width:550,
height:300,
visible:false
}
}
componentDidMount(){
const {worktypeStore} = this.props;
this.computedWH();
}
computedWH=()=>{
const screenWidth = document.body.clientWidth;
const screenHeight = document.body.clientHeight;
if(screenWidth <= 750){
this.setState({width:screenWidth,})
}
if(screenHeight <= 450){
this.setState({height:screenHeight})
}
}
componentWillReceiveProps(nextProps){
}
render() {
const {worktypeStore} = this.props;
const {title,visible,isright,forminfo,tableStore,} = worktypeStore;
const {form,setFormFields,setValidate} = worktypeStore;
const {width,height} = this.state;
const formParams = form.getFormParams() || {};
if (visible&&!isright) {
return (<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@c5t2j3`}
title={title||getLabel(83855,"编辑工作类型")}
visible={visible}
style= {{width: width, height: height}}
maskClosable={false}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={()=>worktypeStore.handleShareDialog(false)}
buttons={[
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@nbrzv5@clsoe}`} type="primary" onClick={()=>worktypeStore.handleShareDialog(false)}>{getLabel(309,"关闭")}</Button>)
]}>
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@sez07g`} >
<div style={{color : '#000'}}>
{getLabel(2012,"对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
</WeaDialog>
)
}
return (
<div>
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@gl0ny1`}
title={title}
visible={visible}
style= {{width: width, height: height}}
maskClosable={false}
icon="icon-coms-project"
iconBgcolor="#217346"
onCancel={()=>worktypeStore.handleShareDialog(false)}
buttons={this.getDialogButtons()}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@kxmzfg`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@nr94h5`} height={height-50}>
<ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@h5fng5`} fieldInfo={forminfo} form={form} setFormFields={(v)=>{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
</WeaNewScroll>
</WeaRightMenu>
</WeaDialog>
</div>)
}
getDialogButtons(){
const {worktypeStore} = this.props;
let btn = [];
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@0sxrn1@save`} type="primary"
onClick={ ()=>{
if(worktypeStore.id==''){
worktypeStore.saveFormInfo({method:'add'});
}else{
worktypeStore.saveFormInfo({method:'edit'});
}
}}>{getLabel(86,"保存")}</Button>);
btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@97p0vs@clsoe`} type="primary" onClick={()=>worktypeStore.handleShareDialog(false)}>{getLabel(309,"关闭")}</Button>);
return btn
}
getButtons(){
const {worktypeStore} = this.props;
const {rightMenu} = worktypeStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@fgfazy@${m.type}`} type="primary"
onClick={()=>{
if(m.type == "BTN_SAVE"){
if(worktypeStore.id==''){
worktypeStore.saveFormInfo({method:'add'});
}else{
worktypeStore.saveFormInfo({method:'edit'});
}
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
getRightMenu(){
const {worktypeStore }= this.props;
const {rightMenu} = worktypeStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
})
});
return btnArr
}
onRightMenuClick(key){
const {worktypeStore} = this.props;
const {rightMenu,id} = worktypeStore;
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"){ ////类型编辑
if(id==''){
worktypeStore.saveFormInfo({method:'add'});
}else{
worktypeStore.saveFormInfo({method:'edit'});
}
}
}
});
}
}
export default WorkTypeDialog;

View File

@ -0,0 +1,44 @@
import { WeaSearchGroup,WeaFormItem,WeaLocaleProvider } from 'ecCom';
import { Button } from 'antd';
import {toJS} from "mobx"
import {WeaSwitch} from "comsMobx"
import {inject, observer} from 'mobx-react';
const getLabel = WeaLocaleProvider.getLabel;
@observer
class Condition extends React.Component{
render(){
const { condition, } = this.props.listStore;
const {form,onEnterSearch} = this.props;
const {isFormInit} = form;
let group = [];
const formParams = form.getFormParams();
isFormInit && toJS(condition).map((c,i) =>{
let items = [];
c.items.map((fields,index) => {
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@j4aqj9@${index}`}
label={`${fields.label}`}
labelCol={{span: `${fields.labelcol}`}}
wrapperCol={{span: `${fields.fieldcol}`}}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@ymv0wr@${index}`} fieldConfig={fields} form={form} formParams={formParams} onEnterSearch={onEnterSearch} />
</WeaFormItem>),
colSpan:1,
})
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@xfyxs2@${i}`} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items}/>)
});
return group;
}
}
const getAdButtons = (listStore,ecid) => {
const {doSearch,setShowSearchAd,clearFormFields} = listStore;
return [
(<Button ecId={`${ecid}_Button@svyhjn@search`} type="primary" onClick={()=>{doSearch();setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
(<Button ecId={`${ecid}_Button@2dly6p@reset`} type="ghost" onClick={()=>{clearFormFields();}}>{getLabel(2022,"重置")}</Button>),
(<Button ecId={`${ecid}_Button@ebzwol@cancel`} type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
];
}
export {Condition,getAdButtons}

View File

@ -0,0 +1,62 @@
import { WeaLeftTree } from 'ecCom';
import * as mobx from 'mobx';
import { observer } from 'mobx-react';
import { toJS } from 'mobx';
@observer
class ListLeftTree extends React.Component{
constructor(props) {
super(props);
this.state = {
searchValue: ""
}
}
componentWillReceiveProps(nextProps) {
if (this.props.key !== nextProps.key) {
this.setState({
searchValue: ""
})
}
}
render(){
const {leftTree,leftTreeCount,leftTreeCountType,topTab,selectedTreeKey} = this.props.listStore;
const {setShowSearchAd,clearFormFields,resetTable,initDatas,doSearch,setSelectedTreeKey} = this.props.listStore;
return (
<WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@4588sx`}
datas={toJS(leftTree)}
counts={toJS(leftTreeCount)}
countsType={toJS(leftTreeCountType)}
selectedKeys={[selectedTreeKey]}
searchValue={this.state.searchValue}
onSearchChange={v => {
this.setState({
searchValue: v
})
}}
onSearchLabelClick={()=>{
setShowSearchAd(false);
clearFormFields();
resetTable();
setSelectedTreeKey("");
doSearch({prjtypeid:"",prjtypename:""});
}}
onSelect={(key,topTabCount,countsType)=>{
setShowSearchAd(false);
clearFormFields();
resetTable();
setSelectedTreeKey(key);
doSearch({
prjtypeid: topTabCount.keyid,
prjtypename: countsType.selectedNodes[0].props.name,
});
}}
/>
);
}
}
export default ListLeftTree;

View File

@ -0,0 +1,192 @@
import { WeaSearchGroup,WeaFormItem ,WeaProgress,WeaUpload,WeaLocaleProvider,WeaTools,WeaInputEncrypt} from 'ecCom';
import {Row,Col,InputNumber } from 'antd';
import {WeaSwitch} from "comsMobx"
import {observer} from 'mobx-react';
import {toJS} from "mobx"
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 ProjectCondition extends React.Component{
constructor(props) {
super(props);
}
render(){
const { fieldInfo, form,setFormFields,setValidate } = this.props;
const {isFormInit} = form;
let group = [];
const formParams = form.getFormParams();
isFormInit && fieldInfo.map((c,i) =>{
let items = [];
c.items.map(fields => {
let hide = false;
let dom;
let hasunderline = false;
//只读样式控制
let stylecss = {'margin-right':'5px','margin-top': '6px'};
if(fields.viewAttr == "1" || (fields.conditionType == "BROWSER" && fields.browserConditionParam.viewAttr == "1")) {
hasunderline = true;
stylecss = {'margin-right':'5px','margin-top': '16px'};
} //只读样式控制
if(fields.domkey[0] == "prjprocess"){
if(fields.viewAttr == "1"){
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@q530uy@${fields.domkey[0] }`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@immrwj@${fields.domkey[0] }`} span={12} style={stylecss}>
<WeaProgress ecId={`${this && this.props && this.props.ecId || ''}_WeaProgress@m62zmb@${fields.domkey[0] }`} percent={fields.value || 0} status="active" />
</Col>
</Row>
}else{
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@nlql69@${fields.domkey[0] }`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@eewqs3@${fields.domkey[0] }`} span={24} style={stylecss}>
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@r6vrgr@${fields.domkey[0] }`} min={0} max={100} defaultValue={0} formatter={value=>`${value}%`} parser={value =>value.replace('%','')} onChange={(v)=>{setFormFields({finish:{value:v}})}} />
<span style={{marginLeft:5}}>%</span>
</Col>
</Row>
}
}else if(fields.conditionType == "RICHTEXT"){
if(fields.viewAttr == "1"){
dom = WeaTools.EncryBase.desensitization(fields.value)? <WeaInputEncrypt ecId={`${this && this.props && this.props.ecId || ''}_WeaInputEncrypt@b2sqas`} value={fields.value} type={'TEXTAREA'} />:
<div className='view_basicToolBar'><WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@q1dh43@${fields.domkey[0] }`} fieldConfig={{...fields,ckConfig:view_basicToolBar}} form={form}/></div>;
}else{
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@96fmv3@${fields.domkey[0] }`} fieldConfig={{...fields,ckConfig:basicToolBar}} form={form}/>
}
}else if(fields.conditionType == "ATTACHEMENT"){
let domkey = fields.domkey[0];
dom = <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@r6pngx@${fields.domkey[0] }`}>
<Col ecId={`${this && this.props && this.props.ecId || ''}_Col@xxq555@${fields.domkey[0] }`} span={24} style={stylecss}>
<WeaUpload ecId={`${this && this.props && this.props.ecId || ''}_WeaUpload@vvauqd@${fields.domkey[0] }`}
uploadId={[domkey]}
uploadUrl={(window.ecologyContentPath || '')+"/api/proj/prjutil/fileUpload?accsec="+fields.accsec}
category={fields.accsec}
autoUpload={true}
showBatchLoad={false}
showClearAll={false}
multiSelection={true}
datas={fields.datas}
maxUploadSize={fields.accsize}
onChange={v => {setFormFields({[domkey]:{value:v}})}}
viewAttr={fields.viewAttr}
// onUploading={(state)=>{}}
/>
</Col>
</Row>
}else{
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@uu3zng@${fields.domkey[0] }`} fieldConfig={fields} form={form} formParams={formParams}/>;
}
if(fields.domkey[0] == "members" || fields.domkey[0] == "hrmids02"){
let fhelp
if(fields.browserConditionParam.viewAttr == 1){
fhelp = fields;
}else{
fhelp = {...toJS(fields),helpfulTip:getLabel(383844,"项目人员默认保存时将任务负责人同步至项目成员")}
}
if(hasunderline){
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@a94a5z@${fields.domkey[0] }`}
label={fields.label}
labelCol={{span: `${fields.labelcol}`}}
wrapperCol={{span: `${fields.fieldcol}`}} underline>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@45bdx7@${fields.domkey[0] }`} fieldConfig={fhelp} form={form} formParams={formParams}/>
</WeaFormItem>),
colSpan:1,
hide:hide
});
}else{
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@r4sgkh@${fields.domkey[0] }`}
label={fields.label}
labelCol={{span: `${fields.labelcol}`}}
wrapperCol={{span: `${fields.fieldcol}`}} >
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@992t56@${fields.domkey[0] }`} fieldConfig={fhelp} form={form} formParams={formParams}/>
</WeaFormItem>),
colSpan:1,
hide:hide
});
}
}else if(fields.domkey[0] == "prjstatusname"){
if(hasunderline){
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@7qpgjv@${fields.domkey[0] }`}
label={fields.label}
labelCol={{span: `${fields.labelcol}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${fields.fieldcol}`}} underline>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@nqictr@${fields.domkey[0] }`} fieldConfig={{...toJS(fields),helpfulTip:getLabel(83845,"自定义状态均归属于'正常'")}} form={form} formParams={formParams}/>
</WeaFormItem>),
colSpan:1,
hide:hide
});
}else{
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@2pczzp@${fields.domkey[0] }`}
label={fields.label}
labelCol={{span: `${fields.labelcol}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${fields.fieldcol}`}} >
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@j5anac@${fields.domkey[0] }`} fieldConfig={{...toJS(fields),helpfulTip:getLabel(83845,"自定义状态均归属于'正常'")}} form={form} formParams={formParams}/>
</WeaFormItem>),
colSpan:1,
hide:hide
});
}
}else{
if(hasunderline){
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@wxle4l@${fields.domkey[0] }`}
label={`${fields.label}`}
labelCol={{span: `${fields.labelcol}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${fields.fieldcol}`}} underline>
{dom}
</WeaFormItem>),
colSpan:1,
hide:hide
});
}else{
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@hbhq81@${fields.domkey[0] }`}
label={`${fields.label}`}
labelCol={{span: `${fields.labelcol}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${fields.fieldcol}`}} >
{dom}
</WeaFormItem>),
colSpan:1,
hide:hide
});
}
}
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@2ml8rj@${i}`} needTigger={true} title={c.title} col={1} showGroup={c.defaultshow} items={items}/>)
});
return group;
}
}

View File

@ -0,0 +1,175 @@
import { WeaSearchGroup,WeaFormItem ,WeaTools,WeaLocaleProvider} from 'ecCom';
import {message,Modal} from 'antd';
import {WeaSwitch} from "comsMobx"
import {observer} from 'mobx-react';
import * as Apis from '../../apis/prjwfset';
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class WfsetCondtion extends React.Component{
constructor(props) {
super(props);
}
render(){
const { fieldInfo,form,settype,viewtype } = this.props;
const {isFormInit} = form;
let group = [];
const formParams = form.getFormParams();
isFormInit && fieldInfo.map((c,i) =>{
let items = [];
c.items.map(fields => {
let hide = false;
let dom;
let hasunderline = false;
if(fields.conditionType == "BROWSER"){
if(fields.domkey[0] == "wfid"&&viewtype=="add"){
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@893gtf@${fields.domkey[0]}`} fieldConfig={{...fields, hasAddBtn:true,addOnClick:(values)=> this.callAddPath(values)}}
form={form} formParams={formParams} onChange={this.onWfChange} />
}else if(fields.domkey[0] == "formid"&&viewtype=="add"&&settype=="1"){
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@4ozxtq@${fields.domkey[0]}`} fieldConfig={{...fields,hasAddBtn:true,addOnClick:(values)=> this.showFormnameDialog(values)}}
form={form} formParams={formParams}/>;
}else{
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@3e8548@${fields.domkey[0]}`} fieldConfig={fields} form={form} formParams={formParams}/>;
}
}else{
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@egosd6@${fields.domkey[0]}`} fieldConfig={fields} form={form} formParams={formParams}/>;
}
if(hasunderline){
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@9rukai@${fields.domkey[0]}`}
label={`${fields.label}`}
labelCol={{span: `${fields.labelcol}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${fields.fieldcol}`}} underline>
{dom}
</WeaFormItem>),
colSpan:1,
hide:hide
});
}else{
items.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@8wcw6x@${fields.domkey[0]}`}
label={`${fields.label}`}
labelCol={{span: `${fields.labelcol}`}}
error={form.getError(fields)}
tipPosition="bottom"
wrapperCol={{span: `${fields.fieldcol}`}} >
{dom}
</WeaFormItem>),
colSpan:1,
hide:hide
});
}
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@qnti54@${i}`} needTigger={true} title={c.title} col={1} showGroup={c.defaultshow} items={items}/>)
});
return group
}
callAddPath = (values) => {
const {form} = this.props;
const formParams = form.getFormParams();
const formDatas = form.getFormDatas();
let _this = this;
let url = (window.ecologyContentPath || '')+'/spa/workflow/static4engine/engine.html#/main/workflowengine/path/addContent?isRoute=true';
if (formParams.formid != null && formParams.formid != '') {
url += `&formId=${formParams.formid}`;
}
if (formDatas.formid != null && formDatas.formid.valueObj != null) {
url += `&isBill=${formDatas.formid.valueObj[0].isbill}`;
}
const dialog = WeaTools.createDialog({
title: getLabel(81687,"添加路径"),
moduleName: 'workflow',
url,
style: {
width: 600,
height: 500
},
callback: (datas) => {
form.updateFields({
wfid: {
value: datas.id.toString(),
valueSpan: datas.name,
valueObj: [{
id: datas.id.toString(),
name: datas.name
}]
}
})
_this.getFormInfoByWorkflow(datas.id);
},
onCancel: () => {
}
});
dialog.show();
}
onWfChange = (ids, names, datas) => {
const {form} = this.props;
let _this= this;
if (names.value.length === 0) {
form.updateFields({
formid: {
value: '',
valueSpan: '',
valueObj: [{
id: '',
name: ''
}]
}
})
} else {
_this.getFormInfoByWorkflow(names.value);
}
}
getFormInfoByWorkflow = (id) => {
const {form} = this.props;
Apis.getPrjWorkflowInfo({
workflowid: id
}).then(data => {
if (data.status === '1') {
const {
id,
name
} = data;
form.updateFields({
formid: {
value: id || '',
valueSpan: name || '',
valueObj: [{
id: id || '',
name: name || ''
}]
}
})
} else {
message.error(data.message);
}
}, error => {})
}
showFormnameDialog =(values)=>{
const {form,handleFormnameDialog} = this.props;
const formParams = form.getFormParams();
if(formParams.prjtype){
handleFormnameDialog&&handleFormnameDialog(true);
}else{
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83765,"没有选择项目类型,将根据通用设置生成表单,是否继续?"),
onOk() {
handleFormnameDialog&&handleFormnameDialog(true);
},
onCancel() { },
})
}
}
}

View File

@ -0,0 +1,190 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { Condition, getAdButtons } from '../list/listCondition';
import { WeaTableNew } from 'comsMobx';
import { WeaRightMenu, WeaTop, WeaTab, WeaErrorPage, WeaTools, WeaAlertPage, WeaLeftRightLayout, WeaOrgTree, WeaLocaleProvider } from 'ecCom';
const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
@inject('projectLogStore')
@observer
class ProjectLog extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
this.doInit(this.props);
}
doInit(props) {
const { params, projectLogStore } = props;
const { initDatas } = projectLogStore;
initDatas(params);
}
componentWillReceiveProps(nextProps) {
const keyOld = this.props.location.key;
const keyNew = nextProps.location.key;
const oldParams = this.props.params.logtype;
const newParams = nextProps.params.logtype;
if (keyOld !== keyNew || oldParams !== newParams) {
const { projectLogStore, params } = nextProps;
const { initDatas } = projectLogStore;
projectLogStore.clearStatus();
projectLogStore.resetTable();
initDatas(params);
}
}
componentWillUnmount() {
const { projectLogStore } = this.props;
projectLogStore.clearStatus();
}
render() {
const { projectLogStore } = this.props;
const topTab = [{
key: '0',
title: getLabel(332, "全部")
}, {
key: '1',
title: getLabel(15537, "今天")
}, {
key: '2',
title: getLabel(15539, "本周")
}, {
key: '3',
title: getLabel(15541, "本月")
}, {
key: '4',
title: getLabel(21904, "本季")
}, {
key: '5',
title: getLabel(15384, "本年")
}
]
const { title, loading, tableStore, showSearchAd, form, searchParams, isright, reLoad ,detachable } = projectLogStore;
const formParams = form.getFormParams() || {};
if (!isright) {
return (
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@372epb`}>
<div style={{ color: '#000' }}>
{getLabel(2012, "对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
const content = [];
const tabCom = <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@1ucufx`}
datas={topTab}
keyParam="key" //主键
selectedKey={searchParams.tabkey}
buttonsAd={getAdButtons(projectLogStore,this.props.ecId || '')}
searchType={['base', 'advanced']}
searchsBaseValue={formParams.name}
setShowSearchAd={bool => { projectLogStore.setShowSearchAd(bool) }}
hideSearchAd={() => projectLogStore.setShowSearchAd(false)}
searchsAd={
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@y0cz15`} listStore={projectLogStore} form={form} onEnterSearch={this.onEnterSearch} ></Condition></div>
}
showSearchAd={showSearchAd}
onSearch={v => { projectLogStore.doSearch(v) }}
onSearchChange={v => {projectLogStore.appendFormFields({name:{value: v}}) }}
onChange={this.changeData}
/>
const tableCom = <WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@blqfsv`}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true}
register_table={() => reLoad()}
/>
if (detachable) {
content.push(
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@uj1nyf@layout`} isNew={true} leftCom={this.getOrgTree()}>
{tabCom}
{tableCom}
</WeaLeftRightLayout>,
);
} else {
content.push(tabCom);
content.push(tableCom);
}
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@rauywj`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@l9j6ev`}
title={title}
loading={loading}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={[]}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
onDropMenuClick={this.onRightMenuClick.bind(this)}
>
{content}
</WeaTop>
</WeaRightMenu>)
}
getRightMenu() {
const { projectLogStore } = this.props;
const { rightMenu } = projectLogStore;
let btnArr = [];
rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName
})
});
return btnArr
}
onRightMenuClick(key) {
const { projectLogStore } = this.props;
const { rightMenu } = projectLogStore;
let that = this;
rightMenu && rightMenu.length > 0 && rightMenu.map((m, i) => {
if (Number(key) == i) {
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
if (m.type == "BTN_SEARCH") { //定制列
projectLogStore.doSearch();
} if (m.type == "BTN_COLUMN") { //定制列
projectLogStore.onShowColumn();
}
}
});
}
changeData = (key) => {
const { projectLogStore } = this.props;
projectLogStore.setShowSearchAd(false);
projectLogStore.setSearchParams({ tabkey: key });
projectLogStore.doSearch();
}
getOrgTree(){
const {projectLogStore} = this.props;
return(
<WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@9cefh7`}
key={this.props.location.key}
ref="orgTree"
params={{rightStr:'LogView:View'}}
needSearch={true}
inputLeftDom={`<b>${getLabel(25332,'组织结构')}</b>`}
treeNodeClick={(event, ids, nodeids, nodes)=>{
let subCompanyId = ids[0];
projectLogStore.updateSubCompanyId(subCompanyId);
}}
/>
)
}
onEnterSearch=() =>{
const { projectLogStore } = this.props;
projectLogStore.doSearch();
projectLogStore.setShowSearchAd(false);
}
}
export default WeaTools.tryCatch(React,
props => <WeaErrorPage ecId={`${this && this.props && this.props.ecId || ''}_WeaErrorPage@1wnv8y`} msg={props.error ? props.error : getLabel(383324, "对不起,该页面异常,请联系管理员")} />,
{ error: "" }
)(ProjectLog);

View File

@ -0,0 +1,35 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import {toJS} from "mobx"
import { Tree, Menu, TopTitle,Form } from 'modeCom'
import {WeaTableNew} from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
import equals from 'deep-equal';
import classnames from 'classnames';
@inject("prjResourceStore")
@observer
class PrjResource extends React.Component {
constructor(props) {
super(props);
}
componentDidMount = () => {
}
render() {
const {prjResourceStore} = this.props;
const {dataKey,tableStore} = prjResourceStore;
tableStore.readAll();
return (
<WeaTable
sessionkey={dataKey}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true} />
)
}
}
export default PrjResource;

View File

@ -0,0 +1,222 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import {toJS} from "mobx"
import { Tree, Menu, TopTitle,Form } from 'modeCom'
import { WeaTools, WeaErrorPage ,WeaNewScroll, WeaRightMenu ,WeaTop,WeaDialog } from 'ecCom';
// import Field from '../../comp/field-element';
import equals from 'deep-equal';
import classnames from 'classnames';
class ProcessList extends React.Component {
static defaultProps = {
prefixCls: `111-card`,
dataSource:{
"isOpen": {
"value": '0',
"valueSpan":""
},
"conInfo": {
"value": '1',
"valueSpan":"应用"
},
"address": {
"value": "jfashljk",
"valueSpan": "",
},
"appKey": {
"valueSpan": "",
"value": "去玩儿群无"
},
"customerType": {
"value": {
"customer": "",
"gongyingshang": "1",
"fenxiaosahng":""
}
},
"cach": {
"valueSpan": "",
"value": "1"
},
"day": {
"valueSpan": "",
"value": "1"
}
},
"collapse": true,
"defaultActiveCollapse": [
"base"
],
"groups": [
{
"key": "base",
"name": "应用设置",
"rows": [
{
"cols": [
{
"field": {
"colSpan": 1,
"component": "4",
"dataIndex": "isOpen",
"isSingle": true,
"key": "isOpen",
"title": "是否开启",
"type": "3",
"viewAttr": 2
},
"span": 24
}
]
},
{
"cols": [
{
"field": {
"colSpan": 1,
"component": "8",
"dataIndex": "comeInfo",
"isSingle": true,
"key": "comeInfo",
"options": [
{
"label": "应用",
"title": "应用",
"value": "1"
}
],
"title": "信息来源",
"type": "select",
"viewAttr": 2,
},
"span": 24
}
]
}, {
"cols": [
{
"field": {
"colSpan": 1,
"component": "1",
"dataIndex": "address",
"isSingle": true,
"key": "address",
"title": "接口地址",
"type": "1",
"viewAttr": 2
},
"span": 24
}
]
}, {
"cols": [
{
"field": {
"colSpan": 1,
"component": "1",
"dataIndex": "appkey",
"isSingle": true,
"key": "appkey",
"title": "APP_KEY",
"type": "1",
"viewAttr": 2
},
"span": 24
}
]
}
, {
"cols": [
{
"field": {
"colSpan": 1,
"component": "4",
"dataIndex": "customerType",
"isSingle": false,
"key": "customerType",
"title": "适用客户类型",
"type": "group",
checkType:"checkBox",
"labels": [
{
"dataIndex": "customer",
"title": "客户"
}, {
"dataIndex": "gongyingshang",
"title": "供应商"
}, {
"dataIndex": "fenxiaoshang",
"title": "分销商"
},
],
"viewAttr": 2
},
"span": 24
}
]
},{
"cols": [
{
"field": {
"colSpan": 1,
"component": "4",
"dataIndex": "cach",
"isSingle": true,
"key": "cach",
"title": "是否缓存数据",
"type": "3",
"viewAttr": 2
},
"span": 24
}
]
},{
"cols": [
{
"field": {
"colSpan": 1,
"component": "1",
"dataIndex": "day",
"isSingle": true,
"key": "day",
"title": "缓存保存天数",
"type": "2",
"viewAttr": 2
},
"span": 24
}
]
},
]
}
],
}
constructor(props) {
super(props);
}
componentDidMount = () => {
}
render() {
const {groups = [], collapse = false, rightMenu = [], top,defaultActiveCollapse,height,dataSource,hasright} =this.props;
return (
<div >
<Form
groups={groups}
dataSource={dataSource}
collapse={true}
noBorder={false}
defaultActiveCollapse={toJS(defaultActiveCollapse)}
updateDataSource={this.updateDataSource}
// update={this.updatePageConfig}
size="middle" >
</Form>
</div>
)
}
}
export default ProcessList;

View File

@ -0,0 +1,230 @@
import React from 'react';
import { Button, Tabs,Card,Pagination,Row,Col } from 'antd';
import { inject, observer } from 'mobx-react';
import { Tree, Menu, TopTitle,Form } from 'modeCom'
import { WeaNewScroll, WeaRightMenu,WeaPopoverHrm } from 'ecCom';
import {toJS} from "mobx"
import Immutable from 'immutable';
const is = Immutable.is;
const NavTree = Tree.NavTree;
import PrjKanBan from "../comp/kanban"
import ProcessList from './ProcessList'
import Prjschedule from '../comp/Prjschedule'
import PrjResource from './PrjResource'
const datas = [
{
name: "应用1",
primaryKey: "1",
parentKey: "",
children: [{
name: "应用2",
primaryKey: "2",
parentKey: "1",
}]
}
]
const datas2 = [
{
name: "项目1",
primaryKey: 1,
subName: "aaaaaa"
}
]
const getDocker = { getDockerHeight: () => document.documentElement.clientHeight };
@inject("projectStore")
@inject("prjResourceStore")
@observer
class Project extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
const {projectStore} = this.props;
projectStore.getLeftList();
}
handleClick = () => {
}
render() {
const {projectStore} = this.props;
const leftdatas = toJS(projectStore.status.leftdatas);
const middatas = toJS(projectStore.status.middatas);
const midCurrent = projectStore.status.midCurrent;
const tabkey = projectStore.status.tabkey;
const {groups = [], collapse = false, rightMenu = [], top,defaultActiveCollapse,height,dataSource,hasright} =this.props;
const prjinfo = toJS(projectStore.status.prjinfo);
const columns = [
{
title: '立项阶段',
key: '1',
items: [
{ title: '项目交底', key: '1' },
{ title: '项目启动任务', key: '2' },
]
},
{
title: '搭建阶段',
key: '2',
items: [
{ title: '项目交底', key: '4' },
{ title: '人力资源模块调研', key: '5' },
{ title: '文档模块需求调研', key: '6' },
]
},
{
title: '上线阶段',
key: '3',
items: [
{ title: '项目交底', key: '7' },
{ title: '人力资源模块调研', key: '8' },
{ title: '文档模块需求调研', key: '9' },
]
},
{
title: '测试阶段',
key: '4',
items: [
{ title: '项目交底', key: '12' },
{ title: '人力资源模块调研', key: '11' },
{ title: '文档模块需求调研', key: '13' },
]
}
];
return (
<NavTree
top={{ name: '类型', placeholder: '请输入关键字搜索' }}
datas={leftdatas.datas}
defaultExpandedKeys={["1"]}
selectedKeys = {leftdatas.selectedKeys}
getDocker={{ getDockerHeight: () => document.documentElement.clientHeight }}
onSelect={this.onSelect}
>
<Menu
top={{ name: '项目', icon: "icon-coms-project", iconBgcolor: "#217346", placeholder: "请输入关键字搜索" }}
datas={middatas.datas}
selectedKey={middatas.selectedKey}
getDocker={{ getDockerHeight: () => document.documentElement.clientHeight }}
leftWidth={300}
current = {midCurrent}
pageSize = {projectStore.status.pageSize}
total={middatas.totalSize}
onSelect={this.onPrjSelect}
onPaginationChange = {this.onPaginationChange}
>
<TopTitle name={projectStore.status.prjname} icon="icon-coms-project" iconBgcolor="#217346" style={{background:'#fff'}} loading={projectStore.status.loading}>
<Tabs defaultActiveKey={'1'} activeKey={tabkey} onChange={this.changeTab}>
<Tabs.TabPane key="1" tab="项目信息">
<WeaRightMenu
datas={this.getRightMenu()}
onClick={this.onRightMenuClick}
>
{prjinfo.defaultActiveCollapse &&
<WeaNewScroll height={700}><Form
groups={prjinfo.groups}
dataSource={prjinfo.dataSource}
collapse={true}
noBorder={false}
defaultActiveCollapse={toJS(prjinfo.defaultActiveCollapse)}
updateDataSource={this.updateDataSource}
// update={this.updatePageConfig}
size="middle" >
</Form>
</WeaNewScroll>}
</WeaRightMenu>
</Tabs.TabPane>
<Tabs.TabPane key="2" tab="日报">
<Prjschedule></Prjschedule>
</Tabs.TabPane>
<Tabs.TabPane key="3" tab="资源">
<PrjResource></PrjResource>
</Tabs.TabPane>
<Tabs.TabPane key="4" tab="看板">
<PrjKanBan columns={columns} />
</Tabs.TabPane>
<Tabs.TabPane key="5" tab="甘特图">
<iframe src={"/proj/gantt/gantt.jsp?projectid=8&ProjID=8"} id="prjtabiframe" name="prjtabiframe" className="flowFrame" frameborder="0" width="100%" height="800px" />
</Tabs.TabPane>
</Tabs>
</TopTitle>
</Menu>
</NavTree>
)
}
onSelect = (selectedKeys) =>{
const {projectStore} = this.props;
if (selectedKeys && selectedKeys.length > 0){
projectStore.getMidList({'prjtype':selectedKeys[0]})
}
}
onPrjSelect = (selectedKey) =>{
const {projectStore} = this.props;
projectStore.getProjectView({'prjid':selectedKey})
}
onPaginationChange = (pageparams) =>{
const {projectStore} = this.props;
projectStore.setMidCurrent(pageparams.current);
projectStore.getMidList({'prjtype':projectStore.status.prjtype,pageindex:pageparams.current})
}
updateDataSource = (fields)=>{
const {projectStore} = this.props;
const prjdatas = toJS(projectStore.status.prjdatas);
projectStore.updateDataSource({...prjdatas,...fields});
}
getRightMenu = () => {
const {projectStore} = this.props;
const rightMenu = projectStore.status.prjinfo.rightMenu;
let btnArr = [];
rightMenu && !is(rightMenu, Immutable.fromJS({})) && rightMenu.map(m => {
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
disabled: m.isControl == '1'
})
});
return btnArr
}
onRightMenuClick = (key) => {
const {projectStore} = this.props;
const rightMenu = projectStore.status.prjinfo.rightMenu;
rightMenu && rightMenu.map((m, i) => {
if (Number(key) == i) {
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
if (fn == "") {
if (m.type == "BTN_EDIT") { //编辑
projectStore.editProject({'prjid':projectStore.status.prjid,'viewtype':'edit'})
}else if(m.type == "BTN_SAVE") {
projectStore.doProjectSave();
}else if(m.type == "BTN_BACK") {
projectStore.doProjectBack();
}
}
}
});
}
changeTab = (tabkey) =>{
const {projectStore,prjResourceStore} = this.props;
projectStore.setTabKey(tabkey);
if(tabkey=='3'){
prjResourceStore.doSearch({'prjid':projectStore.status.prjid})
}
}
}
export default Project;

View File

@ -0,0 +1,56 @@
import React from 'react';
import { WeaTop, WeaRightMenu, WeaLocaleProvider } from 'ecCom';
import ListView from '../comp/view-list';
import { observer } from 'mobx-react';
import { Spin } from "antd";
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class ItemList extends React.Component{
render() {
const { title, store } = this.props;
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@abp2kv`}
datas={[{
key: 'addNewRemind',
content: getLabel(82210, "新建提醒"),
icon: <i className="icon-coms-New-Flow" />,
}]}
onClick={this.doRightMenuAction.bind(this)}
>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@kvfx7z`}
title={title}
icon={<i className='icon-coms-Delayed' />}
iconBgcolor='#217346'
>
<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@d7pjro`} spinning={false} >
<ListView ecId={`${this && this.props && this.props.ecId || ''}_ListView@pc7x10`}
datas={store.remindList}
onItemClick={store.changeSelectedKey}
pagination={{
current:store.pagination.current,
pageSize:store.pagination.pageSize,
total:store.pagination.total,
onChange:store.onChangePaginNation
}}
currentKey={store.currentKey}
scrollHeight={document.documentElement.clientHeight-165}
onSearchListItem={store.onSearchListItem}
onSearchChange={store.onSearchChange}
prjValue={store.prjValue}
/>
</Spin>
</WeaTop>
</WeaRightMenu>
)
}
doRightMenuAction(key){
const { store } = this.props;
if(key == "addNewRemind"){
store.remindId = '-1';
store.getRemindInfo();
}
}
}

View File

@ -0,0 +1,71 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { WeaLeftRightLayout, WeaAlertPage } from 'ecCom';
import { toJS } from "mobx";
import ItemList from "./ItemList";
import TreeList from "./TreeList";
import RemindBase from "./RemindBase";
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
@inject("prjRemindStore")
@observer
class ProjectRemind extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
const { prjRemindStore } = this.props;
prjRemindStore.initList();
}
componentWillReceiveProps(nextProps){
const keyOld = this.props.location.key;
const keyNew = nextProps.location.key;
if(keyOld !== keyNew) {
const {prjRemindStore} = nextProps;
prjRemindStore.initList();
}
}
render() {
const { prjRemindStore } = this.props;
const { isright,isFormInit } = prjRemindStore;
if(isFormInit){
if (!isright) {
return(
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@99wrsf`}>
<div style={{color : '#000'}}>
{getLabel(2012,"对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
return (
<div className="prj-board-page">
{/* <Spin spinning={ prjCardStore.loading || projectBoardStore.loading}> */}
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@9b3xwe`}
isNew={true}
col={3}
leftWidth={320}
leftCom={<TreeList ecId={`${this && this.props && this.props.ecId || ''}_TreeList@mhoepa`} title={getLabel('586',"项目类型")} key={this.props.location.key} store={prjRemindStore} />}
midWidth={320}
midCom={(<ItemList ecId={`${this && this.props && this.props.ecId || ''}_ItemList@9rvq4f`} title={getLabel('15148', "提醒")} store={prjRemindStore} />
)}
// onCollapse={(side,bool)=>{onCollapse(side,bool)}}
>
<RemindBase ecId={`${this && this.props && this.props.ecId || ''}_RemindBase@3mj1hp`} PrjRemindStore={prjRemindStore} />
</WeaLeftRightLayout>
{/* </Spin> */}
</div>
)
}else{
return(
<div>
</div>
)
}
}
}
export default ProjectRemind;

View File

@ -0,0 +1,45 @@
import React from 'react';
import { observer } from 'mobx-react';
import { WeaTop, WeaRightMenu } from 'ecCom';
import _ from 'lodash';
import RemindBaseForm from './RemindBaseForm';
@observer
export default class RemindBase extends React.Component {
render() {
const { PrjRemindStore } = this.props;
return (
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@wajgo6`}
title={ PrjRemindStore.title }
loading={false}
icon={<i className='icon-coms-currency' />}
iconBgcolor="#96358a"
showDropIcon={true}
dropMenuDatas={PrjRemindStore.getTopMenu()}
onDropMenuClick={this.doRightMenuAction.bind(this)}
buttons={PrjRemindStore.getTopButton()}
>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@mq9dav`}
datas={PrjRemindStore.getTopMenu()}
onClick={this.doRightMenuAction.bind(this)}
>
<RemindBaseForm ecId={`${this && this.props && this.props.ecId || ''}_RemindBaseForm@55bo2p`} CommonStore={PrjRemindStore} />
</WeaRightMenu>
</WeaTop>
)
}
doRightMenuAction(key){
const { PrjRemindStore } = this.props;
if(key == "addNewRemind"&&PrjRemindStore.remindId!=-1){
PrjRemindStore.remindId = '-1';
PrjRemindStore.getRemindInfo();
}else if(key == "save"){
PrjRemindStore.save();
}else if(key == "delete"&&PrjRemindStore.remindId!=-1){
PrjRemindStore.delete();
}
}
}

View File

@ -0,0 +1,374 @@
import React from 'react';
import { toJS } from "mobx";
import { WeaSwitch } from 'comsMobx';
import { observer } from 'mobx-react';
import { InputNumber } from "antd";
import { WeaNewScroll , WeaSelect , WeaFormItem, WeaInput, WeaLocaleProvider, WeaError, WeaCheckbox, WeaSelectGroup, WeaSearchGroup, WeaHelpfulTip, WeaTextarea } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
import RemindPerson from './RemindPerson';
@observer
export default class RemindBaseForm extends React.Component {
// componentWillMount() {
// const { CommonStore } = this.props;
// CommonStore.initRightPage();
// }
render() {
const { CommonStore } = this.props;
return (
<div className="cube-remind-base-form">
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@sbn1k0`} height={CommonStore.contentHeight - 90}>
{this.getFormItems()}
</WeaNewScroll>
</div>
)
}
getFormItems() {
const { CommonStore } = this.props;
const { datas, changeDatas, fieldChange, initConditionField } = CommonStore;
let html = <div />;
const formlabelcol = { labelCol: { span: 4 }, wrapperCol: { span: 18 } };
let items1 = [];
let items2 = [];
let items3 = [];
/***基本信息 */
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@4oucm4`} label='ID' {...formlabelcol} >
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@34rvhs`} fieldName="ID" viewAttr={1} value={datas.id} />
</WeaFormItem>)
});
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@okhi4m`} label={getLabel(33439, "名称")} {...formlabelcol} >
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@n0ryuw`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(33439, "名称") + '"' + getLabel(21423, "未填写")}
ref={ref => {CommonStore.nameremind = ref;}}>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@10hcqo`} fieldName="name" viewAttr={3} value={datas.name} onChange={(value) => { changeDatas({'name':value}) }} isBase64={true} inputType="multilang" />
</WeaError>
</WeaFormItem>)
});
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@lma0s4`} label={getLabel(586,"项目类型")} {...formlabelcol} >
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@3qi436`} fieldName="prjtype" viewAttr={1} value={datas.prjtype} />
</WeaFormItem>)
});
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@e8kqhy`} label={getLabel(18624, "是否启用")} {...formlabelcol} >
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@t90fij`} fieldName="isenable" display="switch" value={datas.isenable} onChange={(value) => { changeDatas({'isenable':value}) }} />
</WeaFormItem>)
});
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@yqfoil`} label={getLabel(82212, "提醒类型")} {...formlabelcol} >
<WeaSelectGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSelectGroup@9lfmyk`}
isMobx
value={toJS(datas.remindtype)}
options={[
{
"key": "1",
"selected": true,
"showname": getLabel(82213, "即时提醒")
}, {
"key": "2",
"selected": false,
"showname": getLabel(17497, "到期提醒")
}
]}
selectLinkageDatas={{
'1': {
conditionType: 'SELECT',
domkey: ['SELECT'],
options:[
{
"key": "1",
"selected": true,
"showname": getLabel(81937, "项目创建")
}, {
"key": "2",
"selected": false,
"showname": getLabel(501070, "项目状态变更")
}, {
"key": "3",
"selected": false,
"showname": getLabel(501071, "任务创建")
}, {
"key": "4",
"selected": false,
"showname": getLabel(501072, "任务变更")
}
]
},
'2': {
conditionType: 'SELECT',
domkey: ['SELECT'],
options:[
{
"key": "5",
"selected": true,
"showname": getLabel(501073, "任务预警")
}, {
"key": "6",
"selected": false,
"showname": getLabel(501074, "任务超期")
}
]
},
}}
onChange={(value) => { changeDatas({'remindtype':value});changeDatas({'contentselect':new Date()});changeDatas({'titleselect':new Date()});initConditionField(); }}
/>
</WeaFormItem>)
});
if (datas.remindtype&&datas.remindtype[1][0]=='3') {
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@yzqukv`} label={getLabel(501198, "项目创建时是否提醒")} {...formlabelcol} >
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@ybj85x`} fieldName="iscreate" display="switch" value={datas.iscreate} onChange={(value) => { changeDatas({'iscreate':value}) }} />
</WeaFormItem>)
});
}
if (datas.remindtype&&(datas.remindtype[1][0]=='5' || datas.remindtype[1][0]=='6')) {
items1.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@zxnts4`} label={getLabel(82215, "到期时间")} {...formlabelcol} >
<div style={{ display: "inline-block", position: 'absolute', left: '0', top: '7px' }}>{getLabel(82217, "日期字段") + ":"}</div>
<div style={{ width: '200px', display: 'inline-block', position: 'absolute', left: '60px' }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@9qdhpm`}
value={datas.reminddatefield}
style={{marginLeft:'10px'}}
options={datas.dateOptions}
onChange={(value)=> { changeDatas({'reminddatefield':value}) } }
/>
</div>
<div style={{ position: 'absolute', display: 'inline-block', marginLeft: '385px', top: '7px' }}>{getLabel(82218, "时间字段") + ":"}</div>
<div style={{ width: '200px', display: 'inline-block', position: "absolute", left: '445px' }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@ldwh7v`}
value={datas.remindtimefield}
style={{marginLeft:'10px'}}
options={datas.timeOptions}
onChange={(value)=> { changeDatas({'remindtimefield':value}) } }
/>
</div>
</WeaFormItem>
)
})
items1.push({
com:(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@x29fgj`} label={getLabel(501140, "提前/超期天数")} {...formlabelcol} >
{/* <WeaError tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(82212, "提前/超期天数") + '"' + getLabel(21423, "未填写")}
ref={ref => { remind.push(ref); }}> */}
<InputNumber ecId={`${this && this.props && this.props.ecId || ''}_InputNumber@34f16a`} min={0} max={100} step={1} value={datas.reminddays} onChange={(value) => {changeDatas({ 'reminddays': value });}} />
{/* </WeaError> */}
</WeaFormItem>
)
})
}
/***提醒方式 */
items2.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@9pgm28`} label={getLabel(17586, "短信提醒")} {...formlabelcol} >
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@jsqmk3`} fieldName="remindSMS" display="switch" value={ datas.remindSMS } onChange={(value) => { changeDatas({'remindSMS':value}) }} />
</WeaFormItem>)
});
items2.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@fk4wq3`} label={getLabel(18845, "邮件提醒")} {...formlabelcol} >
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@fm33pp`} fieldName="remindEmail" display="switch" value={ datas.remindEmail } onChange={(value) => { changeDatas({'remindEmail':value}) }} />
</WeaFormItem>)
});
items2.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@iu1u0n`} label={getLabel(23042, "流程提醒")} {...formlabelcol} >
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@c9ow6e`} fieldName="remindWorkflow" display="switch" value={ datas.remindWorkflow } onChange={(value) => { changeDatas({'remindWorkflow':value}) }} />
</WeaFormItem>)
});
items2.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@q0kei7`} label={getLabel(383607, "消息中心提醒")} {...formlabelcol} >
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@i475g5`} fieldName="remindMC" display="switch" value={ datas.remindMC } onChange={(value) => { changeDatas({'remindMC':value}) }} />
</WeaFormItem>)
});
/***提醒信息 */
//提醒条件
items3.push({
com: ( <WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@slg0k9`} label={getLabel(82227, "提醒条件")} {...formlabelcol} >
<div style={{ display: "inline-block", position: 'absolute', left: '0', top: '7px' }}>{getLabel(33331, "字段") + ":"}</div>
<div style={{ width: '200px', display: 'inline-block', position: 'absolute', left: '60px' }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@9vilnj`}
key={new Date()}
value={ datas.conditionfield }
options={this.getOptions1()}
onChange={(v)=> { fieldChange(v) }}
/>
</div>
<div style={{ position: 'absolute', display: 'inline-block', marginLeft: '385px', top: '7px' }}>{getLabel(19113, "值") + ":"}</div>
<div style={{ width: '200px', display: 'inline-block', position: "absolute", left: '445px' }}>
{this.getFormCondition()}
</div>
</WeaFormItem>)
});
if ( datas.remindSMS == "1" || datas.remindWorkflow == "1" ) {
//提醒发起人
if( datas.remindtype[1][0]=='1' || datas.remindtype[1][0]=='2' ){
items3.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@oyvwde`} label={getLabel(128874, "提醒发起人")} {...formlabelcol} >
<div style={{ whiteSpace: "nowrap" }}>
<div style={{ width: 200, display: "inline-block" }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@ka2mjf`} widthMatchOptions={true} options={
[
{
"key": "1",
"selected": true,
"showname": getLabel(16139, "系统管理员")
}, {
"key": "2",
"selected": false,
"showname": getLabel(16573, "项目经理")
}
]
} style={{ width: 200 }} fieldName="sendertype" value={ datas.sendertype } onChange={(value) => { changeDatas({'sendertype':value}); }} />
</div>
<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@hvremu`} width={150} title={getLabel(501378, "短信或流程提醒时生效") + "<br/>"+ getLabel(501380, "选择任务负责人时,第一个任务负责人作为发起人")} />
</div>
</WeaFormItem>)
});
}else{
items3.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@9t8j9q`} label={getLabel(128874, "提醒发起人")} {...formlabelcol} >
<div style={{ whiteSpace: "nowrap" }}>
<div style={{ width: 200, display: "inline-block" }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@eyuoqm`} widthMatchOptions={true} options={
[
{
"key": "1",
"selected": true,
"showname": getLabel(16139, "系统管理员")
}, {
"key": "3",
"selected": false,
"showname": getLabel(15285, "任务负责人")
}
]
} style={{ width: 200 }} fieldName="sendertype" value={ datas.sendertype } onChange={(value) => { changeDatas({'sendertype':value}); }} />
</div>
<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@1caxsy`} width={150} title={getLabel(501378, "短信或流程提醒时生效") + "<br/>"+ getLabel(501380, "选择任务负责人时,第一个任务负责人作为发起人")} />
</div>
</WeaFormItem>)
});
}
}
//提醒标题
if ( datas.remindEmail == "1" || datas.remindWorkflow == "1" || datas.remindMC == "1" ) {
items3.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@xi0lms`} label={getLabel(125926, "提醒标题")} {...formlabelcol} >
<div style={{ width: 200, marginBottom: 5 }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@30u3pz`} key={new Date()} widthMatchOptions={true} value={ datas.titleselect } options={this.getOptions()} style={{ width: 200 }} onChange={(value) => {
changeDatas({'titleselect':value});
changeDatas({'remindtitle':datas.remindtitle+"$"+value+"$"});
setTimeout(()=>{
var Browser_Name=navigator.appName;
var isIE=(Browser_Name=="Microsoft Internet Explorer");//判读是否为ie浏览器
var textNode=document.getElementById("remindtitle");//keyword为要操作的文本框的ID根据情况修改
textNode.focus();
var count=textNode.value.length;
textNode.selectionStart=count;
if(isIE){
var f = textNode.createTextRange();//创建文本范围对象
f.moveStart('character',count); //更改范围起始位置/*如果count改为0就把光标放在text中的字符的最前面*/
f.collapse(true); //将插入点移动到当前范围的开始或结尾。
f.select(); //将当前选中区置为当前对象,执行
}else{
textNode.setSelectionRange(count,count);
}
},100);
}} />
</div>
<div style={{ width: 300, display: "inline-block", marginRight: 13 }}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@4okk05`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(125926, "提醒标题") + '"' + getLabel(21423, "未填写")}
ref={ref => { CommonStore.titleremind = ref; }}>
<WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@pqi64k`} id="remindtitle" viewAttr={3} fieldName="remindtitle" value={ datas.remindtitle } onChange={(value) => { changeDatas({'remindtitle':value}) }} />
</WeaError>
</div>
<WeaHelpfulTip ecId={`${this && this.props && this.props.ecId || ''}_WeaHelpfulTip@l91m3d`} width={300} title={getLabel(558, '提示') + ":" + "<br/> " +
getLabel(385572, "标题可以取表单字段的值可通过上面的select框进行选择字段表现形式为$fieldname$,") + "<br/> " +
getLabel(501145, "其中fieldname为所选择表单中的字段,类型为项目创建、项目状态变更,表单为项目表单,其他类型为任务表单") + "<br/> " +
getLabel(501146, "邮件提醒、流程提醒或消息中心提醒时生效.")
} />
</WeaFormItem>)
});
}
items3.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@y6owyi`} label={getLabel(27415, "提醒内容")} {...formlabelcol} >
<div style={{ width: 200, marginBottom: 5 }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@fcf7ut`} key={new Date()} widthMatchOptions={true} value={datas.contentselect} options={ this.getOptions() } onChange={(value) => { changeDatas({'contentselect':value});changeDatas({'remindcontent':datas.remindcontent+"$"+value+"$"}); }} />
</div>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@jf6bkd`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(27415, "提醒内容") + '"' + getLabel(21423, "未填写")}
ref={ref => { CommonStore.contentremind = ref; }}>
<WeaTextarea ecId={`${this && this.props && this.props.ecId || ''}_WeaTextarea@8q6enx`} fieldName="remindcontent" viewAttr={3} value={datas.remindcontent} onChange={(value) => { changeDatas({'remindcontent':value}); }} />
</WeaError>
</WeaFormItem>)
});
items3.push({ com: (<RemindPerson ecId={`${this && this.props && this.props.ecId || ''}_RemindPerson@8t0l63`} datas={datas} store={CommonStore} />) });
html = <div className="cube-remind-form" >
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@8x0ia2`} needTigger={true} title={getLabel(1361, '基本信息')} col={1} showGroup={true} items={items1} />
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@afabll`} needTigger={true} title={getLabel(18713, '提醒方式')} col={1} showGroup={true} items={items2} />
<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@khdec6`} needTigger={true} title={getLabel(18121, '提醒信息')} col={1} showGroup={true} items={items3} />
</div>;
// if (formloading) html = <Spin>{html}</Spin>;
return html;
}
getOptions() {
const { CommonStore } = this.props;
const { datas } = CommonStore;
if(!datas.remindtype){
return datas.prjTypeFieldOptions;
}else if(datas.remindtype[1][0]=='1' || datas.remindtype[1][0]=='2'){
return datas.prjTypeFieldOptions;
}else{
return datas.prjTskFieldOptions;
}
}
getOptions1() {
const { CommonStore } = this.props;
const { datas } = CommonStore;
let options = [];
options.push({key:'',value:''})
if(!datas.remindtype){
datas.prjTypeFieldOptions1&&datas.prjTypeFieldOptions1.map(c =>{
options.push(c);
})
}else if(datas.remindtype[1][0]=='1' || datas.remindtype[1][0]=='2'){
datas.prjTypeFieldOptions1&&datas.prjTypeFieldOptions1.map(c =>{
options.push(c);
})
}else{
datas.prjTskFieldOptions1.slice(1).map(c =>{
if(c.key!='stageid'){
options.push(c);
}
})
}
return options;
}
getFormCondition = () => {
const {bmform,bmCondition,changeDatas,datas} = this.props.CommonStore;
const {isFormInit} = bmform;
let items = [];
isFormInit && datas.conditionfield && bmCondition.map((c,i) =>{
c.items.map(fields => {
items.push(
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@efjl7s@${i}`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(19113, "值") + '"' + getLabel(21423, "未填写")}
ref={ref => { this.props.CommonStore.valueremind = ref; }}>
<WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@t1xuop@${i}`} fieldConfig={fields} form={bmform} onChange={(value) =>{changeDatas({'conditionfieldvalue':value});}}/>
</WeaError>
)
});
});
return items;
}
}

View File

@ -0,0 +1,185 @@
import React from 'react';
import { action, toJS } from "mobx";
import { WeaError, WeaFormItem, WeaSelect, WeaBrowser, WeaLocaleProvider, WeaScope } from 'ecCom';
import { observer } from 'mobx-react';
import { InputNumber } from "antd";
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class RemindPerson extends React.Component {
render() {
const formlabelcol = { labelCol: { span: 4 }, wrapperCol: { span: 16 } };
const { datas, store} = this.props;
const { appDetachDisableAll} = store;
const remindOptions = [{
"key": "1",
"selected": true,
"showname": getLabel(30042, "人员")
}, {
"key": "2",
"selected": false,
"showname": getLabel(141, "分部")
}, {
"key": "3",
"selected": false,
"showname": getLabel(124, "部门")
}, {
"key": "4",
"selected": false,
"showname": getLabel(122, "角色")
}, {
"key": "5",
"selected": false,
"showname": getLabel(1340, "所有人")
}, {
"key": "1000",
"selected": false,
"showname": getLabel(501147, "项目任务字段")
}
];
if( appDetachDisableAll){
remindOptions.splice(4,1);
}
let item = [];
item.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@a5j2ol`} label={getLabel(26731, "提醒人员")} {...formlabelcol}>
<div className="cube-wea-form-item-remind" style={{ marginTop: "10px" }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@bky05a`} widthMatchOptions={true} options={remindOptions} style={{ width: 200 }} fieldName="receivertype"
value={ datas.receivertype }
onChange={(value) => {
store.changeDatas({'receiverfield':''});
store.changeDatas({'receivertype':value});
store.changeDatas({'receiverdetail':''});
}} />
{datas.receivertype == "1000" &&
<div style={{ display: "inline-block", marginLeft: 10 }}>{getLabel(84113, '字段类型')}
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@pkjif6`}
widthMatchOptions={true}
options={[{
"key": "1",
"selected": true,
"showname": getLabel(30042, "人员")
}, {
"key": "2",
"selected": false,
"showname": getLabel(141, "分部")
}, {
"key": "3",
"selected": false,
"showname": getLabel(124, "部门")
}
]}
style={{ width: 100 }}
fieldName="receiverfieldtype"
value={ datas.receiverfieldtype }
onChange={(value) => {
store.changeDatas({ 'receiverfieldtype': value });
store.changeDatas({'receiverfield':''});
}} />
</div>
}
</div>
</WeaFormItem>)
if (datas.receivertype == "1" || datas.receivertype == "2" || datas.receivertype == "3" || datas.receivertype == "4" || datas.receivertype == "1000") {
if (!(datas.receivertype == "1000")) {
//须选择完模块字段的字段类型
item.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@k3alao`} label={getLabel(33251, "选择")} {...formlabelcol}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@goodg9`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(33251, "选择") + '"' + getLabel(21423, "未填写")}
ref={ref => { store.browserremind = ref; }}>
<WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@un56wk`}
viewAttr={3}
fieldName="receiverfield"
onChange={(value, names, data) => {
store.changeDatas({ 'receiverfield':value });
store.changeDatas({ 'receiverdetail':data });
}}
replaceDatas={toJS(datas.receiverdetail)}
{...this.getCurrentBrowserData(datas.receivertype)}
/>
</WeaError>
</WeaFormItem>)
}else{
item.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@uwe8if`} label={getLabel(33251, "选择")} {...formlabelcol}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@j9agon`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(33251, "选择") + '"' + getLabel(21423, "未填写")}
ref={ref => { store.selectremind = ref; }}>
<WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@0664bx`}
fieldName="receiverfield"
multiple
style={{ width: 200 }}
options={ this.getOptions() }
value={datas.receiverfield}
viewAttr={3}
onChange={(value)=> {store.changeDatas({ 'receiverfield': value });}}
/>
</WeaError>
</WeaFormItem>)
}
}
if (datas.receivertype == "2" || datas.receivertype == "3" || datas.receivertype == "4" || datas.receivertype == "5" || datas.receivertype == "1000") {
item.push(<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@79aut1`} label={getLabel(683, "安全级别")} {...formlabelcol}>
<WeaError ecId={`${this && this.props && this.props.ecId || ''}_WeaError@bdqnpc`} tipPosition='bottom' style={{ width: "100%" }}
error={'"' + getLabel(683, "安全级别") + '"' + getLabel(21423, "未填写")}
ref={ref => { store.levelremind = ref; }}>
<WeaScope ecId={`${this && this.props && this.props.ecId || ''}_WeaScope@2vo9xd`}
isMobx
min={[-10000, 10000]}
max={[-10000, 10000]}
domkey={[
"seclevel",
"seclevelMax"
]}
value={[
datas.receiverlevel,
datas.receiverlevelmax
]}
onChange={v => {
store.changeDatas({ 'receiverlevel': v[0] });
store.changeDatas({ 'receiverlevelmax': v[1] });
if((!v[0]&&v[0]!==0)&&(!v[1]&&v[1]!==0)){
store.setLevelViewAttr(3);
}else{
store.setLevelViewAttr(2);
}
}
}
viewAttr={store.levelViewAttr}
/>
</WeaError>
</WeaFormItem>)
}
return (<div>{item}</div>)
}
getCurrentBrowserData = (value) => {
switch (value) {
case '1':
return { type: 17, isSingle: false, title: getLabel(125270, "多人力") };
case '2':
return { type: 164, isSingle: false, title: getLabel(141, "分部") };
case '3':
return { type: 4, isSingle: false, title: getLabel(124, "部门") };
case '4':
return { type: 267, isSingle: false, title: getLabel(122, "角色") };
}
}
getOptions = (value) => {
const { datas } = this.props;
if(!datas.receiverfieldtype){
return datas.prjAndTskHrmFieldOptions;
}else if(datas.receiverfieldtype=='1'){
return datas.prjAndTskHrmFieldOptions;
}else if(datas.receiverfieldtype=='2'){
return datas.prjAndTskComFieldOptions;
}else if(datas.receiverfieldtype=='3'){
return datas.prjAndTskDeptFieldOptions;
}
}
}

View File

@ -0,0 +1,56 @@
import React from 'react';
import { WeaTop, WeaLeftTree } from 'ecCom';
import { toJS } from 'mobx';
import { observer } from 'mobx-react';
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class TreeList extends React.Component {
constructor(props) {
super(props);
this.state = {
searchValue: ""
}
}
componentWillReceiveProps(nextProps) {
if (this.props.key !== nextProps.key) {
this.setState({
searchValue: ""
})
}
}
render() {
const { store, title } = this.props;
return (
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@34p04k`}
title={title}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
>
<div style={{ height: "100%",overflow:"hidden" }}>
<WeaLeftTree ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftTree@oiuka7`}
searchLabel={getLabel('21979',"全部类型")}
datas={toJS(store.treeDatas)}
selectedKeys={[store.selectedTreeKey]}
searchValue={this.state.searchValue}
onSearchChange={v => {
this.setState({
searchValue: v
})
}}
onSearchLabelClick ={()=>{
store.getTreeList();
}}
onSelect={(key)=>{
store.setSelectedTreeKey(key);
store.setPrjTypeId(key.replace('prjtype_',''));
}}
/>
</div>
</WeaTop>
)
}
}

View File

@ -0,0 +1,223 @@
import React from 'react';
import { Button } from 'antd';
import { inject, observer } from 'mobx-react';
import { WeaRightMenu, WeaReqTop, WeaNewScroll, WeaTools, WeaAlertPage, WeaLocaleProvider } from "ecCom"
import ProjectInfo from '../common/projectInfo'
import TaskList from '../common/taskList'
import StageList from '../common/stageList'
import TaskTempletImpDialog from '../dialog/taskTempletImpDialog'
const getLabel = WeaLocaleProvider.getLabel;
@inject('prjTempletCardStore')
@observer
class PrjTempletCard extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
const { prjTempletCardStore, location: { query } } = this.props;
const { getPrjTempletInfo } = prjTempletCardStore;
getPrjTempletInfo({ viewtype: 'view', ...query });
}
render() {
const { prjTempletCardStore } = this.props;
const { selectTabKey, loading, prjname, hasRight, prjisdel, taskTempletImpStore, taskTempletImpStore: { reflesh } } = prjTempletCardStore;
const tabs = [{ key: "prjinfo", title: getLabel(16290, "项目信息") }, { key: "sublist", title: getLabel(18505, "任务列表") }, { key: "stagelist", title: getLabel('387407',"阶段设置") }];
if (prjisdel) {
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@o9ff6b`} >
<div style={{ color: '#000' }}>
{getLabel(18375, "项目模板") + getLabel(18967, "已删除")}
</div>
</WeaAlertPage>
)
}
if (!hasRight && !prjisdel) {
return (<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@fii38y`} >
<div style={{ color: '#000' }}>
{getLabel(2012, "对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
if (hasRight) {
return (
<div>
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@16df7h`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
<WeaReqTop ecId={`${this && this.props && this.props.ecId || ''}_WeaReqTop@60jf18`}
title={prjname}
loading={loading}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
onDropMenuClick={this.onRightMenuClick.bind(this)}
tabDatas={tabs}
selectedKey={selectTabKey}
onChange={this.taskCardChangeTab.bind(this)}
>
<div className="prj-req-content">
<div className='prj-req-content-inner'>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@7tzuth`} scrollId='prj-req-content-main-scroll' height='100%'>
<div>{selectTabKey == "prjinfo" && <ProjectInfo ecId={`${this && this.props && this.props.ecId || ''}_ProjectInfo@6rlgjm`} formStore={prjTempletCardStore} />}</div>
<div>{selectTabKey == "sublist" && <TaskList ecId={`${this && this.props && this.props.ecId || ''}_TaskList@pon2bs`} formStore={prjTempletCardStore} />}</div>
<div>{selectTabKey == "stagelist" && <StageList ecId={`${this && this.props && this.props.ecId || ''}_StageList@xcz5l2`} ref={el => { this.StageList = el }} contentStore={prjTempletCardStore} />}</div>
</WeaNewScroll>
</div>
</div>
<TaskTempletImpDialog ecId={`${this && this.props && this.props.ecId || ''}_TaskTempletImpDialog@avojab`} ref={ ref => {taskTempletImpStore.remind = ref} } prjImportStore={taskTempletImpStore} refTaskList={prjTempletCardStore.refTaskList} />
</WeaReqTop>
</WeaRightMenu>
</div>
)
}
return (<div></div>)
}
getButtons() {
const { prjTempletCardStore } = this.props;
const { rightMenu, prjid, prjname, form, selectTabKey, taskTempletImpStore, stageInfo :{selectedRowKeys}, taskInfoStore } = prjTempletCardStore;
let btnArr = [];
let that = this;
rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
let disabled = false;
if(selectTabKey == "stagelist" && selectedRowKeys.length==0){
if(m.type == "BTN_COPY"||m.type == "BTN_DELETE"){
disabled = true;
}
}
if(selectTabKey == "sublist" && taskInfoStore.selectedRowKeys.length == 0){
if(m.type == "BTN_DELETEBATCH"){
disabled = true;
}
}
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@hk42lj@${m.type}`} type="primary"
onClick={() => {
if (selectTabKey == "prjinfo") { //项目信息
if (m.type == "BTN_EDIT") { //编辑
prjTempletCardStore.getPrjTempletInfo({ viewtype: 'edit', templetId: prjid });
} else if (m.type == "BTN_SAVE") { //保存
prjTempletCardStore.savePrjTempletInfo({ templetId: prjid });
} else if (m.type == "BTN_BACK") { //返回
prjTempletCardStore.getPrjTempletInfo({ viewtype: 'view', templetId: prjid });
} else if (m.type == "BTN_DELETE") { //删除
//prjTempletCardStore.delPrjInfo({method:"del",templetId:prjid,from:"mymanagerproject"});
}
} else if (selectTabKey == "sublist") { //任务列表
if (m.type == 'BTN_EDIT') { //编辑
//prjTempletCardStore.showEditTaskModal(true);
} else if (m.type == "BTN_TEMPLETTASKIMP") { //批量导入
taskTempletImpStore.handleDialog(true, prjid, prjname);
}else if(m.type == "BTN_DELETEBATCH" ){ //批量删除
taskInfoStore.delTaskBatch("delbatch");
}else if(m.type == "BTN_ADDTASK"){ //添加任务
taskInfoStore.handleDialog(true,"add","",{ templetId: prjid});
}
} else if (selectTabKey == "stagelist") { //任务列表
if (m.type == 'BTN_ADD_SHARE') { //新增
this.StageList.tableEdit.refs.edit.doAdd()
} else if (m.type == "BTN_DELETE") { //删除
this.StageList.tableEdit.refs.edit.doDelete()
} else if (m.type == "BTN_COPY") { //复制
this.StageList.tableEdit.refs.edit.doCopy()
} else if (m.type == "BTN_SUBMIT") { //保存
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
prjTempletCardStore.saveStageSet(checkProps);
}
}
}}
disabled={disabled}
>
{m.menuName}
</Button>
);
});
return btnArr;
}
getRightMenu() {
const { prjTempletCardStore } = this.props;
const { rightMenu, stageInfo :{selectedRowKeys} , selectTabKey, taskInfoStore } = prjTempletCardStore;
let btnArr = [];
rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
let disabled = false;
if(selectTabKey == "stagelist" && selectedRowKeys.length==0){
if(m.type == "BTN_COPY"||m.type == "BTN_DELETE"){
disabled = true;
}
}
if(selectTabKey == "sublist" && taskInfoStore.selectedRowKeys.length == 0){
if(m.type == "BTN_DELETEBATCH"){
disabled = true;
}
}
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
disabled : disabled
})
});
return btnArr
}
onRightMenuClick(key) {
const { prjTempletCardStore } = this.props;
const { rightMenu, selectTabKey, prjid, prjname, taskTempletImpStore, taskInfoStore } = prjTempletCardStore;
rightMenu && rightMenu.length > 0 && rightMenu.map((m, i) => {
if (Number(key) == i) {
if (selectTabKey == "prjinfo") {
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
if (fn != "") {
fn = fn.substring(0, fn.indexOf('('));
} else {
if (m.type == "BTN_EDIT") { //编辑
prjTempletCardStore.getPrjTempletInfo({ viewtype: 'edit', templetId: prjid });
} else if (m.type == "BTN_SAVE") { //保存
prjTempletCardStore.savePrjTempletInfo({ templetId: prjid });
} else if (m.type == "BTN_BACK") { //返回
prjTempletCardStore.getPrjTempletInfo({ viewtype: 'view', templetId: prjid });
} else if (m.type == "BTN_DELETE") {
prjTempletCardStore.delPrjInfo({ method: "del", prjid: prjid, from: "mymanagerproject" });
}
}
}
if (selectTabKey == "sublist") { //任务列表
if (m.type == 'BTN_EDIT') { //编辑
prjTempletCardStore.showEditTaskModal(true);
} else if (m.type == "BTN_TEMPLETTASKIMP") { //批量导入
taskTempletImpStore.handleDialog(true, prjid, prjname);
}else if(m.type == "BTN_ADDTASK"){ //添加任务
taskInfoStore.handleDialog(true,"add","",{ templetId: prjid});
}else if(m.type == "BTN_DELETEBATCH" ){ //批量删除
taskInfoStore.delTaskBatch("delbatch");
}
}
if (selectTabKey == "stagelist") { //任务列表
if (m.type == 'BTN_ADD_SHARE') { //新增
this.StageList.tableEdit.refs.edit.doAdd()
} else if (m.type == "BTN_DELETE") { //删除
this.StageList.tableEdit.refs.edit.doDelete()
} else if (m.type == "BTN_COPY") { //复制
this.StageList.tableEdit.refs.edit.doCopy()
} else if (m.type == "BTN_SUBMIT") { //保存
const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
prjTempletCardStore.saveStageSet(checkProps);
}
}
}
});
}
taskCardChangeTab(key) {
const { prjTempletCardStore } = this.props;
prjTempletCardStore.changeTab(key);
}
}
export default PrjTempletCard;

View File

@ -0,0 +1,177 @@
import React from 'react';
import { Button} from 'antd';
import { inject, observer } from 'mobx-react';
import {WeaRightMenu,WeaReqTop,WeaNewScroll,WeaLocaleProvider} from "ecCom"
const getLabel = WeaLocaleProvider.getLabel;
import RelateWorkFlow from '../common/relateWorkFlow'
import RelateDocument from "../common/relateDocument"
import TaskInfo from '../common/taskInfo'
@inject('taskTempletCardStore')
@observer
class TaskTempletCard extends React.Component {
componentDidMount() {
const {taskTempletCardStore,location:{query} }= this.props;
const {getTaskTempletForm} = taskTempletCardStore;
getTaskTempletForm({viewtype:'view',...query});
}
componentWillUnmount(){
}
render() {
let _this = this;
const {taskTempletCardStore}= this.props;
const tabDatas = [
{key: 'taskinfo',title: getLabel(83789,"任务信息")},
{key: 'req', title: getLabel(1044,"相关流程")},
{key: 'doc', title: getLabel(857,"相关文档")},
];
const {selectTabKey,loading,taskname,form} = taskTempletCardStore;
return (
<div ref="box">
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@227x77`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
<WeaReqTop ecId={`${this && this.props && this.props.ecId || ''}_WeaReqTop@vdzhuu`}
title={taskname}
loading={loading}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
onDropMenuClick={this.onRightMenuClick.bind(this)}
tabDatas={tabDatas}
selectedKey={selectTabKey}
onChange={this.taskCardChangeTab.bind(this)}
>
<div className="prj-req-content">
<div className='prj-req-content-inner'>
<WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@bhsrrk`} scrollId='prj-req-content-main-scroll' height='100%'>
{
selectTabKey === 'taskinfo' &&
<div style={{height: '100%' }}>
<TaskInfo ecId={`${this && this.props && this.props.ecId || ''}_TaskInfo@0axi55`} listStore={taskTempletCardStore} form={form}/>
</div>
}
{
selectTabKey === 'req' &&
<div style={{height: '100%' }}>
<RelateWorkFlow ecId={`${this && this.props && this.props.ecId || ''}_RelateWorkFlow@th0spd`} contentStore={taskTempletCardStore} />
</div>
}
{
selectTabKey === 'doc' &&
<div style={{height: '100%' }}>
<RelateDocument ecId={`${this && this.props && this.props.ecId || ''}_RelateDocument@uo8ipp`} contentStore={taskTempletCardStore} />
</div>
}
</WeaNewScroll>
</div>
</div>
</WeaReqTop>
</WeaRightMenu>
</div>
)
}
getButtons(){
const {taskTempletCardStore }= this.props;
const {rightMenu,taskid,selectTabKey} = taskTempletCardStore;
let btnArr = [];
let that = this;
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@wi3kqn@${m.type}`} type="primary"
onClick={()=>{
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
if(selectTabKey == 'taskinfo'){ //项目信息
if(m.type == "BTN_EDIT"){ //编辑
taskTempletCardStore.getTaskTempletForm({viewtype:'edit',templetTaskId:taskid});
}else if(m.type == "BTN_SAVE"){ //保存
taskTempletCardStore.saveTaskTempletInfo({taskid:taskid});
}else if(m.type == "BTN_DELETE"){ //删除
taskTempletCardStore.delTask("del",taskid);
}else if(m.type == "BTN_BACK"){ //返回
taskTempletCardStore.getTaskTempletForm({viewtype:'view',templetTaskId:taskid});
}
}
if(selectTabKey == 'req'){ //相关流程
if(m.type == "BTN_NEWREQ"){
}
}
if(selectTabKey == 'doc'){ //相关文档
if(m.type == "BTN_NEWDOC"){
}
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
getRightMenu(){
const {taskTempletCardStore }= this.props;
const {rightMenu} = taskTempletCardStore;
let btnArr = [];
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName
})
});
return btnArr
}
onRightMenuClick(key){
const {taskTempletCardStore }= this.props;
const {rightMenu,taskid,selectTabKey} = taskTempletCardStore;
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(selectTabKey == 'taskinfo'){ //项目信息
if(m.type == "BTN_EDIT"){ //编辑
taskTempletCardStore.getTaskTempletForm({viewtype:'edit',templetTaskId:taskid});
}else if(m.type == "BTN_SAVE"){ //保存
taskTempletCardStore.saveTaskTempletInfo({templetTaskId:taskid});
}else if(m.type == "BTN_DELETE"){ //删除
taskTempletCardStore.delTask("del",taskid);
}else if(m.type == "BTN_BACK"){ //返回
taskTempletCardStore.getTaskTempletForm({viewtype:'view',templetTaskId:taskid});
}
}
if(selectTabKey == 'req'){ //相关流程
if(m.type == "BTN_NEWREQ"){
}
}
if(selectTabKey == 'doc'){ //相关文档
if(m.type == "BTN_NEWDOC"){
}
}
}
});
}
taskCardChangeTab(key){
const {taskTempletCardStore} =this.props;
taskTempletCardStore.changeTab(key);
}
cancelShare=()=>{
const {taskTempletCardStore} = this.props;
taskTempletCardStore.showTaskShare(false);
}
saveShare=()=>{
const {taskTempletCardStore} = this.props;
taskTempletCardStore.showTaskShare(false);
}
}
export default TaskTempletCard;

View File

@ -0,0 +1,301 @@
import {WeaTop,WeaTab,WeaRightMenu,WeaSearchGroup,WeaFormItem,WeaAlertPage,WeaLocaleProvider,WeaTools,WeaCheckbox} from "ecCom"
import { Button ,Switch} from "antd";
import {WeaSwitch} from "comsMobx";
import {Condition} from '../list/listCondition';
import {inject, observer } from 'mobx-react';
import {toJS} from "mobx"
import WfSetList from '../common/wfsetList'
import PrjWfSetDialog from '../dialog/prjwfsetDialog'
const getLabel = WeaLocaleProvider.getLabel;
@inject('templetApproveStore')
@observer
class PrjTempletApproveSet extends React.Component {
constructor(props){
super(props)
}
componentDidMount(){
const {templetApproveStore,params : {wftype}} = this.props;
templetApproveStore.initData({wftype:wftype});
templetApproveStore.getPrjWfSetCondition({wftype:wftype});
}
componentWillReceiveProps(nextProps){
const { templetApproveStore } = this.props;
const keyOld = this.props.location.key;
const keyNew = nextProps.location.key;
const paramsOld = this.props.params;
const paramsNew = nextProps.params;
if(keyOld!==keyNew||paramsOld!==paramsNew) {
templetApproveStore.clearStatus();
templetApproveStore.clearFormFields();
templetApproveStore.getPrjWfSetCondition({wftype:paramsNew.wftype});
templetApproveStore.initData({wftype:paramsNew.wftype});
}
}
componentWillUnmount(){
const {templetApproveStore} = this.props;
templetApproveStore.clearStatus();
templetApproveStore.clearFormFields();
}
render(){
const {templetApproveStore} = this.props;
const {title,isright,loading,selectTabKey,prjWfSetStore,wftype,showSearchAd,wfsetConditonform,changeTab} = templetApproveStore;
const formParams = wfsetConditonform.getFormParams() || {};
let tabs = [];
if("3" ==wftype){
tabs = [{
color: '#000000',
groupid: 'approveset',
showcount: false,
title: getLabel(84412,"审批设置"),
viewcondition: 0
},{
color: '#ff3232',
groupid: 'wflist',
showcount: false,
title: getLabel(84413,"自定义审批流程"),
viewcondition: 1
}
];
}else{
tabs = [];
}
if (!isright) {
return(
<WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@tjwo88`}>
<div style={{color : '#000'}}>
{getLabel(2012,"对不起,您暂时没有权限!")}
</div>
</WeaAlertPage>
)
}
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@ucc1q6`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)}>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@gs0rsu`}
title={title||(getLabel('503288','模板审批'))}
loading={loading}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
onDropMenuClick={this.onRightMenuClick.bind(this)}
>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@9k8svb`}
buttonsAd={this.getAdButtons()}
searchType={(selectTabKey == '1' || wftype == "2" || wftype == "1") ? ['base','advanced'] : ['']}
searchsBaseValue={formParams.name}
setShowSearchAd={bool=>{templetApproveStore.setShowSearchAd(bool)}}
hideSearchAd={()=> templetApproveStore.setShowSearchAd(false)}
searchsAd={
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@qae6s3`} listStore={templetApproveStore} form={wfsetConditonform} onEnterSearch={this.onEnterSearch} ></Condition></div>
}
showSearchAd={showSearchAd}
onSearch={v=>{templetApproveStore.getWfSetList({wftype:wftype})}}
onSearchChange={v=>{templetApproveStore.setFormSearchFields({name:{value:v}})}}
datas={tabs}
keyParam="viewcondition" //主键
countParam="groupid"
selectedKey={selectTabKey}
onChange={changeTab}
/>
{ (selectTabKey == '0' && wftype == "3") &&
<div >{this.getBasicInfo()}</div>
}
{ (selectTabKey == '1' || wftype == "2" || wftype == "1") &&
<div >
{[<WfSetList ecId={`${this && this.props && this.props.ecId || ''}_WfSetList@3oma7y`} contentStore={templetApproveStore} wftype={wftype}/>,<PrjWfSetDialog ecId={`${this && this.props && this.props.ecId || ''}_PrjWfSetDialog@32cytl`} contentStore={prjWfSetStore} wftype={wftype}/>]}
</div>
}
</WeaTop>
</WeaRightMenu>
)
}
getBasicInfo() {
const {templetApproveStore, } = this.props;
const {fieldinfo,form,setFormFields} = templetApproveStore;
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] == "chkNeedAppr"){
// <Switch checked={formParams[field.domkey[0]] == "1"} onChange={checked =>setFormFields({[field.domkey[0]]:{value:checked ? '1' : '0'}})}/>
dom =
<WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@ady74g@${field.domkey[0]}`}
value={formParams[field.domkey[0]]}
display="switch"
style={{display: 'inline'}}
onChange={checked => setFormFields({[field.domkey[0]]:{value:checked }})}
/>
}else if(field.domkey[0] == "wfid"){
//dom = <WeaSwitch fieldConfig={field} form={form} formParams={formParams} onChange={(ids,names)=>{templetApproveStore.setFormWfid(ids)}} />;
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@8yzoif@${field.domkey[0]}`} fieldConfig={{...field, hasAddBtn:true,addOnClick:(values)=> this.callAddPath(values)}}
form={form} formParams={formParams} onChange={(ids,names)=>{templetApproveStore.setFormWfid(ids)}} />
}else{
dom = <WeaSwitch ecId={`${this && this.props && this.props.ecId || ''}_WeaSwitch@ju9nck@${field.domkey[0]}`} fieldConfig={field} form={form} formParams={formParams}/>;
}
items.push({
com: (<WeaFormItem ecId={`${this && this.props && this.props.ecId || ''}_WeaFormItem@q1gc0q@${field.domkey[0]}`}
label={`${field.label}`}
labelCol={{ span: 5 }}
wrapperCol={{ span: 14 }}
error={form.getError(field)}
tipPosition="bottom">
{dom}
</WeaFormItem>),
col: 1,
hide:hide
});
});
group.push(<WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@9mvd90@${i}`} needTigger={true} title={c.title} showGroup={true} items={items} />)
});
return group;
}
callAddPath = (values) => {
const {templetApproveStore, } = this.props;
const {form} = templetApproveStore;
// const formParams = form.getFormParams();
// const formDatas = form.getFormDatas();
let _this = this;
let url = (window.ecologyContentPath || '')+'/spa/workflow/static4engine/engine.html#/main/workflowengine/path/addContent?isRoute=true';
// if (formParams.formid != null && formParams.formid != '') {
// url += `&formId=${formParams.formid}`;
// }
// if (formDatas.formid != null && formDatas.formid.valueObj != null) {
// url += `&isBill=${formDatas.formid.valueObj[0].isbill}`;
// }
const dialog = WeaTools.createDialog({
title: getLabel(81687,"添加路径"),
moduleName: 'workflow',
url,
style: {
width: 600,
height: 500
},
callback: (datas) => {
form.updateFields({
wfid: {
value: datas.id.toString(),
valueSpan: datas.name,
valueObj: [{
id: datas.id.toString(),
name: datas.name
}]
}
})
},
onCancel: () => {
}
});
dialog.show();
}
wfSetChangeTab(key){
const {templetApproveStore} = this.props;
templetApproveStore.changeTab(key);
}
getButtons(){
const {templetApproveStore }= this.props;
const {rightMenu,wfsetListStore,prjWfSetStore,selectTabKey,wftype} = templetApproveStore;
let {selectedRowKeys} = wfsetListStore;
let btnArr = [];
let that = this;
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@91pygz@${m.type}`} type="primary"
disabled={isDisabled && m.isControl == "1"}
onClick={()=>{
if(selectTabKey == '0' && wftype == "3"){
if(m.type == "BTN_SAVE"){
templetApproveStore.saveTempletApprove();
}
}else if(selectTabKey == '1' || wftype == "2" || wftype == "1"){
if(m.type == "BTN_CREATE"){
prjWfSetStore.handleShareDialog(true,"add",wftype,"baseinfo");
}else if(m.type == "BTN_DELETEBATCH"){
templetApproveStore.batchDeleteWfSet(`${toJS(selectedRowKeys)}`);
}
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
getRightMenu(){
const {templetApproveStore }= this.props;
const {rightMenu,wfsetListStore} = templetApproveStore;
let {selectedRowKeys} = wfsetListStore;
let btnArr = [];
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
disabled:isDisabled && m.isControl == "1"
})
});
return btnArr
}
onRightMenuClick(key){
const {templetApproveStore }= this.props;
const {rightMenu,wfsetListStore,selectTabKey,wftype,prjWfSetStore} = templetApproveStore;
let {selectedRowKeys} = wfsetListStore;
rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
if(Number(key) == i){
if(selectTabKey == '0' && wftype == "3"){
if(m.type == "BTN_SAVE"){
templetApproveStore.saveTempletApprove();
}
}else if(selectTabKey == '1'|| wftype == "2" || wftype == "1"){ //审批流程
if(m.type == "BTN_SEARCH"){
templetApproveStore.reLoad();
}else if(m.type == "BTN_CREATE"){
prjWfSetStore.handleShareDialog(true,"add", wftype ,"baseinfo");
}else if(m.type == "BTN_DELETEBATCH"){
templetApproveStore.batchDeleteWfSet(`${toJS(selectedRowKeys)}`);
}else if(m.type == "BTN_COLUMN"){
templetApproveStore.onShowColumn();
}
}
}
});
}
getAdButtons = () => {
const {templetApproveStore} = this.props;
const {getWfSetList,wftype,setShowSearchAd,clearFormFields} = templetApproveStore;
return [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@cxf2fu@search`} type="primary" onClick={()=>{getWfSetList({wftype:wftype});setShowSearchAd(false);}}>{getLabel(197,"搜索")}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@gx1x97@reset`} type="ghost" onClick={()=>{clearFormFields();}}>{getLabel(2022,"重置")}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@w7vka6@cancel`} type="ghost" onClick={()=>{setShowSearchAd(false)}}>{getLabel(201,"取消")}</Button>)
];
}
onEnterSearch=() =>{
const {templetApproveStore} = this.props;
templetApproveStore.getWfSetList({wftype:wftype});
templetApproveStore.setShowSearchAd(false);
}
}
export default PrjTempletApproveSet;

View File

@ -0,0 +1,251 @@
import React from 'react';
import { inject, observer } from 'mobx-react';
import { Button} from 'antd';
import {toJS} from "mobx";
import {Condition,getAdButtons} from '../list/listCondition';
import {WeaTableNew} from 'comsMobx';
const WeaTable = WeaTableNew.WeaTable;
import {WeaRightMenu,WeaTop,WeaTab,WeaLeftRightLayout,WeaLocaleProvider} from 'ecCom';
import ListLeftTree from '../list/listLeftTree'
import AddPrjTemplet from '../dialog/addPrjTempletDialog'
const getLabel = WeaLocaleProvider.getLabel;
@inject('templetListStore')
@observer
class TempletList extends React.Component {
constructor(props) {
super(props);
this.doInit(this.props);
}
doInit(props){
const { templetListStore } = props;
const {initTreeDatas,doSearch,initDatas} = templetListStore;
initDatas();
doSearch();
initTreeDatas();
}
componentDidMount(){
const { templetListStore } = this.props;
const {form} = templetListStore;
const datas = form.getFormDatas();
form.updateFields(datas);
}
componentWillReceiveProps(nextProps){
const keyOld = this.props.location.key;
const keyNew = nextProps.location.key;
//点击菜单路由刷新组件
if(keyOld !== keyNew) {
const { templetListStore } = nextProps;
templetListStore.clearStatus();
templetListStore.resetTable();
this.doInit(nextProps);
}
}
componentWillUnmount(){
const { templetListStore } = this.props;
templetListStore.clearStatus();
templetListStore.resetTable();
}
render(){
const {templetListStore} = this.props;
const {title,loading,tableStore,showSearchAd,form,exchangeStore,reLoad,addPrjTempletStore} = templetListStore;
const formParams = form.getFormParams() || {};
return (
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@rwix7y`} datas={this.getRightMenu()} onClick={this.onRightMenuClick.bind(this)} >
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@xrueev`}
title={title||getLabel(586,"项目类型")}
loading={loading}
icon={<i className='icon-coms-project' />}
iconBgcolor='#217346'
buttons={this.getTopButtons()}
buttonSpace={10}
showDropIcon={true}
dropMenuDatas={this.getRightMenu()}
onDropMenuClick={this.onRightMenuClick.bind(this)}
>
<WeaLeftRightLayout ecId={`${this && this.props && this.props.ecId || ''}_WeaLeftRightLayout@62i1dv`}
isNew = {true}
showLeft = {true}
leftCom={<ListLeftTree ecId={`${this && this.props && this.props.ecId || ''}_ListLeftTree@bh54x1`} listStore={templetListStore} key={this.props.location.key}/>}
>
<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@vlevma`}
buttonsAd={getAdButtons(templetListStore,this.props.ecId || '')}
searchType={['base','advanced']}
searchsBaseValue={formParams.name}
setShowSearchAd={bool=>{templetListStore.setShowSearchAd(bool)}}
hideSearchAd={()=> templetListStore.setShowSearchAd(false)}
searchsAd={
<div><Condition ecId={`${this && this.props && this.props.ecId || ''}_Condition@6e7k4k`} listStore={templetListStore} form={form} onEnterSearch={this.onEnterSearch} ></Condition></div>
}
showSearchAd={showSearchAd}
onSearch={v=>{templetListStore.doSearch()}}
onSearchChange={v=>{templetListStore.appendFormFields({name:{value:v}})}}
onChange={ this.changeData }
/>
<WeaTable ecId={`${this && this.props && this.props.ecId || ''}_WeaTable@u4c3it`}
comsWeaTableStore={tableStore}
hasOrder={true}
needScroll={true}
register_table={()=>reLoad()}
getColumns={c=>this.reRenderColumns(c)}
onOperatesClick={this.onOperatesClick.bind(this)}
/>
</WeaLeftRightLayout>
</WeaTop>
<AddPrjTemplet ecId={`${this && this.props && this.props.ecId || ''}_AddPrjTemplet@tosg7m`} contentStore={templetListStore} isreflesh={true} />
</WeaRightMenu>)
}
getTopButtons(){
const {templetListStore} = this.props;
const {rightMenu,tableStore,addPrjTempletStore,prjtypeid} = templetListStore;
let {selectedRowKeys} = tableStore;
let btnArr = [];
let that = this;
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
let addflag = false;
if(prjtypeid&&prjtypeid>0){
addflag = true;
}
rightMenu && rightMenu.length>0 && toJS(rightMenu).map(m=>{
let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
if(m.type == "BTN_CREATE"&&!addflag){
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@8l3bz5@${m.type}`} type="primary"
disabled={true}
onClick={()=>{
if(fn == ""){
if(m.type == "BTN_CREATE"){
addPrjTempletStore.handleShareDialog(true,{viewtype:'add',prjtypeid:prjtypeid})
}
}
}}>
{m.menuName}
</Button>
);
}else{
m.isTop == '1' && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@6xaukn@${m.type}`} type="primary"
disabled={isDisabled && m.isControl == "1"}
onClick={()=>{
if(fn == ""){
if(m.type == "BTN_CREATE"){
addPrjTempletStore.handleShareDialog(true,{viewtype:'add',prjtypeid:prjtypeid})
}else if(m.type == "BTN_DELETEBATCH"){
templetListStore.delBatchPrjTemplet(`${toJS(selectedRowKeys)}`);
}
}
}}>
{m.menuName}
</Button>
);
}
});
return btnArr;
}
getRightMenu(){
const {templetListStore }= this.props;
const {rightMenu,tableStore,prjtypeid} = templetListStore;
let {selectedRowKeys} = tableStore;
let btnArr = [];
const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
let addflag = false;
if(prjtypeid&&prjtypeid>0){
addflag = true;
}
rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
if(m.type == "BTN_CREATE"&&!addflag){
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
disabled:true
})
}else{
btnArr.push({
icon: <i className={m.menuIcon} />,
content: m.menuName,
disabled:isDisabled && m.isControl == "1"
})
}
});
return btnArr
}
onRightMenuClick(key){
const {templetListStore }= this.props;
const {rightMenu,tableStore,addPrjTempletStore,prjtypeid} = templetListStore;
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"){ //定制列
templetListStore.onShowColumn();
}else if(m.type == "BTN_CREATE"){
addPrjTempletStore.handleShareDialog(true,{viewtype:'add',prjtypeid:prjtypeid})
}else if(m.type == "BTN_DELETEBATCH"){
templetListStore.delBatchPrjTemplet(`${toJS(selectedRowKeys)}`);
}
}
});
}
reRenderColumns(columns){
const {templetListStore }= this.props;
columns.forEach(c=>{
if(c.dataIndex=='templetName'){
c.render = (text, record)=>{
let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
let hrefUrl = "<a href=\"javascript:openFullWindowForXtable('"+(window.ecologyContentPath || '')+"/spa/prj/engine.html#/main/prjengine/templet/templetcard?templetId="+record['randomFieldId']+"')\">"+valueSpan+"</a>";
return <span dangerouslySetInnerHTML={{__html: hrefUrl}}></span>
}
} else {
c.render = function(text, record){
let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
return <span dangerouslySetInnerHTML={{__html: valueSpan}}></span>
}
}
})
return columns;
}
changeData=(key)=>{
const {templetListStore} = this.props;
templetListStore.setShowSearchAd(false);
templetListStore.doSearch({
tabkey:key
});
}
onOperatesClick(record,index,operate,flag){
const {templetListStore} = this.props;
let _href = operate && operate.href ? operate.href : "";
let fn = _href.replace("javascript:","");
fn = fn.substring(0,fn.indexOf('('));
if(fn != ""){
if("onEdit"==fn){ //编辑模板
}else if('onDel' == fn){//删除模板
}else if('onTaskList' == fn){ //模板列表
}else if('onApprove' == fn){ //模板审批
templetListStore.doApprovetemplate(record.randomFieldId);
}else if('onSel' == fn){ //模板指定
templetListStore.doSelectPrjTemplet(record.randomFieldId);
}
}
}
onEnterSearch=() =>{
const {templetListStore} = this.props;
templetListStore.doSearch();
templetListStore.setShowSearchAd(false);
}
}
export default TempletList;

45
pc4backstage/prj/debug.js Normal file
View File

@ -0,0 +1,45 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createHashHistory } from 'History';
import { Router, Route, useRouterHistory } from 'react-router';
import { syncHistoryWithStore, RouterStore } from 'mobx-react-router';
import { Provider } from 'mobx-react';
import { WeaDebugRouteMenu } from 'ecCom';
WeaDebugRouteMenu.defaultProps.showRouteLev = 3;
import Module from './index';
const routing = new RouterStore();
const allStore = {
routing,
...Module.store,
};
const browserHistory = useRouterHistory(createHashHistory)({
queryKey: '_key',
basename: '/',
});
const history = syncHistoryWithStore(browserHistory, allStore.routing);
const Home = props => props.children;
const Root = () => (
<Provider ecId={`${this && this.props && this.props.ecId || ''}_Provider@6v4ite`} {...allStore}>
<Router ecId={`${this && this.props && this.props.ecId || ''}_Router@to8qwi`} history={history}>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@iczqgo`} name='root' breadcrumbName='根路由' path='/' component={WeaDebugRouteMenu}>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@474ofd`} name='main' breadcrumbName='入口' path='main' component={Home}>
{ Module.Route }
</Route>
</Route>
</Router>
</Provider>
);
ReactDOM.render(<Root ecId={`${this && this.props && this.props.ecId || ''}_Root@l4cjm5`} />, document.getElementById('container'));

56
pc4backstage/prj/index.js Normal file
View File

@ -0,0 +1,56 @@
import { Route } from 'react-router'
import { WeaLocaleProvider } from 'ecCom';
import stores from './stores';
import './style/index';
import './util'
import Home from './components/Home';
import BaseManagerList from './components/baseManager/BaseManagerList';
import Prjcode from './components/baseManager/prjCode';
import PrjAppSet from './components/appSet'
import TempletList from './components/templet/templetList'
import PrjTempletCard from './components/templet/prjTempletCard'
import TaskTempletCard from './components/templet/taskTempletCard'
import PrjCardTabSet from './components/custom/PrjCardTabSet';
import FieldTab from './components/custom/FieldTab';
import TempletApproveStore from './components/templet/templetApproveSet'
import WfSetList from './components/common/wfsetList';
import PrjLog from './components/log/ProjectLog';
import PrjRemind from './components/remind/PrjRemind';
import Demo from './components/Demo';
window.prjmode_store = stores;
const getLocaleLabel = WeaLocaleProvider.getLocaleLabel.bind(this, 'prjengine');
const Routes = (
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@vhe617`} path="prjengine" onEnter={getLocaleLabel} component={Home}>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@qujyaw`} path="demo" component={Demo} ></Route>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@642zjp`} name="basemanager" path="basemanager" breadcrumbName="基础设置" >
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@8xl9uj`} name="bmtype" path="bmtype/:bmtype" component={BaseManagerList}/>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@wp77ha`} name="prjcode" path="prjcode" component={Prjcode}/>
</Route>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@rzwzx5`} name="appset" path="appset" component={PrjAppSet} breadcrumbName="应用设置" ></Route>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@5ub2uj`} name="templet" path="templet" breadcrumbName="模板维护" >
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@yfhzq3`} name="list" path="list" component={TempletList}/>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@2fggzv`} name="templetcard" path="templetcard" component={PrjTempletCard}/>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@5n0c3v`} name="tasktempletcard" path="tasktempletcard" component={TaskTempletCard}/>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@cmbemy`} name="templetApproveStroe" path="templetApproveStroe/:wftype" component={TempletApproveStore}/>
</Route>
{/* <Route name="wfset" path="wfset" breadcrumbName="" >
<Route name="wfsetlist" path="wfsetlist" component={WfSetList}/>
</Route> */}
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@w7pvqc`} name="custom" path="custom" breadcrumbName="自定义设置" >
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@4yzrrs`} name="prjcardtabset" path="prjcardtabset/:tabtype" component={PrjCardTabSet} breadcrumbName="项目卡片显示栏目"/>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@z85lcu`} name="prjfieldinfotab" path="prjfieldinfotab/:fieldtype" component={FieldTab} breadcrumbName="项目卡片字段定义"/>
</Route>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@i6nasn`} name="log" path="log" breadcrumbName="项目日志" >
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ysxb59`} name="logtype" path="logtype/:logtype" component={PrjLog}/>
</Route>
<Route ecId={`${this && this.props && this.props.ecId || ''}_Route@ka5ha4`} name="remind" path="remind" component={PrjRemind} breadcrumbName="提醒设置" ></Route>
</Route>
);
module.exports = {
Route:Routes,
store:stores,
}

View File

@ -0,0 +1,54 @@
import React from 'react'
import ReactDOM from 'react-dom';
import { createHistory, useBasename, createHashHistory } from 'history'
import { Router, Route, useRouterHistory, Redirect ,IndexRedirect} from 'react-router'
import { Provider } from 'mobx-react';
import { RouterStore, syncHistoryWithStore } from 'mobx-react-router';
const routingStore = new RouterStore();
const browserHistory = useRouterHistory(createHashHistory)({
queryKey: '_key',
basename: '/'
});
//import PrjEngine from "weaPrjEngine";
import PrjEngine from './index.js';
const PrjEngineStore = PrjEngine.store;
const PrjEngineRoute = PrjEngine.Route;
const history = syncHistoryWithStore(browserHistory, routingStore);
window.weaHistory = history;
let store = {
// Key can be whatever you want
routing: routingStore,
...PrjEngineStore
}
const Home = props => props.children;
class Root extends React.Component {
render() {
return (
<Provider {...store}>
<Router history={history}>
<Route name="main" breadcrumbName="入口" path="main" component={Home}>
{PrjEngineRoute}
</Route>
</Router>
</Provider>
)
}
}
ReactDOM.render(<Root />, document.getElementById('container'));

View File

@ -0,0 +1,329 @@
import { observable, action } from 'mobx';
import {WeaForm} from 'comsMobx'
import {WeaTools,WeaLocaleProvider} from "ecCom"
import {Modal,message} from "antd"
import { toJS } from 'mobx';
// import {prjEditFormRules} from "../util/index"
import * as Apis from '../apis/templet.js';
const getLabel = WeaLocaleProvider.getLabel;
export class AddPrjTempletStore{
@observable title = "";//新建项目模板
@observable selectedKey = "prjinfo";
@observable form = new WeaForm();
@observable visible = false;
@observable conditionDatas ={
taskinfo:[],
fieldinfo:[],
prjid:"",
rightMenu:[],
userid:"",
taskViewAttr:""
};
validateRules = {}; //校验规则
@observable selectedRowKey = [];
@observable spinning = false;
@observable stageInfo = {
stageKey : 0,
stageColumns : [] ,
stageColumnDatas : [] ,
selectedRowKeys : [] ,
selectedDatas : {}
}
@action
handleShareDialog = (bool,params) =>{
this.visible = bool;
this.selectedKey = "prjinfo";
this.selectedRowKey = [];
this.clearStageStatus();
if(bool){
this.getAddCondition(params);
this.getPrjTempletStageList();
}
}
changeTab=(key)=>{
this.selectedKey = key
}
//初始化form
getAddCondition=(params={})=>{
this.form = new WeaForm();
var newParams = {...params};
Apis.getPrjTempletForm(newParams).then(data=>{
this.conditionDatas = {
taskinfo : data.taskinfo,
fieldinfo : data.fieldinfo,
prjid : data.prjid,
rightMenu : data.rightMenus,
userid: data.userid,
taskViewAttr: data.taskViewAttr,
};
if(data&&data.templetName){
this.title = data.templetName;
}else{
this.title = getLabel(83977,"新建项目模板");
}
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
})
}
//更新数据
setFormFields=(value)=>{
this.form.updateFields(value, false);
}
//保存校验规则
setValidate= (params={}) =>{
this.validateRules = params;
}
//保存list
saveListDatas =(datas)=>{
this.conditionDatas = {
...this.conditionDatas,
taskinfo:datas
}
}
addNewListDatas=()=>{
const data ={
"endtime": "",
"hrmid": "",
"budget": "0.000",
"workday": "0",
"begintime": "",
"pid": "0",
"realid": "0",
"beftaskname": "",
"id": "",
"beftaskid": "",
"name": getLabel(83982,"新的任务"),
"hrmname": "",
"begindate": "",
"enddate": ""
};
let newtaskinfo = toJS(this.conditionDatas.taskinfo);
newtaskinfo.push(data);
this.saveListDatas(this.addKeytoDatas(newtaskinfo));
}
addKeytoDatas(datas){
let _datas = datas.map((data, i) => {
let _data = {...data};
_data.rowIndex = i+1;
return _data
})
return _datas
}
saveRowKeys=(arr)=>{
this.selectedRowKey = arr ;
}
//删除
deleListDatas=()=>{
let newtaskinfo = this.addKeytoDatas(toJS(this.conditionDatas.taskinfo));
let _datas = [].concat(newtaskinfo);
const that = this;
if(this.selectedRowKey.length == 0){
Modal.info({
title: getLabel(15172,"系统提示"),
content: getLabel(30951,"请选择需要删除的数据!"),
okText: getLabel(826, "确定"),
});
}else{
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83925,"该任务及其子任务都会被删除,您确认要删除吗?"),
onOk() {
toJS(that.selectedRowKey).map(key => {
_datas = _datas.filter(data => Number(data.rowIndex) !== key)
});
const newdatas = that.changeBeforeTask(_datas);
that.saveListDatas(that.addKeytoDatas(newdatas));
that.selectedRowKey = [];
}
});
}
}
//change 前置任务
changeBeforeTask=(datas)=>{
let _datas = [].concat(datas);
_datas.map(item=>{
if(item.beftaskid && item.beftaskid !== "0"){
let bool = true;
for(let i = 0 ;i < _datas.length; i++){
if(_datas[i].rowIndex == item.beftaskid){
item.beftaskid = _datas[i].rowIndex;
item.beftaskname = _datas[i].name;
bool = true;
return ;
}else{
bool = false
}
}
if(!bool){
item.beftaskid = "0";
item.beftaskname = "";
}
}
});
return _datas;
}
saveAddProject=(params={})=>{
const { isreflesh, checkProps } = params;
const { pass } = checkProps;
let _this = this;
this.form.validateForm().then(f => {
if (f.isValid&&pass) {
if(this.checkRepeat()){
let newParams = {...this.form.getFormParams(),...params};
let par = {...newParams,method:"add"};
par.subfields = JSON.stringify(toJS(this.conditionDatas.taskinfo));
par.stagelist = JSON.stringify(toJS(this.stageInfo.stageColumnDatas));
this.spinning = true;
Apis.doPrjTempletOpertaion(par).then(data=>{
if(data.isright){
_this.spinning = false;
if(data.success){
message.success(getLabel(83551,"保存成功!"));
if(isreflesh){
window._table.reLoad();
}
this.handleShareDialog(false);
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
_this.spinning = false;
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
}else{
f.showErrors();
}
if(this.selectedKey=='prjinfo'&&pass==false){
message.error(getLabel(15859,"必要信息不完整!"));
}
if(this.selectedKey=='sublist'&&(f.isValid==false||pass==false)){
message.error(getLabel(15859,"必要信息不完整!"));
}
if(this.selectedKey=='stagelist'&&f.isValid==false){
message.error(getLabel(15859,"必要信息不完整!"));
}
});
}
checkRepeat = () => {
let repeat = true;
let datas = toJS(this.stageInfo.stageColumnDatas);
datas && datas.length>0 && datas.map((d1,i1) => {
if(repeat){
datas && datas.length>0 && datas.map((d2,i2) => {
if(i1 !== i2 && d1.name == d2.name){
// Modal.warning({
// title: getLabel(15172, "系统提示"),
// content: getLabel('387703',"阶段名称重复!"),
// });
message.error(getLabel('387703',"阶段名称重复!"));
repeat = false;
}
})
}
})
return repeat;
}
clearStatus =()=>{
this.selectedKey = "prjinfo";
this.conditionDatas ={
taskinfo:[],
fieldinfo:[],
prjid:"",
rightMenu:[],
userid:"",
taskViewAttr:""
};
this.validateRules = {}; //校验规则
this.selectedRowKey = [];
}
getPrjTempletStageList = (params = {}) => {
this.loading = true;
let newParams = { actionType: "add", templateId: this.prjid, ...params };
Apis.getPrjTempletStageList(newParams).then(data => {
this.stageInfo.stageColumns = data.columns;
//this.stageInfo.stageColumnDatas = data.columnDatas;
this.rightMenu = data.rightMenus;
this.loading = false;
})
}
onRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => {
this.stageInfo.selectedRowKeys = sRowKeys;
if (selectedDatas) {
this.stageInfo.selectedDatas = selectedDatas;
}
}
onChange = (datas,a,v,b) => {
let newDatas = [];
this.stageInfo.stageKey++;
datas.map((item) => {
if (typeof (item.id) == "undefined") {
newDatas.push({
id: "new_" + this.stageInfo.stageKey,
...item,
name: ""
});
} else {
newDatas.push(item);
}
});
let newTaskDatas = [];
let taskDatas = toJS(this.conditionDatas.taskinfo);
taskDatas.map((item)=>{
let find = false;
newDatas.map((item2)=>{
if(item.stageid !== "" && item.stageid == item2.id){
find = true;
}
});
if(!find){
newTaskDatas.push({...item,stageid:""});
}else{
newTaskDatas.push(item);
}
});
this.conditionDatas.taskinfo = newTaskDatas;
this.stageInfo.stageColumnDatas = newDatas;
}
clearStageStatus = () => {
this.stageInfo = {
stageKey : 0,
stageColumns: [],
stageColumnDatas: [],
selectedRowKeys: [],
selectedDatas: {}
}
}
}

View File

@ -0,0 +1,167 @@
import { observable, action, toJS } from 'mobx';
import {Modal,message} from "antd"
const confirm = Modal.confirm;
import { WeaTools,WeaLocaleProvider} from 'ecCom';
import { ListStore} from './listStore';
import { WeaForm,WeaTableNew} from 'comsMobx';
import {PrjTypeStore } from "./prjtypeStore"
import {WorkTypeStore } from "./worktypeStore"
import * as Apis from '../apis/basemanger';
const getLabel = WeaLocaleProvider.getLabel;
class BaseManagerListStore extends ListStore{
@observable rightMenu = [];
@observable title = "";//项目类型
@observable basetype = "prjtype";
@observable baseParams={
}
@observable searchParams = {
name:""
}
@observable rightMenu =[];
@observable condition = [];
@observable prjtypeStore = new PrjTypeStore();
@observable worktypeStore = new WorkTypeStore();
@action
initData=(params={})=>{
this.form = new WeaForm();
this.basetype = params.bmtype
Apis.getBaseMangerCondition(params).then(data=>{
this.title = data.title;
this.condition = data.condition;
this.form && !this.form.isFormInit && this.form.initFormFields(data.condition);
this.doSearch(params);
})
}
@action
doSearch = (params={}) =>{
this.loading = true;
//获取表单的参数值
const searchParamsAd = this.form.getFormParams();
const newParams = { ...this.searchParams, ...searchParamsAd, ...params };
Apis.getBaseMangerList(newParams).then(data=>{
this.tableStore.getDatas(data.sessionkey, params.current || 1);
this.searchParams = { ...this.searchParams, ...params };
this.dataKey = data.sessionkey;
this.rightMenu = data.rightMenus;
this.loading = false;
})
}
//删除
delPrjType = (value)=>{
let _this = this;
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83601,"您确认要删除选中的记录吗?"),
onOk() {
if(_this.basetype=='prjtype'){
Apis.doPrjTypeOpt({prjtypeid:value,method:'delete'}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.doSearch();
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else if(_this.basetype=='worktype'){
Apis.doWorkTypeOpt({worktypeid:value,method:'delete'}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.doSearch();
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else if(_this.basetype=='prjstatus'){
Apis.doPrjStatusOpt({prjstatusid:value,method:'delete'}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.doSearch();
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
},
onCancel() { },
})
}
//批量删除
delPrjTypeBatch = (value)=>{
let _this = this;
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83601,"您确认要删除选中的记录吗?"),
onOk() {
if(_this.basetype=='prjtype'){
Apis.doPrjTypeOpt({prjtypeid:value,method:'batchdelete'}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.doSearch();
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else if(_this.basetype=='worktype'){
Apis.doWorkTypeOpt({worktypeid:value,method:'batchdelete'}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.doSearch();
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else if(_this.basetype=='prjstatus'){
Apis.doPrjStatusOpt({prjstatusid:value,method:'batchdelete'}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.doSearch();
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
},
onCancel() { },
})
}
onShowColumn=()=>{
this.tableStore.setColSetVisible(true);
this.tableStore.tableColSet(true)
}
clearStatus=()=>{
this.rightMenu =[];
this.condition = [];
this.searchParams = {};
this.verified = false;
this.hasRight = false;
}
}
export default BaseManagerListStore;

View File

@ -0,0 +1,954 @@
import { observable, action,toJS } from 'mobx';
import { WeaTools, WeaLocaleProvider, WeaSelect } from 'ecCom';
import { Modal, message, Button } from "antd";
import {WeaForm} from 'comsMobx';
const getLabel = WeaLocaleProvider.getLabel;
const confirm = Modal.confirm;
import FieldOptionManage from '../../components/custom/FieldOptionManage';
import FieldCommonSelect from '../../components/custom/FieldCommonSelect';
import * as Apis from '../../apis/custom';
let dbKeys = ",PERCENT,PLAN,PRECISION,PRIMARY,PRINT,PROC,PROCEDURE,PUBLIC,RAISERROR,READ,READTEXT,RECONFIGURE,REFERENCES,REPLICATION,RESTORE,RESTRICT,RETURN,REVOKE,RIGHT,ROLLBACK,ROWCOUNT,ROWGUIDCOL,RULE,SAVE,SCHEMA,SELECT,SESSION_USER,SET,SETUSER,SHUTDOWN,SOME,STATISTICS,SYSTEM_USER,TABLE,TEXTSIZE,THEN,TO,TOP,TRAN,TRANSACTION,TRIGGER,TRUNCATE,TSEQUAL,UNION,UNIQUE,UPDATE,UPDATETEXT,USE,USER,VALUES,VARYING,VIEW,WAITFOR,WHEN,WHERE,WHILE,WITH,WRITETEXT,EXCEPT,EXEC,EXECUTE,EXISTS,EXIT,FETCH,FILE,FILLFACTOR,FOR,FOREIGN,FREETEXT,FREETEXTTABLE,FROM,FULL,FUNCTION,GOTO,GRANT,GROUP,HAVING,HOLDLOCK,IDENTITY,IDENTITY_INSERT,IDENTITYCOL,IF,IN,INDEX,INNER,INSERT,INTERSECT,INTO,IS,JOIN,KEY,KILL,LEFT,LIKE,LINENO,LOAD,NATIONAL,NOCHECK,NONCLUSTERED,NOT,NULL,NULLIF,OF,OFF,OFFSETS,ON,OPEN,OPENDATASOURCE,OPENQUERY,OPENROWSET,OPENXML,OPTION,OR,ORDER,OUTER,OVER,ADD,ALL,ALTER,AND,ANY,AS,ASC,AUTHORIZATION,BACKUP,BEGIN,BETWEEN,BREAK,BROWSE,BULK,BY,CASCADE,CASE,CHECK,CHECKPOINT,CLOSE,CLUSTERED,COALESCE,COLLATE,COLUMN,COMMIT,COMPUTE,CONSTRAINT,CONTAINS,CONTAINSTABLE,CONTINUE,CONVERT,CREATE,CROSS,CURRENT,CURRENT_DATE,CURRENT_TIME,CURRENT_TIMESTAMP,CURRENT_USER,CURSOR,DATABASE,DBCC,DEALLOCATE,DECLARE,DEFAULT,DELETE,DENY,DESC,DISK,DISTINCT,DISTRIBUTED,DOUBLE,DROP,DUMMY,DUMP,ELSE,END,ERRLVL,ESCAPE,";
//以下for oracle.update by cyril on 2008-12-08 td:9722
dbKeys += "ACCESS,ADD,ALL,ALTER,AND,ANY,AS,ASC,AUDIT,BETWEEN,BY,CHAR,";
dbKeys += "CHECK,CLUSTER,COLUMN,COMMENT,COMPRESS,CONNECT,CREATE,CURRENT,";
dbKeys += "DATE,DECIMAL,DEFAULT,DELETE,DESC,DISTINCT,DROP,ELSE,EXCLUSIVE,";
dbKeys += "EXISTS,FILE,FLOAT,FOR,FROM,GRANT,GROUP,HAVING,IDENTIFIED,";
dbKeys += "IMMEDIATE,IN,INCREMENT,INDEX,INITIAL,INSERT,INTEGER,INTERSECT,";
dbKeys += "INTO,IS,LEVEL,LIKE,LOCK,LONG,MAXEXTENTS,MINUS,MLSLABEL,MODE,";
dbKeys += "MODIFY,NOAUDIT,NOCOMPRESS,NOT,NOWAIT,NULL,NUMBER,OF,OFFLINE,ON,";
dbKeys += "ONLINE,OPTION,OR,ORDER,PCTFREE,PRIOR,PRIVILEGES,PUBLIC,RAW,";
dbKeys += "RENAME,RESOURCE,REVOKE,ROW,ROWID,ROWNUM,ROWS,SELECT,SESSION,";
dbKeys += "SET,SHARE,SIZE,SMALLINT,START,SUCCESSFUL,SYNONYM,SYSDATE,TABLE,";
dbKeys += "THEN,TO,TRIGGER,UID,UNION,UNIQUE,UPDATE,USER,VALIDATE,VALUES,";
dbKeys += "VARCHAR,VARCHAR2,VIEW,WHENEVER,WHERE,WITH,";
export default class FieldConfigStore {
comObj;
newIdIndex = 0;
selectDefineList;
@observable selectCommonList = [];
errors = [];
tempOptionList = [];
notCopyFields = [];
delFields = [];
@observable canEdit;
@observable columnDta = [];
columnDef = [];
@observable responseData = {};
@observable selectedKeys = [];
@observable selectedData = {};
@observable loading = true;
@observable fieldType = "";
@observable prjTypeId = "";
@observable dbfieldnamesForCompare = "";
@observable dbfieldnamesForCompare2 = "";
// 字段加密
@observable encryptFieldSetVisible = false;
@observable encryptFieldSetForm = {
fieldForm: new WeaForm(),
conditioninfo: [],
loading: false,
}
@observable currentClickRecord = {};
@observable needInitData = '1';
@observable oldisencrypt = '';
@action
componentWillMount = (comObj) => {
this.comObj = comObj;
this.comObj.props.params.viewOpend = 1;
}
@action
componentDidMount = (prjtype, prjtypeid) => {
this.loading = true;
this.clearData();
if (prjtype == "prjtype") {
this.initDatas({
prjFieldType: prjtype,
prjTypeId: prjtypeid
});
} else {
this.initDatas({
prjFieldType: prjtype,
prjTypeId: prjtypeid
});
}
}
@action
initDatas = (params) => {
this.fieldType = params.prjFieldType;
this.prjTypeId = params.prjTypeId;
Apis.getPrjFieldData(params).then(action((datas) => {
// if(status == "success"){
let { columnDef, columnDta, canEdit, selectDefineList, rightMenus, selectedData, dbfieldnamesForCompare, dbfieldnamesForCompare2, selectCommonList } = datas;
columnDef && columnDef.map(res => {
if (res.dataIndex === 'encryptSet') {
res.com[0] = {
type: 'CUSTOM',
key: res.dataIndex,
render: (text, record, index, onEdit) => {
if (record) {
if(record.viewAttr ==1||!(record.fieldHtmlType==1||record.fieldHtmlType==2)){
return (<span />);
}
//项目类型不显示通用字段的加密设置
if(this.fieldType=='prjtype'&&record.fieldtype==1){
return (<span />);
}
//项目通用字段名称、状态不显示
if(this.fieldType=='prj'&&(record.fieldName=='name'||record.fieldName=='procode'||record.fieldName=='status')){
return (<span />);
}
//任务字段名称、上级任务、进度、前置任务不显示
if(this.fieldType=='prjtsk'&&(record.fieldName=='subject'||record.fieldName=='parentid'||record.fieldName=='finish'||record.fieldName=='prefinish')){
return (<span />);
}
return (
<span className="prj-encrypt-setting"
onClick={() => {
this.getEncryptFieldSetForm(record);
}}
>{getLabel(526997, '加密设置')}</span>
);
}
return (<span />);
},
};
}
return res;
})
for (let rowData of columnDta) {
// 对已有数据数据库字段名称增加onChange处理
rowData.com.fieldName[0].onChange = this.fieldNameChange.bind(this);
// 对已有数据数据库字段名称增加onChange处理
// rowData.com.fieldLabel[0].onChange = this.fieldLabelChange.bind(this);
// 对已有数据,重新定义行上的选择框和附件上传的联动效果
rowData.com.fieldDbType[0].options = (compArr) => {
return this.defineCascader(compArr, rowData.id,rowData.canDel);
}
}
this.canEdit = canEdit;
let columnKey = 0;
let columnDatas = [];
columnDta.map(item => {
columnDatas.push({
...item,
key: columnKey
});
columnKey++;
});
this.columnDta = columnDatas;
this.columnDef = columnDef;
// setTimeout(function(){
this.selectedData = selectedData;
this.dbfieldnamesForCompare = dbfieldnamesForCompare;
this.dbfieldnamesForCompare2 = dbfieldnamesForCompare2;
// },500);
this.selectDefineList = selectDefineList;
this.selectCommonList = selectCommonList;
this.loading = false;
this.responseData = { status: "success", errorMsg: "", canEdit: canEdit, rightMenus: rightMenus };
}));
}
@action
componentWillUnmount = () => {
this.clearData();
}
@action
reSearch(comObj) {
this.clearData(true);
const params = {
prjFieldType: this.fieldType,
prjTypeId: this.prjTypeId
}
this.initDatas(params);
}
@action
clearData = (isSave) => {
this.canEdit = false;
this.columnDef = [];
this.columnDta = [];
this.newIdIndex = 0;
this.delFields = [];
this.selectedKeys = [];
this.selectedData = {};
this.notCopyFields = [];
this.selectDefineList = [];
if (!isSave) {
this.prjTypeId = "";
}
}
// 重新定义字段类型的联动效果
@action
defineCascader(compArr, dataIndex, canDel) {
if (compArr.length == 7) {
// 移除特殊字段
compArr.pop();
// 移除附件上传
compArr.pop();
}
return compArr.map((comp) => {
if (comp.key == 'input') {
// 文本长度 必填
let newComp = { ...comp };
newComp.subChildren.subChildren.text.viewAttr = 3;
return newComp;
} else if (comp.key == 'select') {
// 增加选择项维护功能
let newComp = {...comp,otherParams:{customProps:{viewAttr:"3"}},viewAttr:"3"};
newComp.subChildren = {
type: 'select',
viewAttr: dataIndex.indexOf('newId_')>-1?'3':'1',
options: [{
key: '0',
selected:true,
showname: getLabel(124929, '独立选择框', 'label')
},{
key: '1',
showname: getLabel(124930, '公共选择框', 'label')
}],
subChildren:{
'0':{
type: FieldOptionManage,
fieldId: dataIndex
},
'1':{
type: FieldCommonSelect,
fieldId: dataIndex,
canDel: canDel
}
}
};
return newComp;
} else if (comp.key == 'upload') {
// 去掉附件上传的子组件
let newComp = { ...comp };
return newComp;
} else if (comp.key == 'textarea') {
// 高度默认值为4去掉是否html编辑check框和label
let newComp = { ...comp };
newComp.subChildren[0].value = 4;
return newComp;
}else if(comp.key == "browser"){
let newComp = { ...comp };
newComp.subChildren.viewAttr = 3;
newComp.subChildren.subChildren[161].viewAttr = 3;
newComp.subChildren.subChildren[162].viewAttr = 3;
return newComp;
}
return comp;
});
}
@action
fieldNameChange = (v, record, index, key) => {
const that = this;
if (v) {
// 验证数据库字段名称只能是英文和数字,且必须是英文开头
if (!/^[a-zA-Z][a-zA-Z0-9]*$/.test(v)) {
Modal.error({
title: getLabel(15172, "系统提示"),
content: getLabel(384192, "数据库字段名称必须以字母开头,并且只允许字母和数字的组合!"),
okText: getLabel(826, "确定"),
onOk() {
// 清空输入框
that.columnDta[index].fieldName = "";
}
});
}
var fname = v;
if (fname != "") {
fname = "," + fname.toUpperCase() + ",";
if (dbKeys.indexOf(fname) > 0) {
Modal.error({
title: getLabel(15172, "系统提示"),
content: getLabel(19946, "不能使用数据库保留字作为字段名!"),
okText: getLabel(826, "确定"),
onOk() {
// 清空输入框
that.columnDta[index].fieldName = "";
}
});
}
}
}
}
@action
fieldLabelChange = (v, record, index, key) => {
const that = this;
WeaTools.callApi("/api/workflow/formSetting/fieldSet/getPinYin", "POST", {labelName:v}).then((datas) => {
that.columnDta[index].fieldName = datas.pinyin;
});
}
@action
setColumnDta = (columnDta) => {
this.columnDta = columnDta;
// // 数据更新后同步selectedData处理删除或者移动行的情况
// const cde = toJS(this.columnDef);
// let newSelectedData = {};
// for(let k=0;k<cde.length;k++){
// const isCheckBoxField = cde[k].hasOwnProperty("checkType");
// if(isCheckBoxField){
// const comType = cde[k].checkType;
// if(comType != "checkbox"){
// continue;
// }
// const dataIndex = cde[k].dataIndex;
// let rows = this.comObj.refs.tableObj.getSelectedDatas(dataIndex);
// if(Array.isArray(rows)){
// let arrs = [];
// for(let i=0;i<rows.length;i++){
// arrs.push(rows[i].key);
// }
// newSelectedData[dataIndex] = arrs;
// }
// }
// }
// this.selectedData = newSelectedData;
}
@action
setSelectedKeys = (keys) => {
this.selectedKeys = keys;
}
@action
setCheckedData(checkedData){
this.selectedData = checkedData;
}
@action
setSelectedData = (dataIndex, selectedData) => {
let isOpen = selectedData.isOpen;
let isMust = selectedData.isMust;
let index = 0;
if (dataIndex == "isOpen") {
let needDel = [];
isMust.map((item,key) => {
if (isOpen.indexOf(item) == -1) {
index = isMust.indexOf(item);
if (index > -1) {
needDel.push(index);
}
}
});
let isMustNew = [];
isMust.map((item,key)=>{
if(needDel.indexOf(key)==-1){
isMustNew.push(item);
}
})
isMust = isMustNew;
} else {
isMust.map(item => {
if (isOpen.indexOf(item) == -1) {
index = isOpen.indexOf(item);
if (index == -1) {
isOpen.push(item);
}
}
});
}
this.selectedData = { ...selectedData, isOpen: isOpen, isMust: isMust };
}
@action
saveTemOption = (fieldId,temOption) => { //备份选择框选项
let finded = false;
for (let temp of this.tempOptionList) {
if (fieldId == temp.fieldid) {
finded = true;
temp.options = temOption;
break;
}
}
if (!finded) {
this.tempOptionList.push({ fieldid: fieldId, variable: true, options: temOption });
}
}
@action
resetSelectDefineList = (fieldId) => { //用备份重置选择框选项
for (let selectDefine of this.selectDefineList) {
if (fieldId == selectDefine.fieldid) {
for (let temp of this.tempOptionList) {
if (fieldId == temp.fieldid) {
selectDefine.options = temp.options
break;
}
}
break;
}
}
}
@action
setSelectDefineList = (fieldId, datas) => {
let options = []
let i = 0;
for (let data of datas) {
let id = data.id == "" ? "select_" + i : data.id
let key = typeof (data.key) == "undefined" ? i : data.key
options.push({ key: key + "", id: id + "", showname: data.showname, isdefault: data.isdefault, value: i });
i++;
}
let finded = false;
for (let selectDefine of this.selectDefineList) {
if (fieldId == selectDefine.fieldid) {
finded = true;
selectDefine.options = options;
break;
}
}
if (!finded) {
this.selectDefineList.push({ fieldid: fieldId, variable: true, options: options });
}
}
@action
setSelectCommonList = (fieldId,data) => {
let params = {id:data}
let finded = false;
for (let selectCommon of this.selectCommonList) {
if (fieldId == selectCommon.fieldid) {
finded = true;
Apis.getSelectCommonOptions(params).then(action((datas) => {
selectCommon.value = data;
selectCommon.options = datas.options;
selectCommon.replaceDatas = datas.replaceDatas;
}))
break;
}
}
if (!finded) {
Apis.getSelectCommonOptions(params).then(action((datas) => {
this.selectCommonList.push({ fieldid: fieldId, variable: true, value: data, options: datas.options, replaceDatas: datas.replaceDatas });
}))
}
}
@action
doSaveCheck = () => {
// this.responseData={};
this.loading = true;
let f = true;
let checkrepeat = true;
let checkrepeat2 = true;//校验其他项目类型的重复
const cde = toJS(this.columnDef);
const cda = toJS(this.columnDta);
for (let j = 0; j < cda.length; j++) {
const rda = cda[j];
if (rda.canDel == "n") {
continue;
}
for (let k = 0; k < cde.length; k++) {
const dataIndex = cde[k].dataIndex;
const viewAttr = cde[k].com[0].viewAttr;
let value = ""
if (dataIndex == "fieldDbType") {
if(rda[dataIndex] instanceof Array && rda[dataIndex][0] == "input"){
const inputType = rda[dataIndex][1];
if(inputType == "text"){
value = rda[dataIndex][2];
}else{
continue;
}
}else if(rda[dataIndex] instanceof Array && rda[dataIndex][0] == "browser"){
if(typeof(rda[dataIndex][1])!=="undefined" &&( rda[dataIndex][1]['value'] == "161" || rda[dataIndex][1]['value'] == "162")){
if(typeof (rda[dataIndex][2]) == "undefined"){
value = rda[dataIndex][2];
}else{
value = rda[dataIndex][2]['value'];
}
}else{
value = rda[dataIndex][1];
}
}else{
continue;
}
} else {
value = rda[dataIndex];
}
if (viewAttr == 3 && (value == "" || typeof (value) == "undefined")) {
f = false;
break;
}
if (rda["id"].indexOf("newId") > -1) {
for(let s=0;s < cda.length; s++){
const rda2 = cda[s];
if(rda["id"] !== rda2["id"] && rda2["fieldName"]==rda["fieldName"]){
checkrepeat = false;
break;
}
}
if (this.dbfieldnamesForCompare.indexOf(","+rda["fieldName"].trim().toUpperCase()+",") > 0) {
checkrepeat = false;
break;
}
if (this.dbfieldnamesForCompare2.indexOf(","+rda["fieldName"].trim().toUpperCase()+",") > 0) {
checkrepeat2 = false;
break;
}
}
}
if (!f) {
break;
}
}
let f1 = true;//校验公共选择的必填
toJS(this.errors).map(error => {
const c = error.ref;
if (f1 && c && !c.props.children.props.value && c.props.children.props.viewAttr == "3") {
c.showError();
f1=false;
}
});
if (f && checkrepeat && checkrepeat2 && f1) {
let cdaCopy = [].concat(toJS(cda));
for (let rowData of cdaCopy) {
// delete rowData.com;
// delete rowData.checkProps;
for (let c of cde) {
const isCheckBoxField = c.hasOwnProperty("checkType");
if (isCheckBoxField) {
const dataIndex = c.dataIndex;
rowData[dataIndex] = 0;
}
}
}
// checkBox的值与datas里的值进行同步
for (let k = 0; k < cde.length; k++) {
const isCheckBoxField = cde[k].hasOwnProperty("checkType");
if (isCheckBoxField) {
const dataIndex = cde[k].dataIndex;
let rows = this.comObj.refs.tableObj.getSelectedDatas(dataIndex);
for (let row of rows) {
for (let rowData of cdaCopy) {
if (row.id == rowData.id && row.fieldtype == rowData.fieldtype) { //通用里面的id和自定义里的id相同时会导致字段勾选不生效
rowData[dataIndex] = 1;
}
}
}
}
}
const fieldList = JSON.stringify(cdaCopy);
const selectDefineList = JSON.stringify(this.selectDefineList);
const selectCommonList = JSON.stringify(this.selectCommonList);
const delFieldIdList = JSON.stringify(this.delFields);
// const viewOpend = this.comObj.props.params.viewOpend;
WeaTools.callApi("/api/proj/custom/saveField", "POST", { fieldList: fieldList, selectDefineList: selectDefineList, fieldType: this.fieldType, prjTypeId: this.prjTypeId, delFieldIdList: delFieldIdList, selectCommonList: selectCommonList }).then((datas) => {
if (datas.status == "success") {
message.success(datas.msg);
this.reSearch();
} else {
message.error(datas.msg);
this.loading = false;
}
});
} else {
if (!checkrepeat) {
// Modal.warning({
// title: getLabel(15172, "系统提示"),
// content: getLabel(83470, "数据库字段名称重复,请重新输入")
// });
message.error(getLabel(83470, "数据库字段名称重复,请重新输入"));
} else if (!checkrepeat2) {
// Modal.warning({
// title: getLabel(15172, "系统提示"),
// content:getLabel('385973',"数据库字段名与项目类型其他自定义字段重复,请修改!")
// });
message.error(getLabel('385973',"数据库字段名与项目类型其他自定义字段重复,请修改!"));
} else {
if(f1){
this.comObj.refs.tableObj.refs.edit.doRequiredCheck();
}
}
this.loading = false;
}
}
@action
doAdd() {
const tableIns = this.comObj.refs.tableObj.refs.edit;
tableIns.doAdd();
// id自增
this.newIdIndex++;
const newId = "newId_" + this.newIdIndex;
const dataIndex = this.columnDta.length - 1;
// 新增行的id
this.columnDta[dataIndex].id = newId;
// 新增项目类型字段时需要给fieldtype2
//debugger;
if (this.fieldType == "prjtype") {
this.columnDta[dataIndex].fieldtype = 2;
} else {
this.columnDta[dataIndex].fieldtype = 1;
}
// 新增行的启用字段默认位勾选状态
this.columnDta[dataIndex].checkProps = {
isOpen: { value: 1, disabled: false }, isMust: { value: 0, disabled: false }
}
// this.columnDta[dataIndex].isOpen = 1;
// 字段显示名
let fieldLabel = [{ ...this.columnDef[0].com[0],onChange: this.fieldLabelChange }];
// 数据库字段名称
let fieldName = [{ ...this.columnDef[1].com[0], onChange: this.fieldNameChange }];
// 字段类型
let fieldDbType = [{
key: "fieldDbType", type: "CUSTOMFIELD", options: (compArr) => {
return this.defineCascader(compArr, newId);
}
}];
// 组名
let groupId = [{ ...this.columnDef[3].com[0] }];
groupId[0].options[0].selected = true;
let selectedOption = groupId[0].options[0].key;
this.columnDta[dataIndex].groupId = selectedOption;
// 更新选择框类型选项维护的dataIndex(newId)
//let isopen = "1";
this.columnDta[dataIndex].com = { fieldName: fieldName, fieldLabel: fieldLabel, fieldDbType: fieldDbType, groupId: groupId, variable : true };
let newselectIndex = this.columnDta.length - 1
this.selectedData.isOpen.push(newselectIndex);
}
@action
doDelete() {
const tableIns = this.comObj.refs.tableObj.refs.edit;
const sRowKeys = tableIns.state.selectedRowKeys;
if (sRowKeys.length == 0) {
Modal.info({
title: getLabel(15172, "系统提示"),
content: getLabel(30951, "请选择需要删除的数据!"),
okText: getLabel(826, "确定"),
onOk() { },
});
return;
}
const that = this;
Modal.confirm({
title: getLabel(15172, "系统提示"),
content: getLabel(83600, "确定要删除吗?"),
onOk() {
for (let sKey of sRowKeys) {
const delFieldId = that.columnDta[sKey].id;
const delFieldName = that.columnDta[sKey].fieldName;
that.dbfieldnamesForCompare = that.dbfieldnamesForCompare.replace(","+delFieldName.trim().toUpperCase()+",",",");
that.dbfieldnamesForCompare2 = that.dbfieldnamesForCompare2.replace(","+delFieldName.trim().toUpperCase()+",",",");
if (delFieldId.indexOf("newId_") == -1) {
that.delFields.push(delFieldId);
}
for (const error of that.errors) {
if (delFieldId == error.id) {
error.ref = null;
break;
}
}
}
tableIns.doDelete();
that.setSelectedKeys([]);
}
});
}
@action
doCopy() {
let sRowKeys = this.selectedKeys.sort();
if(typeof(sRowKeys) == "undefined" || sRowKeys.length == 0){
Modal.info({
title: getLabel(15172,'系统提示'),
content: getLabel( 31433 ,"请选择需要复制的数据!"),
okText:getLabel(826,"确定"),
onOk() {},
});
return;
}
sRowKeys = this.selectedKeys.sort();
let newSelectedData = {...toJS(this.selectedData)};
let newSelectDefineList = [].concat(this.selectDefineList);
for(const key of sRowKeys){
let newRowData = {...toJS(this.columnDta[key])};
const oldId = newRowData.id;
// id自增
this.newIdIndex++;
// 复制select可选项
const newId = "newId_"+this.newIdIndex;
for(let sl of this.selectDefineList){
debugger;
if(sl.fieldid == oldId){
let newSl = {...sl};
newSl.fieldid = newId;
newSl.id = newId;
newSl.variable = true;
newSelectDefineList.push(newSl);
break;
}
}
// 复制公共select
for(let sl of this.selectCommonList){
debugger;
if(sl.fieldid == oldId){
let newSl = {...sl};
newSl.fieldid = newId;
newSl.variable = true;
this.selectCommonList.push(newSl);
break;
}
}
newRowData.fieldid = newId;
newRowData.id = newId;
newRowData.canDel = "y";
for(let pName in newRowData.checkProps) {
newRowData.checkProps[pName].viewAttr = 2;
}
if(oldId.indexOf("newId_") == -1){
// 字段显示名
let fieldLabel = [{ ...this.columnDef[0].com[0],onChange:this.fieldLabelChange }];
// 数据库字段名称
let fieldName = [{...this.columnDef[1].com[0],onChange:this.fieldNameChange.bind(this)}];
// 字段类型
let fieldDbType = [{key:"fieldDbType",type:"CUSTOMFIELD",options:(compArr) => {
return this.defineCascader(compArr,newId);
}}];
newRowData.com.fieldName = fieldName;
newRowData.com.fieldLabel = fieldLabel;
newRowData.com.fieldDbType = fieldDbType;
newRowData.fieldDbType = newRowData.fieldDbTypeEdit;
}else{
// 字段类型
let fieldDbType = [{
key: "fieldDbType", type: "CUSTOMFIELD", options: (compArr) => {
return this.defineCascader(compArr, newId);
}
}];
newRowData.com.fieldDbType = fieldDbType;
}
for(let c of this.columnDef){
const isCheckBoxField = c.hasOwnProperty("checkType");
if(isCheckBoxField){
let finded = false;
for(let sKey of this.selectedData[c.dataIndex]){
if(key == sKey){
finded = true;
break;
}
}
if(finded){
// 被复制行是选中的
newSelectedData[c.dataIndex].push(this.columnDta.length);
}
}
}
this.columnDta.push(newRowData);
}
this.selectedData = newSelectedData;
this.selectDefineList = newSelectDefineList;
}
@action
getRightMenus() {
const { rightMenus } = this.responseData;
let btnArr = [];
let copyDisabled = true;
let deleDisabled = true;
const sRowKeys = toJS(this.selectedKeys);
if (sRowKeys.length > 0) {
copyDisabled = false;
deleDisabled = false;
}
rightMenus && rightMenus.length > 0 && rightMenus.map(m => {
btnArr.push({
key: m.type,
icon: <i className={m.menuIcon} />,
content: m.menuName,
disabled: this.loading || (m.type == "BTN_COPY" ? copyDisabled : deleDisabled && m.isControl == "1"),
onClick: key => {
this.buttonClick(key);
}
})
});
return btnArr;
}
getTopButtons() {
const { rightMenus } = this.responseData;
let btnArr = [];
let copyDisabled = true;
let deleDisabled = true;
const sRowKeys = toJS(this.selectedKeys);
if(sRowKeys.length > 0){
copyDisabled = false;
}
if(sRowKeys.length > 0 ){
deleDisabled = false;
}
rightMenus && rightMenus.length > 0 && rightMenus.map(m=>{
m.isTop == "1" && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pqylee@${m.type}`} style={{marginLeft:"10px"}} type={"primary"}
disabled={this.loading||(m.type=="BTN_COPY"?copyDisabled:deleDisabled && m.isControl == "1")}
onClick={()=>{
this.buttonClick(m.type);
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
@action
buttonClick(key) {
if (key == "BTN_SUBMIT") {
this.doSaveCheck();
} else if (key == "BTN_DELETE") {
this.doDelete();
} else if (key == "BTN_ADD_SHARE") {
this.doAdd();
} else if (key == "BTN_COPY") {
this.doCopy();
}
}
@action clear = () => {
this.encryptFieldSetForm.fieldForm.isFormInit && this.encryptFieldSetForm.fieldForm.resetConditionValue();
}
setParams = (params = {}, callback) => {
Object.keys(params).forEach(key => {
this[key] = params[key];
});
typeof callback === 'function' && callback();
}
// 获取加密字段设置表单
@action
getEncryptFieldSetForm = async (record) => {
if (!record) return;
this.encryptFieldSetVisible = true;
this.currentClickRecord = record;
let params = {
fieldType: this.fieldType,
fieldName: record.fieldName
};
this.encryptFieldSetForm.loading = true;
this.clear();
const result = await Apis.getFieldSet(params);
if (result.status == '1') {
const conditioninfo = result.conditioninfo || [];
this.encryptFieldSetForm.fieldForm.initFormFields(conditioninfo);
this.encryptFieldSetForm.conditioninfo = conditioninfo;
this.oldisencrypt = result.isencrypt;
}
this.encryptFieldSetForm.loading = false;
}
// 保存加密字段设置
@action saveEncryptFieldSet = async () => {
this.needInitData = '1';
const isencrypt = this.encryptFieldSetForm.fieldForm.getFormParams().isencrypt;
if(this.oldisencrypt=='0'&&isencrypt=='1'){
this.confirmInfo({
width: 500,
content: (
<div>
<div>1.{getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!')}</div><br />
<div>
<span>2.{getLabel('531157','历史数据量可能较大, 此操作可能需要较长时间,对系统性能也可能会造成一定影响,请确认是否处理历史数据:')}</span>
<span>
<WeaSelect ecId={`${this.myProps && this.myProps.ecId || ''}_WeaSelect@s8aet2`} style={{display: 'inline'}}
options={[
{
key: '1',
selected: false,
showname: getLabel('553','处理')
},{
key: '0',
selected: false,
showname: getLabel('529752','不处理')
},
]}
detailtype={3}
value={this.needInitData}
supportCancel
onChange={(v,showname)=>{
this.needInitData = v;
}}
/>
</span>
</div>
</div>
),
onOk: this.doSave
});
}else{
this.needInitData = '0';
this.doSave();
}
}
// 保存加密字段设置
@action doSave = async () => {
if (!this.currentClickRecord) return;
let params = {
...this.encryptFieldSetForm.fieldForm.getFormParams(),
fieldType: this.fieldType,
fieldName: this.currentClickRecord.fieldName,
fromType: 'defineField',
needInitData: this.needInitData
};
this.encryptFieldSetForm.loading = true;
const result = await Apis.saveFieldSet(params);
if (!result.status) {
message.error(result.api_errormsg);
} else if (result.status == '1') {
message.success(`${getLabel(18758, '保存成功')}`);
this.encryptFieldSetVisible = false;
} else {
message.error(result.message ? result.message : `${getLabel(22620, '保存失败')}`);
}
this.encryptFieldSetForm.loading = false;
}
//#region confirm info
confirmInfo = (props) => {
confirm({
...props,
title: props.title || getLabel(131329, '信息确认'),
okText: getLabel(33703, '确定'),
cancelText: getLabel(32694, '取消')
});
}
}

View File

@ -0,0 +1,232 @@
import { observable,action,computed,toJS } from 'mobx';
import { WeaTools,WeaLocaleProvider } from 'ecCom';
import { Modal,message,Button } from "antd";
import * as Apis from '../../apis/custom';
const getLabel = WeaLocaleProvider.getLabel;
export default class FieldGroupStore {
comObj;
columnDef;
columnDta;
@observable canEdit;
@observable responseData = {};
@observable selectedKeys = [];
@observable prjtype = "";
@action
componentWillMount=(comObj)=>{
this.comObj = comObj;
}
@action
componentDidMount=(prjtype)=>{
this.initDatas(prjtype);
}
@action
initDatas=(prjtype)=>{
this.prjtype = prjtype;
const params = {
prjFieldType : prjtype,
prjTypeId : "3"
}
//getFieldGroupData
Apis.getFieldGroupData(params).then((datas)=>{
const {columnDef,columnDta,title,canEdit} = datas;
this.canEdit = canEdit;
this.columnDef = columnDef;
this.columnDta = columnDta;
this.responseData = {status:"success",errorMsg:"",...datas};
this.selectedKeys = [];
});
}
@action
componentWillUnmount=()=>{
this.comObj = {};
this.columnDef = [];
this.columnDta = [];
this.responseData = {};
this.selectedKeys = [];
}
@action
setSelectedKeys=(keys)=>{
this.selectedKeys = keys;
}
@action
setColumnDta=(columnDta)=>{
this.columnDta = columnDta;
}
@action
doSaveCheck=()=>{
let f = true;
let fieldLabel;
const cde = toJS(this.columnDef);
const cda = toJS(this.columnDta);
for(let j=0;j < cda.length; j++){
const rda = cda[j];
for(let k=0;k<cde.length;k++){
const label = cde[k].title;
const viewAttr = cde[k].com[0].viewAttr;
const dataIndex = cde[k].dataIndex;
const value = rda[dataIndex];
if(viewAttr == 3 && (value == "" || typeof(value) == "undefined")){
f = false;
fieldLabel = label;
break;
}
}
if(!f){
break;
}
}
if(f){
const useTable = this.comObj.props.params.useTable;
const fieldGroupList = JSON.stringify(cda);
const params = {
fieldGroupList:fieldGroupList,
useTable:useTable,
fieldType : this.prjtype
}
Apis.saveFieldGroupData(params).then((datas)=>{
if(datas.msgid == "0"){
message.success(datas.msg);
this.responseData = {};
this.initDatas(this.prjtype);
}else{
message.error(datas.msg);
}
});
// WeaTools.callApi("/api/prj/baseInfo/fieldGroupSave", "POST", {fieldGroupList:fieldGroupList,useTable:useTable}).then((datas)=>{
// });
}else{
this.comObj.refs.tableObj.refs.edit.doRequiredCheck();
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
}
}
doAdd(){
const tableIns = this.comObj.refs.tableObj.refs.edit;
tableIns.doAdd();
}
doCopy(){
const sRowKeys = this.selectedKeys.sort();
const tableIns = this.comObj.refs.tableObj.refs.edit;
if(sRowKeys.length==0){
Modal.info({
title: getLabel(15172,"系统提示"),
content: getLabel(31433,"请选择需要复制的数据"),
okText:getLabel(826,"确定"),
onOk() {},
});
}else{
tableIns.doCopy();
}
}
doDelete(){
const tableIns = this.comObj.refs.tableObj.refs.edit;
const sRowKeys = tableIns.state.selectedRowKeys;
if(sRowKeys.length == 0){
Modal.info({
title: getLabel(15172,"系统提示"),
content: getLabel(30951,"请选择需要删除的数据!"),
okText:getLabel(826,"确定"),
onOk() {},
});
return;
}
tableIns.doDelete();
this.setSelectedKeys([]);
}
getRightMenus(){
const {rightMenus} = this.responseData;
let btnArr = [];
rightMenus && rightMenus.length > 0 && rightMenus.map(m=>{
if(m.type == "BTN_DELETE" || m.type == "BTN_COPY"){
btnArr.push({
key: m.type,
icon: <i className={m.menuIcon}/>,
disabled : this.selectedKeys.length == 0,
content: m.menuName,
onClick: key =>{
if(key == "BTN_SUBMIT"){
this.doSaveCheck();
}else if(key == "BTN_DELETE"){
this.doDelete();
}else if(key == "BTN_ADD"){
this.doAdd();
}else if(key == "BTN_COPY"){
this.doCopy();
}
}
})
}else{
btnArr.push({
key: m.type,
icon: <i className={m.menuIcon}/>,
content: m.menuName,
onClick: key =>{
if(key == "BTN_SUBMIT"){
this.doSaveCheck();
}else if(key == "BTN_DELETE"){
this.doDelete();
}else if(key == "BTN_ADD"){
this.doAdd();
}else if(key == "BTN_COPY"){
this.doCopy();
}
}
})
}
});
return btnArr;
}
getTopButtons(){
const {rightMenus} = this.responseData;
let btnArr = [];
let copyDisabled = true;
let deleDisabled = true;
const sRowKeys = toJS(this.selectedKeys);
if(sRowKeys.length > 0){
copyDisabled = false;
}
if(sRowKeys.length > 0 ){
deleDisabled = false;
}
rightMenus && rightMenus.length > 0 && rightMenus.map(m=>{
m.isTop == "1" && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@nxlp03@${m.type}`} type={"primary"}
style={{marginLeft:"10px"}}
disabled={m.type=="BTN_COPY"?copyDisabled:deleDisabled && m.isControl == "1"}
onClick={()=>{
if(m.type == "BTN_SUBMIT"){
this.doSaveCheck();
}else if(m.type == "BTN_DELETE"){
this.doDelete();
}else if(m.type == "BTN_ADD"){
this.doAdd();
}else if(m.type == "BTN_COPY"){
this.doCopy();
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
}

View File

@ -0,0 +1,220 @@
import { observable, action, toJS} from 'mobx';
import { WeaTools,WeaCheckbox} from 'ecCom';
import {CptListStore} from './CptListStore';
import {WeaForm} from 'comsMobx';
import * as API_LIST from '../../apis/custom';
import { message,Modal } from 'antd';
/**
* @author
*
*/
export default class FieldInfoStore extends CptListStore{
@observable isModalEdit = false;
@observable columnDatas = [];
@observable selectedKey = "1";
@observable tabTitle = "";
@observable tabData = [];
title = "显示栏目";
// @observable formtype = new WeaForm();
@action
clearStatus=()=>{
this.selectedKey="1";
}
@observable columns = [{
"title": "数据库字段名称",
"com": [{
"viewAttr": "3",
"label": "",
"type": "INPUT",
"key": "fieldname"
}],
"width": "10%",
"dataIndex": "fieldname",
"key": "fieldname"
}, {
"title": "字段显示名",
"com": [{
"label": "",
"type": "INPUT",
"viewAttr": "3",
"key": "fieldlabel"
}],
"width": "20%",
"dataIndex": "fieldlabel",
"key": "fieldlabel"
}, {
"title": "字段类型",
"com": [{
"label": "",
"type": "CUSTOMFIELD",
"viewAttr": "3",
"key": "type",
"options" : (compArr)=>{
return this.defineCascader(compArr);
}
}],
"width": "25%",
"dataIndex": "type",
"key": "type"
}, {
"title": "分组",
"com": [{
"label": "",
"type": "SELECT",
"editType": "2",
"key": "linkurl"
}],
"width": "15%",
"useRecord": true,
"dataIndex": "linkurl",
"key": "linkurl"
}, {
"title": <span><WeaCheckbox onChange={this.chooseCheckBoxAll_isopen.bind(this)}/>启用</span>,
"com": [{
"label": "",
"type": "CHECKBOX",
"editType": "2",
"key": "isopen"
}],
"width": "15%",
"useRecord": true,
"dataIndex": "isopen",
"key": "isopen"
}, {
"title": <span><WeaCheckbox onChange={this.chooseCheckBoxAll_ismand.bind(this)}/>必填</span>,
"com": [{
"label": "",
"type": "CHECKBOX",
"editType": "2",
"key": "ismand"
}],
"width": "15%",
"useRecord": true,
"dataIndex": "ismand",
"key": "ismand"
}];
@observable browserColumns = [];
// 重新定义字段类型的联动效果
defineCascader(compArr,dataIndex){
if(compArr.length == 7){
// 移除特殊字段
compArr.pop();
}
return compArr.map((comp) => {
if(comp.key == 'input'){
// 文本长度 必填
let newComp = {...comp};
newComp.subChildren.subChildren.text.viewAttr = 3;
return newComp;
}else if (comp.key == 'select') {
// 增加选择项维护功能
let newComp = {...comp};
newComp.subChildren = {
// type: FieldOptionManage,fieldId:dataIndex
};
return newComp;
}else if (comp.key == 'upload') {
// 去掉附件上传的子组件
let newComp = {...comp};
delete newComp.subChildren;
return newComp;
}else if (comp.key == 'textarea') {
// 高度默认值为4去掉是否html编辑check框和label
let newComp = {...comp};
newComp.subChildren[0].value = 4;
delete newComp.subChildren[1];
delete newComp.subChildren[2];
return newComp;
}
return comp;
});
}
@action
initDatas=()=>{
WeaTools.callApi("/api/proj/custom/getPrjFieldTab", "GET").then((datas)=>{
// if(status == "success"){
// let {tabTitle,tabData} = datas;
this.tabTitle = datas.tabTitle;
this.tabData = datas.tabData;
// this.responseData = {status:status,errorMsg:msgcode,tabTitle:tabTitle,tabData:tabData};
// }else{
// if(hasright){
// this.responseData = {status:status,errorMsg:msgcode};
// }else{
// this.responseData = {status:status,errorMsg:"对不起,您暂时没有权限!"};
// }
// }
});
}
@action
changeTabKey = (key)=>{
this.selectedKey = key;
}
@action
getColumnsInfo=(params)=>{
this.columnDatas = [{
fieldlabel : "isdata",
fieldname : "是否",
ismand : "1",
isopen : "1",
type : [
"input",
"text",
"2"
]
}]
}
checkData=()=>{
let canSave = true;
this.columnDatas.forEach(element => {
if(element.groupnamecn==""){
canSave = false;
}
})
return canSave;
}
@action
setColumnDatas=(datas)=>{
let _this = this;
_this.columnDatas = datas;
}
chooseCheckBoxAll_isopen(value){
if(value == "1"){
this.columnDatas = this.columnDatas.map(item=>{
item.isopen = "1";
return item;
})
}else{
this.columnDatas = this.columnDatas.map(item=>{
item.isopen = "0";
return item;
})
}
}
chooseCheckBoxAll_ismand(value){
if(value == "1"){
this.columnDatas = this.columnDatas.map(item=>{
item.ismand = "1";
return item;
})
}else{
this.columnDatas = this.columnDatas.map(item=>{
item.ismand = "0";
return item;
})
}
}
}

View File

@ -0,0 +1,164 @@
import { observable,action,computed,toJS } from 'mobx';
import { WeaTools,WeaLocaleProvider } from 'ecCom';
import { Modal,message,Button } from "antd";
import * as Apis from '../../apis/custom';
const getLabel = WeaLocaleProvider.getLabel;
export default class FieldLanguageStore {
comObj;
columns;
dataMap;
@observable canEdit;
@observable responseData = {};
@observable fieldType = "";
@observable prjTypeId = "";
@action
componentWillMount=(comObj)=>{
this.comObj = comObj;
this.dataMap = new Map();
}
@action
componentDidMount=(prjtype,prjtypeid)=>{
const params = {
prjFieldType : prjtype,
prjTypeId : prjtypeid
}
this.initDatas(params);
}
@action
initDatas=(params)=>{
this.fieldType = params.prjFieldType;
this.prjTypeId = params.prjTypeId;
Apis.getFieldLanguageData(params).then((data)=>{
this.canEdit = data.canEdit;
this.columns = data.columns;
this.responseData = {status:"success",errorMsg:"",...data};
});
}
@action
componentWillUnmount=()=>{
this.comObj = {};
this.dataMap.clear();
this.responseData = {};
}
@action
putData=(k,v)=>{
this.dataMap.set(k,v);
}
@action
doSaveCheck=()=>{
let f = true;
for (const [k, v] of this.dataMap) {
for(const record of v){
for(const column of this.columns){
const viewAttr = record.com[column.key][0].viewAttr;
if(viewAttr == "1"){
continue;
}
if(viewAttr == "3"){
const value = record[column.key];
if(value == "" || typeof(value) == "undefined"){
f = false;
break;
}
}
}
if(!f){
break;
}
}
if(!f){
break;
}
}
if(f){
let requestParams = {};
for (const [k, v] of this.dataMap) {
let records = [];
for(const record of v){
if(record.canDel == "n"){
continue;
}
let newRecord = Object.assign({},record);
delete newRecord.com;
records.push(newRecord);
}
requestParams[k] = records;
}
const useTable = this.comObj.props.params.useTable;
const fieldLanguageMap = JSON.stringify(requestParams);
const params = {
fieldLanguageMap : fieldLanguageMap,
useTable : useTable,
fieldType : this.fieldType,
prjTypeId : this.prjTypeId
}
Apis.saveFieldLanguageCmd(params).then((data)=>{
if(data.msgid == "0"){
message.success(data.msg);
this.reSearch();
}else{
message.error(data.msg);
}
});
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
message.error(getLabel(15859,"必要信息不完整!"));
}
}
@action
reSearch(comObj){
const params = {
prjFieldType : this.fieldType ,
prjTypeId : this.prjTypeId
}
this.initDatas(params);
}
getRightMenus(){
const {rightMenus} = this.responseData;
let btnArr = [];
rightMenus && rightMenus.length > 0 && rightMenus.map(m=>{
btnArr.push({
key: m.type,
icon: <i className={m.menuIcon}/>,
content: m.menuName,
onClick: key =>{
if(key == "BTN_SUBMIT"){
this.doSaveCheck();
}
}
})
});
return btnArr;
}
getTopButtons(){
const {rightMenus} = this.responseData;
let btnArr = [];
rightMenus && rightMenus.length > 0 && rightMenus.map(m=>{
m.isTop == "1" && btnArr.length < 4 && btnArr.push(
<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@wih99y@${m.type}`} type={m.type=="BTN_SUBMIT"?"primary":""}
style={{marginLeft:"10px"}}
onClick={()=>{
if(m.type == "BTN_SUBMIT"){
this.doSaveCheck();
}
}}>
{m.menuName}
</Button>
);
});
return btnArr;
}
}

View File

@ -0,0 +1,210 @@
import { observable, action, toJS} from 'mobx';
import { WeaTools,WeaCheckbox,WeaLocaleProvider} from 'ecCom';
import {WeaForm} from 'comsMobx';
import * as Apis from '../../apis/custom';
import { message,Modal } from 'antd';
import { ListStore } from '../listStore';
const getLabel = WeaLocaleProvider.getLabel;
export default class FieldTabStore extends ListStore{
@observable isModalEdit = false;
@observable columnDatas = [];
@observable selectedKey = "1";
@observable tabTitle = "";
@observable tabData = [];
@observable noRight = false;
/** 左侧树store */
@observable leftTree = [];
@observable leftTreeCount = {};
@observable leftTreeCountType = [];
@observable selectedTreeKey = "";
@observable typeTitle = "";
@observable treeType={};
@observable treeInfo={
prjtypeid : "",
prjtypename : ""
};
@action
clearStatus=()=>{
this.selectedKey="1";
this.treeInfo={
prjtypeid : "",
prjtypename : ""
};
}
@observable browserColumns = [];
// 重新定义字段类型的联动效果
defineCascader(compArr,dataIndex){
if(compArr.length == 7){
// 移除特殊字段
compArr.pop();
}
return compArr.map((comp) => {
if(comp.key == 'input'){
// 文本长度 必填
let newComp = {...comp};
newComp.subChildren.subChildren.text.viewAttr = 3;
return newComp;
}else if (comp.key == 'select') {
// 增加选择项维护功能
let newComp = {...comp};
newComp.subChildren = {
// type: FieldOptionManage,fieldId:dataIndex
};
return newComp;
}else if (comp.key == 'upload') {
// 去掉附件上传的子组件
let newComp = {...comp};
delete newComp.subChildren;
return newComp;
}else if (comp.key == 'textarea') {
// 高度默认值为4去掉是否html编辑check框和label
let newComp = {...comp};
newComp.subChildren[0].value = 4;
delete newComp.subChildren[1];
delete newComp.subChildren[2];
return newComp;
}
return comp;
});
}
@action
initDatas=(params)=>{
Apis.getPrjFieldTab(params).then((datas)=>{
this.noRight = datas.noRight;
this.tabTitle = datas.tabTitle;
this.tabData = datas.tabData;
});
}
@action
initTreeDatas=(params={})=>{
Apis.getPrjTypeTree({treetype:'prjtemplet',...params,fromfield:"1"}).then(data=>{
this.treeInfo = {
prjtypeid : data.selectedKeys,
prjtypename : data.selectedNames
}
this.leftTree =data.treedata;
this.leftTreeCount = data.treecount;
this.leftTreeCountType = data.treecountcfg;
this.selectedTreeKey = "prjtype_"+data.selectedKeys;
this.typeTitle = data.selectedNames;
})
}
@action
changeTabKey = (key)=>{
this.selectedKey = key;
}
@action
getColumnsInfo=(params)=>{
this.columnDatas = [{
fieldlabel : "isdata",
fieldname : getLabel(163,"是")+getLabel(161,"否"),
ismand : "1",
isopen : "1",
type : [
"input",
"text",
"2"
]
}]
}
checkData=()=>{
let canSave = true;
this.columnDatas.forEach(element => {
if(element.groupnamecn==""){
canSave = false;
}
})
return canSave;
}
@action
saveCardTabSet=()=>{
if(this.checkData()){
let keepgroupids = "";
this.columnDatas.forEach(element => {
keepgroupids+=","+element.groupid
});
keepgroupids = keepgroupids.substr(1,keepgroupids.length);
const params = {
datas : JSON.stringify(this.columnDatas),
keepgroupids : keepgroupids
}
API_LIST.saveCardTabSet(params).then((data)=>{
if(data.isright){
if(data.msgid!="11"){
message.success(data.msg);
this.getColumnsInfo();
}else{
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
});
}else{
Modal.error({
title: getLabel(15172,"系统提示"),
content: getLabel(15859,"必要信息不完整!"),
});
}
}
checkDatas=()=>{
}
@action
setColumnDatas=(datas)=>{
let _this = this;
_this.columnDatas = datas;
}
chooseCheckBoxAll_isopen(value){
if(value == "1"){
this.columnDatas = this.columnDatas.map(item=>{
item.isopen = "1";
return item;
})
}else{
this.columnDatas = this.columnDatas.map(item=>{
item.isopen = "0";
return item;
})
}
}
chooseCheckBoxAll_ismand(value){
if(value == "1"){
this.columnDatas = this.columnDatas.map(item=>{
item.ismand = "1";
return item;
})
}else{
this.columnDatas = this.columnDatas.map(item=>{
item.ismand = "0";
return item;
})
}
}
setSelectedTreeKey=(key) =>{
this.selectedTreeKey = key;
this.clearStatus();
}
setTreeInfo=(params)=>{
this.treeInfo.prjtypeid = params.prjtypeid;
this.treeInfo.prjtypename = params.prjtypename;
this.typeTitle = params.prjtypename;
}
}

View File

@ -0,0 +1,209 @@
import { observable, action, toJS} from 'mobx';
import {WeaLocaleProvider} from 'ecCom';
import * as Apis from '../../apis/custom';
import { message,Modal } from 'antd';
const getLabel = WeaLocaleProvider.getLabel;
/**
* @author
*
*/
export default class PrjCardTabSetStore {
@observable isModalEdit = false;
@observable columns = [];
@observable columnDatas = [];
@observable selectedData = {};
@observable uerLanguage ="";
@observable status = false;
@observable selectedKeys = [];
@observable loading = true;
@observable tabtype = 'prj';
cnTitleTip = "自定义页面链接地址可以为外网地址,如: &#10; " +
"http://www.baidu.com &#10; " +
"也可以是内部地址,如: &#10; " +
"/test.jsp?a=1&b=2 &#10; " +
"可以带上参数传参,像这样: &#10; " +
"/test.jsp?a=1&b=2 &#10; " +
"也可以写占位符{#id}传项目id,像这样: &#10; " +
"/test.jsp?a=1&prjid={#id}&mypara2={#id} &#10; " +
"即使不写占位符,默认也会接收到2个固定的参数: &#10; " +
"isfromProjTab=1&projectid=项目id\t";
enTitleTip = "Custom page link address for network address, such as: &#10; "+
"Http://www.baidu.com &#10; Can also be internal address, such as: &#10; "+
"/test.jsp?a=1&b=2 &#10; You can take parameter arguments, such as this: &#10; "+
"/test.jsp?a=1&b=2 &#10; "+
"Can also like to write a placeholder {#id} project ID: &#10; "+
"/test.jsp?a=1&prjid={#id}&mypara2={#id} &#10; "+
"If not write placeholder, the default will also receive 2 fixed parameter: &#10; "+
"isfromProjTab=1&projectid=id";
hnTitleTip = "自定義頁面鏈接地址可以爲外網地址,如: &#10; " +
"http://www.baidu.com &#10; " +
"也可以是內部地址,如: &#10; " +
"/test.jsp?a=1&b=2 &#10; " +
"可以帶上參數傳參,像這樣: &#10; " +
"/test.jsp?a=1&b=2 &#10; " +
"也可以寫占位符{#id}傳項目id,像這樣: &#10; " +
"/test.jsp?a=1&prjid={#id}&mypara2={#id} &#10; " +
"即使不寫占位符,默認也會接收到2個固定的參數: &#10; " +
"isfromProjTab=1&projectid=項目id";
@observable columnDef = [];
@observable browserColumns = [];
@observable noRight = true;
@action
getColumnsInfo=(params)=>{
this.tabtype = params.tabtype;
Apis.loadGroupData(params).then((data)=>{
if(!data.noRight){
this.status = false;
let {laguageId,tableInfo} = data;
let {columns,selectedData} = tableInfo;
if(this.tabtype == "prj"){
if(laguageId == 7){
columns[2].title = <span title="自定义页面链接地址可以为外网地址,如: &#10;http://www.baidu.com &#10;也可以是内部地址,如: &#10;/test.jsp?a=1&amp;b=2 &#10;可以带上参数传参,像这样: &#10;/test.jsp?a=1&amp;b=2 &#10;也可以写占位符{#id}传项目id或者其他项目通用字段,项目类型字段前面需要加上1_,像这样: &#10;/test.jsp?a=1&amp;prjid={#id}&amp;mypara1={#1_xmlxzd} &#10;即使不写占位符,默认也会接收到2个固定的参数: &#10;isfromProjTab=1&amp;prjid=项目id">链接地址<span className="icon-coms-Explain" style={{color:"#fa0",fontSize:"14px",marginLeft:5}} /></span>;
}else if(laguageId == 8){
columns[2].title = <span title="Custom page link address for network address, such as:&#10;Http://www.baidu.com&#10;Can also be internal address, such as:&#10;/test.jsp?a=1&amp;b=2&#10;You can take parameter arguments, such as this:&#10;/test.jsp?a=1&amp;b=2&#10;Can also write a placeholder {# id} to pass the item ID or other item universal fields. You need to add 1_ before the project type field, like this:&#10;/test.jsp?a=1&amp;prjid={#id}&amp;mypara1={#1_xmlxzd} &#10;If not write placeholder, the default will also receive 2 fixed parameter:&#10;isfromProjTab=1&amp;prjid=id">Link Address<span className="icon-coms-Explain" style={{color:"#fa0",fontSize:"14px",marginLeft:5}} /></span>;
}else if(laguageId == 9){
columns[2].title = <span title="自定義頁面鏈接地址可以爲外網地址,如: &#10;http://www.baidu.com &#10;也可以是內部地址,如: &#10;/test.jsp?a=1&amp;b=2 &#10;可以帶上參數傳參,像這樣: &#10;/test.jsp?a=1&amp;b=2 &#10;也可以寫佔位符{#id}傳項目id或者其他項目通用字段,項目類型字段前面需要加上1_,像這樣: &#10;/test.jsp?a=1&amp;prjid={#id}&amp;mypara1={#1_xmlxzd} &#10;即使不寫占位符,默認也會接收到2個固定的參數: &#10;isfromProjTab=1&amp;projectid=項目id">連結位址<span className="icon-coms-Explain" style={{color:"#fa0",fontSize:"14px",marginLeft:5}} /></span>;
}
}else{
if(laguageId == 7){
columns[2].title = <span title="自定义页面链接地址可以为外网地址,如: &#10;http://www.baidu.com &#10;也可以是内部地址,如: &#10;/test.jsp?a=1&amp;b=2 &#10;可以带上参数传参,像这样: &#10;/test.jsp?a=1&amp;b=2 &#10;也可以写占位符{#id}传任务id或者其他任务字段,项目通用字段前面需要加上1_,项目类型字段前面需要加上2_,像这样: &#10;/test.jsp?a=1&amp;taskid={#id}&amp;mypara1={#1_tyxmzd}&amp;mypara2={#2_xmlxzd} &#10;即使不写占位符,默认也会接收到2个固定的参数: &#10;isfromTaskTab=1&amp;taskid=任务id">链接地址<span className="icon-coms-Explain" style={{color:"#fa0",fontSize:"14px",marginLeft:5}} /></span>;
}else if(laguageId == 8){
columns[2].title = <span title="Custom page link address for network address, such as:&#10;Http://www.baidu.com&#10;Can also be internal address, such as:&#10;/test.jsp?a=1&amp;b=2&#10;Can also write placeholder {id} to pass task ID or other task fields. You need to add 1_ before the general project field and 2_ before the project type field, like this:&#10;/test.jsp?a=1&amp;taskid={#id}&amp;mypara1={#1_tyxmzd}&amp;mypara2={#2_xmlxzd} &#10;If not write placeholder, the default will also receive 2 fixed parameter:&#10;isfromTaskTab=1&amp;taskid=id">Link Address<span className="icon-coms-Explain" style={{color:"#fa0",fontSize:"14px",marginLeft:5}} /></span>;
}else if(laguageId == 9){
columns[2].title = <span title="自定義頁面鏈接地址可以爲外網地址,如: &#10;http://www.baidu.com &#10;也可以是內部地址,如: &#10;/test.jsp?a=1&amp;b=2 &#10;可以帶上參數傳參,像這樣: &#10;/test.jsp?a=1&amp;b=2 &#10;也可以寫佔位符{#id}傳任務id或者其他任務字段,項目通用字段前面需要加上1_,項目類型字段前面需要加上2_,像這樣: &#10;/test.jsp?a=1&amp;taskid={#id}&amp;mypara1={#1_tyxmzd}&amp;mypara2={#2_xmlxzd} &#10;即使不寫占位符,默認也會接收到2個固定的參數: &#10;isfromTaskTab=1&amp;taskid=任務id">連結位址<span className="icon-coms-Explain" style={{color:"#fa0",fontSize:"14px",marginLeft:5}} /></span>;
}
}
this.columnDef = columns;
this.noRight = data.noRight;
this.columnDatas = data.tableInfo.columnDatas;
this.selectedData = selectedData;
this.status = true;
this.loading = false;
this.selectedKeys = [];
}
});
}
checkData=()=>{
let canSave = true;
this.columnDatas.forEach(element => {
if(element.groupnamecn==""){
canSave = false;
}
})
return canSave;
}
@action
saveCardTabSet=()=>{
if(this.checkData()){
let keepgroupids = "";
this.columnDatas.forEach(element => {
if(element.groupid){
keepgroupids+=","+element.groupid
}
});
keepgroupids = keepgroupids.substr(1,keepgroupids.length);
let cdaCopy = this.columnDatas.map(d=>({...d}));
const cde = toJS(this.columnDef);
// const cda = toJS(this.columnDta);
//checkBox的值与datas里的值进行同步
for(let rowData of cdaCopy){
for(let c of cde){
if(c.hasOwnProperty("checkType")){
rowData[c.dataIndex] = 0;
}
}
}
let rows = toJS(this.selectedData.isopen);
for(let row of rows){
for(let i=0;i<cdaCopy.length;i++){
let rowData = cdaCopy[i];
if(row == i){
rowData["isopen"] = 1;
}
}
}
const params = {
datas : JSON.stringify(cdaCopy),
keepgroupids : keepgroupids,
tabtype : this.tabtype
}
this.loading = true;
Apis.saveCardTabSet(params).then((data)=>{
if(data.isright){
if(data.status!="-1"){
message.success(getLabel(83551,"保存成功!"));
this.getColumnsInfo({tabtype:this.tabtype});
}else{
message.error(getLabel(83280,"保存失败,请联系系统管理员!"));
this.loading = false;
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
this.loading = false;
}
});
}
// else{
// Modal.error({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
// }
}
checkDatas=()=>{
}
@action
setColumnDatas=(datas)=>{
let _this = this;
_this.columnDatas = datas;
}
chooseCheckBoxAll(value){
if(value == "1"){
this.columnDatas = this.columnDatas.map(item=>{
if(typeof(item.com) == "undefined"){
item.isopen = "1";
return item;
}else{
return item
}
})
}else{
this.columnDatas = this.columnDatas.map(item=>{
if(typeof(item.com) == "undefined"){
item.isopen = "0";
return item;
}else{
return item
}
})
}
}
@action
setSelectedKeys=(keys)=>{
this.selectedKeys = keys;
}
@action
setCheckedData(checkedData){
this.selectedData = checkedData;
}
@action
setSelectedData=(selectedData)=>{
this.selectedData = selectedData;
}
}

View File

@ -0,0 +1,47 @@
import BaseManagerListStore from './baseManagerListStore'
import PrjCodeStore from './prjCodeStore'
import PrjAppSetStore from './prjAppSetStore'
import TempletListStore from './templetListStore'
import PrjTempletCardStore from './prjTempletCardStore'
import TaskTempletCardStore from './taskTempletCardStore'
import TempletApproveStore from './templetApproveStore'
import PrjCardTabSetStore from './custom/PrjCardTabSetStore'
import PrjFieldConfigStore from './custom/FieldConfigStore'
import PrjFieldGroupStore from './custom/FieldGroupStore'
import PrjFieldLanguageStore from './custom/FieldLanguageStore'
import PrjFieldTabStore from './custom/FieldTabStore'
import ProjectLogStore from './projectLogStore'
import PrjRemindStore from './prjRemindStore'
const baseManagerStore = new BaseManagerListStore();
const prjCodeStore = new PrjCodeStore();
const prjAppSetStore = new PrjAppSetStore();
const templetListStore = new TempletListStore();
const prjTempletCardStore = new PrjTempletCardStore();
const taskTempletCardStore = new TaskTempletCardStore();
const templetApproveStore = new TempletApproveStore();
const prjCardTabSetStore = new PrjCardTabSetStore();
const prjFieldConfigStore = new PrjFieldConfigStore();
const prjFieldGroupStore = new PrjFieldGroupStore();
const prjFieldLanguageStore = new PrjFieldLanguageStore();
const prjFieldTabStore = new PrjFieldTabStore();
const projectLogStore = new ProjectLogStore();
const prjRemindStore = new PrjRemindStore();
export default {
baseManagerStore,
prjCodeStore,
prjAppSetStore,
templetListStore,
prjTempletCardStore,
taskTempletCardStore,
templetApproveStore,
prjCardTabSetStore,
prjFieldTabStore,
prjFieldLanguageStore,
prjFieldGroupStore,
prjFieldConfigStore,
projectLogStore,
prjRemindStore
}

View File

@ -0,0 +1,75 @@
import { observable, action } from 'mobx';
import {WeaTableNew,WeaForm} from 'comsMobx'
const {TableStore} = WeaTableNew;
export class ListStore{
/** 列表store */
@observable loading = false;
@observable title = "";
@observable dataKey = "";
@observable tableStore = new TableStore();
/** 高级查询store */
@observable form = new WeaForm();
@observable showSearchAd = false; //高级搜索显隐
@observable condition = [];
/** 左侧树store */
@observable leftTree = [];
@observable leftTreeCount = {};
@observable leftTreeCountType = [];
@observable selectedTreeKey = "";
/** 顶部Tab组件store */
topTab = [];
topTabCount = {};
constructor() {
this.setLoading = this.setLoading.bind(this);
this.setTitle = this.setTitle.bind(this);
this.setShowSearchAd = this.setShowSearchAd.bind(this);
this.setFormFields = this.setFormFields.bind(this);
this.appendFormFields = this.appendFormFields.bind(this);
this.clearFormFields = this.clearFormFields.bind(this);
this.resetForm = this.resetForm.bind(this);
this.resetTable = this.resetTable.bind(this);
}
//刷新列表
reLoad = () => {
this.tableStore.getDatas(this.tableStore.dataKey, this.tableStore.current, this.tableStore.pageSize, this.tableStore.sortParams)
}
@action
setLoading(bool = false){
this.loading = bool;
}
setTitle(title){
this.title = title;
}
setShowSearchAd(bool) {
this.showSearchAd = bool;
}
setFormFields(value){
this.form.updateFields(value, true); //true代表完全覆盖方式更新条件值
}
appendFormFields(value){
this.form.updateFields(value, false);
}
clearFormFields(){
this.form.resetConditionValue(); //清除查询条件值
}
resetForm(){
this.form = new WeaForm();
}
resetTable(){
this.dataKey = "";
this.tableStore = new TableStore();
}
}

View File

@ -0,0 +1,90 @@
import { observable, action } from 'mobx';
import {WeaTableNew,WeaForm} from 'comsMobx'
const {TableStore} = WeaTableNew;
import {WeaTools,WeaLocaleProvider} from "ecCom"
import {Modal,message} from "antd"
const confirm = Modal.confirm;
import { toJS } from 'mobx';
import * as Apis from '../apis/prjappset';
const getLabel = WeaLocaleProvider.getLabel;
export class PrjAppSetStore{
@observable form = new WeaForm();
@observable isright = true;
@observable fieldinfo = [];
@observable rightMenu = [];
@observable approval_title = "";
@observable pmenu = [];
@observable tmenu = [];
@observable ptmenu = [];
@observable vmenu = {};
validateRules = {}; //校验规则
//初始化form
initData =(params={})=>{
this.form = new WeaForm();
Apis.getPrjAppSetInfo(params).then(data=>{
this.isright = data.isright;
this.fieldinfo = data.fieldinfo;
this.rightMenu = data.rightMenus;
this.approval_title = data.approval_title;
this.pmenu = data.pmenu;
this.tmenu = data.tmenu;
this.ptmenu = data.ptmenu;
this.vmenu = data.vmenu;
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
})
}
doPrjAppSet=(params={})=>{
let newParams = {...toJS(this.form.getFormParams()),...params};
if((newParams.prj_dsc_acc==1 && (!newParams.prj_dsc_accsec||parseInt(newParams.prj_dsc_accsec)<=0))
||(newParams.tsk_dsc_acc==1 &&(!newParams.tsk_dsc_accsec||parseInt(newParams.tsk_dsc_accsec)<=0))
||(newParams.prj_acc==1 &&(!newParams.prj_accsec||parseInt(newParams.prj_accsec)<=0))
||(newParams.tsk_acc==1 &&(!newParams.tsk_accsec||parseInt(newParams.tsk_accsec)<=0))
||(newParams.tsk_approval==1&&(!newParams.tsk_modify_type))){
this.form.validateForm().then(f => {
if (!f.isValid) {
f.showErrors();
}
})
}else{
Apis.doPrjAppSet({...newParams,...toJS(this.vmenu)}).then(data=>{
if(data.isright){
if(data.success){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83551,"保存成功!"),
});
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
}
//更新数据
setFormFields=(value)=>{
this.form.updateFields(value, false);
}
//更新菜单数据
setMenuValue=(params={})=>{
this.vmenu = {...this.vmenu,...params};
}
//保存校验规则
setValidate= (params={}) =>{
this.validateRules = params;
}
clearStatus =()=>{
this.fieldinfo = [];
this.rightMenu = [];
this.validateRules = {}; //校验规则
}
}
export default PrjAppSetStore;

View File

@ -0,0 +1,91 @@
import { observable, action ,toJS} from 'mobx';
import {Modal,message} from "antd"
import {WeaTools,WeaLocaleProvider} from "ecCom"
import {WeaTableNew,WeaForm} from 'comsMobx'
import objectAssign from "object-assign"
import MobxReactForm from 'mobx-react-form';
import {getFormFields} from "../util/index"
import * as Apis from '../apis/basemanger';
import _ from 'lodash';
const getLabel = WeaLocaleProvider.getLabel;
class PrjCodeStore{
@observable prjDatas = {
codeType : "1",
};
@observable isright = false;
@observable form = new MobxReactForm();
@observable formloading = true;
@observable condition = [];
@action
initData = (params) =>{
this.doPrjCodeInit(params);
}
changeCodeType=(obj)=>{
this.prjDatas = objectAssign({}, this.prjDatas, obj);
}
savecondition = (data)=>{
this.condition = data;
}
doPrjCodeInit=(params={})=>{
this.form.reset();
Apis.doPrjCodeInit(params).then(data=>{
this.isright = data.isright;
this.prjDatas = data.prjDatas;
this.form.initFields({fields:getFormFields(data.codeConditions)});
this.condition = data.codeConditions;
this.formloading = false;
});
}
doSubmit=(params)=>{
let datas = []
_.each(this.form.values(),(value1,key1)=>{
_.each(toJS(this.condition),(value2,key2)=>{
if(key1 == value2.domkey[0]){
let data = {
showName : value2.showName,
value : value1,
showType : value2.showType,
order : value2.order
}
datas.push(data);
}
})
})
let newParams = {conditionDatas: JSON.stringify(datas),...this.prjDatas,...params}
Apis.doPrjCodeOpt(newParams).then(data=>{
if(data.isright){
if(data.success){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83551,"保存成功!"),
});
}else{
Modal.error({
title: getLabel(15172,"系统提示"),
content: getLabel(84544,"保存失败!"),
});
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
clearStatus=()=>{
this.prjDatas = {
codeType : "1",
};
this.form = new MobxReactForm();
this.formloading = true;
this.condition = [];
}
}
export default PrjCodeStore;

View File

@ -0,0 +1,341 @@
import { observable, action, autorun, toJS } from "mobx";
import { message, Button, Modal } from "antd";
import _ from 'lodash';
import { WeaTableNew, WeaForm } from 'comsMobx';
const { TableStore } = WeaTableNew;
import {WeaLocaleProvider,WeaTools} from "ecCom"
import * as Apis from '../apis/prjremind';
const getLabel = WeaLocaleProvider.getLabel;
export default class PrjRemindStore {
@observable loading = false;
@observable remindList = [];
@observable remindId = "";
@observable remindValue = "";
//项目类型树
@observable treeDatas = [];
@observable treeCount = {};
@observable treeCountType = [];
@observable selectedTreeKey = "";
@observable remindListloading = true;
@observable currentKey = "";
@observable pagination = {
pageSize: 10,
current: 1,
total: 0
}
@observable datas = {};
@observable title;
@observable isright;
@observable isFormInit = false;
nameremind;
titleremind;
contentremind;
browserremind;
selectremind;
valueremind;
levelremind;
@observable bmform = new WeaForm();
@observable bmCondition = [];
@observable levelViewAttr = 2;
@observable appDetachDisableAll = false;
constructor() {
autorun(() => {
if (this.remindId) {
localStorage.setItem("prj_remind_selectedKey", this.remindId);
}
});
}
@action
initList = () => {
this.getTreeList();
this.pagination.current = 1;
//该API返回内容包含 禁用“所有人”权限范围
WeaTools.callApi("/api/proj/baseManager/getPrjTypeShareList", "GET",{prjtypeid:-1}).then((data) => {
this.appDetachDisableAll = data.appDetachDisableAll ;
});
}
@action
getTreeList = (params) => {
Apis.getPrjTypeTreePageList({ treetype: 'prjsearch', ...params }).then(data => {
this.treeDatas = data.treedata;
this.treeCount = data.treecount;
this.treeCountType = data.treecountcfg;
this.setSelectedTreeKey("prjtype_" + data.selectedKeys);
localStorage.setItem("prj_treeid", data.selectedKeys);
this.getRemindList();
})
}
setSelectedTreeKey = (key) => {
if(this.selectedTreeKey !== key){
this.selectedTreeKey = key;
}
}
@action
setPrjTypeId = (key) => {
localStorage.setItem("prj_treeid", key);
this.pagination.current = 1;
this.getCurrentPageDatas();
}
@action
onChangePaginNation = (current = this.pagination.current, pageSize = this.pagination.pageSize) => {
this.pagination.current = current;
this.pagination.pageSize = pageSize;
this.getCurrentPageDatas();
}
@action
getCurrentPageDatas = (current = this.pagination.current, pageSize = this.pagination.pageSize) => {
this.getRemindList();
}
@action
changeSelectedKey = (key) => {
this.setRemindId(key);
this.getRemindInfo(key);
}
@action
getRemindList = (params={pageIndex : this.pagination.current, pageSize : this.pagination.pageSize}) => {
Apis.getRemindListByPrjType({ ...params, prjTypeId:localStorage.getItem("prj_treeid") }).then(data => {
this.isright = data.isright;
this.isFormInit = true;
if(this.isright){
this.remindList = data.remindList;
this.pagination.total = data.totalSize;
if(this.remindList.length>0){
this.setRemindId();
}else{
this.remindId=-1;
}
this.getRemindInfo();
}
})
}
@action
setRemindId = (remindId = localStorage.getItem("prj_remind_selectedKey") || this.remindId) => {
let filter = this.remindList.slice().filter(d => d.id == remindId);
if (remindId && filter.length > 0) {
this.remindId = remindId;
} else {
this.remindId = _.get(this.remindList.slice(), '[0].id');
}
this.currentKey = this.remindId;
}
@action
onChangePaginNation = (current = this.pagination.current, pageSize = this.pagination.pageSize) => {
this.pagination.current = current;
this.pagination.pageSize = pageSize;
this.getCurrentPageDatas();
}
@action
onSearchListItem = (value) => {
this.getRemindList({
pageIndex: 1,
pageSize: this.pagination.pageSize,
remindname: value
});
this.remindValue = value;
}
@action
onSearchChange = (value) =>{
this.remindValue = value;
}
@action
changeDatas = (obj) =>{
this.datas = {...this.datas,...obj};
}
@action
getRemindInfo = (remindId = this.remindId || localStorage.getItem("prj_remind_selectedKey") ) => {
Apis.getRemindInfoByRemindId({'remindId':remindId,prjtype:localStorage.getItem("prj_treeid")}).then(data =>{
if(data.isright){
this.title = data.datas.title;
this.datas = data.datas;
this.bmform = new WeaForm();
if(this.datas.conditionfield!=''){
let type = '';
if(this.datas.conditionfield.indexOf('1_')==0){
type = 'prj';
}else if(this.datas.conditionfield.indexOf('2_')==0){
type = 'prjtype';
}else{
type = 'prjtsk';
}
Apis.getConditionField({ 'fieldname':this.datas.conditionfield,'fieldvalue':this.datas.conditionfieldvalue,'type':type,'prjtypeid':this.datas.prjtypeid }).then(data => {
this.bmCondition = data.fieldinfo;
this.bmform.initFormFields(this.bmCondition);
});
}
if((!this.datas.receiverlevel&&this.datas.receiverlevel!==0)&&(!this.datas.receiverlevelmax&&this.datas.receiverlevelmax!==0)){
this.levelViewAttr = 3;
}else{
this.levelViewAttr = 2;
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
getTopMenu(){
let arr = new Array();
arr.push({
key: 'save',
content: getLabel(86, "保存"),
icon: <i className="icon-coms-Preservation" />
});
if(this.remindId!=-1){
arr.push({
key: 'delete',
content: getLabel(91, "删除"),
icon: <i className="icon-coms-delete" />
});
arr.push({
key: 'addNewRemind',
content: getLabel(82210, "新建提醒"),
icon: <i className="icon-coms-New-Flow" />
});
}
return arr;
}
getTopButton(){
return [<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@3uatth@save`} onClick={() => this.save()} type='primary'>{getLabel(86, '保存', 'label')}</Button>];
}
save(){
this.bmform.validateForm().then(f=>{
if(f.isValid){
if(this.validateDatas()){
Apis.saveOrUpdateRemindInfo({'remindInfo':JSON.stringify(this.datas),remindId:this.remindId,prjtype:localStorage.getItem("prj_treeid")}).then(data =>{
if(data.isright){
if(data.Msg == "success"){
this.getCurrentPageDatas();
message.success(getLabel(83551,"保存成功!"));
}else{
message.error(getLabel(84544,"保存失败!"));
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
}else{
this.valueremind.showError();
}
});
}
delete(){
Modal.confirm({
title: getLabel(15172, "系统提示"),
content: getLabel(501430, "此操作将会删除该提醒,确认删除吗?"),
onOk:()=>{
Apis.saveOrUpdateRemindInfo({remindId:this.remindId,method:'delete'}).then(data =>{
if(data.isright){
if(data.Msg == "success"){
this.getCurrentPageDatas();
message.success(getLabel(20461,"删除成功!"));
}else{
message.error(getLabel(20462,"删除失败!"));
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
});
},
onCancel:()=> { },
});
}
validateDatas() {
let boole = true;
const datas = this.datas;
if(!datas.name){
this.nameremind.showError();
boole = false;
}
if(!datas.remindcontent){
this.contentremind.showError();
boole = false;
}
if(datas.remindEmail == "1" || datas.remindWorkflow == "1" || datas.remindMC == "1"){
if(!datas.remindtitle){
this.titleremind.showError();
boole = false;
}
}
if (datas.receivertype == "1" || datas.receivertype == "2" || datas.receivertype == "3" || datas.receivertype == "4"){
if(!datas.receiverfield){
this.browserremind.showError();
boole = false;
}
}
if (datas.receivertype == "1000"){
if(!datas.receiverfield){
this.selectremind.showError();
boole = false;
}
}
if (datas.receivertype == "2" || datas.receivertype == "3" || datas.receivertype == "4" || datas.receivertype == "5" || datas.receivertype == "1000"){
if((!datas.receiverlevel&&datas.receiverlevel!==0)&&(!datas.receiverlevelmax&&datas.receiverlevelmax!==0)){
this.levelremind.showError();
boole = false;
}
}
return boole;
}
@action
fieldChange = (fieldname) => {
const that = this;
that.datas = {...that.datas,...{'conditionfield':fieldname}};
let type = '';
if(fieldname.indexOf('1_')==0){
type = 'prj';
}else if(fieldname.indexOf('2_')==0){
type = 'prjtype';
}else{
type = 'prjtsk';
}
Apis.getConditionField({ 'fieldname':fieldname,'fieldvalue':'','type':type,'prjtypeid':that.datas.prjtypeid }).then(data => {
that.datas = {...that.datas,...{'conditionfieldvalue':data.fieldvalue}};
that.bmform = new WeaForm();
that.bmCondition = data.fieldinfo;
if(fieldname!=''){
that.bmform.initFormFields(that.bmCondition);
}
});
}
@action
initConditionField = ()=>{
this.datas.conditionfield = '';
this.bmform = new WeaForm();
}
@action
setLevelViewAttr = (v)=>{
this.levelViewAttr = v;
}
}

View File

@ -0,0 +1,255 @@
import { observable, action, autorun, toJS } from 'mobx';
import { WeaTools, WeaLocaleProvider } from "ecCom"
import objectAssign from 'object-assign';
import { message, Modal } from 'antd';
const confirm = Modal.confirm;
import isEqual from 'lodash/isEqual';
import { WeaTableNew, WeaForm } from 'comsMobx'
const { TableStore } = WeaTableNew;
const { ls } = WeaTools;
import * as Apis from '../apis/templet';
import { TaskInfoStore } from './taskInfoStore'
import { TaskTempletImpStore } from './taskTempletImpStore'
// import { prjEditFormRules } from "../util/index"
const getLabel = WeaLocaleProvider.getLabel;
export class PrjTempletCardStore {
@observable selectTabKey = "prjinfo"
@observable loading = false;
@observable prjid = "";
@observable prjname = "";
@observable rightMenu = [];
@observable form = new WeaForm(); //项目信息
@observable fieldInfo = [];
@observable hasRight = true;
@observable prjisdel = false;
validateRules = {}; //校验规则
@observable taskListTableStore = new TableStore({
dataHandle: (datas) => { //任务列表
datas.forEach((data) => {
if (typeof (data.subListspan) == 'string') {
data.subListspan = data.subListspan ? JSON.parse(data.subListspan) : undefined;
}
});
return datas;
}
});
@observable verified = false;
@observable showEditTask = false;
@observable taskInfoStore = new TaskInfoStore();
@observable taskTempletImpStore = new TaskTempletImpStore();
@observable stageColumns = [];
@observable stageColumnDatas = [];
@observable selectedRowKeys = [];
@observable selectedDatas = {};
@observable stageInfo = {
stageColumns: [],
stageColumnDatas: [],
selectedRowKeys: [],
selectedDatas: {},
canedit:false
}
@action
reLoad = () => {
this.taskListTableStore.getDatas(this.taskListTableStore.dataKey, this.taskListTableStore.current, this.taskListTableStore.pageSize, this.taskListTableStore.sortParams)
}
@action
refTaskList = () => {
this.getPrjTempletTaskList();
}
//设置选中按钮
changeTab = (key) => {
this.selectTabKey = key;
if (key == "prjinfo") {
this.getPrjTempletInfo({ viewtype: 'view', templetId: this.prjid });
} else if (key == "sublist") {//任务列表
this.getPrjTempletTaskList();
} else if (key == "stagelist") {//阶段设置
this.clearStageStatus();
this.getPrjTempletStageList();
}
}
getPrjTempletInfo = (params = {}) => {
this.loading = true;
this.prjid = params.templetId;
this.form = new WeaForm();
Apis.getPrjTempletForm(params).then(data => {
if (!data.isright && typeof (data.isright) !== "undefined") {
this.hasRight = false;
} else {
this.hasRight = true;
this.fieldInfo = data.fieldinfo;
this.rightMenu = data.rightMenus;
this.prjname = data.templetName;
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
}
this.loading = false;
})
}
//项目信息 -- 编辑保存
savePrjTempletInfo = (params = {}) => {
this.form.validateForm().then(f => {
if (f.isValid) {
let newParams = { ...toJS(this.form.getFormParams()), method: "edit", templetId: this.prjid, ...params };
Apis.doPrjTempletOpertaion(newParams).then(data => {
if(data.isright){
if (data.success) {
this.getPrjTempletInfo({ viewtype: "view", templetId: this.prjid });
window.opener._table.reLoad();
} else {
// Modal.warning({
// title: getLabel(15172, "系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
} else {
f.showErrors();
// Modal.warning({
// title: getLabel(15172, "系统提示"),
// content: getLabel(15859, "必要信息不完整!"),
// });
}
});
}
//高级搜索设值
setFormFields = (value) => {
this.form.updateFields(value, false); //true代表完全覆盖方式更新条件值
}
//项目信息-校验规则
setValidate = (params = {}) => {
this.validateRules = params;
}
//任务列表
getPrjTempletTaskList = (params = {}) => {
this.loading = true;
let newParams = { templateId: this.prjid, ...params };
Apis.getPrjTempletTaskList(newParams).then(data => {
this.taskListTableStore.getDatas(data.sessionkey, 1);
this.rightMenu = data.rightMenus;
this.loading = false;
})
}
showEditTaskModal = (bool) => {
this.showEditTask = bool;
}
onShowColumn = () => { //显示定制列
if (this.selectTabKey == "3") {
this.prjSubStore.setColSetVisible(true);
this.prjSubStore.tableColSet(true)
}
}
getPrjTempletStageList = (params = {}) => {
this.loading = true;
let newParams = { actionType: "edit", templateId: this.prjid, ...params };
Apis.getPrjTempletStageList(newParams).then(data => {
this.stageInfo.stageColumns = data.columns;
this.stageInfo.stageColumnDatas = data.columnDatas;
this.stageInfo.canedit = data.canedit;
this.rightMenu = data.rightMenus;
this.loading = false;
})
}
onRowSelect = (sRowKeys, rows, dataIndex, selectedDatas) => {
this.stageInfo.selectedRowKeys = sRowKeys;
if (selectedDatas) {
this.stageInfo.selectedDatas = selectedDatas;
}
}
onChange = (datas) => {
this.stageInfo.stageColumnDatas = datas;
}
saveStageSet = (checkProps) => {
const { pass } = checkProps;
if (pass&&this.checkRepeat()) {
let keepgroupids = "";
this.stageInfo.stageColumnDatas.forEach(element => {
if (element.id) {
keepgroupids += "," + element.id
}
});
keepgroupids = keepgroupids.substr(1, keepgroupids.length);
Apis.savePrjTempletStage({ datas: JSON.stringify(this.stageInfo.stageColumnDatas), keepgroupids: keepgroupids, templateId: this.prjid }).then(data => {
if (data.success) {
this.clearStageStatus();
message.success(data.msg);
this.getPrjTempletStageList();
} else {
message.error(data.msg);
}
})
}
}
checkRepeat = () => {
let repeat = true;
let datas = toJS(this.stageInfo.stageColumnDatas);
datas && datas.length>0 && datas.map((d1,i1) => {
if(repeat){
datas && datas.length>0 && datas.map((d2,i2) => {
if(i1 !== i2 && d1.name == d2.name){
message.warning(getLabel('387703',"阶段名称重复!"));
repeat = false;
}
})
}
})
return repeat;
}
clearStageStatus = () => {
let _canedit = this.stageInfo.canedit;
this.stageInfo = {
stageColumns: [],
stageColumnDatas: [],
selectedRowKeys: [],
selectedDatas: {},
canedit:_canedit
}
}
}
export default PrjTempletCardStore;

View File

@ -0,0 +1,673 @@
import { observable, action } from 'mobx';
import {WeaTableNew,WeaForm} from 'comsMobx'
const {TableStore} = WeaTableNew;
import {WeaTools,WeaLocaleProvider,WeaCheckbox} from "ecCom"
import {Modal,message} from "antd"
const confirm = Modal.confirm;
import { toJS } from 'mobx';
// import {prjEditFormRules} from "../util/index"
import * as Apis from '../apis/basemanger';
const getLabel = WeaLocaleProvider.getLabel;
export class PrjTypeStore{
@observable title = getLabel(83843,"编辑项目类型");//编辑项目类型
@observable selectedKey = "prjtypeinfo";
@observable form = new WeaForm();
@observable visible = false;
@observable isright = true;
@observable prjtypeinfo = [];
@observable prjtypeid = "";
@observable rightMenu = "";
@observable selectLinkageDatas = {};
validateRules = {}; //校验规则
shareCondition_add = [
{
"colSpan": 2,
"conditionType": "SELECT",
"domkey": [
"sharetype"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(21956,"对象类型"),
"labelcol": 6,
"options": [
{
"key": "5",
"selected": true,
"showname": getLabel(179,"人力资源")
}, {
"key": "6",
"selected": false,
"showname": getLabel(141,"分部")
}, {
"key": "1",
"selected": false,
"showname": getLabel(124,"部门")
}, {
"key": "7",
"selected": false,
"showname": getLabel(6086,"岗位")
}, {
"key": "2",
"selected": false,
"showname": getLabel(122,"角色")
}, {
"key": "3",
"selected": false,
"showname": getLabel(1340,"所有人")
}
],
"viewAttr": 2
}, {
"1": [[
{
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "57",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"relatedshareid"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(106,"对象"),
"labelcol": 6,
"viewAttr": 3
}
],[
{
"colSpan": 2,
"conditionType": "INPUT_INTERVAL",
"needDefaultValue":false,
"domkey": [
"seclevel",
"seclevelMax"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(683,"安全级别"),
"labelcol": 6,
"value": [
0,
''
],
"viewAttr": 3
}
]
],
"6": [[
{
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "194",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"relatedshareid"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(106,"对象"),
"labelcol": 6,
"value": 3,
"viewAttr": 2
}
],[
{
"colSpan": 2,
"conditionType": "INPUT_INTERVAL",
"needDefaultValue":false,
"domkey": [
"seclevel",
"seclevelMax"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(683,"安全级别"),
"labelcol": 6,
"value": [
0,
''
],
"viewAttr": 3
}
]
],
"5": [[
{
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "17",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"relatedshareid"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(106,"对象"),
"labelcol": 6,
"viewAttr": 3
}
]
],
"7": [[
{
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "278",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"relatedshareid"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(106,"对象"),
"labelcol": 6,
"viewAttr": 3
}
],[
{
"colSpan": 2,
"conditionType": "SELECT_LINKAGE",
"domkey": [
"joblevel"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(28169,"岗位级别"),
"labelcol": 6,
"options": [
{
"key": "0",
"selected": true,
"showname": getLabel(140,"总部")
}, {
"key": "2",
"selected": false,
"showname": getLabel(19437,"指定分部")
}, {
"key": "1",
"selected": false,
"showname": getLabel(19438,"指定部门")
}
],
"selectLinkageDatas": {
"1": {
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "57",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"jobtitledepartment"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": "",
"labelcol": 6,
"viewAttr": 3
},
"2": {
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "194",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"jobtitlesubcompany"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": "",
"labelcol": 6,
"viewAttr": 3
}
},
"viewAttr": 2
}
]
],
"3": [[
{
"colSpan": 2,
"conditionType": "INPUT_INTERVAL",
"needDefaultValue":false,
"domkey": [
"seclevel",
"seclevelMax"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(683,"安全级别"),
"labelcol": 6,
"value": [
0,
''
],
"viewAttr": 3
}
]
],
"2": [[
{
"browserConditionParam": {
"completeParams": {},
"conditionDataParams": {},
"dataParams": {},
"destDataParams": {},
"hasAddBtn": false,
"hasAdvanceSerach": true,
"idSeparator": ",",
"isAutoComplete": 1,
"isDetail": 0,
"isMultCheckbox": false,
"isSingle": false,
"pageSize": 10,
"quickSearchName": "",
"type": "65",
"viewAttr": 3
},
"colSpan": 2,
"conditionType": "BROWSER",
"domkey": [
"relatedshareid"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(106,"对象"),
"labelcol": 6,
"viewAttr": 3
}, {
"colSpan": 2,
"conditionType": "SELECT",
"domkey": [
"rolelevel"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(139,"级别"),
"labelcol": 6,
"options": [
{
"key": "0",
"selected": true,
"showname": getLabel(124,"部门")
}, {
"key": "1",
"selected": false,
"showname": getLabel(141,"分部")
}, {
"key": "2",
"selected": false,
"showname": getLabel(140,"总部")
}
],
"viewAttr": 2
}
],[
{
"colSpan": 2,
"conditionType": "INPUT_INTERVAL",
"needDefaultValue":false,
"domkey": [
"seclevel",
"seclevelMax"
],
"fieldcol": 16,
"isQuickSearch": false,
"label": getLabel(683,"安全级别"),
"labelcol": 6,
"value": [
0,
''
],
"viewAttr": 3
}
]
]
}
]
tabs_add = [{key:"prjtypeinfo",title:getLabel(1361,"基本信息")}];
tabs_edit = [{key:"prjtypeinfo",title:getLabel(1361,"基本信息")},{key:"addshare",title:getLabel(21945,"创建权限")},{key:"share",title:getLabel(2112,"共享设置")}];
datakey = "";
@observable tableStore = new TableStore();
@observable targetid = "";
@action
handleShareDialog = (bool,key,params) =>{
this.visible = bool;
if(bool){
this.prjtypeid = params.prjtypeid;
this.changeTab(key);
}
}
changeTab=(key)=>{
this.selectedKey = key;
if(key=="prjtypeinfo"){
this.getPrjTypeForm({prjtypeid:this.prjtypeid,viewtype:'edit'});
}else if(key=="addshare"||key=="share"){
this.getPrjTypeShareList(key,this.prjtypeid,{})
}
}
//初始化form
getPrjTypeForm=(params={})=>{
this.form = new WeaForm();
Apis.getPrjTypeFormField(params).then(data=>{
this.isright = data.isright;
this.prjtypeinfo = data.fieldinfo;
this.rightMenu = data.rightMenus;
if(this.prjtypeid&&this.prjtypeid!=""){
this.title = getLabel(83843,"编辑项目类型");
}else{
this.title = getLabel(83848,"新建项目类型");
}
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
})
}
//项目类型权限
getPrjTypeShareList=(type,id,params={})=>{
Apis.getPrjTypeShareList({prjtypeid:id,type:type}).then(data=>{
this.title = data.title;
this.rightMenu = data.rightMenus;
this.selectLinkageDatas = data.selectLinkageDatas;
this.tableStore.getDatas(data.sessionkey, params.current || 1);
this.dataKey = data.sessionkey;
})
}
//项目类型保存
savePrjTypeInfo=(params={})=>{
this.form.validateForm().then(f=>{
if(f.isValid){
let newParams = {...toJS(this.form.getFormParams()),prjtypeid:this.prjtypeid,...params};
let checkParams = {...toJS(this.form.getFormParams()),prjtypeid:this.prjtypeid,method:"checkPrjTypeName"};
Apis.doPrjTypeOpt(checkParams).then(data=>{
if(data.isright){
if(data.checkflag){
Apis.doPrjTypeOpt(newParams).then(data=>{
if(data.success){
this.handleShareDialog(false);
if(params.method=='edit'){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83551,"保存成功!"),
});
}
window._table.reLoad();
}
})
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(21943,"类型名称重复")
// });
message.error(getLabel(21943,"类型名称重复"));
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
}
});
}
//项目类型保存
saveToEditPrjTypeInfo=(params={})=>{
this.form.validateForm().then(f=>{
if(f.isValid){
let newParams = {...toJS(this.form.getFormParams()),prjtypeid:this.prjtypeid,...params};
let checkParams = {...toJS(this.form.getFormParams()),prjtypeid:this.prjtypeid,method:"checkPrjTypeName"};
Apis.doPrjTypeOpt(checkParams).then(data=>{
if(data.isright){
if(data.checkflag){
Apis.doPrjTypeOpt(newParams).then(data=>{
if(data.success){
this.prjtypeid = data.newid;
this.getPrjTypeForm({prjtypeid:data.newid,viewtype:'edit'});
window._table.reLoad();
}
})
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(21943,"类型名称重复")
// });
message.error(getLabel(21943,"类型名称重复"));
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
}
});
}
//添加共享v
addShare = (value)=>{
Apis.doPrjTypeShareOpt({...value,method:'add',prjtypeid:this.prjtypeid,opttype:this.selectedKey}).then(data=>{
if(data.isright){
this.getPrjTypeShareList(this.selectedKey,this.prjtypeid,{})
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
//删除
delBatch = (value,selectedKey,sharetype)=>{
let _this = this;
if(_this.selectedKey=='addshare'){
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83601,"您确认要删除选中的记录吗?"),
onOk() {
Apis.doPrjTypeShareOpt({id:value,method:'delete',opttype:_this.selectedKey,isdelright:"1"}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.getPrjTypeShareList(_this.selectedKey,_this.prjtypeid,{})
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() { },
})
}else{
let _isdelright = 0;
let content = getLabel(83601,"您确认要删除选中的记录吗?");
if(sharetype==100||sharetype==101||sharetype==102||sharetype==103){
content = <div><WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@6bjxw1`} id='delright' content={getLabel(513171,"是否删除数据权限")}
onChange={(value) => {
_isdelright = value;
}}/> </div>;
}
Modal.confirm({
title: getLabel(513173,"请确认是否删除共享"),
content: content,
onOk() {
Apis.doPrjTypeShareOpt({id:value,method:'delete',opttype:_this.selectedKey,prjtypeid:_this.prjtypeid,isdelright:_isdelright}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.getPrjTypeShareList(_this.selectedKey,_this.prjtypeid,{})
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() { },
})
}
}
//批量删除
delBatchShare = (value)=>{
let _this = this;
if(_this.selectedKey=='addshare'){
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83601,"您确认要删除选中的记录吗?"),
onOk() {
Apis.doPrjTypeShareOpt({id:value,method:'batchdelete',opttype:_this.selectedKey}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.getPrjTypeShareList(_this.selectedKey,_this.prjtypeid,{})
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() { },
})
}else{
let _isdelright = 0;
Modal.confirm({
title: getLabel(513173,"请确认是否删除共享"),
content: <div><WeaCheckbox ecId={`${this && this.props && this.props.ecId || ''}_WeaCheckbox@63b682`} id='delright' content={getLabel(513171,"是否删除数据权限")}
onChange={(value) => {
_isdelright = value;
}}/> </div>,
onOk() {
Apis.doPrjTypeShareOpt({id:value,method:'batchdelete',opttype:_this.selectedKey,prjtypeid:_this.prjtypeid,isdelright:_isdelright}).then(data=>{
if(data.isright){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
_this.getPrjTypeShareList(_this.selectedKey,_this.prjtypeid,{})
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() { },
})
}
}
//更新数据
setFormFields=(value)=>{
this.form.updateFields(value, false);
}
//保存校验规则
setValidate= (params={}) =>{
this.validateRules = params;
}
clearStatus =()=>{
this.selectedKey = "prjtypeinfo";
this.prjtypeinfo = [];
this.prjtypeid = "";
this.rightMenu = [];
this.validateRules = {}; //校验规则
}
}

View File

@ -0,0 +1,280 @@
import { observable, action } from 'mobx';
import {WeaForm} from 'comsMobx'
import {WeaLocaleProvider} from "ecCom"
import {Modal,message} from "antd"
// import {prjEditFormRules} from "../util/index"
import * as Apis from '../apis/prjwfset';
const getLabel = WeaLocaleProvider.getLabel;
export class PrjWfSetStore{
@observable title = "";//项目流程创建
@observable selectTabKey = "baseinfo";
@observable visible = false;
@observable formvisible = false;
@observable rightMenu = [];
@observable viewtype = "add";
@observable wfsetid = "";
@observable wftype = "1";//流程类型1创建、2审批、3模板审批
@observable fieldinfo = [];
@observable form = new WeaForm();
@observable fieldinfo1 = [];
@observable fieldSetform = new WeaForm();
@observable fieldinfo2 = {};
@observable actionDatas = [];
@observable sqlwhere1 = "";
@observable sqlwhere2 = "";
validateRules = {}; //校验规则
@action
handleShareDialog = (bool,viewtype,wftype,selectTabKey,params) =>{
this.visible = bool;
this.viewtype = viewtype;
this.wftype = wftype;
this.selectTabKey = selectTabKey;
if(bool){
if(selectTabKey == 'baseinfo'){
this.getPrjWfSetForm(viewtype,wftype,params);
}else if(selectTabKey == "fieldsel"){
this.getPrjWfSetFiled(viewtype,wftype,params);
}else if(selectTabKey == "actionset"){
this.getPrjWfActionSet(viewtype,wftype,params);
}
}
}
@action
handleFormnameDialog = (bool) =>{
this.formvisible = bool;
}
//初始化form
@action
getPrjWfSetForm=(viewtype,wftype,params={})=>{
var newParams = {...params,viewtype:viewtype,wftype:wftype};
let _this = this;
Apis.getPrjWfSetForm(newParams).then(data=>{
_this.setPrjWfSetForm(data);
})
}
@action
setPrjWfSetForm=(data)=>{
this.title = data.title;
this.fieldinfo = data.fieldinfo;
this.rightMenu = data.rightMenus;
this.wfsetid = data.wfsetid;
this.form = new WeaForm();
this.form && !this.form.isFormInit && this.form.initFormFields(this.fieldinfo);
// this.fieldinfo[0].items[0].onChange = this.wfOnChange;
}
wfOnChange=(key,names, datas)=>{
this.form.$("wfid").bind().onChange(key,names, datas);
if(datas[0].id){
this.form.updateFields({formid:{value:datas[0].formid,valueSpan:datas[0].formidspan}},false);
}
}
//字段设置
@action
getPrjWfSetFiled=(viewtype,wftype,params={})=>{
var newParams = {...params,viewtype:viewtype,wftype:wftype};
let _this = this;
this.wfsetid = params.wfsetid;
Apis.getPrjWfSetField(newParams).then(data=>{
_this.setPrjWfSetField(data);
})
}
@action
setPrjWfSetField=(data)=>{
this.fieldinfo1 = data.fieldinfo;
this.rightMenu = data.rightMenus;
this.fieldSetform = new WeaForm();
this.fieldSetform && !this.fieldSetform.isFormInit && this.fieldSetform.initFormFields(data.fieldinfo);
}
//动作设置
@action
getPrjWfActionSet=(viewtype,wftype,params={})=>{
var newParams = {...params,viewtype:viewtype,wftype:wftype};
let _this = this;
this.wfsetid = params.wfsetid;
Apis.getPrjWfActionSet(newParams).then(data=>{
_this.setPrjWfActionSet(data);
})
}
@action
setPrjWfActionSet=(data)=>{
this.fieldinfo2 = data.fieldinfo;
this.actionDatas = data.fieldinfo.datas;
this.rightMenu = data.rightMenus;
}
@action
changeTab=(key)=>{
this.selectTabKey = key;
if(key == 'baseinfo'){
this.getPrjWfSetForm(this.viewtype,this.wftype,{wfsetid:this.wfsetid});
}else if(key == "fieldsel"){
this.getPrjWfSetFiled(this.viewtype,this.wftype,{wfsetid:this.wfsetid});
}else if(key == "actionset"){
this.getPrjWfActionSet(this.viewtype,this.wftype,{wfsetid:this.wfsetid});
}
}
@action
//更新数据
setFormFields=(value)=>{
this.form.updateFields(value, false);
}
@action
//保存校验规则
setValidate= (params={}) =>{
this.validateRules = params;
}
@action
saveBaseInfo=(params={})=>{
const {saveAndSet} = params;
let _this = this;
this.form.validateForm().then(f=>{
if(f.isValid){
let newParams = {method:this.viewtype,id : this.wfsetid,...this.form.getFormParams(),...params,wftype : this.wftype};
Apis.doPrjWfOperation(newParams).then(data=>{
if(data.isright){
if(data.success){
window._table.reLoad();
if(_this.viewtype=="add"){
if(saveAndSet){
message.success(getLabel(383317,"新建成功"));
_this.handleShareDialog(true,"edit",_this.wftype,"baseinfo",{wfsetid : data.newid});
}else{
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(383317,"新建成功")
});
_this.handleShareDialog(false);
}
}else{
message.success(getLabel(18758,"保存成功"));
}
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.errmsg,
// });
message.error(data.errmsg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
}
});
}
@action
saveFieldSel=(params={})=>{
let _this = this;
this.fieldSetform.validateForm().then(f=>{
if(f.isValid){
let newParams = {method:"fieldmap",id : this.wfsetid,...this.fieldSetform.getFormParams(),...params,wftype : this.wftype};
Apis.doPrjWfOperation(newParams).then(data=>{
if(data.isright){
if(data.success){
message.success(getLabel(18758,"保存成功"));
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.errmsg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(15859,"必要信息不完整!"),
// });
}
});
}
@action
saveActionSet=(params={})=>{
if(this.checkData()){
let keepactionids = "";
this.actionDatas.forEach(element => {
if(element.id){
keepactionids+=","+element.id;
}
});
if(keepactionids){
keepactionids = keepactionids.substr(1,keepactionids.length);
}
let newParams = {
datas : JSON.stringify(this.actionDatas),
keepgroupids : keepactionids,
method:"saveact",
id : this.wfsetid,
wftype : this.wftype
}
Apis.doPrjWfOperation(newParams).then((data)=>{
if(data.isright){
if(data.status!="-1"){
message.success(getLabel(18758,"保存成功"));
//this.getColumnsInfo();
}else{
message.error(getLabel(125961,"请联系系统管理员"));
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
});
}
}
@action
onChangeAction =(datas)=>{
let _this = this;
_this.actionDatas = datas;
}
checkData=()=>{
let canSave = true;
this.actionDatas.forEach(element => {
if(element.objid==""){
canSave = false;
}
})
return canSave;
}
@action
clearStatus =()=>{
this.selectTabKey = "baseinfo";
this.fieldinfo = [];
this.title = "";//项目流程创建
this.visible = false;
this.validateRules = {}; //校验规则
this.actionDatas = [];
}
}

View File

@ -0,0 +1,27 @@
import {observable, action} from 'mobx';
import * as Apis from '../../apis/project';
import { WeaTools } from 'ecCom';
import {WeaTableNew} from 'comsMobx'
const {TableStore} = WeaTableNew;
class PrjResourceStore {
@observable dataKey = '';
@observable searchParams = {};
@observable tableStore = new TableStore()
@action
doSearch(params = {}) {
Apis.getPrjResource(params).then((data) => {
this.tableStore.getDatas(data.sessionkey, params.current || 1);
this.searchParams = { ...params };
this.dataKey = data.sessionkey;
});
}
}
export default PrjResourceStore;

View File

@ -0,0 +1,26 @@
import {observable, action} from 'mobx';
import {WeaTableNew} from 'comsMobx'
const {TableStore} = WeaTableNew;
import * as Apis from '../../apis/project';
import { WeaTools } from 'ecCom';
class ProcessListStore {
@observable orderFields = {};
@observable dataKey = '';
@observable tableStore = new TableStore()
@action
doSearch(params = {}) {
Apis.getProject(newParams).then((data) => {
this.tableStore.getDatas(data.sessionkey, params.current || 1);
this.searchParams = {...params };
this.dataKey = data.sessionkey;
});
}
}
export default ProcessListStore;

View File

@ -0,0 +1,103 @@
import {observable, action} from 'mobx';
import * as Apis from '../../apis/project';
class ProjectStore {
@observable
status = {
loading: false,
leftdatas:{selectedKeys:'',datas:[]},
middatas:{selectedKey:'',selectname:'',datas:[],totalSize:"0",prjinfo:{}},
midCurrent: 1,
pageSize:10,
prjtype:'',
prjid:'',
prjname:'',
prjinfo:{},
prjdatas:{},
tabkey:'1',
};
@action
getLeftList(params) {
let resultParams = {...params,pageSize:this.status.pageSize};
this.status.loading = true;
Apis.getPrjTypeTreePageList(resultParams).then((result) => {
this.status.prjtype = result.leftdatas.selectedKeys;
this.status.leftdatas = result.leftdatas;
this.status.middatas = result.middatas;
this.status.prjid = result.middatas.selectedKey;
this.status.prjname = result.middatas.selectname;
this.status.prjinfo = result.middatas.prjinfo;
this.status.loading = false;
});
}
@action
getMidList(params) {
let resultParams = {...params,pageSize:this.status.pageSize};
this.status.prjtype = params.prjtype;
Apis.getPrjPageListByTypeId(resultParams).then((result) => {
this.status.middatas = result;
this.status.tabkey = '1';
this.status.prjinfo = result.prjinfo;
this.status.prjid = result.selectedKey;
this.status.prjname = result.selectname;
});
}
@action
setMidCurrent(pagenum) {
this.status.midCurrent = pagenum;
}
@action
setTabKey(tabkey) {
this.status.tabkey = tabkey;
}
@action
getProjectView(params) {
this.status.prjid = params.prjid;
Apis.getProjectView(params).then((result) => {
this.status.tabkey = '1';
this.status.prjname = result.top.name;
this.status.prjinfo = result;
});
}
@action
editProject(params) {
Apis.getProjectView(params).then((result) => {
this.status.prjinfo = result;
this.status.prjdatas = result.dataSource;
});
}
@action
updateDataSource(params) {
this.status.prjdatas = params;
}
@action
doProjectSave(){
const prjdatas = this.status.prjdatas;
let par = { 'prjid': this.status.prjid };
for (var item in prjdatas) {
let fieldValue = prjdatas[item].value;
par[item] = fieldValue;
}
this.doProjectBack();
}
@action
doProjectBack(){
let params = {'prjid':this.status.prjid};
Apis.getProjectView(params).then((result) => {
this.status.prjinfo = result;
this.status.prjdatas = result.dataSource;
});
}
}
export default ProjectStore;

View File

@ -0,0 +1,90 @@
import { observable,action } from 'mobx';
import { ListStore } from './listStore';
import { WeaLocaleProvider } from "ecCom"
import * as Apis from '../apis/projectlog';
const getLabel = WeaLocaleProvider.getLabel;
class ProjectLogStroe extends ListStore {
@observable searchParams = {
tabkey: "1",
}
@observable rightMenu = [];
@observable isright = true;
@observable detachable = false;
@observable subCompanyId = "";
@action
initDatas = (params = {}) => {
Apis.getPrjLogCondition(params).then(data => {
this.searchParams = { ...this.searchParams, ...params };
this.condition = data.condition;
this.isright = data.isright;
this.title = data.title;
//根据高级搜索条件初始化form
this.form && !this.form.isFormInit && this.form.initFormFields(data.condition);
this.form.updateFields({
readdate_select__readdate_start__readdate_end: { value:['1', '', '']},
}, false);
}).then(()=>{
this.doSearch();
});
}
@action
doSearch = (params = {}) => {
if (this.isright) {
this.loading = true;
//获取表单的参数值
const searchParamsAd = this.form.getFormParams();
this.searchParams.tabkey = searchParamsAd.readdate_select;
const newParams = { ...this.searchParams, ...searchParamsAd, ...params,subCompanyId:this.subCompanyId };
Apis.getPrjLogList(newParams).then(data => {
this.tableStore.getDatas(data.sessionkey, params.current || 1);
this.dataKey = data.sessionkey;
this.rightMenu = data.rightMenus;
this.detachable = data.detachable;
this.loading = false;
})
}
}
onShowColumn = () => { //显示定制列
this.tableStore.setColSetVisible(true);
this.tableStore.tableColSet(true)
}
setSearchParams = (params) => {
this.searchParams = {...this.searchParams,...params};
this.form.updateFields({
readdate_select__readdate_start__readdate_end: { value:[params.tabkey, '', '']},
}, false);
}
/**
* 更新组织结构树选中分部
* @param subCompanyId
*/
updateSubCompanyId(subCompanyId ){
this.subCompanyId = subCompanyId
const readdate_select = this.searchParams.tabkey;
this.form.resetForm();
this.form.updateFields({
readdate_select__readdate_start__readdate_end: { value:[readdate_select, '', '']},
}, false);
this.doSearch();
}
clearStatus = () => {
this.baseParams = {};
this.searchParams = { tabkey: "1" };
this.isright = true;
this.rightMenu = [];
this.showSearchAd = false;
this.clearFormFields();
this.resetForm();
this.condition = [];
this.resetTable(true);
}
}
export default ProjectLogStroe;

View File

@ -0,0 +1,119 @@
import { observable, action, toJS } from 'mobx';
import {WeaTableNew,WeaForm} from 'comsMobx'
import { WeaTools,WeaLocaleProvider } from 'ecCom';
import * as Task_Apis from "../apis/templet"
import {getFormInitDatas,prjEditFormRules} from "../util/index"
import {message,Modal} from "antd"
const confirm = Modal.confirm;
const getLabel = WeaLocaleProvider.getLabel;
/**
* @author ljc 2017-12-19
* 任务的编辑新增等
*/
export class TaskInfoStore{
@observable title = "";//编辑任务
@observable rightMenu = [];
@observable taskid = "";
@observable taskForm = new WeaForm();
@observable visible = false;
@observable taskInfo = {};
@observable type = "";
@observable baseParams = {} ; //基本数据保存
@observable validateRules = {};
@observable selectedRowKeys = [];
@action
handleDialog = (bool,type,id,params={} ) =>{
this.visible = bool;
if(bool){
this.taskid = id;
this.type = type;
if(type=='add'){
this.title= getLabel(1342,"添加任务");
}else if(type=='view'){
this.title= getLabel(382572,"查看任务");
}else if(type=='edit'){
this.title = getLabel(15284,"编辑任务");
}
this.baseParams =params ;
this.getTaskInfo(type,id,params);
}
}
getTaskInfo=(type,id,params={})=>{
this.taskForm = new WeaForm();
Task_Apis.getTaskTempletForm({viewtype:type,templetTaskId:this.taskid,...params}).then(data=>{
this.taskInfo = data;
this.rightMenu = data.rightMenus;
this.taskForm && !this.taskForm.isFormInit && this.taskForm.initFormFields(data.fieldinfo);
this.taskForm.isFormInit && this.taskForm.updateFields(getFormInitDatas(data.fieldinfo),false);
})
}
setFormFields=(value)=>{
this.taskForm.updateFields(value, false); //true代表完全覆盖方式更新条件值
}
//保存规则
setValidate=(params={})=>{
this.validateRules = params;
}
@action
delTask=(type,taskid)=>{
let _this = this;
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83925,"该任务及其子任务都会被删除,您确认要删除吗?"),
onOk() {
Task_Apis.doPrjTaskTempletOpt({method:type,templetTaskId:taskid}).then(data=>{
if(data.success){
window._table.reLoad();
}else{
message.error(getLabel(383746,"请求失败")+""+data.msgcode);
}
})
},
onCancel() { },
})
}
@action
delTaskBatch=(type,taskid)=>{
let _this = this;
if(this.selectedRowKeys.length > 0){
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83925,"该任务及其子任务都会被删除,您确认要删除吗?"),
onOk() {
Task_Apis.doPrjTaskTempletOpt({method:type,templetTaskIds:`${_this.selectedRowKeys}`}).then(data=>{
if(data.isright){
if(data.success){
_this.selectedRowKeys = [];
window._table.reLoad();
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83472,"删除成功!"),
});
}else{
message.error(getLabel(383746,"请求失败")+""+data.msgcode);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() { },
})
}
}
@action
onRowSelect = (rows) => {
this.selectedRowKeys = rows;
}
}

View File

@ -0,0 +1,155 @@
import { observable, action, autorun,toJS } from 'mobx';
import {WeaTools} from "ecCom"
import objectAssign from 'object-assign';
import {message,Modal} from 'antd';
const confirm = Modal.confirm;
import {WeaTableNew,WeaForm} from 'comsMobx'
const {TableStore} = WeaTableNew;
import * as Apis from '../apis/templet';
import {getFormInitDatas,prjEditFormRules} from "../util/index"
import {TaskInfoStore} from './taskInfoStore'
class TaskTempletCardStore {
@observable selectTabKey = "taskinfo"
@observable form = new WeaForm();
@observable taskInfo= [] ; //任务信息
@observable loading = false;
@observable taskid ="";
@observable targetid ="";
@observable prjid ="";
taskname="";
validateRules = {};
@observable rightMenu = [];
@observable condition = [];
@observable taskInfoStore = new TaskInfoStore();
@observable taskDocStore = new TableStore(); //文档
@observable relateList ={} ; // 查询结果集
@action
reLoad = (tableStore) => {
tableStore.getDatas(tableStore.dataKey, tableStore.current,tableStore.pageSize,tableStore.sortParams)
}
@action
//设置选中按钮
changeTab=(key)=>{
this.selectTabKey = key;
if(key == 'taskinfo'){
this.getTaskTempletForm({viewtype:'view',templetTaskId:this.taskid});
}
if(key == "req" || key == "doc"){
this.getTaskTempletReference(key);
}
}
//任务信息
getTaskTempletForm=(params={})=>{
this.loading = true;
this.form = new WeaForm();
Apis.getTaskTempletForm(params).then(data=>{
this.taskid = data.taskid ||params.taskid ;
this.prjid = data.prjid;
this.taskname = data.taskname;
this.taskInfo = data;
this.rightMenu = data.rightMenus;
this.loading = false;
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
this.form.isFormInit && this.form.updateFields(getFormInitDatas(data.fieldinfo),false);
})
}
//高级搜索设值
setFormFields=(value)=>{
if(this.selectTabKey == "taskinfo"){
this.form.updateFields(value, false); //true代表完全覆盖方式更新条件值
}
}
//任务信息保存
saveTaskTempletInfo=(params={})=>{
this.form.validate().then(f=>{
if(f.isValid){
let newParams = {method:'edit',...toJS(this.form.getFormParams()),templetTaskId:this.taskid,...params};
Apis.doPrjTaskTempletOpt(newParams).then(data=>{
window.opener&&window.opener._table&&window.opener._table.reLoad();
this.getTaskTempletForm({viewtype:'view',templetTaskId:this.taskid});
})
}else{
f.showErrors();
Modal.warning({
title: getLabel(15172,"系统提示"),
content: getLabel(15859,"必要信息不完整!"),
});
}
});
}
//任务删除
@action
delTask=(type,taskid)=>{
let _this = this;
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83925,"该任务及其子任务都会被删除,您确认要删除吗?"),
onOk() {
Apis.delTask({method:type,taskid:taskid}).then(data=>{
if(data.success){
window.opener&&window.opener._table&&window.opener._table.reLoad();
window.close();
}else{
message.error(getLabel(383746,"请求失败")+""+data.msgcode);
}
})
},
onCancel() { },
})
}
//相关流程-文档
getTaskTempletReference=(type)=>{
this.loading = true;
const newParams = {templetId:this.prjid,templetTaskId:this.taskid, reftype:type};
Apis.getTaskTempletReference(newParams).then(data=>{
if(type== "req"){
this.relateList = data;
this.rightMenu = data.rightMenus;
}else if(type== "doc"){
this.taskDocStore.getDatas(data.sessionkey,1);
this.relateList = data;
this.rightMenu = data.rightMenus;
}
this.loading = false;
});
}
//所需流程文档操作
doDspTaskRequiredOpt = (params={},type) =>{
Apis.doDspTaskTempletReqOpt(params).then(data=>{
this.getTaskTempletReference(type);
if(params.method == "addRequiredWF" || params.method == "addRequiredDoc"){
message.success(getLabel(83880,"添加成功!"));
}else if(params.method == "delRequiredWF" || params.method == "delRequiredDoc"){
message.success(getLabel(83472,"删除成功!"));
}
})
}
//相关文档操作
doDspTaskReferenceOpt = (params={},type)=>{
Apis.doDspTaskTempletRefOpt(params).then(data=>{
this.getTaskTempletReference(type);
message.success(params.method =="del" ? getLabel(83880,"添加成功!"):getLabel(83472,"删除成功!"));
})
}
//保存规则
setValidate=(params={})=>{
this.validateRules = params;
}
}
export default TaskTempletCardStore;

View File

@ -0,0 +1,83 @@
import { observable, action, autorun,toJS } from 'mobx';
import {WeaLocaleProvider} from "ecCom"
import {Modal,} from 'antd';
import * as Apis from '../apis/templet';
const getLabel = WeaLocaleProvider.getLabel;
export class TaskTempletImpStore {
@observable rightMenu = [];
@observable templetid = "";
@observable templetname = "";
@observable visible = false;
@observable taskmandstr = "";
@observable taskotherstr = "";
@observable loading = false;
@observable taskisrefresh = new Date().getTime();
@observable hasTaskUpload = false;
@observable filelist = [];
@observable excelfile = '';
@observable spinning = false;
@observable taskmsg = "";
@observable imp_totalCount = "";//总数据数
@observable imp_successCount = "";//正确导入数
@observable imp_loseCount = "";//失败条数
@observable remind;
@action
handleDialog = (bool,templetid,templetname) =>{
this.visible = bool;
if(bool){
this.templetid = templetid;
this.templetname = templetname;
this.initTaskDatas();
}
}
@action
initTaskDatas=(params={})=>{
this.loading = true;
Apis.getTaskTempletImp(params).then(data=>{
this.taskmandstr = data.mandstr;
this.taskotherstr = data.otherstr;
this.rightMenu = data.rightMenus;
this.loading = false;
})
}
hasUpload=(bool,type)=>{
this.hasTaskUpload = bool;
}
doImport=(doImport)=>{
let _this = this;
let params = {isdata:"3",templetId:this.templetid,taskexcelfile:this.excelfile||''};
if(this.excelfile==''){
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(19508,"未选择模板"),
// });
this.remind.refs.import.showError();
return;
}else{
this.spinning = true;
Apis.doPrjimpopt(params).then(data => {
if(data) {
_this.spinning = false;
_this.taskmsg = data.msg;
_this.imp_totalCount = data.totalCount;
_this.imp_successCount = data.successCount;
doImport&&doImport();
}
})
}
}
clearStatus=()=>{
this.taskmsg = "";
this.imp_totalCount = "";
this.imp_successCount = "";
this.excelfile="";
this.filelist=[];
}
}

View File

@ -0,0 +1,344 @@
import { observable, action } from 'mobx';
import {WeaTableNew,WeaForm} from 'comsMobx'
const {TableStore} = WeaTableNew;
import {WeaTools,WeaLocaleProvider} from "ecCom"
import {Modal,message} from "antd"
const confirm = Modal.confirm;
import { toJS } from 'mobx';
import * as Apis from '../apis/templet';
import * as Apis_wf from '../apis/prjwfset';
import {PrjWfSetStore} from './prjwfsetStore';
const getLabel = WeaLocaleProvider.getLabel;
class TempletApproveStore{
@observable title = "";//模板审批
@observable form = new WeaForm();
@observable wftype = "";
@observable isright = true;
@observable fieldinfo = [];
//@observable tabs = [{key:"approveset",title:"审批设置"},{key:"wflist",title:"自定义流程设置"}];
@observable tabs = [];
@observable chkNeedAppr = "0";
@observable selectTabKey = "0";
@observable loading = false;
@observable rightMenu = [];
validateRules = {}; //校验规则
@observable showSearchAd = false // 高级搜索显示
@observable wfsetListStore = new TableStore();
@observable wfsetConditonform = new WeaForm();
@observable condition = [];
@observable prjWfSetStore = new PrjWfSetStore();
@action
reLoad = () =>{
this.getWfSetList({wftype:this.wftype});
}
//初始化form
@action
initData =(params={})=>{
this.wftype = params.wftype;
Apis_wf.getWfSetTab(params).then(data=>{
if("3" == this.wftype){
// this.tabs = [{
// color: '#000000',
// groupid: 'approveset',
// showcount: false,
// title: getLabel(84412,"审批设置"),
// viewcondition: 0
// },{
// color: '#ff3232',
// groupid: 'wflist',
// showcount: false,
// title: getLabel(84413,"自定义审批流程"),
// viewcondition: 1
// }
// ];
this.selectTabKey = "0";
}else{
// this.tabs = [];
this.selectTabKey = "1";
}
this.title = data.toptitle;
})
if("3" == this.wftype){
this.loading = true;
Apis.getTempletApproveForm(params).then(data=>{
this.updateData(data);
})
}else{
this.getWfSetList(params);
}
}
@action
updateData=(data)=>{
this.isright = data.isright;
if(data.isright){
this.rightMenu = data.rightMenus;
this.chkNeedAppr = data.formdatas.chkNeedAppr;
this.fieldinfo = this.prjEditFormRules(data.fieldinfo);
this.form = new WeaForm();
this.form && !this.form.isFormInit && this.form.initFormFields(this.prjEditFormRules(data.fieldinfo));
this.loading = false;
}
}
@action
changeTab=(key)=>{
this.selectTabKey = key
if(key == '0'){
this.initData({wftype : this.wftype});
}else if(key == "1"){
this.condition=[];
this.wfsetListStore = new TableStore();
this.getPrjWfSetCondition({wftype : this.wftype});
}
}
@action
prjEditFormRules = (condition=[]) =>{
let _this = this;
condition.map(c =>{
let items = [];
c.items.map((field,index) => {
//联动
if(field.domkey[0]=='wfid'){
if(_this.chkNeedAppr==1){
field.browserConditionParam.viewAttr = "3";
}else{
field.browserConditionParam.viewAttr = "2";
}
}
if(field.conditionType == "BROWSER"){
if(field.browserConditionParam.viewAttr == "3"){
field.rules ='required|string'// 校验规则
}else{
field.rules ='string'
}
}else{
if(field.viewAttr == "3"){
field.rules ='required|string'// 校验规则
}else{
field.rules ='string'
}
}
})
});
return condition;
}
@action
batchDeleteWfSet = (selectedRowKeys) => {
const count = selectedRowKeys.split(",").length;
const newParams = {ids : selectedRowKeys,method : "batchdelete",wftype :this.wftype }
if(count>0){
Modal.confirm({
title: getLabel(15172, "系统提示"),
content: getLabel(83601,"您确认要删除选中的记录吗?"),
onOk() {
Apis_wf.doPrjWfOperation(newParams).then(data=>{
if(data.isright){
if(data.success){
message.success(getLabel(20461,"删除成功"));
window._table.reLoad();
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() {},
});
}
}
@action
deleteWfSet = (id) => {
const newParams = {id : id,method : "delete",wftype :this.wftype }
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83600,"您确认要删除吗?"),
onOk() {
Apis_wf.doPrjWfOperation(newParams).then(data=>{
if(data.isright){
if(data.success){
message.success(getLabel(20461,"删除成功"));
window._table.reLoad();
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() {},
});
}
@action
toggleuse = (id,isopen) => {
const newParams = {id : id,method : "toggleuse",isopen : isopen , wftype :this.wftype }
Apis_wf.doPrjWfOperation(newParams).then(data=>{
if(data.isright){
if(data.success){
if("1" == isopen){
message.success(getLabel(32626,"已启用"));
}else{
message.warning(getLabel(384564,"已禁用"));
}
window._table.reLoad();
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
//流程配置列表
@action
getWfSetList=(params={})=>{
//获取表单的参数值
this.loading = true;
const searchParamsAd = this.wfsetConditonform.getFormParams();
const newParams = {...searchParamsAd, ...params};
Apis_wf.getPrjWfSetList(newParams).then(data=>{
this.isright = data.isright;
if(data.isright){
this.wfsetListStore.getDatas(data.sessionkey, 1);
this.rightMenu = data.rightMenus;
this.loading = false;
}
});
}
//流程配置列表
@action
getPrjWfSetCondition=(params={})=>{
//获取表单的高级查询
this.wfsetConditonform = new WeaForm();
Apis_wf.getPrjWfSetCondition(params).then(data=>{
this.condition = data.condition;
this.wfsetConditonform && !this.wfsetConditonform.isFormInit && this.wfsetConditonform.initFormFields(data.condition);
});
}
//form 重置
@action
clearFormFields=()=>{
if(this.selectTabKey == "1" || this.wftype == "1" || this.wftype == "2"){
this.wfsetConditonform.reset(); //清除查询条件值
}
}
//高级搜索显隐
@action
setShowSearchAd=(bool)=>{
this.showSearchAd = bool
}
@action
onShowColumn=()=>{ //显示定制列
if(this.selectTabKey == "1" || this.wftype == "1" || this.wftype == "2"){
this.wfsetListStore.setColSetVisible(true);
this.wfsetListStore.tableColSet(true);
}
}
//任务信息保存
@action
saveTempletApprove=(params={})=>{
this.form.validateForm().then(f=>{
if(f.isValid){
let newParams = {...toJS(this.form.getFormParams())};
Apis.doTempletApproveSave(newParams).then(data=>{
if(data.isright){
if(data.success){
message.success(getLabel(83551,"保存成功!"));
}else{
Modal.error({
title: getLabel(15172,"系统提示"),
content: data.errmsg,
});
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
}
});
}
//更新数据
@action
setFormFields=(value)=>{
//联动设置必填
this.chkNeedAppr = value.chkNeedAppr.value;
this.form = new WeaForm();
this.form.initFormFields(this.prjEditFormRules(this.fieldinfo));
this.form.updateFields(value, false);
}
//更新数据
@action
setFormSearchFields=(value)=>{
this.wfsetConditonform.updateFields(value, true);
}
@action
setFormWfid = (value)=>{
this.fieldinfo = this.getFieldInfo(this.fieldinfo,value);
this.form.updateFields(value, false);
}
@action
getFieldInfo=(condition,value)=>{
condition.map(c =>{
let items = [];
c.items.map((field,index) => {
if(field.domkey[0]=='wfid'){
let replaceDatas = value.wfid.valueObj;
field.browserConditionParam = {...field.browserConditionParam,replaceDatas:replaceDatas};
}
})
});
return condition;
}
//保存校验规则
@action
setValidate= (params={}) =>{
this.validateRules = params;
}
@action
clearStatus =()=>{
this.fieldinfo = [];
this.rightMenu = [];
this.validateRules = {}; //校验规则
}
@action
setWftype=(wftype)=>{
this.wftype = wftype;
}
}
export default TempletApproveStore;

View File

@ -0,0 +1,194 @@
import { observable, action} from 'mobx';
import { ListStore } from './listStore';
import {Modal,message} from 'antd';
import {WeaLocaleProvider} from "ecCom"
import * as Apis from '../apis/templet.js';
import {AddPrjTempletStore} from './addPrjTempletStore'
const getLabel = WeaLocaleProvider.getLabel;
class TempletListStore extends ListStore{
@observable title = "";//项目类型
@observable rightMenu =[];
/** 左侧树store */
@observable leftTree = [];
@observable leftTreeCount = {};
@observable leftTreeCountType = [];
@observable selectedTreeKey = "";
@observable treeType={};
@observable prjtypeid = "";
@observable addPrjTempletStore = new AddPrjTempletStore();
condition = [{
"title": getLabel(15774,"搜索条件"),
"items": [{
"colSpan": 2,
"conditionType": "INPUT",
"domkey": ["name"],
"fieldcol": 18,
"isQuickSearch": true,
"label": getLabel(28050,"模板名称"),
"labelcol": 6,
"precision": 0,
"viewAttr": 2
}, {
"colSpan": 2,
"conditionType": "INPUT",
"domkey": ["typedesc"],
"fieldcol": 18,
"isQuickSearch": false,
"label": getLabel(433,"描述"),
"labelcol": 6,
"precision": 0,
"viewAttr": 2
}],
"defaultshow": true
}]
@action
initDatas=(params={})=>{
this.form && !this.form.isFormInit && this.form.initFormFields(this.condition);
}
initTreeDatas=(params={})=>{
Apis.getTempletPrjTypeTree({treetype:'prjtemplet',...params}).then(data=>{
this.leftTree =data.treedata;
this.leftTreeCount = data.treecount;
this.leftTreeCountType = data.treecountcfg;
//this.selectedTreeKey = data.selectedKeys;
})
}
doSearch=(params={})=>{
this.loading = true;
const searchParamsAd = this.form.getFormParams();
const newParams = {...this.treeType,...searchParamsAd, ...params };
if(params.prjtypeid!=undefined){
this.treeType = {prjtypeid:params.prjtypeid};
this.prjtypeid = params.prjtypeid;
}
if(params.prjtypename){
this.title = params.prjtypename;
}else{
this.title = getLabel(586,"项目类型");
}
Apis.getTempletByPrjTypeList(newParams).then(data=>{
this.tableStore.getDatas(data.sessionkey, params.current || 1);
this.dataKey = data.sessionkey;
this.rightMenu = data.rightMenus;
this.loading = false;
})
}
reLoad=()=>{
this.tableStore.getDatas(this.tableStore.dataKey, this.tableStore.current, this.tableStore.pageSize, this.tableStore.sortParams);
Apis.getTempletPrjTypeTree({treetype:'prjtemplet'}).then(data=>{
this.leftTree =data.treedata;
this.leftTreeCount = data.treecount;
this.leftTreeCountType = data.treecountcfg;
})
}
onShowColumn=()=>{
this.tableStore.setColSetVisible(true);
this.tableStore.tableColSet(true)
}
setSelectedTreeKey=(key) =>{
this.selectedTreeKey = key;
}
clearStatus=()=>{
this.showSearchAd = false;
this.clearFormFields();
}
//批量删除模板
@action
delBatchPrjTemplet=(id)=>{
let _this = this;
let par = {id:id,method:"batchdelete"};
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83601,"您确认要删除选中的记录吗?"),
onOk() {
Apis.doPrjTempletOpertaion(par).then(data=>{
if(data.isright){
if(data.success){
// Modal.success({
// title: getLabel(15172,"系统提示"),
// content: getLabel(20461,"删除成功"),
// });
message.success(getLabel(20461,"删除成功"));
_this.reLoad();
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
},
onCancel() { },
})
}
//指定模板
@action
doSelectPrjTemplet=(id)=>{
let _this = this;
let par = {templetId:id,proTypeId:this.prjtypeid,method:"select"};
Apis.doPrjTempletOpertaion(par).then(data=>{
if(data.isright){
if(data.success){
_this.tableStore.getDatas(_this.tableStore.dataKey, _this.tableStore.current, _this.tableStore.pageSize, _this.tableStore.sortParams);
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: data.msg,
// });
message.error(data.msg);
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}
//指定模板
@action
doApprovetemplate=(id)=>{
let _this = this;
let par = {templetId:id};
Modal.confirm({
title: getLabel(15172,"系统提示"),
content: getLabel(83921,"你确定要提交审批吗?"),
onOk() {
Apis.doApprovetemplate(par).then(data=>{
if(data.success){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(83923,"提交成功!"),
});
_this.reLoad();
}else{
// Modal.warning({
// title: getLabel(15172,"系统提示"),
// content: getLabel(125188,"后台流程配置不正确,请检查后台流程配置!"),
// });
message.error(getLabel(125188,"后台流程配置不正确,请检查后台流程配置!"));
}
})
},
onCancel() { },
})
}
}
export default TempletListStore;

View File

@ -0,0 +1,152 @@
import { observable, action } from 'mobx';
import {WeaTableNew,WeaForm} from 'comsMobx'
const {TableStore} = WeaTableNew;
import {WeaTools,WeaLocaleProvider} from "ecCom"
import {Modal,message} from "antd"
const confirm = Modal.confirm;
import { toJS } from 'mobx';
// import {prjEditFormRules} from "../util/index"
import * as Apis from '../apis/basemanger';
const getLabel = WeaLocaleProvider.getLabel;
export class WorkTypeStore{
@observable title = "";//编辑工作类型
@observable form = new WeaForm();
@observable formtype = "";
@observable visible = false;
@observable isright = true;
@observable forminfo = [];
@observable id = "";
@observable rightMenu = "";
validateRules = {}; //校验规则
@action
handleShareDialog = (bool,params) =>{
this.visible = bool;
if(bool){
this.id = params.id;
this.formtype = params.formtype;
if(this.formtype=="worktype"){
this.getWorkTypeForm({worktypeid:this.id});
}else if(this.formtype=="prjstatus"){
this.getPrjStatusForm({prjstatusid:this.id});
}
}
}
//初始化form
getWorkTypeForm=(params={})=>{
this.form = new WeaForm();
Apis.getWorkTypeFormField(params).then(data=>{
this.isright = data.isright;
this.forminfo = data.fieldinfo;
this.rightMenu = data.rightMenus;
if(this.id&&this.id!=""){
this.title = getLabel(83855,"编辑工作类型");
}else{
this.title = getLabel(83854,"新建工作类型");
}
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
})
}
//初始化form
getPrjStatusForm=(params={})=>{
this.form = new WeaForm();
Apis.getPrjStatusFormField(params).then(data=>{
this.isright = data.isright;
this.forminfo = data.fieldinfo;
this.rightMenu = data.rightMenus;
if(this.id&&this.id!=""){
this.title = getLabel(93,"编辑")+getLabel(587,"项目状态");
}else{
this.title = getLabel(82,"新建")+getLabel(587,"项目状态");
}
this.form && !this.form.isFormInit && this.form.initFormFields(data.fieldinfo);
})
}
//项目类型保存
saveFormInfo=(params={})=>{
if(this.formtype=="worktype"){
this.saveWorktypeInfo(params);
}else if(this.formtype=="prjstatus"){
this.savePrjStatusInfo(params);
}
}
//工作类型保存
saveWorktypeInfo=(params={})=>{
this.form.validateForm().then(f=>{
if(f.isValid){
let newParams = {...toJS(this.form.getFormParams()),worktypeid:this.id,...params};
Apis.doWorkTypeOpt(newParams).then(data=>{
if(data.isright){
if(data.success){
this.handleShareDialog(false);
if(params.method=='edit'){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(18758,"保存成功")
});
}
window._table.reLoad();
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
}
});
}
//项目状态保存
savePrjStatusInfo=(params={})=>{
this.form.validateForm().then(f=>{
if(f.isValid){
let newParams = {...toJS(this.form.getFormParams()),prjstatusid:this.id,...params};
Apis.doPrjStatusOpt(newParams).then(data=>{
if(data.isright){
if(data.success){
this.handleShareDialog(false);
if(params.method=='edit'){
Modal.success({
title: getLabel(15172,"系统提示"),
content: getLabel(18758,"保存成功")
});
}
window._table.reLoad();
}
}else{
message.error(getLabel('507580','出现错误!对不起,您暂时没有权限!!'));
}
})
}else{
f.showErrors();
}
});
}
//更新数据
setFormFields=(value)=>{
this.form.updateFields(value, false);
}
//保存校验规则
setValidate= (params={}) =>{
this.validateRules = params;
}
clearStatus =()=>{
this.selectedKey = "prjtypeinfo";
this.prjtypeinfo = [];
this.prjtypeid = "";
this.rightMenu = [];
this.validateRules = {}; //校验规则
}
}

View File

@ -0,0 +1,514 @@
/* 新建流程的 */
.dyfContainer {
height: 100%;
margin-top: 30px;
margin-bottom: 30px;
}
.dyfA {}
.listbox-item-style {
display: inline-block;
line-height: 13px;
clear: both;
height: 13px;
width: 13px;
cursor: default;
}
.mainItem {
margin: 0 0 0 0;
padding: 0px;
list-style: none;
}
.centerItem {
height: 30px;
line-height: 30px;
padding-left: 0px;
position: relative;
margin-bottom: 5px;
font-size: 14px
}
.centerItem:hover {
background: #f5f5f5;
}
.centerItem:hover .imageItem {
display: block!important;
}
.centerItem a {
color: #7a7a7a;
}
.centerItem a:hover {
color: #4ab1fc;
}
.centerItem .ant-menu-item{
width: 100%;
}
.imageItem {
position: absolute;
right: 0;
height: 30px;
z-index: 101;
padding-right: 10px;
background:#f5f5f5;
}
.fontItem {
width: 100%;
float: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding:0 20px;
}
.imgspan {
height: 26px;
width: 30px;
float: left;
margin-top: 4px;
}
.imgdiv {
background-color: rgb(153, 153, 153);
border: 1px solid #e0e0e0;
border-bottom: none;
}
.imgspan img {
margin-top: 3px;
margin-left: 17px;
cursor: pointer;
}
.agentlistdata {
position: absolute;
background-color: #f5f5f5;
border: 1px solid #e0e0e0;
z-index: 100;
min-width: 50px;
}
.agenter {
float: left;
border-bottom-style: solid;
border-bottom: 1px solid #e2e3e4;
margin-bottom: 13px;
margin-left: 15px;
margin-right: 15px;
height: 24px;
line-height: 24px;
}
.importTxt {}
.importSpan {
margin-top: 5px;
width: 206px;
background-color: #fff;
margin-left: 10px;
margin-right: 10px;
}
.importSpan img {
float: right;
margin-top: 7;
position: relative;
top: -30;
}
.centerItem:hover {
display: block;
}
.labelText {
margin-top: 10px;
height: 30px;
line-height: 30px;
text-align: center;
display: none;
}
.prj-create-main {
height: 100%;
}
.prj-create-main .ant-card {
background: #f5f5f5;
border-radius: 0;
font-size: 12px;
position: relative;
transition: all .3s;
margin-bottom: 10px;
min-width: 273px;
font-family: "Microsoft Yahei"!important;
overflow: visible;
}
.prj-create-main .ant-card:hover {
background: #ffffff;
border-color: #d5d5d5;
}
.prj-create-main .ant-card-bordered {
border-width: 0px;
border: 1px solid #f5f5f5;
border-top: 4px solid red;
}
.prj-create-main .ant-card-body {
padding: 15px 0px 0px 0px;
}
.wf-card-item {
height: 30px;
line-height: 30px;
padding-left: 0px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
padding-left: 0px;
}
.wf-card-item a {
color: #123885;
margin-left: 8px;
margin-right: 12px;
}
.wf-card-icon {
width: 64px;
height: 64px;
}
.wf-card-type-name {
width: 100%;
text-align: center;
color: #292929;
font-size: 16px;
}
.wf-card-type-name>span {
display: inline-block;
vertical-align: top;
}
.wf-card-btn-icon {
cursor: pointer;
padding-left: 15px;
}
.wf-tab {}
.wf-bar-advance {
position: absolute;
right: 20px;
z-index: 999;
height: 37px;
}
.advanceBtn {
font-family: 'menu' !important;
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-size: 22px;
display: inline-block;
vertical-align: baseline;
text-align: center;
text-rendering: auto;
margin-right: 5px;
cursor: pointer;
}
.wf-bar-advance-search {
float: left;
display: inline-block;
vertical-align: baseline;
margin-top: 5px;
}
.wf-bar-advance-btn {
float: right;
display: inline-block;
vertical-align: baseline;
margin-top: 5px;
font-size: 16px;
}
.wf-bar-advance-btn i {
cursor: pointer;
padding-right: 5px;
}
.abcbtn-group {
padding-left: 10px;
padding-bottom: 13px;
font-family: "arial";
font-size: 16px;
}
.abcbtn-group .ant-btn {
border-radius: 1px;
margin-right: 2px;
padding: 0px;
width: 30px;
height: 30px;
border: none;
background: #f5f5f5;
font-size: 16px;
}
.abcbtn-group .ant-btn:last-child {
width: 60px;
}
.abcbtn-group .ant-btn-ghost:focus,
.abcbtn-group .ant-btn-ghost:hover,
.abcbtn-group .btn-selected {
color: #fff;
background-color: #108ee9;
border-color: #108ee9;
}
.abcbtn-group .ant-btn-ghost[disabled]:focus,
.abcbtn-group .ant-btn-ghost[disabled]:hover {
color: #ccc;
background-color: #f7f7f7;
border-color: #d9d9d9;
}
.abc-circle {
width: 60px;
height: 60px;
background: #55D2D4;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
border-radius: 30px;
margin: 0 auto;
text-align: center;
}
.abc-span {
display: inline;
font-size: 32px;
line-height: 60px;
color: #ffffff;
}
.autocomplete-suggestions {
color: #484848;
width: 226px;
}
.autocomplete-suggestion {
padding: 2px 5px;
color: #5b5b5b;
white-space: nowrap;
overflow: hidden;
height: 30px;
line-height: 30px;
cursor: pointer;
text-overflow: ellipsis;
border-bottom: 1px solid #e2e3e4;
cursor: pointer;
}
.autocomplete-suggestion:hover {
border-bottom-color: #99cdf8;
}
.importwf {
position: absolute;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #d9d9d9;
z-index: 9999;
width: 226px;
height: 50px;
display: none;
box-shadow: 0 1px 6px hsla(0, 0%, 39%, .2);
border-radius: 6px;
}
.importwf input {
width: 200px;
height: 28px;
box-shadow: none;
margin-left: 13px;
margin-top: 8px;
}
.one-card-title {
float: left;
width: 300px!important;
height: 100%;
margin-bottom: 15px;
}
.one-card-content {
margin-left: 300px;
height: 100%;
}
.one-card-content-inner {
padding: 0 10px;
height: 100%
}
.one-card-content ul {
overflow: visible;
}
.one-card-content ul li,
.usedtodo>ul>li {
width: 360px;
float: left;
}
.usedtodo {
width: 100%;
height: 100%;
}
.usedtodo>ul>li .centerItem {
margin-bottom: 20px;
}
.prj-create-main .ant-tabs-content{
overflow-y: auto;
height: 100%;
margin-top: 5px;
}
.prj-create-main .ant-tabs-bar{
margin: -36px 0 0;
}
/*新建流程图标*/
.icon-circle-add-item {
display: block;
width: 60px;
height: 60px;
margin: 0 auto;
font-size: 32px;
line-height: 59px;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
.prj-create-main .wea-add-drop-btn {
display: inline-block;
width: 30px;
text-align: center;
cursor: pointer;
position: relative;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content {
position: absolute;
top: 30px;
right: 0;
background: #fff;
border: 1px solid #dadada;
box-shadow: 0 0 2px #dadada;
padding: 10px 0;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .wea-add-drop-btn-on {
height: 27px;
width: 30px;
position: absolute;
top: -27px;
right: -1px;
line-height: 21px;
border: 1px solid #dadada;
border-bottom: 0;
background-color: #fff;
box-shadow: 0px -1px 2px -1px #dadada;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-btn-area {
display: inline-block;
width: 30px;
height: 30px;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .ant-menu {
border-right: 0;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .ant-menu-item {
padding: 0 5px;
height: 30px;
line-height: 30px;
border-right: 0;
text-align: left;
text-indent: 1em;
font-size: 14px;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .ant-menu-item-active,
.ant-menu-item:hover {
background-color: #dadada;
color: #7a7a7a;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content a {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content a:hover {
color: #7a7a7a;
}
/*最科学的清浮动。。用after撑高请慎用overflowhidden,暂不影响其他的*/
.prj-create-main .clearfix:after {
clear: both;
content: ".";
display: block;
font-size: 0;
height: 0;
visibility: hidden
}
.prj-create-main .clearfix:after {
_zoom: 1;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .wea-input-focus {
width: 80%;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .wea-input-focus>button {
width: 14%;
}
.prj-create-main .wea-add-drop-btn .wea-add-drop-content .wea-input-focus .ant-input-wrapper>input {
width: 100%;
}
.prj-create-main .wea-prj-add-content {
width: 100%;
padding: 20px 10px 0;
overflow-y: auto;
}

View File

@ -0,0 +1,105 @@
body {
line-height: normal;
overflow: hidden;
}
#container {
overflow: hidden;
height: 100%;
width: 100%;
}
.prj-board-page{
height: 100%;
.wea-left-right-layout {
background: #e8edf4;
.wea-left-right-layout-left {
border-right: 0px;
background: #e8edf4;
&>div:not(.wea-left-right-layout-btn) {
margin-right: 5px;
background: #fff;
height: 100%;
}
}
}
.wea-new-top-wapper .wea-new-top {
border-bottom: 0px;
}
.ant-tabs{
.ant-tabs-bar {
margin-bottom: 0px;
}
}
}
.prj-list-view {
height: 100%;
.ant-pagination {
margin-top: 9px;
text-align: center;
&>li {
float: none;
display: inline-block;
}
}
}
.prj-list-item {
border: 10px;
box-sizing: border-box;
display: block;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
cursor: pointer;
text-decoration: none;
margin: 0px;
padding: 0px;
outline: none;
font-size: 12px;
font-weight: inherit;
position: relative;
color: #000;
line-height: 16px;
transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms;
background: none;
.prj-list-item-content {
margin-left: 0px;
position: relative;
padding: 10px 0px;
margin: 0px 20px;
border-bottom: 1px solid #e7e7e7;
.name-state{
float: right;
width: 60px;
height: 18px;
background: #038ef6;
color: #fff;
border-radius: 10px;
text-align: center;
line-height: 18px;
}
.prj-list-item-content-top{
white-space: nowrap;
overflow: hidden;
margin-right: 60px;
.name-wrapper {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.subname-wrapper {
font-size: 10px;
line-height: 16px;
height: 16px;
margin: 4px 0px 0px;
color: rgba(0, 0, 0, 0.54);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.prj-setting-tip{
display: inline-block;
padding-left: 10px;
}

View File

@ -0,0 +1,165 @@
/*卡片的body*/
.prj-req-content{
width: 100%;
height: 100%;
overflow: hidden;
padding: 24px 30px 39px;
.prj-req-content-inner{
width: 100%;
height: 100%;
background-color: #fff;
border: 1px solid #e2e2e2;
}
.wf-input-main {
width: 100%;
}
}
/*卡片的-相关交流头部*/
.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;
}
}
}
//相关交流
.prj-exchange-logs{
/*客户联系卡片*/
.prj-view-contactlog .view-contactlog-card{
border: none;
border-bottom: 1px solid #efeff4;
border-radius: 0;
margin: 5px 0 3px;
}
.prj-view-contactlog .view-contactlog-card .ant-card-body{
padding: 10px 10px 0px;
}
.prj-view-contactlog .view-contactlog-card .card-left{
width: 40px;
height: 40px;
background: #efeff4;
border-radius: 50%;
margin: 0 10px 0 0;
float: left;
overflow: hidden;
}
.prj-view-contactlog .view-contactlog-card .card-right{
margin-left: 50px;
}
.prj-view-contactlog .view-contactlog-card .card-right .card-right-hrm{
color: #b3a6b3;
}
.prj-view-contactlog .view-contactlog-card .card-right .card-right-hrm span a{
color: #95B3D7;
}
.prj-view-contactlog .view-contactlog-card .card-right .feedbackrelate{
padding: 5px;
padding-left: 0px;
color: #595959;
}
.prj-view-contactlog .view-contactlog-card .card-right .feedbackrelate div{
/*height: 24px;*/
line-height: 24px;
}
.prj-view-contactlog .view-contactlog-card .card-right a:hover {
text-decoration: underline !important;
color: #FF0000 !important;
}
.clear{clear: both}
.crm-no-datas-show{
color: #929393;
text-align: center;
margin: 10px;
}
.prj-pagination{
float: right;
margin-right: 20px;
margin-top: 10px;
}
}
/*全局设置button samll 样式*/
.prj-btn-small{
padding: 0px 4px;
border-radius: 0;
margin-right: 10px;
}
.wea-table-edit .prj-dropdown-link .ant-dropdown-link {
visibility: hidden;
}
.wea-table-edit .ant-table-row-level-0:hover .prj-dropdown-link .ant-dropdown-link{
visibility: visible;
}
/*看板*/
#prjkanban{
.kanban-parent{
display: inline-block;
margin: 10px 20px;
border:1px solid #ececec;
width: 300px;
h2{
height: 30px;
line-height: 30px;
text-align: center;
background: #ccc;
cursor: move;
}
.kanban-child{
height: 20px;
line-height: 20px;
background: red;
margin: 10px 0;
}
}
}
/*table自定义样式*/
.wea-prj-table-customsize .ant-table-tbody>tr>td {
padding: 10px 8px;
word-break: break-all;
}
.wea-prj-table-customsize .ant-table-thead>tr>th {
background-color: #f8fcff;
}
.wea-prj-table-customsize .ant-table-thead>tr>th {
padding-top: 14px;
padding-bottom: 14px;
}
.wea-prj-table-customsize .ant-table-thead th {
border-bottom: 1px solid #eaeaea;
font-weight: 400;
}
.wea-prj-table-customsize .ant-table,.wea-prj-table-customsize .ant-table table {
border-radius: 0;
}
/*卡片富文本,工具栏样式处理*/
.view_basicToolBar{
.cke_top{
padding:0px
}
}

View File

@ -0,0 +1,28 @@
.prj-formitem-move{
.prj-cursor-pointer{
cursor: pointer;
margin-right: 10px
}
&:hover .icon-coms-move{
color: #2db7f5;
}
}
.prj-code-table-container {
border-right:1px solid #000;
border-bottom:1px solid #000;
td{
border-left:1px solid #000;
border-top:1px solid #000
}
}
.prj-code-table tr{
height: 30px;
td{
border:none
}
font{
margin:0 5px;
}
}

Some files were not shown because too many files have changed in this diff Show More