diff --git a/pc4backstage/prj/apis/basemanger.js b/pc4backstage/prj/apis/basemanger.js
new file mode 100644
index 0000000..eec6f38
--- /dev/null
+++ b/pc4backstage/prj/apis/basemanger.js
@@ -0,0 +1,61 @@
+import { WeaTools } from 'ecCom';
+
+//项目基础设置-查询条件
+export const getBaseMangerCondition = params => {
+ return WeaTools.callApi('/api/proj/baseManager/getBaseCondition', 'GET', params);
+}
+
+//项目基础设置-列表
+export const getBaseMangerList = params => {
+ return WeaTools.callApi('/api/proj/baseManager/getBaseMangerList', 'GET', params);
+}
+
+//项目基础设置-项目类型form
+export const getPrjTypeFormField = params => {
+ return WeaTools.callApi('/api/proj/baseManager/getPrjTypeFormField', 'GET', params);
+}
+
+//项目基础设置-工作类型form
+export const getWorkTypeFormField = params => {
+ return WeaTools.callApi('/api/proj/baseManager/getWorkTypeFormField', 'GET', params);
+}
+
+//项目基础设置-项目状态form
+export const getPrjStatusFormField = params => {
+ return WeaTools.callApi('/api/proj/baseManager/getPrjStatusFormField', 'GET', params);
+}
+
+//项目基础设置-项目类型共享设置
+export const getPrjTypeShareList = params => {
+ return WeaTools.callApi('/api/proj/baseManager/getPrjTypeShareList', 'GET', params);
+}
+
+//项目基础设置-项目类型操作(增、删、改)
+export const doPrjTypeOpt = params => {
+ return WeaTools.callApi('/api/proj/baseManager/doPrjTypeOpt', 'GET', params);
+}
+
+//项目基础设置-工作类型操作(增、删、改)
+export const doWorkTypeOpt = params => {
+ return WeaTools.callApi('/api/proj/baseManager/doWorkTypeOpt', 'GET', params);
+}
+
+//项目基础设置-项目状态操作(增、删、改)
+export const doPrjStatusOpt = params => {
+ return WeaTools.callApi('/api/proj/baseManager/doPrjStatusOpt', 'GET', params);
+}
+
+//项目基础设置-项目类型权限(增、删、改)
+export const doPrjTypeShareOpt = params => {
+ return WeaTools.callApi('/api/proj/baseManager/doPrjTypeShareOpt', 'POST', params);
+}
+
+//项目基础设置-项目编码
+export const doPrjCodeInit = params => {
+ return WeaTools.callApi('/api/proj/baseManager/doPrjCodeInit', 'GET', params);
+}
+
+//项目基础设置-项目编码
+export const doPrjCodeOpt = params => {
+ return WeaTools.callApi('/api/proj/baseManager/doPrjCodeOpt', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/apis/custom.js b/pc4backstage/prj/apis/custom.js
new file mode 100644
index 0000000..ec2367a
--- /dev/null
+++ b/pc4backstage/prj/apis/custom.js
@@ -0,0 +1,60 @@
+import { WeaTools } from 'ecCom';
+
+//自定义字段-项目类型树
+export const getPrjTypeTree = params => {
+ return WeaTools.callApi('/api/proj/custom/getFieldPrjTypeTreeData', 'GET', params);
+}
+
+//项目卡片显示栏目数据初始化
+export const loadGroupData = params => {
+ return WeaTools.callApi('/api/proj/custom/loadGroupData', 'GET', params);
+}
+
+
+//项目卡片显示栏目数据保存
+export const saveCardTabSet = params => {
+ return WeaTools.callApi('/api/proj/custom/saveCardTabSet', 'POST', params);
+}
+
+
+//项目自定义字段Tab数据加载
+export const getPrjFieldTab = params => {
+ return WeaTools.callApi('/api/proj/custom/getPrjFieldTab', 'GET', params);
+}
+
+//项目自定义字段数据加载
+export const getPrjFieldData = params => {
+ return WeaTools.callApi('/api/proj/custom/getPrjFieldData', 'GET', params);
+}
+
+
+//项目自定义字段显示名设置数据加载
+export const getFieldLanguageData = params => {
+ return WeaTools.callApi('/api/proj/custom/getFieldLanguageData', 'GET', params);
+}
+
+//项目自定义字段分组设置数据加载
+export const getFieldGroupData = params => {
+ return WeaTools.callApi('/api/proj/custom/getFieldGroupData', 'GET', params);
+}
+
+//项目自定义字段分组设置数据加载
+export const saveFieldGroupData = params => {
+ return WeaTools.callApi('/api/proj/custom/saveFieldGroupData', 'POST', params);
+}
+
+//项目自定义字段显示名设置数据保存
+export const saveFieldLanguageCmd = params => {
+ return WeaTools.callApi('/api/proj/custom/saveFieldLanguageCmd', 'POST', params);
+}
+
+//公共选择框options
+export const getSelectCommonOptions = params => {
+ return WeaTools.callApi('/api/proj/custom/getSelectCommonOptions', 'POST', params);
+}
+
+// 获取加密字段设置
+export const getFieldSet = params => WeaTools.callApi('/api/prj/encrypt/fieldset/getFieldSet', 'POST', params);
+
+// 保存加密字段设置
+export const saveFieldSet = params => WeaTools.callApi('/api/prj/encrypt/fieldset/saveFieldSet', 'POST', params);
\ No newline at end of file
diff --git a/pc4backstage/prj/apis/prjappset.js b/pc4backstage/prj/apis/prjappset.js
new file mode 100644
index 0000000..7868eb0
--- /dev/null
+++ b/pc4backstage/prj/apis/prjappset.js
@@ -0,0 +1,11 @@
+import { WeaTools } from 'ecCom';
+
+//应用设置-基础信息
+export const getPrjAppSetInfo = params => {
+ return WeaTools.callApi('/api/proj/appset/getPrjAppSetInfo', 'GET', params);
+}
+
+//应用设置-编辑保存
+export const doPrjAppSet = params => {
+ return WeaTools.callApi('/api/proj/appset/doPrjAppSet', 'GET', params);
+}
diff --git a/pc4backstage/prj/apis/prjremind.js b/pc4backstage/prj/apis/prjremind.js
new file mode 100644
index 0000000..b661dbd
--- /dev/null
+++ b/pc4backstage/prj/apis/prjremind.js
@@ -0,0 +1,26 @@
+import {WeaTools} from 'ecCom'
+
+// 项目类型-树形
+export const getPrjTypeTreePageList = params => {
+ return WeaTools.callApi('/api/proj/pcproject/getPrjTypeTree', 'GET', params);
+}
+
+// 根据项目类型获取提醒列表
+export const getRemindListByPrjType = params => {
+ return WeaTools.callApi('/api/proj/remind/getRemindListByPrjType', 'GET', params);
+}
+
+// 根据remindId获取提醒信息
+export const getRemindInfoByRemindId = params => {
+ return WeaTools.callApi('/api/proj/remind/getRemindInfoByRemindId', 'GET', params);
+}
+
+// 增加or更新提醒信息
+export const saveOrUpdateRemindInfo = params => {
+ return WeaTools.callApi('/api/proj/remind/saveOrUpdateRemindInfo', 'POST', params);
+}
+
+// 获取条件字段
+export const getConditionField = params => {
+ return WeaTools.callApi('/api/proj/remind/getConditionField', 'POST', params);
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/apis/prjwfset.js b/pc4backstage/prj/apis/prjwfset.js
new file mode 100644
index 0000000..00eb156
--- /dev/null
+++ b/pc4backstage/prj/apis/prjwfset.js
@@ -0,0 +1,45 @@
+import { WeaTools } from 'ecCom';
+//流程设置-查询条件
+export const getPrjWfSetCondition = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWfSetCondition', 'GET', params);
+}
+
+//流程设置-列表
+export const getPrjWfSetList = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWfSetList', 'GET', params);
+}
+
+//流程设置-基础信息表单
+export const getPrjWfSetForm = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWfSetForm', 'GET', params);
+}
+
+//流程设置-根据流程获取表单信息
+export const getPrjWorkflowInfo = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWorkflowInfo', 'GET', params);
+}
+
+//流程设置-根据项目类型初始化表单
+export const getInitformByPrjtype = params => {
+ return WeaTools.callApi('/api/proj/wfset/getInitformByPrjtype', 'GET', params);
+}
+
+//流程设置-字段设置
+export const getPrjWfSetField = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWfSetField', 'GET', params);
+}
+
+//流程设置-字段设置
+export const getPrjWfActionSet = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWfActionSet', 'GET', params);
+}
+
+//流程设置-保存
+export const doPrjWfOperation = params => {
+ return WeaTools.callApi('/api/proj/wfset/doPrjWfOperation', 'GET', params);
+}
+
+//流程设置-Tab
+export const getWfSetTab = params => {
+ return WeaTools.callApi('/api/proj/wfset/getPrjWfSetTab', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/apis/projectlog.js b/pc4backstage/prj/apis/projectlog.js
new file mode 100644
index 0000000..e8a6907
--- /dev/null
+++ b/pc4backstage/prj/apis/projectlog.js
@@ -0,0 +1,11 @@
+import { WeaTools } from 'ecCom';
+
+//项目日志-查询条件
+export const getPrjLogCondition = params => {
+ return WeaTools.callApi('/api/proj/log/getPrjLogCondition', 'GET', params);
+}
+
+//项目日志-列表
+export const getPrjLogList = params => {
+ return WeaTools.callApi('/api/proj/log/getPrjLogList', 'GET', params);
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/apis/templet.js b/pc4backstage/prj/apis/templet.js
new file mode 100644
index 0000000..e7427b5
--- /dev/null
+++ b/pc4backstage/prj/apis/templet.js
@@ -0,0 +1,88 @@
+import { WeaTools } from 'ecCom';
+
+//模板维护-项目类型树
+export const getTempletPrjTypeTree = params => {
+ return WeaTools.callApi('/api/proj/templet/getTempletPrjTypeTree', 'GET', params);
+}
+
+//模板维护-模板列表
+export const getTempletByPrjTypeList = params => {
+ return WeaTools.callApi('/api/proj/templet/getTempletByPrjTypeList', 'GET', params);
+}
+
+//模板表单
+export const getPrjTempletForm = params => {
+ return WeaTools.callApi('/api/proj/templet/getPrjTempletForm', 'GET', params);
+}
+
+//模板新建
+export const doPrjTempletOpertaion = params => {
+ return WeaTools.callApi('/api/proj/templet/doPrjTempletOpertaion', 'POST', params);
+}
+
+//模板任务列表
+export const getPrjTempletTaskList = params => {
+ return WeaTools.callApi('/api/proj/templet/getPrjTempletTaskList', 'GET', params);
+}
+
+//模板阶段设置
+export const getPrjTempletStageList = params => {
+ return WeaTools.callApi('/api/proj/templet/getPrjTempletStageList', 'GET', params);
+}
+
+//模板阶段设置
+export const savePrjTempletStage = params => {
+ return WeaTools.callApi('/api/proj/templet/savePrjTempletStage', 'POST', params);
+}
+
+//模板任务表单
+export const getTaskTempletForm = params => {
+ return WeaTools.callApi('/api/proj/templet/getTaskTempletForm', 'GET', params);
+}
+
+//模板任务表单
+export const getTaskTempletReference = params => {
+ return WeaTools.callApi('/api/proj/templet/getTaskTempletRefList', 'GET', params);
+}
+
+//模板任务--相关流程、文档必须操作
+export const doDspTaskTempletReqOpt = params => {
+ return WeaTools.callApi('/api/proj/templet/doDspTaskTempletReqOpt', 'GET', params);
+}
+
+//模板任务--相关文档操作
+export const doDspTaskTempletRefOpt = params => {
+ return WeaTools.callApi('/api/proj/templet/doDspTaskTempletRefOpt', 'GET', params);
+}
+
+//模板任务--任务操作
+export const doPrjTaskTempletOpt = params => {
+ return WeaTools.callApi('/api/proj/templet/doPrjTaskTempletOpt', 'POST', params);
+}
+
+//模板任务--导入初始化
+export const getTaskTempletImp = params => {
+ return WeaTools.callApi('/api/proj/templet/getTaskTempletImp', 'GET', params);
+}
+
+//模板任务--导入
+export const doPrjimpopt = params => {
+ return WeaTools.callApi('/api/proj/prjutil/doprjimpopt', 'POST', params);
+}
+
+//模板审批
+export const getTempletApproveForm = params => {
+ return WeaTools.callApi('/api/proj/templet/getTempletApproveForm', 'GET', params);
+}
+
+//模板审批-审批保存
+export const doTempletApproveSave = params => {
+ return WeaTools.callApi('/api/proj/templet/doTempletApproveSave', 'GET', params);
+}
+
+//模板审批-提交流程
+export const doApprovetemplate = params => {
+ return WeaTools.callApi('/api/proj/templet/doApprovetemplate', 'GET', params);
+}
+
+
diff --git a/pc4backstage/prj/components/Demo.js b/pc4backstage/prj/components/Demo.js
new file mode 100644
index 0000000..fa03591
--- /dev/null
+++ b/pc4backstage/prj/components/Demo.js
@@ -0,0 +1,67 @@
+import React from 'react';
+import { Button, Tabs , Tree, Menu, TopTitle} from 'antd';
+import { inject, observer } from 'mobx-react';
+import {WeaTop ,WeaLeftRightLayout} from "ecCom"
+
+
+class Demo extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ time: 0
+ }
+ }
+ componentDidMount() {
+ jQuery(window).resize(() => {
+ if (this.timer) {
+ clearTimeout(this.timer);
+ }
+ this.timer = setTimeout(() => {
+ this.forceUpdate();
+ }, 200);
+ });
+ }
+ handleClick = () => {
+
+ }
+ render() {
+ return (
+
+
+ fffff
}
+ leftWidth={25}>
+ {/* { contentDiv } */}
+
+
+
+ )
+ }
+}
+
+export default Demo;
+
+
+{/*
+
+
+
+
+ { this.setState({ time: this.state.time + 2 }) }} />
+
+
+
+
+
+
+
+ */}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/Home.js b/pc4backstage/prj/components/Home.js
new file mode 100644
index 0000000..0f3bbb8
--- /dev/null
+++ b/pc4backstage/prj/components/Home.js
@@ -0,0 +1,16 @@
+import { WeaPopoverHrm ,WeaLocaleProvider} from 'ecCom';
+
+class Home extends React.Component {
+ render() {
+ return (
+
+
+
+ {this.props.children}
+
+
+ )
+ }
+}
+
+export default Home
diff --git a/pc4backstage/prj/components/appSet/index.js b/pc4backstage/prj/components/appSet/index.js
new file mode 100644
index 0000000..bb4fc4d
--- /dev/null
+++ b/pc4backstage/prj/components/appSet/index.js
@@ -0,0 +1,241 @@
+import {WeaTop,WeaTools,WeaErrorPage,WeaRightMenu,WeaSearchGroup,WeaFormItem,WeaAlertPage,WeaHelpfulTip,WeaLocaleProvider,WeaCheckbox } from "ecCom"
+import { Button ,InputNumber,Radio} from "antd";
+import {WeaSwitch} from "comsMobx";
+import {inject, observer } from 'mobx-react';
+import {toJS} from "mobx"
+const RadioGroup = Radio.Group;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject('prjAppSetStore')
+@observer
+class AppSet extends React.Component{
+ constructor(props){
+ super(props)
+ }
+ componentDidMount(){
+ const {prjAppSetStore} = this.props;
+ prjAppSetStore.initData();
+ }
+ componentWillReceiveProps(nextProps) {
+ const {prjAppSetStore} = this.props;
+ if(this.props.location.key !== nextProps.location.key) {
+ prjAppSetStore.clearStatus();
+ prjAppSetStore.initData();
+ }
+ }
+ componentWillUnmount(){
+ const {prjAppSetStore} = this.props;
+ prjAppSetStore.clearStatus();
+ }
+
+ render(){
+ const {prjAppSetStore} = this.props;
+ const {fieldinfo,isright} = prjAppSetStore;
+ if (!isright) {
+ return(
+
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+ )
+ }
+ return (
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ >
+ {this.getBasicInfo()}
+
+
+ )
+ }
+
+ getBasicInfo() {
+ const {prjAppSetStore, } = this.props;
+ const {fieldinfo,form,setFormFields,setValidate,setMenuValue,vmenu} = prjAppSetStore;
+ const {isFormInit} = form;
+ let group = [];
+ const formParams = form.getFormParams();
+ isFormInit && toJS(fieldinfo).map((c,i) =>{
+ let hide = false;
+ let items = [];
+ c.items.map(field => {
+ let dom = ;
+ if(field.domkey[0] == "prj_gnt_warningday"){
+ dom = {setFormFields({[field.domkey[0]]:{value:v}})}}/>
+ }else if(field.domkey[0] == "tsk_approval_type"){
+ if(formParams["tsk_approval"]!="1"){
+ hide = true;
+ }
+ dom = [
+ setFormFields({[field.domkey[0]]:{value:e.target.value}})}>
+ {getLabel(84826,"项目经理审批")}
+ {getLabel(84827,"上级任务负责人审批")}
+ ,
+ ]
+ }else if(field.domkey[0] == "tsk_modify_type"){
+ if(formParams["tsk_approval"]!="1"){
+ hide = true;
+ }
+ }else if(field.conditionType == "BROWSER"){
+ if((field.domkey[0]=="prj_dsc_accsec"&&formParams["prj_dsc_acc"]!="1")
+ ||(field.domkey[0]=="tsk_dsc_accsec"&&formParams["tsk_dsc_acc"]!="1")
+ ||(field.domkey[0]=="prj_accsec"&&formParams["prj_acc"]!="1")
+ ||(field.domkey[0]=="tsk_accsec"&&formParams["tsk_acc"]!="1")){
+ hide = true;
+ }
+ }else if(field.domkey[0] == "prj_acc_isright"){
+ dom = [
+ ,
+
+ ]
+ if(field.domkey[0]=="prj_acc_isright"&&formParams["prj_acc"]!="1"){
+ hide = true;
+ }
+ }else if(field.domkey[0] == "tsk_acc_isright"){
+ dom = [
+ ,
+
+ ]
+ if(field.domkey[0]=="tsk_acc_isright"&&formParams["tsk_acc"]!="1"){
+ hide = true;
+ }
+ }else if(field.domkey[0] == "tsk_timefield"){
+ dom = [
+ ,
+
+ ]
+ }else if(field.domkey[0] == "workflow_filter"){
+ dom = [
+ ,
+
+ ]
+ }
+ items.push({
+ com: (
+ {dom}
+ ),
+ col: 1,
+ hide:hide
+ });
+
+ //项目任务菜单控制
+ if(field.domkey[0] == "prj_feedback"){
+ let pmenus = prjAppSetStore.pmenu||[];
+ let pdom = [];
+ pmenus && toJS(pmenus).map(m =>{
+ pdom.push({setMenuValue({[m.id]:v})}} />)
+ });
+ items.push({
+ com: (
+ {pdom}
+ ),
+ col: 1,
+ hide:hide
+ });
+
+ let tmenus = prjAppSetStore.tmenu||[];
+ let tdom = [];
+ tmenus && toJS(tmenus).map(m =>{
+ tdom.push({setMenuValue({[m.id]:v})}}/>)
+ });
+ items.push({
+ com: (
+ {tdom}
+ ),
+ col: 1,
+ hide:hide
+ });
+
+ let ptmenus = prjAppSetStore.ptmenu||[];
+ let ptdom = [];
+ ptmenus && toJS(ptmenus).map(m =>{
+ ptdom.push({setMenuValue({[m.id]:v})}}/>)
+ });
+ items.push({
+ com: (
+ {ptdom}
+ ),
+ col: 1,
+ hide:hide
+ });
+ }
+ });
+ group.push()
+ });
+ return group;
+ }
+
+ getButtons(){
+ const {prjAppSetStore} = this.props;
+ const {rightMenu} = prjAppSetStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ m.isTop == '1' && btnArr.length < 4 && btnArr.push(
+
+ );
+ });
+ return btnArr;
+ }
+
+ getRightMenu(){
+ const {prjAppSetStore }= this.props;
+ const {rightMenu,tableStore} = prjAppSetStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ btnArr.push({
+ icon: ,
+ content: m.menuName,
+ })
+ });
+ return btnArr
+ }
+ onRightMenuClick(key){
+ const {prjAppSetStore} = this.props;
+ const {rightMenu} = prjAppSetStore;
+ let that = this;
+ rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
+ if(Number(key) == i){
+ let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
+ if(m.type == "BTN_SAVE"){
+ prjAppSetStore.doPrjAppSet({method:'edit'});
+ }
+ }
+ });
+ }
+
+}
+
+export default WeaTools.tryCatch(React,
+ props => ,
+ {error: ""}
+)(AppSet);
\ No newline at end of file
diff --git a/pc4backstage/prj/components/baseManager/BaseManagerList.js b/pc4backstage/prj/components/baseManager/BaseManagerList.js
new file mode 100644
index 0000000..a6afd06
--- /dev/null
+++ b/pc4backstage/prj/components/baseManager/BaseManagerList.js
@@ -0,0 +1,216 @@
+import React from 'react';
+import { inject, observer } from 'mobx-react';
+import { Button, Tabs,Card,Pagination,Row,Col,Modal } from 'antd';
+const confirm = Modal.confirm;
+import {toJS} from "mobx";
+import {WeaTableNew} from 'comsMobx';
+import {WeaRightMenu,WeaTop,WeaTab,WeaErrorPage,WeaTools,WeaLocaleProvider} from 'ecCom';
+const WeaTable = WeaTableNew.WeaTable;
+const getLabel = WeaLocaleProvider.getLabel;
+import {Condition,getAdButtons} from '../list/listCondition';
+import PrjTypeDialog from '../dialog/prjtypeDialog'
+import WorkTypeDialog from '../dialog/worktypeDialog'
+
+@inject('baseManagerStore')
+@observer
+class BaseManagerList extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+ componentDidMount(){
+ const {baseManagerStore,params } = this.props;
+ const {initData} = baseManagerStore;
+ initData(params);
+ }
+ componentWillReceiveProps(nextProps){
+ const keyOld = this.props.location.key;
+ const keyNew = nextProps.location.key;
+ const oldParams = this.props.params.bmtype;
+ const newParams = nextProps.params.bmtype;
+ if(keyOld !== keyNew || oldParams !== newParams) {
+ const {baseManagerStore,params } = nextProps;
+ const {initData} = baseManagerStore;
+ baseManagerStore.clearStatus();
+ baseManagerStore.resetTable();
+ baseManagerStore.setShowSearchAd(false);
+ initData(params);
+ }
+ }
+ componentWillUnmount(){
+ const {baseManagerStore,params } = this.props;
+ baseManagerStore.clearStatus();
+ baseManagerStore.resetTable();
+ }
+ render(){
+ const {baseManagerStore} = this.props;
+ const {title,loading,form,showSearchAd,tableStore,reLoad,prjtypeStore,worktypeStore} = baseManagerStore;
+ const formParams = form.getFormParams() || {};
+ return (
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getTopButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ onDropMenuClick={this.onRightMenuClick.bind(this)}
+ >
+ {baseManagerStore.setShowSearchAd(bool)}}
+ hideSearchAd={()=> baseManagerStore.setShowSearchAd(false)}
+ searchsAd={
+
+ }
+ showSearchAd={showSearchAd}
+ onSearch={v=>{baseManagerStore.doSearch()}}
+ onSearchChange={v=>{baseManagerStore.setFormFields({name:{value:v}})}}
+ advanceHeight={100}
+ />
+ this.reRenderColumns(c)}
+ register_table={()=>reLoad()}
+ onOperatesClick={this.onOperatesClick.bind(this)}
+ />
+
+
+
+
+ )
+ }
+ getTopButtons(){
+ const {baseManagerStore,} = this.props;
+ const {rightMenu,tableStore,prjtypeStore,worktypeStore,basetype} = baseManagerStore;
+ let {selectedRowKeys} = tableStore;
+ let btnArr = [];
+ let that = this;
+ const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
+ rightMenu && rightMenu.length>0 && toJS(rightMenu).map(m=>{
+ m.isTop == '1' && btnArr.length < 4 && btnArr.push(
+
+ );
+ });
+ return btnArr;
+ }
+
+ reRenderColumns(columns){
+ const {baseManagerStore }= this.props;
+ const {prjtypeStore} = baseManagerStore;
+
+ columns.forEach(c=>{
+ if(c.dataIndex=='fullname_edit'){
+ c.render = (text, record)=>{
+ let valueSpan = record[c.dataIndex];
+ return {
+ prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:record['randomFieldId']})
+ }} >
+ }
+ } else {
+ c.render = function(text, record){
+ let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
+ return
+ }
+ }
+ })
+ return columns;
+ }
+
+ getRightMenu(){
+ const {baseManagerStore }= this.props;
+ const {rightMenu,tableStore} = baseManagerStore;
+ let {selectedRowKeys} = tableStore;
+ let btnArr = [];
+ const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ btnArr.push({
+ icon: ,
+ content: m.menuName,
+ disabled:isDisabled && m.isControl == "1"
+ })
+ });
+ return btnArr
+ }
+
+ onRightMenuClick(key){
+ const {baseManagerStore,}= this.props;
+ const {rightMenu,tableStore,prjtypeStore,worktypeStore,basetype} = baseManagerStore;
+ let {selectedRowKeys} = tableStore;
+ let that = this;
+ rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
+ if(Number(key) == i){
+ let fn = m.menuFun.indexOf('this') >= 0 ? `${m.menuFun.split('this')[0]})` : m.menuFun;
+ if(m.type == "BTN_COLUMN"){ //定制列
+ baseManagerStore.onShowColumn();
+ }else if(m.type == "BTN_CREATE"){
+ if(basetype=='prjtype'){
+ prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:""})
+ }else{
+ worktypeStore.handleShareDialog(true,{id:"",formtype:basetype});
+ }
+ }else if(m.type == "BTN_DELETEBATCH"){
+ baseManagerStore.delPrjTypeBatch(`${toJS(selectedRowKeys)}`);
+ }else if(m.type == "BTN_SEARCH"){
+ baseManagerStore.doSearch();
+ }
+ }
+ });
+ }
+
+ onOperatesClick(record,index,operate,flag){
+ const {baseManagerStore,baseManagerStore:{prjtypeStore,worktypeStore,basetype}} = this.props;
+ let _href = operate && operate.href ? operate.href : "";
+ let fn = _href.replace("javascript:","");
+ fn = fn.substring(0,fn.indexOf('('));
+ let that = this;
+ if(fn != ""){
+ if("onEdit"==fn){ //编辑项目类型
+ if(basetype=='prjtype'){
+ prjtypeStore.handleShareDialog(true,"prjtypeinfo",{prjtypeid:record.randomFieldId});
+ }else{
+ worktypeStore.handleShareDialog(true,{id:record.randomFieldId,formtype:basetype});
+ }
+ }else if('onDel' == fn){ //项目类型删除
+ baseManagerStore.delPrjType(record.randomFieldId);
+ }else if('onCreate' == fn){ //项目类型创建权限
+ prjtypeStore.handleShareDialog(true,"addshare",{prjtypeid:record.randomFieldId})
+ }else if('onShare' == fn){ //项目类型共享权限
+ prjtypeStore.handleShareDialog(true,"share",{prjtypeid:record.randomFieldId})
+ }
+ }
+ }
+
+ onEnterSearch=() =>{
+ const {baseManagerStore} = this.props;
+ baseManagerStore.doSearch();
+ baseManagerStore.setShowSearchAd(false);
+
+ }
+
+}
+
+export default WeaTools.tryCatch(React,
+ props => ,
+ {error: ""}
+)(BaseManagerList);
\ No newline at end of file
diff --git a/pc4backstage/prj/components/baseManager/prjCode.js b/pc4backstage/prj/components/baseManager/prjCode.js
new file mode 100644
index 0000000..003a7db
--- /dev/null
+++ b/pc4backstage/prj/components/baseManager/prjCode.js
@@ -0,0 +1,322 @@
+import {WeaTop,WeaTools,WeaErrorPage,WeaRightMenu,WeaSearchGroup,WeaFormItem,WeaSelect,WeaInput,WeaAlertPage,WeaLocaleProvider,WeaCheckbox} from "ecCom"
+import { Button ,Switch,InputNumber,Spin,Radio} from "antd";
+import {inject, observer } from 'mobx-react';
+import {toJS} from "mobx"
+import WeaPrjDragula from '../comp/weaDragula'
+import '../../style/coding.less'
+const RadioGroup = Radio.Group;
+const getLabel = WeaLocaleProvider.getLabel;
+
+export const TempForm = observer(({ prjCodeStore }) => {
+ const { form,prjDatas,changeCodeType } = prjCodeStore;
+ return prjCodeStore.condition.map((fields,index) => {
+ const getDom = () => {
+ if(fields.conditionType == "SWITCH"){
+
+ if(fields.showName=='445'){
+ return
+ {/* form.$(fields.domkey[0]).value = checked ? '1' : '0'}
+ /> */}
+ form.$(fields.domkey[0]).value = checked}
+ />
+ changeCodeType({yearViewNum:value})}
+ />
+ }else{
+ // return form.$(fields.domkey[0]).value = checked ? '1' : '0'}
+ // />
+ return form.$(fields.domkey[0]).value = checked}
+ />
+ }
+ }else if(fields.conditionType == "INPUTNUMBER"){
+ return form.$(fields.domkey[0]).value = v }/>
+ }else{
+ return form.$(fields.domkey[0]).value = v }/>
+ }
+ }
+ return (
+ {`${fields.label}`}}
+ labelCol={{ span: `${fields.labelcol}` }}
+ wrapperCol={{ span: `${fields.fieldcol}` }}>
+ {getDom()}
+
)
+ })
+})
+
+@inject('prjCodeStore')
+@observer
+class PrjCode extends React.Component{
+ constructor(props){
+ super(props)
+ }
+ componentDidMount(){
+ const {prjCodeStore} = this.props;
+ prjCodeStore.initData();
+ }
+ componentWillReceiveProps(nextProps) {
+ const { prjCodeStore } = this.props;
+ if(this.props.location.key !== nextProps.location.key) {
+ prjCodeStore.clearStatus();
+ prjCodeStore.initData();
+ }
+ }
+ componentWillUnmount(){
+ const {prjCodeStore} = this.props;
+ prjCodeStore.clearStatus();
+ }
+ render(){
+ const {prjCodeStore} = this.props;
+ const {prjDatas,formloading,condition,isright} = prjCodeStore;
+
+ if (!isright) {
+ return(
+
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+ )
+ }
+
+ const {codeType,prjtypeflow,worktypeflow,modifyStartCode,startCode,buydate,buydateselect} = prjDatas;
+ const style = {
+ height:"50px",lineHeight:"50px"
+ }
+
+ return (
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ >
+
+
+ this.onChange({codeType:value})}
+ />
+
+
+
+
+ jQuery(clickDom).hasClass("icon-coms-move")}
+ datas={toJS(condition)}
+ getKeyFromData={this.getRowKey}
+ getKeyFromDom={this.getKeyFromDom}
+ onDrop={this.onDrop}
+ >
+
+
+ f.domkey.join('')).join('_')}/>
+
+
+
+
+
+
+ {/* this.onChange({prjtypeflow: checked ? '1' : '0'})}
+ /> */}
+ this.onChange({prjtypeflow: checked })}
+ />
+
+
+ {/* this.onChange({worktypeflow: checked ? '1' : '0'})}
+ /> */}
+ this.onChange({worktypeflow: checked })}
+ />
+
+
+ {/* this.onChange({buydate: checked ? '1' : '0'})}
+ /> */}
+ this.onChange({buydate: checked })}
+ />
+
+ this.onChange({buydateselect: e.target.value})}>
+ {getLabel(445,"年")}
+ {getLabel(6076,"月")}
+ {getLabel(390,"日")}
+
+
+
+
+ {/* this.onChange({modifyStartCode: checked ? '1' : '0'})}
+ /> */}
+ this.onChange({modifyStartCode: checked })}
+ />
+
+ {
+ modifyStartCode == "1" &&
+
+ this.onChange({startCode:value})} />
+
+ }
+
+
+
+
+ {this.showCodeView()}
+
+
+
+
+
+
+ )
+ }
+ getRightMenu(){
+ let btns = [];
+ const {doSubmit} = this.props.prjCodeStore;
+ btns.push({
+ icon: ,
+ content: getLabel(86,"保存"),
+ key:"1",
+ onClick:(key)=>{doSubmit()}
+ });
+ return btns
+ }
+ getButtons(){
+ const {doSubmit} = this.props.prjCodeStore;
+ let btnArr = [];
+ btnArr.push();
+ return btnArr
+ }
+
+ getKeyFromDom = (dom) => {
+ return jQuery(".icon-coms-move",dom).attr("data-index");
+ }
+
+ getRowKey = (record, index) => {
+ return typeof record['id'] !== 'undefined' ? record['id'] : index;
+ }
+
+ onDrop = (datas) => {
+ datas.length>0 && toJS(datas).map((fields,index) =>{
+ datas[index].order = index;
+ });
+ const {prjCodeStore} = this.props;
+ prjCodeStore.savecondition(datas);
+ }
+
+ onChange=(value)=>{
+ const {prjCodeStore} = this.props;
+ prjCodeStore.changeCodeType(value)
+ }
+
+ showCodeView(){
+ const {prjCodeStore } = this.props;
+ const {condition,form,prjDatas} = prjCodeStore;
+ var colors= new Array ("#6633CC","#FF33CC","#666633","#CC00FF","#996666") ;
+ let group = [];
+ condition.length>0 && toJS(condition).map((item,index)=>{
+ let dom ;
+ if(item.conditionType.toUpperCase() == "SWITCH"){
+ if(form.$(item.domkey[0]).values() == "0"){
+ return ""
+ }else{
+ let numstr = "****";
+ if(item.showName=='6076'||item.showName=='16889'||(item.showName=='445'&&prjDatas.yearViewNum==0)){
+ numstr = "**";
+ }
+ dom =
+ | {item.label} |
+ |
+ | {numstr} |
+
+ }
+ }else if(item.conditionType.toUpperCase() == "INPUTNUMBER"){
+ dom =
+ | {item.label} |
+ |
+ | {this.createFlowNum(form.$(item.domkey[0]).values())} |
+
+ }else{
+ dom =
+ | {item.label} |
+ |
+ | {form.$(item.domkey[0]).values()} |
+
+ }
+ group.push( | )
+ })
+ return group
+ }
+
+ createFlowNum=(num)=>{
+ let str = "";
+ if(Number(num) <= 0){
+ str ="***"
+ }else if(Number(num) == 1){
+ str = 1
+ }else{
+ for(let i=0;i ,
+ {error: ""}
+)(PrjCode);
\ No newline at end of file
diff --git a/pc4backstage/prj/components/common/projectInfo.js b/pc4backstage/prj/components/common/projectInfo.js
new file mode 100644
index 0000000..dcec9a9
--- /dev/null
+++ b/pc4backstage/prj/components/common/projectInfo.js
@@ -0,0 +1,39 @@
+
+import { observer} from "mobx-react";
+import {WeaAlertPage,WeaLocaleProvider} from "ecCom"
+import ProjectCondition from '../list/projectCondition'
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+export default class ProjectInfo extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ componentDidMount(){
+ }
+
+ componentWillReceiveProps(nextProps) {
+ }
+
+ render() {
+ const {hasRight,fieldInfo,form,setFormFields,setValidate } = this.props.formStore;
+ if (!hasRight) {
+ return (
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+ )
+ }
+ if (hasRight) {
+ return (
+
+
{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
+ )
+ }
+ return
+ }
+
+}
+
diff --git a/pc4backstage/prj/components/common/relateDocument.js b/pc4backstage/prj/components/common/relateDocument.js
new file mode 100644
index 0000000..6070d53
--- /dev/null
+++ b/pc4backstage/prj/components/common/relateDocument.js
@@ -0,0 +1,225 @@
+
+import {Button,Row,Col, Icon,message,Modal} from 'antd';
+import {WeaTools,WeaBrowser,WeaAlertPage,WeaLocaleProvider} from 'ecCom';
+import {inject, observer} from "mobx-react";
+import {toJS} from 'mobx';
+import PrjShowGroup from '../comp/prj-show-group'
+import PrjTableEdit from '../comp/prj-table-edit'
+import {WeaTableNew} from 'comsMobx';
+const WeaTable = WeaTableNew.WeaTable;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+export default class RelateExchange extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state ={
+
+ }
+
+ }
+ componentDidMount(){
+
+ }
+ componentWillReceiveProps(nextProps) {
+
+ }
+ render() {
+ const {contentStore} = this.props;
+ const {taskDocStore,relateList,relateList:{canRef}} = contentStore;
+ const columns = [
+ {
+ title: getLabel(16398,"文档目录"), //列名
+ dataIndex: 'docCategoryName', //列的id 对应数据
+ key: 'docCategoryName', //前端渲染key值
+ com: [
+ { label: '', type: 'LINK_DOC' , key: 'docCategoryName', viewAttr:1, width: 120, otherParams: {className: 'test-className'}},
+ ],
+ colSpan: 1,
+ width: '50%',
+ className: 'wea-table-edit-name',
+ },
+ {
+ title: getLabel(17906,"必要"), //列名
+ dataIndex: 'isNecessary', //列的id 对应数据
+ key: 'isNecessary', //前端渲染key值
+ com: [
+ { label: '', type: 'CHECKBOX' ,editType: '1', key: 'isNecessary', width: 80, }
+ ],
+ colSpan: 1,
+ width: '40%',
+ className: 'wea-table-edit-ismust',
+ },
+ {
+ title: '', //列名
+ dataIndex: 'operate', //列的id 对应数据
+ key: 'sex', //前端渲染key值
+ com: [
+ { label: '', type: 'OPERATE' ,editType: '1', key: 'operate', options: [{ key: '1', showname: getLabel(91,"删除")}] }
+ ],
+ colSpan: 1,
+ width: '10%',
+ className: 'prj-dropdown-link',
+ },
+ ];
+ return (
+ )
+ }
+ getButtons(){
+ const {contentStore} = this.props;
+ const {relateList:{canRef}} = contentStore;
+ let btn = [];
+ if(canRef){
+ btn.push(
+ this.addDocType(ids, names, datas)} customized={true} >
+
+
+ );
+ }
+ return btn;
+ }
+ getRelateButtons(){
+ const {contentStore} = this.props;
+ const {taskDocStore,relateList:{canRelated}} = contentStore;
+ const {selectedRowKeys} = taskDocStore;
+ let btn = [];
+ if(canRelated){
+ btn.push(this.addDocument(ids, names, datas)} customized={true} >
+
+ );
+ btn.push( );
+ }
+ return btn;
+ }
+ //编辑
+ onChange=(data)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskRequiredOpt,taskid,} = contentStore;
+ doDspTaskRequiredOpt({
+ method:'modifyRequiredDocN',
+ taskid : taskid,
+ secID : data.reqDocSecCategory,
+ isNecessary:data.isNecessary
+ },'doc');
+ }
+ //新增所需文档
+ addDocType=(ids, names, datas)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskRequiredOpt,taskid,} = contentStore;
+ doDspTaskRequiredOpt({
+ method:'addRequiredDoc',
+ taskid : taskid,
+ secID : ids
+ },'doc');
+ }
+ //删除
+ handleOperate=(record)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskRequiredOpt,taskid,} = contentStore;
+ Modal.confirm({
+ title: getLabel(15172,"系统提示"),
+ content: getLabel(83600,"您确认要删除吗?"),
+ onOk() {
+ doDspTaskRequiredOpt({
+ method:'delRequiredDoc',
+ taskid : taskid,
+ secID : record.reqDocSecCategory
+ },'doc');
+ },
+ onCancel() { },
+ })
+
+ }
+ //新建
+ addDocument=(ids, names, datas)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskReferenceOpt,taskid,prjid} = contentStore;
+ doDspTaskReferenceOpt({
+ dotype:'doc',
+ method:'add',
+ prjid : prjid,
+ taskid:taskid,
+ docid:ids,
+ ids:""
+ },'doc')
+ }
+ deleteDocument=()=>{
+ const {contentStore} = this.props;
+ const {doDspTaskReferenceOpt,taskid,taskDocStore,prjid} = contentStore;
+ const {selectedRowKeys} = taskDocStore;
+ Modal.confirm({
+ title: getLabel(15172,"系统提示"),
+ content: getLabel(83601,"您确认要删除选中的记录吗?"),
+ onOk() {
+ doDspTaskReferenceOpt({
+ dotype:'doc',
+ method:'del',
+ prjid : prjid,
+ taskid:taskid,
+ docid:"",
+ ids:`${toJS(selectedRowKeys)}`
+ },'doc')
+ },
+ onCancel() { },
+ })
+ }
+ onOperatesClick(record,index,operate,flag){
+ let _href = operate && operate.href ? operate.href : "";
+ let fn = _href.replace("javascript:","");
+ fn = fn.substring(0,fn.indexOf('('));
+ const {contentStore} = this.props;
+ const {doDspTaskReferenceOpt,taskid,taskDocStore,prjid} = contentStore;
+ if(fn != ""){
+ if("onDelRelated"==fn){ //delete
+ Modal.confirm({
+ title: getLabel(15172,"系统提示"),
+ content: getLabel(83600,"您确认要删除吗?"),
+ onOk() {
+ doDspTaskReferenceOpt({
+ dotype:'doc',
+ method:'del',
+ prjid : prjid,
+ taskid:taskid,
+ docid:"",
+ ids:record.randomFieldId
+ },'doc')
+ },
+ onCancel() { },
+ })
+ }
+ }
+ }
+
+}
+
diff --git a/pc4backstage/prj/components/common/relateWorkFlow.js b/pc4backstage/prj/components/common/relateWorkFlow.js
new file mode 100644
index 0000000..7484d6a
--- /dev/null
+++ b/pc4backstage/prj/components/common/relateWorkFlow.js
@@ -0,0 +1,140 @@
+
+import {Button,Row,Col, Icon,message,Modal} from 'antd';
+import {WeaTools,WeaBrowser,WeaAlertPage,WeaLocaleProvider} from 'ecCom';
+import {inject, observer} from "mobx-react";
+import {toJS} from 'mobx';
+import PrjShowGroup from '../comp/prj-show-group'
+import PrjTableEdit from '../comp/prj-table-edit'
+import {WeaTableNew} from 'comsMobx';
+const WeaTable = WeaTableNew.WeaTable;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+export default class RelateExchange extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state ={
+
+ }
+
+ }
+ componentDidMount(){
+
+ }
+ componentWillReceiveProps(nextProps) {
+
+ }
+ render() {
+ const {contentStore} = this.props;
+ const {relateList,relateList:{canRef}} = contentStore;
+ const columns = [
+ {
+ title: getLabel(16579,"流程类型"), //列名
+ dataIndex: 'wfname', //列的id 对应数据
+ key: 'wfname', //前端渲染key值
+ com: [
+ { label: '', type: 'LINK_WF' , key: 'wfname', viewAttr:1, width: 120, otherParams: {className: 'test-className'}},
+ ],
+ colSpan: 1,
+ width: '50%',
+ className: 'wea-table-edit-name',
+ },
+ {
+ title: getLabel(17906,"必要"), //列名
+ dataIndex: 'isNecessary', //列的id 对应数据
+ key: 'isNecessary', //前端渲染key值
+ com: [
+ { label: '', type: 'CHECKBOX' ,editType: '1', key: 'isNecessary', width: 80, }
+ ],
+ colSpan: 1,
+ width: '40%',
+ className: 'wea-table-edit-ismust',
+ },
+ {
+ title: '', //列名
+ dataIndex: 'operate', //列的id 对应数据
+ key: 'sex', //前端渲染key值
+ com: [
+ { label: '', type: 'OPERATE' ,editType: '1', key: 'operate', options: [{ key: '1', showname: getLabel(91,"删除")}] }
+ ],
+ colSpan: 1,
+ width: '10%',
+ className: 'prj-dropdown-link',
+ },
+ ];
+ return (
+ )
+ }
+ getButtons(){
+ const {contentStore} = this.props;
+ const {relateList:{canRef}} = contentStore;
+ let btn = [];
+ if(canRef){
+ btn.push(
+ this.addWorkFlowType(ids, names, datas)} customized={true} >
+
+
+ );
+ }
+ return btn;
+ }
+
+ //编辑
+ onChange=(data)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskRequiredOpt,taskid,} = contentStore;
+ doDspTaskRequiredOpt({
+ method:'modifyRequiredWFN',
+ taskid : taskid,
+ wfid : data.wfid,
+ isNecessary:data.isNecessary
+ },'req');
+ }
+ //新增
+ addWorkFlowType=(ids, names, datas)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskRequiredOpt,taskid,} = contentStore;
+ doDspTaskRequiredOpt({
+ method:'addRequiredWF',
+ taskid : taskid,
+ wfids : ids
+ },'req');
+ }
+ //删除
+ handleOperate=(record)=>{
+ const {contentStore} = this.props;
+ const {doDspTaskRequiredOpt,taskid,} = contentStore;
+ Modal.confirm({
+ title: getLabel(15172,"系统提示"),
+ content: getLabel(83600,"您确认要删除吗?"),
+ onOk() {
+ doDspTaskRequiredOpt({
+ method:'delRequiredWF',
+ taskid : taskid,
+ wfid : record.wfid
+ },'req');
+ },
+ onCancel() { },
+ })
+
+ }
+}
+
diff --git a/pc4backstage/prj/components/common/stageList.js b/pc4backstage/prj/components/common/stageList.js
new file mode 100644
index 0000000..632a664
--- /dev/null
+++ b/pc4backstage/prj/components/common/stageList.js
@@ -0,0 +1,47 @@
+
+import { observer } from "mobx-react";
+import React from 'react';
+import { WeaTableEdit } from 'ecCom';
+import { toJS } from 'mobx';
+@observer
+export default class StageList extends React.Component {
+
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ const { contentStore } = this.props;
+ const { stageInfo : { stageColumns, stageColumnDatas, selectedDatas, selectedRowKeys,canedit }, onRowSelect, onChange } = contentStore;
+ return (
+
+ {stageColumns && stageColumns.length>0 && {this.tableEdit = el}}
+ />}
+
)
+
+ }
+
+ getRowSelection = (rowSelection) => {
+ const { contentStore } = this.props;
+ const { stageInfo : { canedit }} = contentStore;
+ let sel = { ...rowSelection };
+ sel.getCheckboxProps = (record) => {
+ return { disabled: record.candel == false };
+ }
+ return canedit ? sel:null;
+ }
+
+}
+
diff --git a/pc4backstage/prj/components/common/taskInfo.js b/pc4backstage/prj/components/common/taskInfo.js
new file mode 100644
index 0000000..920cd02
--- /dev/null
+++ b/pc4backstage/prj/components/common/taskInfo.js
@@ -0,0 +1,240 @@
+import { WeaSearchGroup, WeaFormItem, WeaTools, WeaUpload, WeaProgress, WeaLocaleProvider, WeaInputEncrypt } from 'ecCom';
+import { Row, Col, InputNumber, Modal, message } from 'antd';
+import { toJS } from "mobx"
+import { WeaSwitch } from "comsMobx"
+import { inject, observer } from 'mobx-react';
+import PrjDateTime from '../comp/prj-data-time'
+import { datediff } from '../../util/index'
+const getKey = WeaTools.getKey;
+const getLabel = WeaLocaleProvider.getLabel;
+const view_basicToolBar = {
+ uploadUrl: (window.ecologyContentPath || '')+"/api/blog/fileupload/uploadimage",
+ startupFocus: false,
+ toolbar: [],
+};
+const basicToolBar = {
+ uploadUrl: (window.ecologyContentPath || '')+"/api/blog/fileupload/uploadimage",
+ startupFocus: false,
+ toolbar: [
+ { name: 'markdown', items: ['Markdown'] },
+ { name: 'document', items: ['Source', '-', 'Save', 'NewPage', 'Preview', '-', 'Templates'] },
+ { name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'] },
+ { name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'CopyFormatting', 'RemoveFormat'] },
+ { name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize'] },
+ { name: 'colors', items: ['TextColor', 'BGColor'] },
+ { name: 'tools', items: ['Maximize', 'ShowBlocks'] },
+ { name: 'insert', items: ['Image', 'Table', 'Smiley'] }
+ ],
+};
+
+@observer
+export default class TaskInfo extends React.Component {
+
+ render() {
+ const { taskInfo, setFormFields, setValidate } = this.props.listStore;
+ const { form } = this.props;
+ const { isFormInit } = form;
+ let group = [];
+ const formParams = form.getFormParams();
+ isFormInit && toJS(taskInfo.fieldinfo).map((c,i) => {
+ let items = [];
+ c.items.map(fields => {
+ let hide = false;
+ let dom;
+ let hasunderline = false;
+ let stylecss = { 'margin-right': '5px', 'margin-top': '6px' };
+ //只读样式控制
+ if (fields.viewAttr == "1" || (fields.conditionType == "BROWSER" && fields.browserConditionParam.viewAttr == "1")) {
+ hasunderline = true;
+ stylecss = { 'margin-right': '5px', 'margin-top': '16px' };
+ }
+ if (fields.domkey[0] == "begindate") {
+ dom =
+
+ { setFormFields({ begindate: { value: v[0] } }); this.workdayComputed(v, "begin") }} />
+
+
+ } else if (fields.domkey[0] == "enddate") {
+ dom =
+
+ {
+ if (taskInfo.maxSubTaskEndDate == "" || typeof (taskInfo.maxSubTaskEndDate) == "undefined") {
+ setFormFields({ enddate: { value: v[0] } });
+ this.workdayComputed(v, "end")
+ } else {
+ if (new Date(v[0]) < new Date(taskInfo.maxSubTaskEndDate)) {
+ // Modal.warning({
+ // title: getLabel(15172, "系统提示"),
+ // content: getLabel(83887, "任务完成的最后时间小于其子任务完成的最后时间!"),
+ // });
+ message.error(getLabel(83887, "任务完成的最后时间小于其子任务完成的最后时间!"));
+ setFormFields({ enddate: { value: [taskInfo.maxSubTaskEndDate] } });
+ this.workdayComputed([taskInfo.maxSubTaskEndDate, formParams.endtime], "end")
+ } else {
+ setFormFields({ enddate: { value: v[0] } });
+ this.workdayComputed(v, "end")
+ }
+ }
+ }} />
+
+
+ } else if (fields.domkey[0] == "actualbegindate") {
+ dom =
+
+ { setFormFields({ actualbegindate__actualbegintime: { value: v } }); this.onActualComputed(v, "begin") }} />
+
+
+ } else if (fields.domkey[0] == "actualenddate") {
+ dom =
+
+ { setFormFields({ actualenddate__actualendtime: { value: v } }); this.onActualComputed(v, "end") }} />
+
+
+ } else if (fields.domkey[0] == "finish") {
+ if (fields.viewAttr == "1") {
+ dom =
+
+
+
+
+ } else {
+ dom =
+
+ { this.checkProgress(v); }} />
+ %
+
+
+ }
+ } else if (fields.conditionType == "RICHTEXT") { //多行文本
+ if(fields.viewAttr == "1"){
+ dom = WeaTools.EncryBase.desensitization(fields.value)? :
+
+ }else{
+ dom =
+ }
+ } else if (fields.domkey[0] == "accessory") {
+ let domkey = fields.domkey[0];
+ dom =
+
+ { setFormFields({ [domkey]: { value: v } }) }}
+ viewAttr={fields.viewAttr}
+ // onUploading={(state)=>{}}
+ />
+
+
+ } else {
+ dom = ;
+ }
+ if (hasunderline) {
+ items.push({
+ com: (
+ {dom}
+ ),
+ colSpan: 1,
+ hide: hide
+ });
+ } else {
+ items.push({
+ com: (
+ {dom}
+ ),
+ colSpan: 1,
+ hide: hide
+ });
+ }
+ });
+ group.push()
+ });
+ return group;
+ }
+
+ workdayComputed = (arg, type) => {
+ const { setFormFields, taskInfo: { passnoworktime, userid } } = this.props.listStore;
+ const { form } = this.props;
+ const formParams = form.getFormParams() || {};
+ let res = "";
+ if (type == "begin") {
+ if (arg[0] && formParams.enddate) {
+ res = datediff(arg[0], formParams.enddate, "00:00", "23:59", userid, passnoworktime);
+ }
+ } else {
+ if (arg[0] && formParams.begindate) {
+ res = datediff(formParams.begindate, arg[0], "00:00", "23:59", userid, passnoworktime);
+ }
+ }
+ setFormFields({ workday: { value: res } });
+ }
+ onActualComputed = (arg, type) => { //maxSubTaskEndDate
+ const { setFormFields, taskInfo: { passnoworktime, userid } } = this.props.listStore;
+ const { form } = this.props;
+ const formParams = form.getFormParams() || {};
+ let res = "0";
+ if (type == "begin") {
+ if (arg[0] && formParams.actualenddate) {
+ res = datediff(arg[0], formParams.actualenddate, arg[1] || "00:00", formParams.actualendtime || "23:59", userid, passnoworktime);
+ }
+ } else {
+ if (arg[0] && formParams.actualbegindate) {
+ res = datediff(formParams.actualbegindate, arg[0], formParams.actualbegintime || "00:00", arg[1] || "23:59", userid, passnoworktime);
+ }
+ }
+ setFormFields({ realmandays: { value: res } })
+ }
+ checkProgress = (value) => { //进度编辑校验
+ const { taskInfo, setFormFields } = this.props.listStore;
+ if (Number(taskInfo.finishmax) == 99) {
+ if (value > 99) {
+ // Modal.warning({
+ // title: getLabel(15172, "系统提示"),
+ // content: getLabel(383829, "该任务所必须的相关文档或者相关流程不存在,任务不能完成100%。"),
+ // });
+ message.error(getLabel(383829, "该任务所必须的相关文档或者相关流程不存在,任务不能完成100%。"));
+ setFormFields({ finish: { value: 99 } });
+ } else {
+ setFormFields({ finish: { value: value } });
+ }
+ } else {
+ if (value > 100) {
+ setFormFields({ finish: { value: 100 } });
+ } else {
+ setFormFields({ finish: { value: value } });
+ }
+ }
+ }
+}
+
diff --git a/pc4backstage/prj/components/common/taskList.js b/pc4backstage/prj/components/common/taskList.js
new file mode 100644
index 0000000..a7c98dc
--- /dev/null
+++ b/pc4backstage/prj/components/common/taskList.js
@@ -0,0 +1,78 @@
+
+import {WeaProgress} from 'ecCom';
+import {inject, observer} from "mobx-react";
+import {WeaTableNew} from 'comsMobx';
+const WeaTable = WeaTableNew.WeaTable;
+import TaskInfoDialog from '../dialog/taskDialog'
+
+@observer
+export default class TaskList extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ const {formStore }= this.props;
+ const {taskListTableStore,taskInfoStore,reLoad,prjid,refTaskList,tskOnRowSelect} = formStore;
+ // 通过 rowSelection 对象表明需要行选择
+ const rowSelection = {
+ onChange(selectedRowKeys, selectedRows) {
+ taskInfoStore.onRowSelect(selectedRowKeys);
+ }
+ };
+ return (
+
+ reLoad()}
+ getColumns={c=>this.reRenderColumns(c)}
+ onOperatesClick={this.onOperatesClick.bind(this)}
+ rowSelection={rowSelection}
+ />
+ {{refTaskList()}} />}
+ {/* */}
+
)
+
+
+ }
+ reRenderColumns(columns){
+ columns.forEach((c,i)=>{
+ if(c.dataIndex=='finish'){
+ c.render = function(text, record){
+ return
+
+
+ }
+ // } else {
+ // c.render = function(text, record){
+ // let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
+ // return
+ // }
+ }
+ })
+ return columns;
+ }
+
+ onOperatesClick(record,index,operate,flag){
+ let that = this;
+ const {formStore }= this.props;
+ const {taskInfoStore,prjid} = formStore;
+ let _href = operate && operate.href ? operate.href : "";
+ let fn = _href.replace("javascript:","");
+ fn = fn.substring(0,fn.indexOf('('));
+ if(fn != ""){
+ if('onEditTask' == fn){ //编辑
+ taskInfoStore.handleDialog(true,"edit",record.randomFieldId);
+ }else if('onDelTask' == fn){ //删除
+ taskInfoStore.delTask("del",record.randomFieldId);
+ }else if('onAddSubTask' == fn){ //删除
+ taskInfoStore.handleDialog(true,"add",record.randomFieldId,{parentid:record.randomFieldId,templetId:prjid});
+ }
+ }
+ }
+
+}
+
diff --git a/pc4backstage/prj/components/common/wfActionSet.js b/pc4backstage/prj/components/common/wfActionSet.js
new file mode 100644
index 0000000..f349388
--- /dev/null
+++ b/pc4backstage/prj/components/common/wfActionSet.js
@@ -0,0 +1,42 @@
+import {WeaTableEdit} from 'ecCom';
+import {toJS} from "mobx"
+import {observer} from 'mobx-react';
+
+@observer
+export default class WfActionSet extends React.Component{
+ constructor(props) {
+ super(props);
+ }
+ render(){
+ const {fieldInfo,onChangeAction,settype} = this.props;
+ let d = toJS(fieldInfo);
+ return (
+
+ { this.tableEdit = ref } }
+ isModalEdit={false}
+ columns={d.columns}
+ datas={d.datas}
+ title={fieldInfo.title}
+ draggable={false}
+ showCopy={false}
+ onChange={onChangeAction}
+ rowKey = {"actionid"}
+ showAdd = {settype=="1"||settype=="4"||settype=="5"?false:true}
+ showDelete = {settype=="1"||settype=="4"||settype=="5"?false:true}
+ getRowSelection={this.getRowSelection}
+ />
+
+ )
+ }
+
+ getRowSelection = (rowSelection) => {
+ const {fieldInfo,onChangeAction,settype} = this.props;
+ if(settype=="1"){
+ return null;
+ }else{
+ const sel = { ...rowSelection };
+ return sel;
+ }
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/common/wfFieldSet.js b/pc4backstage/prj/components/common/wfFieldSet.js
new file mode 100644
index 0000000..be4c02b
--- /dev/null
+++ b/pc4backstage/prj/components/common/wfFieldSet.js
@@ -0,0 +1,101 @@
+import { WeaSearchGroup,WeaFormItem ,WeaHelpfulTip,WeaLocaleProvider} from 'ecCom';
+import { Row,Col } from 'antd';
+import {toJS} from "mobx"
+import {WeaSwitch} from "comsMobx"
+import {observer} from 'mobx-react';
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+export default class WfFieldSet extends React.Component{
+ constructor(props) {
+ super(props);
+ }
+ getCircle() {
+ let style = {
+ height: 30,
+ textAlign: 'center',
+ }
+ return style;
+ }
+ render(){
+ const { fieldInfo, form,settype } = this.props;
+ const {isFormInit} = form;
+ let group = [];
+ let items = [];
+ const formParams = form.getFormParams();
+ isFormInit && toJS(fieldInfo).map((c,i) =>{
+ items = [];
+ c.items.map((fields,index) => {
+ items.push({
+ com:(
+
+
+ ),
+ colSpan:1,
+ });
+ });
+ if(settype=='1'||settype=='5'){
+ group.push()
+ }
+
+ });
+ if(settype=='1'||settype=='5'){
+ return
+
+
+
+
+
{getLabel(15551,"项目字段")}
+
+
+
+
+
{getLabel(21903,"字段设置")}
+
+
+
+
+ {group}
+
;
+ }else{
+ return
+
+
+
+
+
{getLabel(15551,"项目字段")}
+
+
+
+
+
{getLabel(21903,"字段设置")}
+
+
+
+
+
+ {items.map(d=>d.com)}
+
+
;
+ }
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/common/wfsetList.js b/pc4backstage/prj/components/common/wfsetList.js
new file mode 100644
index 0000000..50b4bfd
--- /dev/null
+++ b/pc4backstage/prj/components/common/wfsetList.js
@@ -0,0 +1,86 @@
+
+import {Button} from 'antd';
+import {WeaProgress,WeaLocaleProvider} from 'ecCom';
+import {observer} from "mobx-react";
+import {WeaTableNew} from 'comsMobx';
+const WeaTable = WeaTableNew.WeaTable;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+export default class WfSetList extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+ componentDidMount(){
+ const {contentStore,wftype} = this.props;
+ contentStore.getWfSetList({wftype:wftype});
+ }
+ componentWillReceiveProps(nextProps) {
+
+ }
+ render() {
+ const {contentStore} = this.props;
+ const {wfsetListStore,reLoad} = contentStore;
+
+ return (
+
+ reLoad(wfsetListStore)}
+ getColumns={c=>this.reRenderColumns(c)}
+ onOperatesClick={this.onOperatesClick.bind(this)}
+ />
+
)
+ }
+
+ getAdButtons = () => {
+ const {contentStore} = this.props;
+ const {getWfSetList,wftype,setShowSearchAd,clearFormFields} = contentStore;
+ return [
+ (),
+ (),
+ ()
+ ];
+ }
+ reRenderColumns(columns){
+ columns.forEach((c,i)=>{
+ if(c.dataIndex=='finish'){
+ c.render = function(text, record){
+ return
+
+
+ }
+ } else {
+ c.render = function(text, record){
+ let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
+ return
+ }
+ }
+ })
+ return columns;
+ }
+ onOperatesClick(record,index,operate,flag){
+ const {contentStore} = this.props;
+ const {prjWfSetStore,wftype} = contentStore;
+ let _href = operate && operate.href ? operate.href : "";
+ let fn = _href.replace("javascript:","");
+ fn = fn.substring(0,fn.indexOf('('));
+ let that = this;
+ if(fn != ""){
+ if('onEdit' == fn){ //编辑
+ prjWfSetStore.handleShareDialog(true,"edit",wftype,"baseinfo",{wfsetid:record.randomFieldId});
+ }else if('onDel' == fn){
+ contentStore.deleteWfSet(record.randomFieldId);
+ }else if('onWfset' == fn){
+ window.open((window.ecologyContentPath || '')+"/spa/workflow/static4engine/engine.html#/main/workflowengine/path/pathSet/pathDetail/baseSet/baseInfo?workflowId="+record.wfid+"&showLeftTree=false","+blank")
+ }else if('onUse' == fn){
+ contentStore.toggleuse(record.randomFieldId,"1");
+ }else if('onNouse' == fn){
+ contentStore.toggleuse(record.randomFieldId,"0");
+ }
+ }
+ }
+}
+
diff --git a/pc4backstage/prj/components/comp/prj-data-time/index.js b/pc4backstage/prj/components/comp/prj-data-time/index.js
new file mode 100644
index 0000000..e865fb1
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-data-time/index.js
@@ -0,0 +1,53 @@
+import {InputNumber, Modal, Icon} from 'antd';
+import isEmpty from 'lodash/isEmpty';
+import isArray from 'lodash/isArray'
+import {WeaDatePicker,WeaTimePicker} from "ecCom"
+import equals from 'deep-equal'
+
+class Main extends React.Component {
+ constructor(props){
+ super(props)
+ this.state={
+ dateValue: '',
+ timeValue: ''
+ }
+ if (!isEmpty(props.value)) {
+ if (props.value[0]) this.state.dateValue = props.value[0];
+ if (props.value[1]) this.state.timeValue = props.value[1];
+ }
+ }
+ componentWillReceiveProps(nextProps){
+ if (!equals(this.props.value,nextProps.value)) {
+ let dateValue = '', timeValue = '';
+ if (!isEmpty(nextProps.value)) {
+ dateValue = nextProps.value[0];
+ timeValue = nextProps.value[1];
+ }
+ this.setState({dateValue, timeValue});
+ }
+ }
+ onChangeDate(value) {
+ this.setState({dateValue: value});
+ const {timeValue = ''} = this.state;
+ this.props.onChange && this.props.onChange([value, timeValue]);
+ }
+ onChangeTime(value) {
+ this.setState({timeValue: value});
+ const {dateValue = ''} = this.state;
+ this.props.onChange && this.props.onChange([dateValue, value]);
+ }
+ render(){
+ const {dateValue, timeValue, } = this.state;
+ const {viewAttr,otherParams,startValue="",endValue=""}=this.props;
+
+ return(
+
+
+
+
+
+ );
+ }
+}
+
+export default Main;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/prj-left-right-layout/index.js b/pc4backstage/prj/components/comp/prj-left-right-layout/index.js
new file mode 100644
index 0000000..aa277b3
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-left-right-layout/index.js
@@ -0,0 +1,69 @@
+import { Icon} from 'antd';
+import cloneDeep from 'lodash/cloneDeep'
+import './index.less'
+
+
+class LeftRightLayout extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ showLeft:props.defaultShowLeft || true,
+ isHover:false,
+ leftWidth:props.leftWidth || 250,
+ treeWidth:props.treeWidth || 250
+ // showRight:false
+ }
+ }
+ componentWillReceiveProps(nextProps){
+ if(this.props.showRight !== nextProps.showRight){
+ this.showright(nextProps.showRight);
+ }
+ }
+ leftShowCo(e){
+ const {showLeft,leftWidth,treeWidth} = this.state;
+ const { onLeftChange,leftCom} = this.props;
+ if(showLeft){
+ jQuery(".three-side-left").animate({width:0},300,"linear",onLeftChange && onLeftChange(false))
+ }else{
+ jQuery(".three-side-left").animate({width:leftCom? leftWidth:treeWidth},300,"linear",onLeftChange && onLeftChange(true))
+ }
+ this.setState({showLeft:!showLeft});
+ e.stopPropagation();
+ e.preventDefault();
+ e.nativeEvent.preventDefault();
+ }
+ render() {
+ const {showLeft,height,isHover,leftWidth,treeWidth} = this.state;
+ const {children,leftCom,rightCom,showRight} = this.props;
+ return (
+
+ {
+ leftCom &&
+
+ }
+
+ {
+ leftCom &&
+
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`}}
+ >
+ }
+
+
+
+ )
+ }
+}
+
+export default LeftRightLayout;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/prj-left-right-layout/index.less b/pc4backstage/prj/components/comp/prj-left-right-layout/index.less
new file mode 100644
index 0000000..7abc5d4
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-left-right-layout/index.less
@@ -0,0 +1,55 @@
+
+@coms-prefix:coms-mode;
+
+@coms-height:46px;
+@coms-small-height:32px;
+
+.wea-left-middle-right-layout,
+.wea-left-middle-right-layout .three-side-left,
+.wea-left-middle-right-layout .three-side-right{
+ height: 100%;
+ overflow: hidden;
+}
+.wea-left-middle-right-layout{
+ background-color: #e8edf4;
+ width: 100%;
+}
+.wea-left-middle-right-layout .three-side-left{
+ float: left;
+ background-color: #fff;
+ height: 100%;
+ .three-side-left-left1{
+ height: 100%;
+ overflow: hidden;
+ float: left;
+ border-right: 1px solid #ececec;
+ }
+ .three-side-left-left2{
+ height: 100%;
+ overflow: hidden;
+ float: left;
+ }
+}
+.wea-left-middle-right-layout .three-side-right{
+ border-right: 1px solid #ececec;
+ position: relative;
+ .three-side-right-container{
+ padding: 0 0px 0 1px;
+ box-sizing: border-box;
+ height: 100%;
+ width: 100%;
+ }
+}
+
+.wea-left-middle-right-layout .wea-three-side-layout-show-left{
+ width: 18px;
+ height: 60px;
+ position: absolute;
+ top: 50%;
+ left: 0;
+ margin-top: -30px;
+ z-index: 11;
+ cursor: pointer;
+ background-size: 100% 100%;
+}
+
diff --git a/pc4backstage/prj/components/comp/prj-show-group/index.js b/pc4backstage/prj/components/comp/prj-show-group/index.js
new file mode 100644
index 0000000..856d5f9
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-show-group/index.js
@@ -0,0 +1,37 @@
+import {Row, Col, Icon} from 'antd';
+import './index.less'
+
+class PrjShowGroup extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ showGroup: props.showGroup ? props.showGroup : true
+ }
+ }
+
+ render() {
+ const {title,leftComponent=[],rightComponent=[], children,btnspace} = this.props;
+ const {showGroup} = this.state;
+ return (
+
+
+
+ {leftComponent}
+
+
+ {rightComponent}
+ this.setState({showGroup:!showGroup})}/>
+
+
+
+ {
+ children
+ }
+
+
+ )
+ }
+
+}
+
+export default PrjShowGroup
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/prj-show-group/index.less b/pc4backstage/prj/components/comp/prj-show-group/index.less
new file mode 100644
index 0000000..a4abc69
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-show-group/index.less
@@ -0,0 +1,33 @@
+.prj-exchange-title{
+ height: 50px;
+ line-height: 50px;
+ border-bottom: 1px solid #e9e9e9;
+ .prj-exchange-title-left{
+ padding-left: 20px;
+ color: #484848;
+ font-weight: 600;
+ }
+ .prj-exchange-title-right{
+ text-align: right;
+ padding-right: 15px;
+ font-size: 12px;
+ }
+
+}
+
+.prj-exchange-content{
+ .prj-exchange-cell-fujian{
+ margin-top: 10px;
+ padding-bottom: 5px;
+ border-bottom: 1px solid #e2e2e2;
+ .wea-form-item{
+ margin-bottom: 5px;
+ }
+ }
+}
+/*全局设置button samll 样式*/
+.prj-btn-small{
+ padding: 0px 4px;
+ border-radius: 0;
+ margin-right: 10px;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/prj-table-edit/index.js b/pc4backstage/prj/components/comp/prj-table-edit/index.js
new file mode 100644
index 0000000..ed4069d
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-table-edit/index.js
@@ -0,0 +1,274 @@
+import {Table, Icon, Button, Spin, Row, Col,Menu, Dropdown,} from 'antd';
+import { WeaTools,WeaInput,WeaTextarea,WeaSelect,WeaBrowser,WeaDatePicker,WeaTimePicker,WeaCheckbox,WeaLocaleProvider} from "ecCom"
+const getLabel = WeaLocaleProvider.getLabel;
+import classNames from 'classnames'
+import isEqual from 'lodash/isEqual';
+import './index.less'
+
+//国际化 zxt- 20170419
+const defaultLocale = {
+ total: getLabel(18609,"共"),
+ totalUnit: getLabel(18256,"条"),
+};
+
+
+class Main extends React.Component {
+ //国际化 zxt- 20170419
+ static contextTypes = {
+ antLocale: React.PropTypes.object,
+ }
+ getLocale() {
+ let locale = {};
+ if(this.context.antLocale && this.context.antLocale.Table) {
+ locale = this.context.antLocale.WeaTableEdit;
+ }
+ return {
+ ...defaultLocale,
+ ...locale,
+ ...this.props.locale
+ };
+ }
+ constructor(props) {
+ super(props);
+ this.state = {
+ columns: [],
+ datas: [],
+ selectedRowKeys: [],
+ current: 1
+ }
+ this.onEdit = this.onEdit.bind(this);
+ }
+ componentDidMount() {
+ const { datas = [], columns = [],canRef } = this.props;
+ columns.length > 0 && this.setState(datas.length > 0 ? {datas: this.addKeytoDatas(datas),columns} : {columns})
+ }
+ componentWillReceiveProps(nextProps) {
+ const { columns = [], datas = [], selectedRowKeys = [],canRef=true } = this.props;
+ const _columns = nextProps.columns || [];
+ const _datas = nextProps.datas || [];
+ const _selectedRowKeys = nextProps.selectedRowKeys || [];
+ const _canRef = nextProps.canRef || true;
+ !isEqual(columns,_columns) && this.setState({columns: _columns});
+ !isEqual(canRef,_canRef) && this.setState({canRef: _canRef});
+ !isEqual(datas,_datas) && this.setState({datas: this.addKeytoDatas(_datas)});
+ !isEqual(selectedRowKeys,_selectedRowKeys) && this.setState({selectedRowKeys: _selectedRowKeys});
+ }
+ componentDidUpdate() {
+
+ }
+ addKeytoDatas(datas){
+ let _datas = datas.map((data, i) => {
+ let _data = {...data};
+ _data.key = i
+ return _data
+ })
+ return _datas
+ }
+ render() {
+ const { datas } = this.state;
+ const {tableProps} = this.props;
+ return(
+
+ )
+ }
+ getColumns(){
+ const { columns } = this.state;
+ let _columns = [].concat(columns);
+ _columns = _columns.map(col => {
+ let _col = { ...col };
+ _col.render || (_col.render = ( text, record, index ) => {
+ return this.getColRender( _col, text, record, index );
+ })
+ return _col
+ });
+ return _columns
+ }
+ getColRender( _col, text, record, index ){
+ const { com } = _col;
+ const { canRef } = this.props;
+ let viewAttr = 2;
+ if(!canRef){
+ viewAttr = 1;
+ }
+ let _com = [];
+ com.map((c,i) => {
+ if(typeof c.props === 'object'){
+ _com.push(c);
+ }else{
+ const { key, label = '', type = 'INPUT', options = [], browserConditionParam = {}, innerStyle = {width: "100%"},
+ showTime = false ,format = "yyyy-MM-dd",otherParams } = c;
+ const _type = type.toUpperCase();
+ let style = _type === 'BROWSER' ? {...innerStyle}:{...innerStyle, display: 'inline-block'}
+ _com.push(
+
+ {label && {label}}
+ { _type === 'INPUT' &&
+ this.onEdit(record, index, key, value)} />
+ }
+ { _type === 'TEXTAREA' &&
+ this.onEdit(record, index, key, value)} />
+ }
+ { _type === 'DATEPICKER' &&
+ this.onEdit(record, index, key, value)} />
+ }
+ { _type === 'TIMEPICKER' &&
+ this.onEdit(record, index, key, value)} />
+ }
+ { _type === 'SELECT' &&
+ this.onEdit(record, index, key, value)} />
+ }
+ { _type === 'BROWSER' &&
+ this.onEdit(record, index, key, ids, names, bDatas)} />
+ }
+ { _type === 'CHECKBOX' &&
+ this.onEdit(record, index, key, value)}
+ />
+ }
+ {
+ _type == "LINK_WF" &&
+
+ {record[key]}
+
+ }
+ {
+ _type == "LINK_DOC" &&
+
+ {record[key]}
+
+ }
+ {
+ _type == "OPERATE" &&
+
+
+ {getLabel(104,"操作")}
+
+
+ }
+
+ )
+ }
+ });
+ return (
+
+ {_com}
+
+ )
+ }
+ getBrowerDatas(record, key){
+ let replaceDatas = [];
+ if(record[key + 'span'] !== undefined) {
+ let keys = record[key].split(',');
+ let values = record[key + 'span'].split(',');
+ if(keys.length === values.length){
+ keys.map((k, i) => {
+ if (k != '' && values[i] != '') replaceDatas.push({id: k, name: values[i]});
+ });
+ }else{
+ }
+ }
+ return replaceDatas
+ }
+ getPagination() {
+ const { pageSize = 0, paginationSize = ''} = this.props;
+ if( !pageSize ) return false;
+ const { current } = this.state;
+ const locale = this.getLocale();
+ let obj = {
+ size: paginationSize,
+ current,
+ pageSize,
+ };
+ return obj
+ }
+ onEdit(record, index, key, value, names, bDatas){
+ const { pageSize = 0 } = this.props;
+ const { datas, current } = this.state;
+ let _datas = [].concat(datas);
+ _datas[pageSize * (current - 1) + index][key] = value;
+ if(names) _datas[pageSize * (current - 1) + index][key + 'span'] = names;
+ this.setState({datas: _datas});
+ this.onChange(_datas,index);
+ }
+ onChange(datas,index){
+ const { columns } = this.state;
+ let _datas = datas.map((data, i) => {
+ let _data = {...data}
+ delete _data.key
+ return _data
+ })
+ typeof this.props.onChange === 'function' && this.props.onChange(_datas[index], columns);
+ }
+ getMenu(record,options,bool){
+ let menu = [];
+ if(options && bool){
+ options.map(item=>{
+ menu.push(
+
+ {item.showname}
+
+ )
+ })
+ return
+ }
+ return menu
+ }
+ onMenuClick=(record,options)=>{
+ typeof this.props.operate == "function" && this.props.operate(record);
+ }
+}
+
+export default Main;
+
diff --git a/pc4backstage/prj/components/comp/prj-table-edit/index.less b/pc4backstage/prj/components/comp/prj-table-edit/index.less
new file mode 100644
index 0000000..f062b40
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prj-table-edit/index.less
@@ -0,0 +1,16 @@
+.wea-table-edit .prj-dropdown-link .ant-dropdown-link {
+ color: #484848
+}
+.prj-link-a a:link {
+ color: #484848;
+}
+.prj-link-a a:hover {
+ color: #038ef6
+}
+
+.prj-content-must{
+ color: red;
+ margin-left: 5px;
+ font-size: 14px;
+ font-weight: 700;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/prjTaskListTable/index.js b/pc4backstage/prj/components/comp/prjTaskListTable/index.js
new file mode 100644
index 0000000..7943d1c
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prjTaskListTable/index.js
@@ -0,0 +1,324 @@
+import {Table,Icon,Row,Col,Button,Modal,InputNumber,message} from 'antd'
+import {WeaInput,WeaBrowser,WeaDialog,WeaNewScroll,WeaLocaleProvider,WeaSelect} from 'ecCom'
+import './index.less'
+import equal from "deep-equal"
+import PrjDateTime from '../prj-data-time'
+import {datediff} from '../../../util'
+const getLabel = WeaLocaleProvider.getLabel;
+
+class PrjTaskListTable extends React.Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ showModal:false,
+ clickKey:"",
+ datas:props.datas || [],
+ selectedRowKeys: [],
+ taskViewAttr :props.taskViewAttr||"",
+ }
+ }
+ componentDidMount() {
+ const { datas = [], taskViewAttr} = this.props;
+ const newdatas = this.addKeytoDatas(datas);
+ this.setState({datas: this.changeBeforeTask(newdatas),taskViewAttr: taskViewAttr})
+ }
+ componentShouldUpdate(nextProps,nextState){
+ return !equal(this.state,nextState)||!equal(this.props.nextProps)
+ }
+ componentWillReceiveProps(nextProps,nextState) {
+ const { datas = [], selectedRowKeys = [],taskViewAttr } = this.state;
+ const _datas = nextProps.datas || [];
+ const _selectedRowKeys = nextProps.selectedRowKeys || [];
+ const _taskViewAttr = nextProps.taskViewAttr || "";
+ !equal(datas,_datas) && this.setState({datas: this.addKeytoDatas(_datas)});
+ !equal(taskViewAttr,_taskViewAttr) && this.setState({taskViewAttr: _taskViewAttr});
+ !equal(selectedRowKeys,_selectedRowKeys) && this.setState({selectedRowKeys:_selectedRowKeys})
+ }
+ componentWillUnmount(){
+
+ }
+ addKeytoDatas(datas){
+ let _datas = datas.map((data, i) => {
+ let _data = {...data};
+ _data.key = i+1;
+ _data.rowIndex = i+1;
+ return _data
+ })
+ return _datas
+ }
+ //change 前置任务
+ changeBeforeTask=(datas)=>{
+ let _datas = [].concat(datas);
+ _datas.map(item=>{
+ if(item.beftaskid && item.beftaskid !== "0"){
+ //let befRealid = item.realid;
+ for(let i = 0 ;i < _datas.length; i++){
+ if(_datas[i].realid == item.beftaskid){
+ item.beftaskid = _datas[i].rowIndex;
+ item.beftaskname = _datas[i].name;
+ }
+ }
+ }
+ })
+ return _datas;
+ }
+ render() {
+ const { datas,showModal,taskViewAttr } = this.state;
+ return(
+
+
+
+
+
+
+
this.setState({showModal:false})}
+
+ >
+
+
+
+
+
+ )
+ }
+ getColumns(){
+ const {taskViewAttr } = this.state;
+ const { stageOptions } = this.props;
+ let dis = true;
+ if(taskViewAttr==2){
+ dis = false;
+ }
+ return [{
+ title: getLabel(15486,"序号"),
+ dataIndex: 'rowIndex',
+ width:"5%",
+ render: (text, record, index ) => {return {text}},
+ }, {
+ title: getLabel(1352,"任务名称"),
+ dataIndex: 'name',
+ width:"20%",
+ render: (text, record, index ) =>
+ this.onEdit(record, index,"name" , value)}
+ />
+ ,
+ }, {
+ title: "阶段",
+ dataIndex: 'name',
+ width:"10%",
+ render: (text, record, index ) =>
+ this.onEdit(record, index,"stageid" , value)}
+ />
+ ,
+ }, {
+ title: getLabel(1298,"工期"),
+ dataIndex: 'workday',
+ width:"5%",
+ render:(text, record, index)=>
+
+
+ }, {
+ title: getLabel(742,"开始时间"),
+ dataIndex: 'begindate',
+ width:"15%",
+ render:(text, record, index)=>
+ {this.timeComputed(v,"begin",index)}} />
+
+ }, {
+ title: getLabel(743,"结束时间"),
+ dataIndex: 'enddate',
+ width:"15%",
+ render:(text, record, index)=>
+ {this.timeComputed(v,"end",index)}} />
+
+ }, {
+ title: getLabel(2233,"前置任务"),
+ dataIndex: 'beftaskid',
+ width:"15%",
+ render:(text, record, index)=>
+
+
+
+ {!dis&&this.setState({showModal:true,clickKey:record.key})}/>}
+
+ },
+ {
+ title: getLabel(2097,"负责人"),
+ dataIndex: 'hrmid',
+ width:"20%",
+ render:(text, record, index)=>
+ {this.onEdit( record, index,"hrmid",ids, names, bDatas)}}
+ replaceDatas={[{id: text, name: record.hrmname}]}
+ />
+
+ }];
+ }
+
+ onEdit= (record, index,name , value,names,bDatas) =>{
+ let that = this;
+ const {clickKey,datas} = this.state;
+ let _datas = [].concat(datas);
+ if(name == "hrmid"){
+ _datas[index][name] = value ;
+ _datas[index]["hrmname"] = names ;
+ }else{
+ _datas[index][name] = value ;
+ }
+ this.setState({datas : _datas});
+ this.onChange(_datas);
+ }
+
+ getButtons(){
+ let btn = [];
+ btn.push();
+ btn.push();
+ return btn;
+ }
+ getModalColumns(){
+ return [{
+ title: getLabel(15486,"序号"),
+ dataIndex: 'rowIndex',
+ width:"15%",
+ render: (text, record, index ) =>{text},
+ }, {
+ title: getLabel(1352,"任务名称"),
+ dataIndex: 'name',
+ width:"85%",
+ render: (text, record, index ) => {text},
+ }]
+ }
+ onRowClick=(record, index)=>{
+ let that = this;
+ const {clickKey,datas} = this.state;
+ let _datas = [].concat(datas);
+ if(record.key == clickKey){
+ // Modal.warning({
+ // title: getLabel(15172,"系统提示"),
+ // content: getLabel(24468,"不能把本身设置为前置任务!"),
+ // onOk() {
+ // that.setState({showModal:false,clickKey:""})
+ // }
+ // })
+ message.error(getLabel(24468,"不能把本身设置为前置任务!"));
+ that.setState({showModal:false,clickKey:""});
+ }else{
+ _datas[clickKey-1].beftaskname = record.name;
+ _datas[clickKey-1].beftaskid = record.rowIndex;
+ that.setState({showModal:false,clickKey:"",datas :_datas})
+ this.onChange(_datas);
+ }
+
+ }
+
+ onClear=()=>{
+ let that = this;
+ const {clickKey,datas} = this.state;
+ let _datas = [].concat(datas);
+ _datas[clickKey-1].beftaskname = "";
+ _datas[clickKey-1].beftaskid = "";
+ that.setState({showModal:false,clickKey:"",datas :_datas})
+ this.onChange(_datas);
+ }
+
+ //计算工期
+ timeComputed= (arg,type,index) =>{
+ const {userid ,isworkday} = this.props;
+ const {datas} = this.state;
+ let _datas = [].concat(datas);
+ let res = "";
+ if(type == "begin"){
+ let time = "";
+ if(!arg[1]){time = "00:00" }else{time = arg[1]}
+ if( _datas[index]["enddate"] && arg[0] ){
+ res = datediff(arg[0],_datas[index]["enddate"],time,_datas[index]["endtime"] || "23:59",userid,isworkday);
+ }
+ _datas[index]["begindate"] = arg[0]
+ _datas[index]["begintime"] = time;
+ }else{
+ let time = "";
+ if(!arg[1]){time = "00:00"}else{time = arg[1]}
+ if(_datas[index]['begindate'] && arg[0] ){
+ res = datediff(_datas[index]['begindate'],arg[0],_datas[index]['begintime'] || "00:00",time,userid,isworkday);
+ }
+ _datas[index]["enddate"] = arg[0]
+ _datas[index]["endtime"] = time;
+ }
+ _datas[index].workday = res;
+ this.setState({datas:_datas})
+ this.onChange(_datas);
+ }
+
+ getRowSelection(){
+ let that = this;
+ const rowSelection = {
+ onChange(selectedRowKeys, selectedRows) {
+ //that.setState({selectedRowKeys:selectedRowKeys});
+ typeof that.props.onRowSelect === 'function' && that.props.onRowSelect(selectedRowKeys);
+ },
+ selectedRowKeys:that.props.selectedRowKeys
+ }
+ return rowSelection
+ }
+
+ onChange(datas){
+ // let _datas = datas.map((data, i) => {
+ // let _data = {...data}
+ // delete _data.key
+ // return _data
+ // })
+ typeof this.props.onChange === 'function' && this.props.onChange(datas);
+ }
+}
+
+export default PrjTaskListTable;
diff --git a/pc4backstage/prj/components/comp/prjTaskListTable/index.less b/pc4backstage/prj/components/comp/prjTaskListTable/index.less
new file mode 100644
index 0000000..6d21867
--- /dev/null
+++ b/pc4backstage/prj/components/comp/prjTaskListTable/index.less
@@ -0,0 +1,23 @@
+
+
+.wea-prj-table-edit .ant-table-tbody>tr>td {
+ padding: 10px 8px;
+ word-break: break-all;
+}
+.wea-prj-table-edit .ant-table-thead>tr>th {
+ background-color: #f8fcff;
+}
+.wea-prj-table-edit .ant-table-thead>tr>th {
+ padding-top: 14px;
+ padding-bottom: 14px;
+}
+.wea-prj-table-edit .ant-table-thead th {
+ border-bottom: 1px solid #eaeaea;
+ font-weight: 400;
+}
+.wea-prj-table-edit .ant-table,.wea-prj-table-edit .ant-table table {
+ border-radius: 0;
+}
+.wea-prj-table-edit .icon-selebeforetask:hover{
+ color: #038ef6
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/view-list/ListItem.js b/pc4backstage/prj/components/comp/view-list/ListItem.js
new file mode 100644
index 0000000..7d79cba
--- /dev/null
+++ b/pc4backstage/prj/components/comp/view-list/ListItem.js
@@ -0,0 +1,40 @@
+import React from 'react';
+import classNames from 'classnames';
+import { WeaLocaleProvider } from 'ecCom';
+const getLabel = WeaLocaleProvider.getLabel;
+
+export default class ListItem extends React.Component {
+ onClick = () => {
+ const { data, onClick } = this.props;
+ onClick && onClick(data.id);
+ }
+
+ render() {
+ const { data, currentKey } = this.props;
+ const className = classNames('prj-list-item-content');
+ let isCurrent = currentKey && currentKey == data.id;
+ return (
+
+
+
+ {/*
{'已启用'}
*/}
+
+
{data.name}
+
+ {data.desc }
+
+
+
+
+
+
+
+
+ )
+ }
+}
+
diff --git a/pc4backstage/prj/components/comp/view-list/index.js b/pc4backstage/prj/components/comp/view-list/index.js
new file mode 100644
index 0000000..aae1203
--- /dev/null
+++ b/pc4backstage/prj/components/comp/view-list/index.js
@@ -0,0 +1,48 @@
+import React from 'react';
+import { WeaNewScroll, WeaInputSearch } from 'ecCom';
+import { Pagination } from 'antd';
+import ListItem from './ListItem';
+import { WeaLocaleProvider } from 'ecCom';
+const getLabel = WeaLocaleProvider.getLabel;
+
+export default class ListView extends React.Component {
+
+ render() {
+ const { datas, onItemClick, pagination, scrollHeight = document.documentElement.clientHeight, currentKey, onSearchListItem, onSearchChange, prjValue } = this.props;
+ return (
+
+
+
+ {datas.length === 0 ?
+
+ {getLabel('83553',"暂无数据")}
+
+ :
+
+ {
+ datas && datas.length > 0 && datas.map(d => (
+
+ ))
+ }
+
+ }
+
+
+
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/comp/weaDragula/index.js b/pc4backstage/prj/components/comp/weaDragula/index.js
new file mode 100644
index 0000000..eeb2929
--- /dev/null
+++ b/pc4backstage/prj/components/comp/weaDragula/index.js
@@ -0,0 +1,98 @@
+
+import dragula from 'react-dragula';
+import isFunction from 'lodash/isFunction';
+import findIndex from 'lodash/findIndex';
+
+class WeaPrjDragula extends React.Component {
+ constructor(props) {
+ super(props);
+ this.drake = null;
+ }
+ componentDidMount() {
+ this.initDragula();
+ }
+
+ componentWillUnmount() {
+ this.drake && this.drake.destroy();
+ }
+
+ render() {
+ return this.props.children;
+ }
+
+ initDragula = () => {
+ let {container,canDrag, onDrop, getKeyFromDom, getKeyFromData} = this.props;
+ if (typeof(container) == "string") {
+ container = jQuery(container, ReactDOM.findDOMNode(this))[0];
+ } else if (isFunction(container)) {
+ container = container();
+ }
+ this.drake = dragula([container], {
+ isContainer: function (el) {
+ return false;
+ },
+ moves: (el, source, handle, sibling) => {
+ return isFunction(canDrag) ? canDrag(handle, el, source, sibling) : canDrag;
+ },
+ mirrorContainer: container
+ });
+ this.drake.on("drop",(el, target, source, sibling) => {
+
+ let {datas} = this.props;
+ if (Array.isArray(datas) && isFunction(getKeyFromDom) && isFunction(getKeyFromData) && isFunction(onDrop)) {
+ let dataKey = getKeyFromDom(el), downKey = sibling ? getKeyFromDom(sibling) : -1;
+ if (downKey == dataKey) {
+ downKey = -1;
+ }
+ let dataIdx = findIndex(datas, (data) => getKeyFromData(data) == dataKey);
+ let downIdx = downKey == -1 ? datas.length : findIndex(datas, (data) => getKeyFromData(data) == downKey);
+ downIdx = downIdx > dataIdx ? downIdx - 1 : downIdx;
+ let data = datas.splice(dataIdx, 1)[0];
+ datas.splice(downIdx, 0, data);
+
+ /*
+ // 遍历并返回新的数据
+ let curData = null;
+ datas = datas.map((data, index) => {
+ if (this.getRowKey(data) == key) {
+ dataIdx = index;
+ curData = data;
+ }
+ if (downKey !== -1 && downKey == this.getRowKey(data)) {
+ downIdx = dataIdx >= 0 ? index - 1 : index;
+ }
+ if (dataIdx == -1 && downIdx == -1) {
+ // 当前与放置的index都没找到,说明未到影响区
+ return data;
+ } else if (dataIdx >=0 && downIdx == -1) {
+ // 找到当前的但没有找到放置位置,需要将下方数据上移一位
+ return index == datas.length - 1 ? datas[dataIdx] : datas[index + 1];
+ } else if (dataIdx == -1 && downIdx >=0) {
+ // 找到放置位置但没有找到当前的,需要将上方数据下移一位
+ return downIdx == index ? null : datas[index - 1];
+ } else {
+ // 都找到之后,如果相等,则做下特殊处理,如果不等,说明已过影响区
+ return index == downIdx ? curData : index == dataIdx ? datas[index - 1] : data;
+ }
+ });
+ // 处理放置位置的数据。
+ datas[downIdx] = curData;*/
+ onDrop(datas, dataIdx, downIdx);
+ } else {
+ isFunction(onDrop) && onDrop(el, sibling, target, source);
+ }
+ });
+ }
+
+}
+
+WeaPrjDragula.propTypes = {
+ container: React.PropTypes.any,//可拖拽区域
+ canDrag: React.PropTypes.any,//是否可拖拽,可以传方法,方法的传参为当前点击的节点。
+ onDrop: React.PropTypes.func,//拖拽结束时触发的方法,第1个参数是拖拽的DOM节点,第二个参数是所放下的位置下方的DOM节点。
+ datas: React.PropTypes.array,//数组
+ getKeyFromData: React.PropTypes.func,//从数组中获得key的方法。
+ getKeyFromDom: React.PropTypes.func,//从Dom中获得key的方法
+};
+
+export default WeaPrjDragula;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/FieldCommonSelect.js b/pc4backstage/prj/components/custom/FieldCommonSelect.js
new file mode 100644
index 0000000..f289ba2
--- /dev/null
+++ b/pc4backstage/prj/components/custom/FieldCommonSelect.js
@@ -0,0 +1,70 @@
+import { WeaSelect, WeaLocaleProvider, WeaBrowser, WeaError } from 'ecCom';
+import { inject, observer } from 'mobx-react';
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject('prjFieldConfigStore')
+@observer
+export default class FieldCommonSelect extends React.Component {
+ constructor(props) {
+ super(props);
+ }
+
+ render() {
+ const { selectCommonList } = this.props.prjFieldConfigStore;
+ const { fieldId, canDel='y' } = this.props;
+ let options=[],variable=true,value='',replaceDatas=[];
+ for (const selectCommon of selectCommonList) {
+ if (fieldId == selectCommon.fieldid) {
+ variable = selectCommon.variable;
+ options = selectCommon.options;
+ value = selectCommon.value;
+ replaceDatas = selectCommon.replaceDatas;
+ break;
+ }
+ }
+ return (
+ variable &&
+
+ {this.addError(fieldId,ref)}}
+ error={getLabel(385869,"此项必填")}>
+ {this.onChange(fieldId,datas)}}
+ />
+
+
+
+
+ );
+ }
+
+ onChange = (fieldId, datas) => {
+ const store = this.props.prjFieldConfigStore;
+ store.setSelectCommonList(fieldId, datas);
+ }
+
+ addError = (id,ref) =>{
+ if(ref!=null){
+ const { errors } = this.props.prjFieldConfigStore;
+ let flag = true;
+ for (const error of errors) {
+ if (id == error.id) {
+ error.ref = ref;
+ flag = false;
+ break;
+ }
+ }
+ if(flag){
+ errors.push({id:id,ref:ref})
+ }
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/FieldConfig.js b/pc4backstage/prj/components/custom/FieldConfig.js
new file mode 100644
index 0000000..22c0431
--- /dev/null
+++ b/pc4backstage/prj/components/custom/FieldConfig.js
@@ -0,0 +1,105 @@
+import { toJS } from 'mobx';
+import { inject, observer } from "mobx-react";
+import React from 'react';
+import {Spin,Modal } from "antd";
+import {WeaTableEdit,WeaRightMenu,WeaAlertPage} from 'ecCom';
+
+@inject('prjFieldConfigStore')
+@observer
+export default class FieldConfig extends React.Component{
+ constructor(props){
+ super(props);
+ }
+
+ getStore() {
+ return this.props.prjFieldConfigStore;
+ }
+
+ componentWillMount(){
+ this.getStore().componentWillMount(this);
+ }
+
+ componentDidMount(){
+ this.getStore().componentDidMount(this.props.params.fieldtype,this.props.prjtypeid);
+ }
+
+ componentWillReceiveProps(nextProps){
+ if(this.props.params.fieldtype!=nextProps.params.fieldtype){
+ this.props.prjFieldConfigStore.componentDidMount(nextProps.params.fieldtype,nextProps.prjtypeid);
+ }else if(this.props.prjtypeid!=nextProps.prjtypeid){
+ this.props.prjFieldConfigStore.componentDidMount(nextProps.params.fieldtype,nextProps.prjtypeid);
+ }
+
+ }
+
+ componentWillUnmount(){
+ this.getStore().componentWillUnmount();
+ }
+
+ render(){
+ const store = this.getStore();
+ const {responseData,setSelectedKeys,setSelectedData,columnDta,columnDef,selectedData,rightMenus,title,canEdit,loading} = store;
+ // const loading = Object.keys(responseData).length == 0;
+ let content = [];
+ if(loading){
+ const loadingCom =
;
+ content = [loadingCom];
+ }else{
+ const {status} = responseData;
+ if(status == "success"){
+
+ const {rightMenus,title,canEdit} = responseData;
+ let tProps = {};
+ tProps.ref = "tableObj";
+ tProps.isModalEdit = false;
+ tProps.columns = toJS(columnDef);
+ tProps.datas = toJS(columnDta);
+ tProps.title = title;
+ tProps.showAdd = false;
+ tProps.showDelete = false;
+ tProps.showCopy = false;
+ tProps.selectedData = toJS(selectedData);
+ if(canEdit){
+ tProps.draggable = true;
+ tProps.onChange = this.onChange;
+ tProps.getRowSelection = this.getRowSelection;
+ }else{
+ tProps.draggable = false;
+ tProps.getRowSelection = ()=>{return undefined};
+ }
+ content.push(
+
+
+
+ );
+ }else{
+ const {errorMsg} = responseData;
+ content = [({errorMsg}
)];
+ }
+ }
+ return content;
+ }
+
+ onChange=(columnDta)=>{
+ const store = this.getStore();
+ store.setColumnDta(columnDta);
+ }
+
+ getRowSelection = (rowSelection) => {
+ let sel = {...rowSelection};
+ sel.getCheckboxProps = (record) => {
+ return {disabled: record.canDel == 'n'};
+ }
+ return sel;
+ }
+
+
+ onRowSelect=(keys, record, dataIndex,selectedDatas)=>{
+ const store = this.getStore();
+ if(typeof(dataIndex) == "undefined"){
+ store.setSelectedKeys(keys);
+ }else{
+ store.setSelectedData(dataIndex,selectedDatas);
+ }
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/FieldGroup.js b/pc4backstage/prj/components/custom/FieldGroup.js
new file mode 100644
index 0000000..17025e8
--- /dev/null
+++ b/pc4backstage/prj/components/custom/FieldGroup.js
@@ -0,0 +1,92 @@
+import { toJS } from 'mobx';
+import { inject, observer } from "mobx-react";
+import React from 'react';
+import {Spin,Modal } from "antd";
+import {WeaTableEdit,WeaRightMenu,WeaAlertPage} from 'ecCom';
+
+@inject('prjFieldGroupStore')
+@observer
+export default class FieldGroup extends React.Component{
+ constructor(props){
+ super(props);
+ }
+
+ getStore() {
+ return this.props.prjFieldGroupStore;
+ }
+
+ componentWillMount(){
+ this.getStore().componentWillMount(this);
+ }
+
+ componentDidMount(){
+ this.getStore().componentDidMount(this.props.params.fieldtype);
+ }
+
+ componentWillUnmount(){
+ this.getStore().componentWillUnmount();
+ }
+
+ render(){
+ const store = this.getStore();
+ const {responseData} = store;
+ const loading = Object.keys(responseData).length == 0;
+ let content = [];
+ if(loading){
+ const loadingCom =
;
+ content = [loadingCom];
+ }else{
+ const {status} = responseData;
+ if(status == "1"){
+ const {columnDef,columnDta,rightMenus,title,canEdit} = responseData;
+ let tProps = {};
+ tProps.ref = "tableObj";
+ tProps.isModalEdit = false;
+ tProps.columns = toJS(columnDef);
+ tProps.datas = toJS(columnDta);
+ tProps.title = title;
+ tProps.showAdd = false;
+ tProps.showDelete = false;
+ tProps.showCopy = false;
+ tProps.copyFilterProps = ["id"]
+ if(canEdit){
+ tProps.draggable = true;
+ tProps.onChange = this.onChange;
+ tProps.onRowSelect = this.onRowSelect;
+ tProps.getRowSelection = this.getRowSelection;
+ }else{
+ tProps.draggable = false;
+ tProps.getRowSelection = ()=>{return undefined};
+ }
+ content.push(
+
+
+
+ );
+ }else{
+ const {errorMsg} = responseData;
+ content = [({errorMsg}
)];
+ }
+ }
+ return content;
+ }
+
+ onChange=(columnDta)=>{
+ const store = this.getStore();
+ store.setColumnDta(columnDta);
+ }
+
+ onRowSelect=(sRowKeys)=>{
+ const store = this.getStore();
+ const {setSelectedData,setSelectedKeys,columnDta} = store;
+ setSelectedKeys(sRowKeys);
+ }
+
+ getRowSelection = (rowSelection) => {
+ let sel = {...rowSelection};
+ sel.getCheckboxProps= (record) => {
+ return {disabled: record.canDel == 'n'};
+ }
+ return sel;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/FieldLanguage.js b/pc4backstage/prj/components/custom/FieldLanguage.js
new file mode 100644
index 0000000..dd998b4
--- /dev/null
+++ b/pc4backstage/prj/components/custom/FieldLanguage.js
@@ -0,0 +1,76 @@
+import { toJS } from 'mobx';
+import { inject, observer } from "mobx-react";
+import React from 'react';
+import {Spin } from "antd";
+import {WeaTableEdit,WeaRightMenu,WeaAlertPage,WeaSearchGroup } from 'ecCom';
+
+@inject('prjFieldLanguageStore')
+@observer
+export default class FieldLanguage extends React.Component{
+ constructor(props){
+ super(props);
+ }
+
+ getStore() {
+ return this.props.prjFieldLanguageStore;
+ }
+
+ componentWillMount(){
+ this.getStore().componentWillMount(this);
+ }
+
+ componentDidMount(){
+ this.getStore().componentDidMount(this.props.params.fieldtype,this.props.prjtypeid);
+ }
+
+ componentWillUnmount(){
+ this.getStore().componentWillUnmount();
+ }
+
+ render(){
+ const store = this.getStore();
+ const {responseData} = store;
+ const loading = false;
+ let content = [];
+ let contentWrap = [];
+ if(loading){
+ const loadingCom =
;
+ contentWrap = [loadingCom];
+ }else{
+ const {status} = responseData;
+ if(status == "1"){
+ const {columns,groups} = responseData;
+ content.push({return undefined}}/>
);
+ toJS(groups).map(group =>{
+ let tProps = {};
+ tProps.isModalEdit = false;
+ tProps.columns = toJS(columns);
+ tProps.datas = toJS(group.columnsData);
+ tProps.draggable = false;
+ tProps.showAdd = false;
+ tProps.showDelete = false;
+ tProps.showCopy = false;
+ tProps.tableProps = {showHeader:false};
+ tProps.getRowSelection = ()=>{return undefined};
+ tProps.onChange = (newData) => {this.onChange(newData,group)};
+ let items = [];
+ items.push({
+ com:(),
+ col:1,
+ });
+ content.push()
+ store.putData(group.id,toJS(group.columnsData));
+ });
+ contentWrap = [{content}
];
+ }else{
+ //contentWrap = [{responseData.errorMsg}
];
+ }
+ }
+ return contentWrap;
+ }
+
+ onChange=(newData,group)=>{
+ const store = this.getStore();
+ store.putData(group.id,newData);
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/FieldOptionManage.js b/pc4backstage/prj/components/custom/FieldOptionManage.js
new file mode 100644
index 0000000..655a89c
--- /dev/null
+++ b/pc4backstage/prj/components/custom/FieldOptionManage.js
@@ -0,0 +1,205 @@
+import { Button, Modal, message } from 'antd'
+import { WeaNewScroll, WeaDialog, WeaTableEdit, WeaSelect, WeaLocaleProvider } from 'ecCom';
+import isEqual from 'lodash/isEqual';
+import isFunction from 'lodash/isFunction';
+import { inject, observer } from 'mobx-react';
+const getLabel = WeaLocaleProvider.getLabel;
+
+const columns = [
+ {
+ title: getLabel(384287, "可选项标识"),
+ dataIndex: 'id',
+ key: 'id',
+ width: "20%",
+ com: [
+ {
+ type: 'input',
+ viewAttr: 1,
+ key: 'id'
+ }
+ ]
+ },{
+ title: getLabel(19113, "值"),
+ dataIndex: 'value',
+ key: 'value',
+ width: "20%",
+ com: [
+ {
+ type: 'input',
+ viewAttr: 1,
+ key: 'value'
+ }
+ ]
+ },
+ {
+ title: getLabel(15442, "可选项文字"),
+ dataIndex: 'showname',
+ key: 'showname',
+ width: "50%",
+ com: [
+ {
+ type: 'input',
+ viewAttr: 3,
+ key: 'showname',
+ }
+ ]
+ }, {
+ title: getLabel(19206, "默认值"),
+ dataIndex: 'isdefault',
+ key: 'isdefault',
+ width: "15%",
+ com: [
+ {
+ type: 'checkbox',
+ viewAttr: 2,
+ key: 'isdefault',
+ }
+ ]
+ },
+ {
+ title: '',
+ dataIndex: 'blank',
+ key: 'blank',
+ width: "5%",
+ com: [
+ {
+ type: 'input',
+ viewAttr: 1,
+ key: 'blank',
+ }
+ ]
+ }
+]
+
+@inject('prjFieldConfigStore')
+@observer
+export default class FieldOptionManage extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ visible: false
+ }
+ }
+
+ componentWillReceiveProps(nextProps) {
+
+ }
+
+ render() {
+ const { visible } = this.state;
+ const { selectDefineList } = this.props.prjFieldConfigStore;
+ const { fieldId } = this.props;
+ let variable = true;
+ let options = [];
+ for (const selectDefine of selectDefineList) {
+ if (fieldId == selectDefine.fieldid) {
+ variable = selectDefine.variable;
+ options = selectDefine.options;
+ break;
+ }
+ }
+ let defaultOption = "";
+ for (let option of options) {
+ if (option.isdefault == "1") {
+ defaultOption = option.key + ""
+ break;
+ } else {
+ defaultOption = options.length > 0 ? options[0].key + "" : "0";
+ }
+ }
+ return (
+ variable &&
+ this.onClick(fieldId)}>{getLabel( 32714 ,'选项维护')}
+ { }} />
+ {this.onCancel(fieldId)}}
+ visible={visible}
+ buttons={[
+ ,
+
+ ]}>
+
+ { this.onChange(fieldId, datas) }} showCopy={false} onRowSelect={this.onRowSelect} />
+
+
+
+ );
+ }
+ onClick = (fieldId) => {
+ const store = this.props.prjFieldConfigStore;
+ for (let temp of store.tempOptionList) {
+ if (fieldId == temp.fieldid){
+ this.setState({ visible: true }); //已备份,直接打开
+ return;
+ }
+ }
+ for (let d of store.selectDefineList) { //无备份,以List的数据做备份
+ if (fieldId == d.fieldid){
+ store.saveTemOption(fieldId,d.options);//非新建数据
+ this.setState({ visible: true });
+ return;
+ }
+ }
+ store.saveTemOption(fieldId,[]);//List无数据,备份空数组
+ this.setState({ visible: true });
+ }
+ onCancel = (fieldId) => {
+ const store = this.props.prjFieldConfigStore;
+ store.resetSelectDefineList(fieldId);
+ this.setState({ visible: false });
+ }
+
+ onChange = (fieldId, datas) => {
+ const store = this.props.prjFieldConfigStore;
+ store.setSelectDefineList(fieldId, datas);
+ }
+
+ saveOptions(fieldId) {
+ const store = this.props.prjFieldConfigStore;
+ let defaultId = "";
+ for (let d of store.selectDefineList) {
+ if (d.fieldid == fieldId) {//d.fieldid是主表字段id fieldId 是selectItem表中选项的fieldId
+ for (let option of d.options) {
+ const value = option.showname;
+ if (value == "" || typeof (value) == "undefined") {
+ this.refs.editTable.refs.edit.doRequiredCheck();
+ return;
+ }
+ let count = 0;
+ for (let optionTemp of d.options) {
+ if (value == optionTemp.showname) {
+ count++;
+ }
+ }
+ if (count > 1) {
+ message.error(getLabel(22356, "选项不能重复!"));
+ return;
+ }
+ if (option.isdefault == "1") {
+ defaultId = option.id;
+ }
+ }
+ store.saveTemOption(fieldId,d.options);
+ break;
+ }
+ }
+ //重新给默认选项赋值
+ for (let c of store.columnDta) {
+ if (c.id == fieldId) {
+ c.fieldDbType[2] = defaultId;
+ }
+ }
+ this.setState({ visible: false });
+ }
+
+ getRowSelection = (rowSelection) => {
+ let sel = { ...rowSelection };
+ sel.getCheckboxProps = (record) => {
+ return { disabled: record.canDel == 'n' };
+ }
+ return sel;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/FieldTab.js b/pc4backstage/prj/components/custom/FieldTab.js
new file mode 100644
index 0000000..b6d3f30
--- /dev/null
+++ b/pc4backstage/prj/components/custom/FieldTab.js
@@ -0,0 +1,314 @@
+import React from 'react';
+import { inject, observer } from 'mobx-react';
+import { WeaTop, WeaTab, WeaRightMenu, WeaTools, WeaErrorPage, WeaNewScroll, WeaLeftTree, WeaAlertPage, WeaLocaleProvider, WeaDialog, WeaSwitch, WeaFormItem, WeaSearchGroup } from 'ecCom';
+import { Button } from "antd";
+import { toJS } from 'mobx';
+import FieldLanguage from "./FieldLanguage"
+import FieldGroup from './FieldGroup'
+import FieldConfig from './FieldConfig'
+import LeftRightLayout from '../comp/prj-left-right-layout'
+const getLabel = WeaLocaleProvider.getLabel;
+import './style/prjField.less'
+
+@inject("prjFieldTabStore", "prjFieldLanguageStore", "prjFieldGroupStore", "prjFieldConfigStore")
+@observer
+class FieldTab extends React.Component {
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ searchValue: ""
+ }
+ }
+
+ doInit(props) {
+ const { prjFieldTabStore } = props;
+ prjFieldTabStore.initTreeDatas();
+ prjFieldTabStore.initDatas();
+ }
+
+ componentDidMount() {
+ this.doInit(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if (this.props.location.key !== nextProps.location.key) {
+ const { prjFieldTabStore } = this.props;
+ prjFieldTabStore.clearStatus();
+ prjFieldTabStore.initTreeDatas();
+ this.setState({
+ searchValue: ""
+ })
+ }
+ }
+ shouldComponentUpdate(nextProps, nextState) {
+ return true;
+ }
+
+ componentWillUnmount() {
+ const { prjFieldTabStore } = this.props;
+ prjFieldTabStore.clearStatus();
+ }
+
+ // 更多按钮
+ getMoreBtn = (btns) => {
+ let btnArr = [];
+ Array.isArray(btns) && btns.forEach((res) => {
+ let icon = ;
+ if (res.key.indexOf('save') > -1) {
+ icon = ;
+ }
+ btnArr.push({
+ key: res.key,
+ icon,
+ content: res.props ? res.props.children : '',
+ onClick: res.props ? res.props.onClick : null,
+ });
+ });
+ return btnArr;
+ }
+
+ // 字段加密设置弹出框
+ getEncryptFieldSetDialog = () => {
+ const {prjFieldConfigStore} = this.props;
+ let { encryptFieldSetVisible, setParams, saveEncryptFieldSet, currentClickRecord,encryptFieldSetForm: { loading } } = prjFieldConfigStore;
+ let btns = [
+ ,
+ ];
+ let { fieldLabel = '' } = currentClickRecord;
+ let title = getLabel('527160', '加密设置(字段:#[fieldName])').replace('#[fieldName]', fieldLabel);
+ const label = getLabel('524355', '提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!');
+ return (
+ setParams({ encryptFieldSetVisible: false })}
+ visible={encryptFieldSetVisible}
+ buttons={btns}
+ style={{ width: 600, height: 200 }}
+ moreBtn={{ datas: this.getMoreBtn(btns) }}
+ hasScroll
+ loading={loading}
+ >
+ {label}
+ {this.getEncryptFieldSetInfo()}
+
+ );
+ }
+
+ // 加密设置表单
+ getEncryptFieldSetInfo =() => {
+ let group = [];
+ const {prjFieldConfigStore} = this.props;
+ const { encryptFieldSetForm: { fieldForm, conditioninfo } } = prjFieldConfigStore;
+ const { isFormInit } = fieldForm;
+ isFormInit && conditioninfo.map((c, i) => {
+ let arr = [];
+ c.items.map((field, index) => {
+ const itemProps = {
+ key: index,
+ label: field.label,
+ labelCol: { span: 9, offset: 6 },
+ error: fieldForm.getError(field),
+ tipPosition: 'bottom',
+ wrapperCol: { span: 6 },
+ };
+ // 二次身份校验仅在脱敏显示时,可以开启
+ let newField = { ...field };
+ if (field.domkey && field.domkey instanceof Array && field.domkey[0] === 'secondauth') {
+ const { desensitization, secondauth } = fieldForm.getFormParams();
+ if (desensitization == '1') {
+ newField = { ...newField, viewAttr: 2 };
+ } else {
+ if (secondauth != '0') {
+ fieldForm.updateFields({ secondauth: { value: 0 } }, false);
+ }
+ newField = { ...newField, viewAttr: 1, disabled: true };
+ }
+ }
+
+ let coms = ;
+ arr.push({
+ com: (
+
+ {coms}
+
+ ),
+ col: 1,
+ });
+ });
+ group.push();
+ });
+ return group;
+ }
+
+ render() {
+ const { prjFieldTabStore } = this.props;
+ const { selectedKey, tabData, treeInfo, noRight } = prjFieldTabStore;
+ const { leftTree, leftTreeCount, selectedTreeKey, typeTitle } = this.props.prjFieldTabStore;
+ const { setShowSearchAd, clearFormFields, setTreeInfo, setSelectedTreeKey } = this.props.prjFieldTabStore;
+ const fieldtype = this.props.params.fieldtype;
+ let title = getLabel(34154, "通用项目字段") + getLabel(18075, "定义");
+ let title_type = typeTitle != "" ? typeTitle : getLabel(34153, "项目类型字段") + getLabel(18075, "定义");
+ let title_task = getLabel(81856, "任务卡片字段定义");
+ title = fieldtype == "prjtype" ? title_type : (fieldtype == "prjtsk" ? title_task : title);
+
+ if (noRight) {
+ return (
+
+ {getLabel(2012, "对不起,您暂时没有权限!")}
+
+
+ )
+ } else {
+ return (
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getTopButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ getHeight={this.resetHeight.bind(this)}
+ >
+ {
+ this.setState({
+ searchValue: v
+ })
+ }}
+ onSearchLabelClick={() => {
+ setShowSearchAd(false);
+ clearFormFields();
+ setSelectedTreeKey("");
+ setTreeInfo({ prjtypeid: "", prjtypename: "" });
+ }}
+ onSelect={(key, topTabCount, countsType) => {
+ setShowSearchAd(false);
+ clearFormFields();
+ setSelectedTreeKey(key);
+ setTreeInfo({
+ prjtypeid: topTabCount.keyid,
+ prjtypename: countsType.selectedNodes[0].props.name,
+ });
+ }}
+ />
+ }
+ showLeft={true}
+ onCollapse={showLeft => { }}
+ col={2}
+ children={
+
+
+
+ { //当加载资产类型树结构时 判断树结构是否加载完成 加载完成再加载字段定义数据
+ (selectedKey == "1" && ("prjtype" == fieldtype ? (leftTree.length > 0 ? true : false) : true)) &&
+ }
+ {
+ selectedKey == "2" &&
+ }
+ {
+ selectedKey == "3" &&
+ }
+ { this.getEncryptFieldSetDialog() }
+
+
+ }
+ >
+
+
+ {/* */}
+
+
+ )
+ }
+ }
+
+
+ resetHeight(height) {
+ jQuery(".prj-query-condition").height(height - 48);
+ }
+
+
+ getRightMenu() {
+ const { prjFieldTabStore, prjFieldConfigStore, prjFieldLanguageStore, prjFieldGroupStore } = this.props;
+ const sKey = prjFieldTabStore.selectedKey;
+ let arr = [];
+ if (sKey == "1") {
+ arr = prjFieldConfigStore.getRightMenus();
+ } else if (sKey == "2") {
+ arr = prjFieldLanguageStore.getRightMenus();
+ } else if (sKey == "3") {
+ arr = prjFieldGroupStore.getRightMenus();
+ }
+ return arr;
+ }
+
+
+ onOperatesClick = (record, index, operate, flag, argumentString) => {
+
+ }
+
+ getTopButtons() {
+ let btns = [];
+
+
+ return btns;
+ }
+
+ getButtons() {
+ const { prjFieldTabStore, prjFieldLanguageStore, prjFieldGroupStore, prjFieldConfigStore } = this.props;
+ const { selectedKey } = prjFieldTabStore;
+ let btnArr = [];
+ {
+ selectedKey == "1" && prjFieldConfigStore.canEdit &&
+ btnArr.push(
+ //
+ prjFieldConfigStore.getTopButtons()
+ //
+ )
+ }
+ {
+ selectedKey == "2" && prjFieldLanguageStore.canEdit &&
+ btnArr.push(
+ //
+ prjFieldLanguageStore.getTopButtons()
+ //
+ )
+ }
+ {
+ selectedKey == "3" && prjFieldGroupStore.canEdit &&
+ btnArr.push(
+ //
+ prjFieldGroupStore.getTopButtons()
+ //
+ )
+ }
+
+ return btnArr;
+ }
+}
+
+export default WeaTools.tryCatch(React,
+ props => ,
+ { error: "" }
+)(FieldTab);
\ No newline at end of file
diff --git a/pc4backstage/prj/components/custom/ListCondition.js b/pc4backstage/prj/components/custom/ListCondition.js
new file mode 100644
index 0000000..9175468
--- /dev/null
+++ b/pc4backstage/prj/components/custom/ListCondition.js
@@ -0,0 +1,40 @@
+import { WeaSearchGroup,WeaFormItem ,WeaSwitch,WeaLocaleProvider} from 'ecCom';
+import { Button } from 'antd';
+import {toJS} from "mobx"
+const getLabel = WeaLocaleProvider.getLabel;
+
+class Condition extends React.Component{
+ render(){
+ const { condition, form } = this.props.listStore;
+ const {isFormInit} = form;
+ let group = [];
+ const formParams = form.getFormParams();
+ isFormInit && toJS(condition).map(c =>{
+ let items = [];
+ c.items.map(fields => {
+ items.push({
+ com:(
+
+ ),
+ colSpan:1
+ })
+ });
+ group.push()
+ });
+ return group;
+ }
+}
+
+const getAdButtons = (listStore) => {
+ const {doSearch,setShowSearchAd,clearFormFields,setConditionByTree} = listStore;
+ return [
+ (),
+ (),
+ ()
+ ];
+}
+
+export {Condition,getAdButtons}
diff --git a/pc4backstage/prj/components/custom/PrjCardTabSet.js b/pc4backstage/prj/components/custom/PrjCardTabSet.js
new file mode 100644
index 0000000..793a677
--- /dev/null
+++ b/pc4backstage/prj/components/custom/PrjCardTabSet.js
@@ -0,0 +1,191 @@
+import React from 'react';
+import { inject, observer } from 'mobx-react';
+import { toJS } from "mobx"
+import { Button, Spin } from 'antd'
+import { WeaDialog, WeaBrowser, WeaTop, WeaUpload, WeaTableEdit, WeaRightMenu, WeaAlertPage, WeaLocaleProvider } from "ecCom"
+const getLabel = WeaLocaleProvider.getLabel;
+
+@inject("prjCardTabSetStore")
+@observer
+class PrjCardTabSet extends React.Component {
+ static defaultProps = {
+
+ }
+ constructor(props) {
+ super(props);
+ this.state = {
+ selectRowKeysLenth: 0
+ }
+
+ }
+ componentWillUnMount() {
+ const { getColumnsInfo } = this.props.prjCardTabSetStore;
+ getColumnsInfo();
+ }
+ componentDidMount() {
+ const { getColumnsInfo } = this.props.prjCardTabSetStore;
+ const tabtype = this.props.params.tabtype;
+ getColumnsInfo({tabtype:tabtype});
+ }
+ componentWillReceiveProps(nextProps) {
+ if (this.props.location.key !== nextProps.location.key || this.props.params.tabtype !== nextProps.params.tabtype) {
+ const { getColumnsInfo } = this.props.prjCardTabSetStore;
+ const tabtype = nextProps.params.tabtype;
+ getColumnsInfo({tabtype:tabtype});
+ }
+ }
+ onClick = (e) => {
+ // alert("自定义组件——详细信息");
+ }
+ onChange = (datas) => {
+ const { setColumnDatas } = this.props.prjCardTabSetStore;
+ setColumnDatas(datas);
+ }
+
+ onRowSelect = (keys, record, dataIndex, selectedDatas) => {
+ const store = this.props.prjCardTabSetStore;
+ if (typeof (dataIndex) == "undefined") {
+ store.setSelectedKeys(keys);
+ } else {
+ store.setSelectedData(selectedDatas);
+ }
+ }
+
+ render() {
+ const { isModalEdit, columnDef, columnDatas, noRight, status, selectedData, loading } = this.props.prjCardTabSetStore;
+ if (noRight) {
+ return (
+
+ {getLabel(2012, "对不起,您暂时没有权限!")}
+
+
+ )
+ } else {
+ return (
+
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getTopButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ >
+
+
+ {status && this.onCopy(keys, datas)}
+ />}
+
+
+
+
+
+ )
+ }
+ }
+
+ getRowSelection = (rowSelection) => {
+ let sel = { ...rowSelection };
+ sel.getCheckboxProps = (record) => {
+ return { disabled: record.issystem == '1' };
+ }
+ return sel;
+ }
+
+ getTopButtons() {
+ let btns = [];
+ const { saveCardTabSet, selectedKeys, setSelectedKeys } = this.props.prjCardTabSetStore;
+ btns.push();
+ btns.push();
+ btns.push();
+ btns.push();
+
+ return btns;
+ }
+
+ onCopy = (keys , datas) => {
+ const store = this.props.prjCardTabSetStore;
+ const { setSelectedData, selectedData, selectedKeys, columnDatas } = store;
+ let d = selectedData.isopen ? selectedData.isopen : [];
+ let r = [];
+ selectedKeys.map((item,key)=>{
+ if((selectedData.isopen+"").indexOf(item)>-1){
+ r.push(keys[key]);
+ }
+ })
+ d = d.concat(r);
+ setSelectedData({
+ ...selectedData,
+ isopen : d
+ });
+ }
+
+ getRightMenu() {
+ const { saveCardTabSet, selectedKeys, setSelectedKeys } = this.props.prjCardTabSetStore;
+ let btns = [];
+ btns.push({
+ key: "save",
+ icon: ,
+ content: getLabel(86, "保存"),
+ onClick: key => {
+ this.refs.tableEdit.refs.edit.doRequiredCheck();
+ saveCardTabSet()
+ }
+ });
+
+ btns.push({
+ key: "addRow",
+ icon: ,
+ content: getLabel(21690, "添加行"),
+ onClick: key => {
+ this.refs.tableEdit.refs.edit.doAdd();
+ }
+ });
+ btns.push({
+ key: "delRow",
+ icon: ,
+ content: getLabel(16182, "删除行"),
+ disabled : selectedKeys.length == 0,
+ onClick: key => {
+ selectedKeys.length > 0 && this.refs.tableEdit.refs.edit.doDelete();
+ setSelectedKeys([]);
+ }
+ });
+
+ btns.push({
+ key: "copyRow",
+ icon: ,
+ content: getLabel(77, "复制") + getLabel(18620, "行"),
+ disabled : selectedKeys.length == 0,
+ onClick: key => {
+ selectedKeys.length > 0 && this.refs.tableEdit.refs.edit.doCopy();
+ }
+ });
+
+ return btns;
+ }
+}
+
+export default PrjCardTabSet;
+
+
+
diff --git a/pc4backstage/prj/components/custom/style/prjField.less b/pc4backstage/prj/components/custom/style/prjField.less
new file mode 100644
index 0000000..a05561b
--- /dev/null
+++ b/pc4backstage/prj/components/custom/style/prjField.less
@@ -0,0 +1,69 @@
+.prj-table-edit-nonetop{
+ .wea-table-edit .wea-table-edit-title {
+ padding: 0;
+ border-bottom: 0px solid #e9e9e9;
+ }
+}
+.prj-table-edit-nonecontent{
+ .ant-table-placeholder {
+ display: none;
+ }
+}
+.prj-search-group-nonepadding{
+ .wea-search-group {
+ padding: 0;
+ }
+}
+
+.prj-table-edit-nonetop{
+ .wea-table-edit {
+ .wea-table-edit-title {
+ padding: 0;
+ border-bottom: 0 solid #e9e9e9;
+ }
+ }
+}
+
+.prj-encrypt-setting{
+ color:#00A9FF;
+ cursor: pointer;
+ padding-left: 8px;
+}
+
+.bs-prj-define-encrypt-dialog .data_security_tip_info{
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ padding: 0px 8px;
+ color: #FF9200;
+ background-color: #FFF3DC;
+ border: 1px solid #FFD073;
+ border-left: none;
+ border-right: none;
+ /* i {
+ position: relative;
+ margin-right: 8px;
+ font-size: 20px;
+ top: 4px;
+ } */
+}
+
+.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-checked.ant-switch-disabled {
+background: #D8EFD1;
+border-color: #D8EFD1;
+}
+.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-checked.ant-switch-disabled:after {
+background: #A5D397;
+cursor: not-allowed;
+border-color: #A5D397;
+}
+.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-disabled {
+cursor: not-allowed;
+background: #DADADA;
+border-color: #DADADA;
+}
+.bs-prj-define-encrypt-dialog .wea-switch .ant-switch.ant-switch-disabled:after {
+background: #EDEDED;
+cursor: not-allowed;
+border-color: #EDEDED;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/dialog/addPrjTempletDialog.js b/pc4backstage/prj/components/dialog/addPrjTempletDialog.js
new file mode 100644
index 0000000..4e8ebdb
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/addPrjTempletDialog.js
@@ -0,0 +1,223 @@
+
+import { Button, Spin } from 'antd';
+import { WeaDialog, WeaTab, WeaNewScroll, WeaRightMenu, WeaLocaleProvider } from 'ecCom';
+import { observer } from "mobx-react";
+import { toJS } from 'mobx';
+import PrjTaskListTable from '../comp/prjTaskListTable'
+import ProjectCondition from '../list/projectCondition'
+import StageList from '../common/stageList'
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+class AddPrjTempletDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ width: 1020,
+ height: 650,
+ }
+ }
+ componentDidMount() {
+
+ }
+ computedWH = () => {
+ }
+ componentWillReceiveProps(nextProps) {
+
+ }
+ render() {
+ const { addPrjTempletStore } = this.props.contentStore;
+ const { title, selectedKey, visible, conditionDatas: { userid, taskinfo, fieldinfo, taskViewAttr }, saveListDatas, saveRowKeys, selectedRowKey, spinning } = addPrjTempletStore;
+ const { form, setFormFields, setValidate } = addPrjTempletStore;
+ const tabs = [{ key: "prjinfo", title: getLabel(16290, "项目信息") }, { key: "sublist", title: getLabel(18505, "任务列表") }, { key: "stagelist", title: getLabel('387407',"阶段设置") }];
+ const { width, } = this.state;
+ const formParams = form.getFormParams() || {};
+ let dialogHeight = window.innerHeight - 150;
+ if (dialogHeight > 600) dialogHeight = 600;
+ return (
+
+
addPrjTempletStore.handleShareDialog(false)}
+ buttons={this.getDialogButtons()}
+ >
+
+
+
+
+
+
{ setFormFields(v) }} setValidate={(v) => { setValidate(v) }} />
+
+
+
{ saveListDatas(datas) }}
+ onRowSelect={(rowkeys) => { saveRowKeys(rowkeys) }}
+ stageOptions={this.getStageOptions()}
+ />
+
+
+ { this.StageList = el }} contentStore={addPrjTempletStore} />
+
+
+
+
+
+
+
)
+ }
+
+ getDialogButtons() {
+ const { isreflesh } = this.props;
+ const { addPrjTempletStore } = this.props.contentStore;
+ const { saveAddProject, conditionDatas: { taskViewAttr } } = addPrjTempletStore;
+ let btn = [];
+ if (taskViewAttr == 2) {
+ btn.push();
+ btn.push();
+ } else {
+ btn.push();
+ }
+ return btn
+ }
+
+ getButtons() {
+ const { addPrjTempletStore } = this.props.contentStore;
+ const { selectedKey, addNewListDatas, deleListDatas, conditionDatas: { taskViewAttr }, selectedRowKey, stageInfo } = addPrjTempletStore;
+ const isDisabled = !(selectedRowKey.length > 0 && `${toJS(selectedRowKey)}`);
+ const stageDisabled = !(stageInfo.selectedRowKeys.length > 0)
+ let btn = [];
+ if (taskViewAttr == 2) {
+ if (selectedKey == "sublist") {
+ btn = [
+ (),
+
+ ];
+ } else if (selectedKey == "stagelist") {
+ btn = [
+ (),
+
+ ];
+ }
+ }
+ return btn
+ }
+
+ getRightMenu() {
+ const { isreflesh } = this.props;
+ const { addPrjTempletStore } = this.props.contentStore;
+ const { selectedKey, saveAddProject, addNewListDatas, deleListDatas, conditionDatas: { taskViewAttr }, selectedRowKey, stageInfo } = addPrjTempletStore;
+ const stageDisabled = !(stageInfo.selectedRowKeys.length > 0)
+ const isDisabled = !(selectedRowKey.length > 0 && `${toJS(selectedRowKey)}`);
+ let btn = [];
+ if (taskViewAttr == 2) {
+ if (selectedKey == "prjinfo") {
+ btn.push({
+ key: '1',
+ icon: ,
+ content: getLabel(86, "保存"),
+ onClick: (key) => {
+ const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
+ saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
+ }
+ });
+ }
+ if (selectedKey == "sublist") {
+ btn.push({
+ key: '1',
+ icon: ,
+ content: getLabel(611, "添加"),
+ onClick: (key) => {
+ addNewListDatas();
+ }
+ });
+ btn.push({
+ key: '2',
+ icon: ,
+ content: getLabel(91, "删除"),
+ disabled: isDisabled,
+ onClick: (key) => {
+ deleListDatas();
+ }
+ });
+ btn.push({
+ key: '3',
+ icon: ,
+ content: getLabel(86, "保存"),
+ onClick: (key) => {
+ const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
+ saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
+ }
+ });
+ }
+
+ if (selectedKey == "stagelist") {
+ btn.push({
+ key: '1',
+ icon: ,
+ content: getLabel(611, "添加"),
+ onClick: (key) => {
+ this.StageList.tableEdit.refs.edit.doAdd()
+ }
+ });
+ btn.push({
+ key: '2',
+ icon: ,
+ content: getLabel(91, "删除"),
+ disabled: stageDisabled,
+ onClick: (key) => {
+ this.StageList.tableEdit.refs.edit.doDelete()
+ }
+ });
+ btn.push({
+ key: '3',
+ icon: ,
+ content: getLabel(86, "保存"),
+ onClick: (key) => {
+ const checkProps = this.StageList.tableEdit.refs.edit.doRequiredCheck();
+ saveAddProject({ isreflesh: isreflesh, checkProps: checkProps });
+ }
+ });
+ }
+ }
+ return btn
+ }
+
+ changeTab(key) {
+ const { addPrjTempletStore } = this.props.contentStore;
+ addPrjTempletStore.changeTab(key)
+ }
+
+ getStageOptions = () => {
+ const { addPrjTempletStore: { stageInfo: { stageColumns, stageColumnDatas, selectedRowKeys, selectedDatas } } } = this.props.contentStore;
+ let options = [];
+ stageColumnDatas && stageColumnDatas.length > 0 && stageColumnDatas.map(item => {
+ options.push({ disabled: false, key: item.id, selected: false, showname: item.name, visible: true })
+ })
+ return options;
+ }
+}
+
+export default AddPrjTempletDialog;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/dialog/editPrjTaskDataDialog.js b/pc4backstage/prj/components/dialog/editPrjTaskDataDialog.js
new file mode 100644
index 0000000..6cfba5d
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/editPrjTaskDataDialog.js
@@ -0,0 +1,48 @@
+
+import {Form, Input, Button, } from 'antd';
+import {WeaDialog, WeaSearchGroup, WeaInput,WeaAuth ,WeaTab,WeaTools,WeaNewScroll,WeaRightMenu,WeaLocaleProvider} from 'ecCom';
+import {inject, observer} from "mobx-react";
+import {toJS} from 'mobx';
+import {WeaTableNew} from 'comsMobx';
+const WeaTable = WeaTableNew.WeaTable;
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+class EditPrjTaskDataDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state={
+ }
+ }
+
+ render() {
+ const {contentStore} = this.props;
+ return (
+
+ {contentStore.showEditTaskModal(false)}}
+ style={{width:'1000px', height:'600px'}}
+ >
+
+
+
+
+
)
+ }
+
+ getButtons(){
+ const {contentStore} = this.props;
+ let btnArr = [];
+ btnArr.push()
+ return btnArr;
+ }
+
+
+}
+
+export default EditPrjTaskDataDialog;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/dialog/prjtypeDialog.js b/pc4backstage/prj/components/dialog/prjtypeDialog.js
new file mode 100644
index 0000000..fd8d59a
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/prjtypeDialog.js
@@ -0,0 +1,1119 @@
+import { Button} from 'antd';
+import {WeaDialog ,WeaTab,WeaNewScroll,WeaAlertPage,WeaRightMenu,WeaAuth,WeaLocaleProvider } from 'ecCom';
+import {observer} from "mobx-react";
+import {toJS} from 'mobx';
+import {WeaTableNew} from 'comsMobx';
+const WeaTable = WeaTableNew.WeaTable;
+import ProjectCondition from '../list/projectCondition'
+import * as Apis from '../../apis/basemanger'
+const getLabel = WeaLocaleProvider.getLabel;
+
+@observer
+class ProjectTypeDialog extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state={
+ width:750,
+ height:450,
+ visible:false
+ }
+ }
+ appDetachDisableAll = false;
+ componentDidMount(){
+ this.computedWH();
+ Apis.getPrjTypeShareList({prjtypeid:-1}).then(data=>{
+ if(data.appDetachDisableAll){//禁用所有人选项
+ this.appDetachDisableAll = data.appDetachDisableAll ;
+ }
+ })
+ }
+ 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 {prjtypeStore} = this.props;
+ const {title,selectedKey,visible,isright,prjtypeinfo,tableStore,prjtypeid,selectLinkageDatas:{optionList1,optionList2,optionList3,optionList4}} = prjtypeStore;
+ const {form,setFormFields,setValidate} = prjtypeStore;
+ let shareCondition_edit = [
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharetype"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(21956,"对象类型"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(179,"人力资源")
+ }, {
+ "key": "5",
+ "selected": false,
+ "showname": getLabel(141,"分部")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(124,"部门")
+ }, {
+ "key": "11",
+ "selected": false,
+ "showname": getLabel(6086,"岗位")
+ }, {
+ "key": "3",
+ "selected": false,
+ "showname": getLabel(122,"角色")
+ }, {
+ "key": "4",
+ "selected": false,
+ "showname": getLabel(1340,"所有人")
+ }, {
+ "key": "100",
+ "selected": false,
+ "showname": getLabel(513163,"模块字段(人员)")
+ },{
+ "key": "101",
+ "selected": false,
+ "showname": getLabel(513164,"模块字段(部门)")
+ },{
+ "key": "102",
+ "selected": false,
+ "showname": getLabel(513165,"模块字段(分部)")
+ },{
+ "key": "103",
+ "selected": false,
+ "showname": getLabel(513166,"模块字段(岗位)")
+ }
+ ],
+ "viewAttr": 2
+ }, {
+ "2": [[
+ {
+ "browserConditionParam": {
+ "completeParams": {},
+ "conditionDataParams": {},
+ "dataParams": {},
+ "destDataParams": {},
+ "hasAddBtn": false,
+ "hasAdvanceSerach": true,
+ "idSeparator": ",",
+ "isAutoComplete": 1,
+ "isDetail": 0,
+ "isMultCheckbox": false,
+ "isSingle": false,
+ "pageSize": 10,
+ "quickSearchName": "",
+ "type": "57",
+ "viewAttr": 3
+ },
+ "colSpan": 2,
+ "conditionType": "BROWSER",
+ "domkey": [
+ "relatedshareid"
+ ],
+ "fieldcol": 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
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "5": [[
+ {
+ "browserConditionParam": {
+ "completeParams": {},
+ "conditionDataParams": {},
+ "dataParams": {},
+ "destDataParams": {},
+ "hasAddBtn": false,
+ "hasAdvanceSerach": true,
+ "idSeparator": ",",
+ "isAutoComplete": 1,
+ "isDetail": 0,
+ "isMultCheckbox": false,
+ "isSingle": false,
+ "pageSize": 10,
+ "quickSearchName": "",
+ "type": "194",
+ "viewAttr": 3
+ },
+ "colSpan": 2,
+ "conditionType": "BROWSER",
+ "domkey": [
+ "relatedshareid"
+ ],
+ "fieldcol": 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
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "1": [[
+ {
+ "browserConditionParam": {
+ "completeParams": {},
+ "conditionDataParams": {},
+ "dataParams": {},
+ "destDataParams": {},
+ "hasAddBtn": false,
+ "hasAdvanceSerach": true,
+ "idSeparator": ",",
+ "isAutoComplete": 1,
+ "isDetail": 0,
+ "isMultCheckbox": false,
+ "isSingle": false,
+ "pageSize": 10,
+ "quickSearchName": "",
+ "type": "17",
+ "viewAttr": 3
+ },
+ "colSpan": 2,
+ "conditionType": "BROWSER",
+ "domkey": [
+ "relatedshareid"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(106,"对象"),
+ "labelcol": 6,
+ "viewAttr": 3
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "11": [[
+ {
+ "browserConditionParam": {
+ "completeParams": {},
+ "conditionDataParams": {},
+ "dataParams": {},
+ "destDataParams": {},
+ "hasAddBtn": false,
+ "hasAdvanceSerach": true,
+ "idSeparator": ",",
+ "isAutoComplete": 1,
+ "isDetail": 0,
+ "isMultCheckbox": false,
+ "isSingle": false,
+ "pageSize": 10,
+ "quickSearchName": "",
+ "type": "278",
+ "viewAttr": 3
+ },
+ "colSpan": 2,
+ "conditionType": "BROWSER",
+ "domkey": [
+ "relatedshareid"
+ ],
+ "fieldcol": 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
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "4": [[
+ {
+ "colSpan": 2,
+ "conditionType": "INPUT_INTERVAL",
+ "needDefaultValue":false,
+ "domkey": [
+ "seclevel",
+ "seclevelMax"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(683,"安全级别"),
+ "labelcol": 6,
+ "value": [
+ 0,
+ ''
+ ],
+ "viewAttr": 2
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "3": [[
+ {
+ "browserConditionParam": {
+ "completeParams": {},
+ "conditionDataParams": {},
+ "dataParams": {},
+ "destDataParams": {},
+ "hasAddBtn": false,
+ "hasAdvanceSerach": true,
+ "idSeparator": ",",
+ "isAutoComplete": 1,
+ "isDetail": 0,
+ "isMultCheckbox": false,
+ "isSingle": false,
+ "pageSize": 10,
+ "quickSearchName": "",
+ "type": "65",
+ "viewAttr": 3
+ },
+ "colSpan": 2,
+ "conditionType": "BROWSER",
+ "domkey": [
+ "relatedshareid"
+ ],
+ "fieldcol": 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
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "100": [[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "relatedid"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(261,"字段"),
+ "labelcol": 6,
+ "options": toJS(optionList1),
+ "viewAttr": 3
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "orgrelation"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(32946,"上下级关系"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(384035,"当前人")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(15709,"直接上级")
+ },{
+ "key": "3",
+ "selected": false,
+ "showname": getLabel(15762,"所有上级")
+ }
+ ],
+ "viewAttr": 3
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "CHECKBOX",
+ "domkey": [
+ "isRestruct"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(31464,"权限重构"),
+ "labelcol": 6,
+ "value":"1",
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "101": [[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "relatedid"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(261,"字段"),
+ "labelcol": 6,
+ "options": toJS(optionList2),
+ "viewAttr": 3
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "orgrelation"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(32946,"上下级关系"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "0",
+ "selected": true,
+ "showname": ""
+ }, {
+ "key": "1",
+ "selected": false,
+ "showname": getLabel(15762,"所有上级")
+ },{
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(15765,"所有下级")
+ }
+ ],
+ "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
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "CHECKBOX",
+ "domkey": [
+ "isRestruct"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(31464,"权限重构"),
+ "labelcol": 6,
+ "value":"1",
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "102": [[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "relatedid"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(261,"字段"),
+ "labelcol": 6,
+ "options": toJS(optionList3),
+ "viewAttr": 3
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "orgrelation"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(32946,"上下级关系"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "0",
+ "selected": true,
+ "showname": ""
+ }, {
+ "key": "1",
+ "selected": false,
+ "showname": getLabel(15762,"所有上级")
+ },{
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(15765,"所有下级")
+ }
+ ],
+ "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
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "CHECKBOX",
+ "domkey": [
+ "isRestruct"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(31464,"权限重构"),
+ "labelcol": 6,
+ "value":"1",
+ "viewAttr": 2
+ }
+ ]
+ ],
+ "103": [[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "relatedid"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(261,"字段"),
+ "labelcol": 6,
+ "options": toJS(optionList4),
+ "viewAttr": 3
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "SELECT",
+ "domkey": [
+ "sharelevel"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(385,"权限"),
+ "labelcol": 6,
+ "options": [
+ {
+ "key": "1",
+ "selected": true,
+ "showname": getLabel(33564,"查看")
+ }, {
+ "key": "2",
+ "selected": false,
+ "showname": getLabel(93,"编辑")
+ }
+ ],
+ "viewAttr": 2
+ }
+ ],[
+ {
+ "colSpan": 2,
+ "conditionType": "CHECKBOX",
+ "domkey": [
+ "isRestruct"
+ ],
+ "fieldcol": 16,
+ "isQuickSearch": false,
+ "label": getLabel(31464,"权限重构"),
+ "labelcol": 6,
+ "value":"1",
+ "viewAttr": 2
+ }
+ ]
+ ]
+ }
+ ];
+ let shareCondition = shareCondition_edit;
+ const tabs_add = [{key:"prjtypeinfo",title:getLabel(1361,"基本信息")}];
+ const tabs_edit = [{key:"prjtypeinfo",title:getLabel(1361,"基本信息")},{key:"addshare",title:getLabel(21945,"创建权限")},{key:"share",title:getLabel(2112,"共享设置")}];
+ let tabs = tabs_edit;
+ if(prjtypeid==''){
+ tabs = tabs_add;
+ }
+ if(selectedKey=='addshare'){
+ shareCondition = prjtypeStore.shareCondition_add;
+ }
+ if( this.appDetachDisableAll){
+ let temp = shareCondition[0];
+ temp.options.splice(5,1);
+ shareCondition[0] = temp ;
+ }
+ const { width,height} = this.state;
+ if (visible&&!isright) {
+ return (prjtypeStore.handleShareDialog(false)}
+ buttons={[
+ ()
+ ]}>
+
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+
+ )
+ }
+ return (
+
+
prjtypeStore.handleShareDialog(false)}
+ buttons={this.getButtons()}
+ >
+
+
+
+ {selectedKey == "prjtypeinfo" &&
+ {setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
+ }
+ {(selectedKey == "addshare"||selectedKey == "share") &&
+
+
+ {
+ prjtypeStore.addShare(v);
+ this.setState({ visible: false });
+ }}
+ onCancel={() => {
+ this.setState({ visible: false });
+ }}
+ />
+
+ }
+
+
+
+
+
)
+ }
+
+ getButtons(){
+ const {prjtypeStore} = this.props;
+ const {rightMenu,tableStore} = prjtypeStore;
+ let btnArr = [];
+ let {selectedRowKeys} = tableStore;
+ const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ m.isTop == '1' && btnArr.length < 4 && btnArr.push(
+
+ );
+ });
+ btnArr.push()
+ return btnArr;
+ }
+
+ getRightMenu(){
+ const {prjtypeStore }= this.props;
+ const {rightMenu,tableStore} = prjtypeStore;
+ let {selectedRowKeys} = tableStore;
+ let btnArr = [];
+ const isDisabled = !(selectedRowKeys.length>0 && `${toJS(selectedRowKeys)}`);
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ btnArr.push({
+ icon: ,
+ content: m.menuName,
+ disabled:isDisabled && m.isControl == "1"
+ })
+ });
+ return btnArr
+ }
+ onRightMenuClick(key){
+ const {prjtypeStore} = this.props;
+ const {rightMenu,saveAddProject,tableStore} = prjtypeStore;
+ let {selectedRowKeys} = tableStore;
+ let that = this;
+ rightMenu && rightMenu.length>0 && rightMenu.map((m,i)=>{
+ if(Number(key) == i){
+ if(m.type == "BTN_SAVE"){ ////类型编辑
+ if(prjtypeStore.prjtypeid==''){
+ prjtypeStore.savePrjTypeInfo({method:'add'});
+ }else{
+ prjtypeStore.savePrjTypeInfo({method:'edit'});
+ }
+ }else if(m.type == "BTN_SAVETOEDIT"){ //
+ prjtypeStore.saveToEditPrjTypeInfo({method:'add'});
+ }else if(m.type == "BTN_APPEND"){ //添加权限
+ this.setState({visible:true})
+ }else if(m.type == "BTN_DELETEBATCH"){//批量删除
+ prjtypeStore.delBatchShare(`${toJS(selectedRowKeys)}`,prjtypeStore.selectedKey);
+ }
+ }
+ });
+ }
+
+ onOperatesClick(record,index,operate,flag){
+ const {prjtypeStore} = this.props;
+ let _href = operate && operate.href ? operate.href : "";
+ let fn = _href.replace("javascript:","");
+ fn = fn.substring(0,fn.indexOf('('));
+ let that = this;
+ if(fn != ""){
+ if("onDel"==fn){
+ prjtypeStore.delBatch(record.id,prjtypeStore.selectedKey,record.sharetype);
+ }
+ }
+ }
+
+ changeTab(key){
+ const {prjtypeStore} = this.props;
+ prjtypeStore.changeTab(key)
+ }
+}
+
+export default ProjectTypeDialog;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/dialog/prjwfsetDialog.js b/pc4backstage/prj/components/dialog/prjwfsetDialog.js
new file mode 100644
index 0000000..41cbb38
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/prjwfsetDialog.js
@@ -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 (
+
+ prjwfsetStore.handleShareDialog(false)}
+ buttons={this.getDialogButtons()}
+ >
+
+ {viewtype=='edit'&&}
+
+ {selectTabKey=='baseinfo'&&{setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} handleFormnameDialog={handleFormnameDialog}/>}
+ {selectTabKey=='fieldsel'&&}
+ {selectTabKey=='actionset'&& { this.WfActionSet = ref } } fieldInfo={fieldinfo2} onChangeAction={onChangeAction} settype={wftype}/>}
+
+
+
+
+ {handleFormnameDialog(false)}}
+ style={{width:400,height:200}}
+ buttons={this.getFormDialogButtons()}
+ >
+
+
+ {
+ this.setState({formname:value })
+ }}
+ />
+
+
+
+
+ )
+ }
+
+ getDialogButtons(){
+ const {contentStore} = this.props;
+ const {selectTabKey,saveBaseInfo,saveFieldSel,saveActionSet,viewtype} = contentStore;
+ let btn = [];
+ if(viewtype=='add'){
+ btn.push();
+ btn.push();
+ }else{
+ if(selectTabKey=="baseinfo"){
+ btn.push();
+ }else if(selectTabKey=="fieldsel"){
+ btn.push();
+ }else if(selectTabKey=="actionset"){
+ btn.push();
+ }
+ }
+ btn.push();
+ return btn
+ }
+
+ getFormDialogButtons(){
+ let btn = [];
+ btn.push();
+ btn.push();
+ 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(
+
+ );
+ });
+ 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: ,
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/dialog/taskDialog.js b/pc4backstage/prj/components/dialog/taskDialog.js
new file mode 100644
index 0000000..a64ebde
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/taskDialog.js
@@ -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 (
+ {handleDialog(false)}}
+ style={{width:1000,height:700}}>
+
+
+
+
+
+
+ )
+ }
+ 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(
+
+ );
+ });
+ btnArr.push()
+ return btnArr;
+ }
+ getRightMenu(){
+ const {contentStore} = this.props;
+ const {handleDialog,rightMenu} = contentStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ btnArr.push({
+ icon: ,
+ 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,"必要信息不完整!"));
+ }
+ });
+ }
+
+}
diff --git a/pc4backstage/prj/components/dialog/taskTempletImpDialog.js b/pc4backstage/prj/components/dialog/taskTempletImpDialog.js
new file mode 100644
index 0000000..20cc368
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/taskTempletImpDialog.js
@@ -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 = "" + 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 + " ";
+ const require = "";
+ 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: (
+
+
+
+
+
+
+
+
+ {field.label}:
+
+ {this.getDom(field)}
+
+
+
+
+
+
+ ),
+ colSpan: 1,
+ })
+ }else{
+ arr.push({
+ com: (
+
+
+
+
+
+
+
+
+ {field.label}:
+
+
+ {this.getDom(field)}
+
+
+
+
+
+
+
+
+ ),
+ colSpan: 1,
+ })
+ }
+ })
+ //导入提示信息
+ arr.push({
+ com: (
+
+
+
+
+
+ { taskmsg!=""&&(parseInt(imp_totalCount)>0&&
{getLabel(128217,"总记录数")}{imp_totalCount}{getLabel(18256,"条")} ,{getLabel(128219,"成功导入")}{imp_successCount}{getLabel(18256,"条")},{getLabel(498,"失败")}{parseInt(imp_totalCount) - parseInt(imp_successCount)}{getLabel(18256,"条")}。 ) }
+
+
+
+
+ ),
+ colSpan: 1,
+ })
+ }
+ if (i == 1) { //导入说明
+ c.items.map((field, index) => {
+ arr.push({
+ com: (
+
+
+
+
+
+
+ {this.getIllustration(field.value, field.link, index, field)}
+
+
+
+ ),
+ colSpan: 1
+ })
+ })
+ }
+ if (i == 2) { //字段说明
+ c.items.map((field, index) => {
+ arr.push({
+ com: (
+
+
+
+
+
+
+ {this.getIllustration1(field.value, field.link, index, field)}
+
+
+
+ ),
+ colSpan: 1
+ })
+ })
+ }
+ _arr.push(
)
+ });
+ return _arr;
+ }
+
+ getDom(field) {
+ const { prjImportStore} = this.props;
+ const {filelist } = prjImportStore;
+ let dom;
+ let domkey = field.domkey;
+ if (domkey&&domkey[0] == 'excelfile') {
+ dom = (
+
+ {
+ this.setFileId(ids, list)
+ }
+ } >
+
+
+
+
+ {filelist.length == 0 ?
{getLabel(384040,"未选择任何文件")}
: filelist.map(file =>
{file.filename}
)}
+
+
)
+ } else {
+ dom =
+ }
+ 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 = ({val}:{getLabel(28446,"下载EXCEL文档模板")}
);
+ } else {
+ p = ();
+ }
+ return p;
+ }
+ getIllustration1(val, url, index, link) {
+ let p;
+ if (index == 0) {
+ p = ();
+ } else if(index==1){
+ p = ();
+ } else{
+ p = ();
+ }
+ return p;
+ }
+ render() {
+ const { prjImportStore } = this.props;
+ const { spinning,visible } = prjImportStore;
+ let dialogHeight = window.innerHeight - 150;
+ if (dialogHeight > 600) dialogHeight = 600;
+
+ return (
+
+ { this.doClose() }}
+ style={{ width: 870, height: dialogHeight }}>
+
+
+
+ {this.getForm()}
+
+
+
+
+
+ )
+ }
+
+ 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(
+
+ );
+ });
+ btnArr.push()
+ return btnArr;
+ }
+ getRightMenu() {
+ const { prjImportStore } = this.props;
+ const { rightMenu } = prjImportStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
+ btnArr.push({
+ icon: ,
+ 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);
+ }
+ }
+ });
+ }
+
+}
diff --git a/pc4backstage/prj/components/dialog/worktypeDialog.js b/pc4backstage/prj/components/dialog/worktypeDialog.js
new file mode 100644
index 0000000..531281c
--- /dev/null
+++ b/pc4backstage/prj/components/dialog/worktypeDialog.js
@@ -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 (worktypeStore.handleShareDialog(false)}
+ buttons={[
+ ()
+ ]}>
+
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+
+ )
+ }
+ return (
+
+
worktypeStore.handleShareDialog(false)}
+ buttons={this.getDialogButtons()}
+ >
+
+
+ {setFormFields(v)}} setValidate={(v)=>{setValidate(v)}} />
+
+
+
+
)
+ }
+
+ getDialogButtons(){
+ const {worktypeStore} = this.props;
+ let btn = [];
+ btn.push();
+ btn.push();
+ 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(
+
+ );
+ });
+ return btnArr;
+ }
+
+ getRightMenu(){
+ const {worktypeStore }= this.props;
+ const {rightMenu} = worktypeStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ btnArr.push({
+ icon: ,
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/list/listCondition.js b/pc4backstage/prj/components/list/listCondition.js
new file mode 100644
index 0000000..18a95e0
--- /dev/null
+++ b/pc4backstage/prj/components/list/listCondition.js
@@ -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:(
+
+ ),
+ colSpan:1,
+ })
+ });
+ group.push()
+ });
+ return group;
+ }
+}
+
+const getAdButtons = (listStore,ecid) => {
+ const {doSearch,setShowSearchAd,clearFormFields} = listStore;
+ return [
+ (),
+ (),
+ ()
+ ];
+}
+
+export {Condition,getAdButtons}
diff --git a/pc4backstage/prj/components/list/listLeftTree.js b/pc4backstage/prj/components/list/listLeftTree.js
new file mode 100644
index 0000000..071f2f4
--- /dev/null
+++ b/pc4backstage/prj/components/list/listLeftTree.js
@@ -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 (
+ {
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/list/projectCondition.js b/pc4backstage/prj/components/list/projectCondition.js
new file mode 100644
index 0000000..369d9a7
--- /dev/null
+++ b/pc4backstage/prj/components/list/projectCondition.js
@@ -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 =
+
+
+
+
+ }else{
+ dom =
+
+ `${value}%`} parser={value =>value.replace('%','')} onChange={(v)=>{setFormFields({finish:{value:v}})}} />
+ %
+
+
+ }
+ }else if(fields.conditionType == "RICHTEXT"){
+ if(fields.viewAttr == "1"){
+ dom = WeaTools.EncryBase.desensitization(fields.value)? :
+
;
+ }else{
+ dom =
+ }
+ }else if(fields.conditionType == "ATTACHEMENT"){
+ let domkey = fields.domkey[0];
+ dom =
+
+ {setFormFields({[domkey]:{value:v}})}}
+ viewAttr={fields.viewAttr}
+ // onUploading={(state)=>{}}
+ />
+
+
+ }else{
+ dom = ;
+ }
+ 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:(
+
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }else{
+ items.push({
+ com:(
+
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }
+
+ }else if(fields.domkey[0] == "prjstatusname"){
+ if(hasunderline){
+ items.push({
+ com:(
+
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }else{
+ items.push({
+ com:(
+
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }
+ }else{
+ if(hasunderline){
+ items.push({
+ com:(
+ {dom}
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }else{
+ items.push({
+ com:(
+ {dom}
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }
+ }
+ });
+ group.push()
+ });
+ return group;
+ }
+}
+
+
+
diff --git a/pc4backstage/prj/components/list/wfsetCondtion.js b/pc4backstage/prj/components/list/wfsetCondtion.js
new file mode 100644
index 0000000..d83b142
--- /dev/null
+++ b/pc4backstage/prj/components/list/wfsetCondtion.js
@@ -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 = this.callAddPath(values)}}
+ form={form} formParams={formParams} onChange={this.onWfChange} />
+ }else if(fields.domkey[0] == "formid"&&viewtype=="add"&&settype=="1"){
+ dom = this.showFormnameDialog(values)}}
+ form={form} formParams={formParams}/>;
+ }else{
+ dom = ;
+ }
+ }else{
+ dom = ;
+ }
+ if(hasunderline){
+ items.push({
+ com:(
+ {dom}
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }else{
+ items.push({
+ com:(
+ {dom}
+ ),
+ colSpan:1,
+ hide:hide
+ });
+ }
+ });
+ group.push()
+ });
+ 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() { },
+ })
+ }
+
+ }
+}
+
+
+
diff --git a/pc4backstage/prj/components/log/ProjectLog.js b/pc4backstage/prj/components/log/ProjectLog.js
new file mode 100644
index 0000000..8a37451
--- /dev/null
+++ b/pc4backstage/prj/components/log/ProjectLog.js
@@ -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 (
+
+
+ {getLabel(2012, "对不起,您暂时没有权限!")}
+
+
+ )
+ }
+
+ const content = [];
+ const tabCom = { projectLogStore.setShowSearchAd(bool) }}
+ hideSearchAd={() => projectLogStore.setShowSearchAd(false)}
+ searchsAd={
+
+ }
+ showSearchAd={showSearchAd}
+ onSearch={v => { projectLogStore.doSearch(v) }}
+ onSearchChange={v => {projectLogStore.appendFormFields({name:{value: v}}) }}
+ onChange={this.changeData}
+ />
+ const tableCom = reLoad()}
+ />
+ if (detachable) {
+ content.push(
+
+ {tabCom}
+ {tableCom}
+ ,
+ );
+ } else {
+ content.push(tabCom);
+ content.push(tableCom);
+ }
+
+ return (
+
+ }
+ iconBgcolor='#217346'
+ buttons={[]}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ onDropMenuClick={this.onRightMenuClick.bind(this)}
+ >
+ {content}
+
+ )
+ }
+
+ getRightMenu() {
+ const { projectLogStore } = this.props;
+ const { rightMenu } = projectLogStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length > 0 && rightMenu.map(m => {
+ btnArr.push({
+ icon: ,
+ 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(
+ ${getLabel(25332,'组织结构')}`}
+ 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 => ,
+ { error: "" }
+)(ProjectLog);
\ No newline at end of file
diff --git a/pc4backstage/prj/components/project/PrjResource.js b/pc4backstage/prj/components/project/PrjResource.js
new file mode 100644
index 0000000..8bdd6ab
--- /dev/null
+++ b/pc4backstage/prj/components/project/PrjResource.js
@@ -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 (
+
+ )
+ }
+}
+
+export default PrjResource;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/project/ProcessList.js b/pc4backstage/prj/components/project/ProcessList.js
new file mode 100644
index 0000000..5ff4bb4
--- /dev/null
+++ b/pc4backstage/prj/components/project/ProcessList.js
@@ -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 (
+
+
+
+ )
+ }
+}
+
+export default ProcessList;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/project/index.js b/pc4backstage/prj/components/project/index.js
new file mode 100644
index 0000000..2f57bb5
--- /dev/null
+++ b/pc4backstage/prj/components/project/index.js
@@ -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 (
+ document.documentElement.clientHeight }}
+ onSelect={this.onSelect}
+ >
+
+
+ )
+ }
+
+ 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: ,
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/remind/ItemList.js b/pc4backstage/prj/components/remind/ItemList.js
new file mode 100644
index 0000000..ba62f4e
--- /dev/null
+++ b/pc4backstage/prj/components/remind/ItemList.js
@@ -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 (
+ ,
+ }]}
+ onClick={this.doRightMenuAction.bind(this)}
+ >
+ }
+ iconBgcolor='#217346'
+ >
+
+
+
+
+
+ )
+ }
+
+ doRightMenuAction(key){
+ const { store } = this.props;
+ if(key == "addNewRemind"){
+ store.remindId = '-1';
+ store.getRemindInfo();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/remind/PrjRemind.js b/pc4backstage/prj/components/remind/PrjRemind.js
new file mode 100644
index 0000000..54ad167
--- /dev/null
+++ b/pc4backstage/prj/components/remind/PrjRemind.js
@@ -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(
+
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+ )
+ }
+ return (
+
+ {/* */}
+ }
+ midWidth={320}
+ midCom={(
+ )}
+ // onCollapse={(side,bool)=>{onCollapse(side,bool)}}
+ >
+
+
+ {/* */}
+
+ )
+ }else{
+ return(
+
+
+ )
+ }
+ }
+
+}
+
+export default ProjectRemind;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/remind/RemindBase.js b/pc4backstage/prj/components/remind/RemindBase.js
new file mode 100644
index 0000000..1c55e8a
--- /dev/null
+++ b/pc4backstage/prj/components/remind/RemindBase.js
@@ -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 (
+ }
+ iconBgcolor="#96358a"
+ showDropIcon={true}
+ dropMenuDatas={PrjRemindStore.getTopMenu()}
+ onDropMenuClick={this.doRightMenuAction.bind(this)}
+ buttons={PrjRemindStore.getTopButton()}
+ >
+
+
+
+
+ )
+ }
+
+ 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();
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/remind/RemindBaseForm.js b/pc4backstage/prj/components/remind/RemindBaseForm.js
new file mode 100644
index 0000000..3c3d5d1
--- /dev/null
+++ b/pc4backstage/prj/components/remind/RemindBaseForm.js
@@ -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 (
+
+
+ {this.getFormItems()}
+
+
+ )
+ }
+
+ getFormItems() {
+ const { CommonStore } = this.props;
+ const { datas, changeDatas, fieldChange, initConditionField } = CommonStore;
+ let html = ;
+ const formlabelcol = { labelCol: { span: 4 }, wrapperCol: { span: 18 } };
+ let items1 = [];
+ let items2 = [];
+ let items3 = [];
+ /***基本信息 */
+ items1.push({
+ com: (
+
+ )
+ });
+ items1.push({
+ com: (
+ {CommonStore.nameremind = ref;}}>
+ { changeDatas({'name':value}) }} isBase64={true} inputType="multilang" />
+
+ )
+ });
+ items1.push({
+ com: (
+
+ )
+ });
+ items1.push({
+ com: (
+ { changeDatas({'isenable':value}) }} />
+ )
+ });
+ items1.push({
+ com: (
+ { changeDatas({'remindtype':value});changeDatas({'contentselect':new Date()});changeDatas({'titleselect':new Date()});initConditionField(); }}
+ />
+ )
+ });
+ if (datas.remindtype&&datas.remindtype[1][0]=='3') {
+ items1.push({
+ com: (
+ { changeDatas({'iscreate':value}) }} />
+ )
+ });
+ }
+ if (datas.remindtype&&(datas.remindtype[1][0]=='5' || datas.remindtype[1][0]=='6')) {
+ items1.push({
+ com: (
+ {getLabel(82217, "日期字段") + ":"}
+
+ { changeDatas({'reminddatefield':value}) } }
+ />
+
+ {getLabel(82218, "时间字段") + ":"}
+
+ { changeDatas({'remindtimefield':value}) } }
+ />
+
+
+ )
+ })
+ items1.push({
+ com:(
+ {/* { remind.push(ref); }}> */}
+ {changeDatas({ 'reminddays': value });}} />
+ {/* */}
+
+ )
+ })
+ }
+
+ /***提醒方式 */
+ items2.push({
+ com: (
+ { changeDatas({'remindSMS':value}) }} />
+ )
+ });
+ items2.push({
+ com: (
+ { changeDatas({'remindEmail':value}) }} />
+ )
+ });
+ items2.push({
+ com: (
+ { changeDatas({'remindWorkflow':value}) }} />
+ )
+ });
+ items2.push({
+ com: (
+ { changeDatas({'remindMC':value}) }} />
+ )
+ });
+
+ /***提醒信息 */
+ //提醒条件
+ items3.push({
+ com: (
+ {getLabel(33331, "字段") + ":"}
+
+ { fieldChange(v) }}
+ />
+
+ {getLabel(19113, "值") + ":"}
+
+ {this.getFormCondition()}
+
+ )
+ });
+ if ( datas.remindSMS == "1" || datas.remindWorkflow == "1" ) {
+ //提醒发起人
+ if( datas.remindtype[1][0]=='1' || datas.remindtype[1][0]=='2' ){
+ items3.push({
+ com: (
+
+
+ { changeDatas({'sendertype':value}); }} />
+
+
"+ getLabel(501380, "选择任务负责人时,第一个任务负责人作为发起人")} />
+
+ )
+ });
+ }else{
+ items3.push({
+ com: (
+
+
+ { changeDatas({'sendertype':value}); }} />
+
+
"+ getLabel(501380, "选择任务负责人时,第一个任务负责人作为发起人")} />
+
+ )
+ });
+ }
+ }
+ //提醒标题
+ if ( datas.remindEmail == "1" || datas.remindWorkflow == "1" || datas.remindMC == "1" ) {
+ items3.push({
+ com: (
+
+ {
+ 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);
+ }} />
+
+
+ { CommonStore.titleremind = ref; }}>
+ { changeDatas({'remindtitle':value}) }} />
+
+
+ " +
+ getLabel(385572, "标题可以取表单字段的值,可通过上面的select框进行选择字段表现形式为:$fieldname$,") + "
" +
+ getLabel(501145, "其中fieldname为所选择表单中的字段,类型为项目创建、项目状态变更,表单为项目表单,其他类型为任务表单") + "
" +
+ getLabel(501146, "邮件提醒、流程提醒或消息中心提醒时生效.")
+ } />
+ )
+ });
+ }
+ items3.push({
+ com: (
+
+ { changeDatas({'contentselect':value});changeDatas({'remindcontent':datas.remindcontent+"$"+value+"$"}); }} />
+
+ { CommonStore.contentremind = ref; }}>
+ { changeDatas({'remindcontent':value}); }} />
+
+ )
+ });
+ items3.push({ com: () });
+
+ html =
+
+
+
+
;
+ // if (formloading) html = {html};
+ 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(
+ { this.props.CommonStore.valueremind = ref; }}>
+ {changeDatas({'conditionfieldvalue':value});}}/>
+
+ )
+ });
+ });
+ return items;
+ }
+
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/remind/RemindPerson.js b/pc4backstage/prj/components/remind/RemindPerson.js
new file mode 100644
index 0000000..ac904f1
--- /dev/null
+++ b/pc4backstage/prj/components/remind/RemindPerson.js
@@ -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(
+
+
{
+ store.changeDatas({'receiverfield':''});
+ store.changeDatas({'receivertype':value});
+ store.changeDatas({'receiverdetail':''});
+ }} />
+ {datas.receivertype == "1000" &&
+ {getLabel(84113, '字段类型')}
+ {
+ store.changeDatas({ 'receiverfieldtype': value });
+ store.changeDatas({'receiverfield':''});
+ }} />
+
+ }
+
+ )
+ if (datas.receivertype == "1" || datas.receivertype == "2" || datas.receivertype == "3" || datas.receivertype == "4" || datas.receivertype == "1000") {
+ if (!(datas.receivertype == "1000")) {
+ //须选择完模块字段的字段类型
+ item.push(
+ { store.browserremind = ref; }}>
+ {
+ store.changeDatas({ 'receiverfield':value });
+ store.changeDatas({ 'receiverdetail':data });
+ }}
+ replaceDatas={toJS(datas.receiverdetail)}
+ {...this.getCurrentBrowserData(datas.receivertype)}
+ />
+
+ )
+ }else{
+ item.push(
+ { store.selectremind = ref; }}>
+ {store.changeDatas({ 'receiverfield': value });}}
+ />
+
+ )
+ }
+ }
+
+ if (datas.receivertype == "2" || datas.receivertype == "3" || datas.receivertype == "4" || datas.receivertype == "5" || datas.receivertype == "1000") {
+ item.push(
+ { store.levelremind = ref; }}>
+ {
+ 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}
+ />
+
+ )
+ }
+
+ return ({item}
)
+ }
+
+ 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;
+ }
+ }
+
+}
diff --git a/pc4backstage/prj/components/remind/TreeList.js b/pc4backstage/prj/components/remind/TreeList.js
new file mode 100644
index 0000000..d23e5ae
--- /dev/null
+++ b/pc4backstage/prj/components/remind/TreeList.js
@@ -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 (
+ }
+ iconBgcolor='#217346'
+ >
+
+ {
+ this.setState({
+ searchValue: v
+ })
+ }}
+ onSearchLabelClick ={()=>{
+ store.getTreeList();
+ }}
+ onSelect={(key)=>{
+ store.setSelectedTreeKey(key);
+ store.setPrjTypeId(key.replace('prjtype_',''));
+ }}
+ />
+
+
+ )
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/components/templet/prjTempletCard.js b/pc4backstage/prj/components/templet/prjTempletCard.js
new file mode 100644
index 0000000..437a8aa
--- /dev/null
+++ b/pc4backstage/prj/components/templet/prjTempletCard.js
@@ -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 (
+
+ {getLabel(18375, "项目模板") + getLabel(18967, "已删除")}
+
+
+ )
+ }
+
+ if (!hasRight && !prjisdel) {
+ return (
+
+ {getLabel(2012, "对不起,您暂时没有权限!")}
+
+
+ )
+ }
+
+ if (hasRight) {
+ return (
+
+
+ }
+ 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)}
+ >
+
+
+
+ {selectTabKey == "prjinfo" &&
}
+ {selectTabKey == "sublist" && }
+ {selectTabKey == "stagelist" && { this.StageList = el }} contentStore={prjTempletCardStore} />}
+
+
+
+ {taskTempletImpStore.remind = ref} } prjImportStore={taskTempletImpStore} refTaskList={prjTempletCardStore.refTaskList} />
+
+
+
+ )
+ }
+ return ()
+ }
+ 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(
+
+ );
+ });
+ 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: ,
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/templet/taskTempletCard.js b/pc4backstage/prj/components/templet/taskTempletCard.js
new file mode 100644
index 0000000..34f3c60
--- /dev/null
+++ b/pc4backstage/prj/components/templet/taskTempletCard.js
@@ -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 (
+
+
+ }
+ 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)}
+ >
+
+
+
+ {
+ selectTabKey === 'taskinfo' &&
+
+
+
+ }
+
+ {
+ selectTabKey === 'req' &&
+
+
+
+ }
+ {
+ selectTabKey === 'doc' &&
+
+
+
+ }
+
+
+
+
+
+
+ )
+ }
+
+ 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(
+
+ );
+ });
+ return btnArr;
+ }
+ getRightMenu(){
+ const {taskTempletCardStore }= this.props;
+ const {rightMenu} = taskTempletCardStore;
+ let btnArr = [];
+ rightMenu && rightMenu.length>0 && rightMenu.map(m=>{
+ btnArr.push({
+ icon: ,
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/templet/templetApproveSet.js b/pc4backstage/prj/components/templet/templetApproveSet.js
new file mode 100644
index 0000000..00d7d53
--- /dev/null
+++ b/pc4backstage/prj/components/templet/templetApproveSet.js
@@ -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(
+
+
+ {getLabel(2012,"对不起,您暂时没有权限!")}
+
+
+ )
+ }
+
+ return (
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ onDropMenuClick={this.onRightMenuClick.bind(this)}
+ >
+ {templetApproveStore.setShowSearchAd(bool)}}
+ hideSearchAd={()=> templetApproveStore.setShowSearchAd(false)}
+ searchsAd={
+
+ }
+ 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") &&
+ {this.getBasicInfo()}
+ }
+ { (selectTabKey == '1' || wftype == "2" || wftype == "1") &&
+
+ }
+
+
+
+ )
+ }
+
+
+ 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"){
+ // setFormFields({[field.domkey[0]]:{value:checked ? '1' : '0'}})}/>
+ dom =
+ setFormFields({[field.domkey[0]]:{value:checked }})}
+ />
+ }else if(field.domkey[0] == "wfid"){
+ //dom = {templetApproveStore.setFormWfid(ids)}} />;
+ dom = this.callAddPath(values)}}
+ form={form} formParams={formParams} onChange={(ids,names)=>{templetApproveStore.setFormWfid(ids)}} />
+ }else{
+ dom = ;
+ }
+ items.push({
+ com: (
+ {dom}
+ ),
+ col: 1,
+ hide:hide
+ });
+ });
+ group.push()
+ });
+ 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(
+
+ );
+ });
+ 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: ,
+ 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 [
+ (),
+ (),
+ ()
+ ];
+ }
+
+ onEnterSearch=() =>{
+ const {templetApproveStore} = this.props;
+ templetApproveStore.getWfSetList({wftype:wftype});
+ templetApproveStore.setShowSearchAd(false);
+ }
+}
+
+export default PrjTempletApproveSet;
\ No newline at end of file
diff --git a/pc4backstage/prj/components/templet/templetList.js b/pc4backstage/prj/components/templet/templetList.js
new file mode 100644
index 0000000..f06d16c
--- /dev/null
+++ b/pc4backstage/prj/components/templet/templetList.js
@@ -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 (
+
+ }
+ iconBgcolor='#217346'
+ buttons={this.getTopButtons()}
+ buttonSpace={10}
+ showDropIcon={true}
+ dropMenuDatas={this.getRightMenu()}
+ onDropMenuClick={this.onRightMenuClick.bind(this)}
+ >
+ }
+ >
+ {templetListStore.setShowSearchAd(bool)}}
+ hideSearchAd={()=> templetListStore.setShowSearchAd(false)}
+ searchsAd={
+
+ }
+ showSearchAd={showSearchAd}
+ onSearch={v=>{templetListStore.doSearch()}}
+ onSearchChange={v=>{templetListStore.appendFormFields({name:{value:v}})}}
+ onChange={ this.changeData }
+ />
+ reLoad()}
+ getColumns={c=>this.reRenderColumns(c)}
+ onOperatesClick={this.onOperatesClick.bind(this)}
+ />
+
+
+
+ )
+
+ }
+
+ 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(
+
+ );
+ }else{
+ m.isTop == '1' && btnArr.length < 4 && btnArr.push(
+
+ );
+ }
+ });
+ 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: ,
+ content: m.menuName,
+ disabled:true
+ })
+ }else{
+ btnArr.push({
+ icon: ,
+ 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 = ""+valueSpan+"";
+ return
+ }
+ } else {
+ c.render = function(text, record){
+ let valueSpan = record[c.dataIndex + "span"] !== undefined ? record[c.dataIndex + "span"] : record[c.dataIndex];
+ return
+ }
+ }
+ })
+ 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;
\ No newline at end of file
diff --git a/pc4backstage/prj/debug.js b/pc4backstage/prj/debug.js
new file mode 100644
index 0000000..f944b37
--- /dev/null
+++ b/pc4backstage/prj/debug.js
@@ -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 = () => (
+
+
+
+
+ { Module.Route }
+
+
+
+
+);
+
+ReactDOM.render(, document.getElementById('container'));
diff --git a/pc4backstage/prj/index.js b/pc4backstage/prj/index.js
new file mode 100644
index 0000000..78c037d
--- /dev/null
+++ b/pc4backstage/prj/index.js
@@ -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 = (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+ */}
+
+
+
+
+
+
+
+
+
+);
+
+module.exports = {
+ Route:Routes,
+ store:stores,
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/single.js b/pc4backstage/prj/single.js
new file mode 100644
index 0000000..e6d79e7
--- /dev/null
+++ b/pc4backstage/prj/single.js
@@ -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 (
+
+
+
+ {PrjEngineRoute}
+
+
+
+ )
+ }
+}
+
+ReactDOM.render(, document.getElementById('container'));
+
+
diff --git a/pc4backstage/prj/stores/addPrjTempletStore.js b/pc4backstage/prj/stores/addPrjTempletStore.js
new file mode 100644
index 0000000..51f71b5
--- /dev/null
+++ b/pc4backstage/prj/stores/addPrjTempletStore.js
@@ -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: {}
+ }
+
+ }
+
+}
+
diff --git a/pc4backstage/prj/stores/baseManagerListStore.js b/pc4backstage/prj/stores/baseManagerListStore.js
new file mode 100644
index 0000000..327095d
--- /dev/null
+++ b/pc4backstage/prj/stores/baseManagerListStore.js
@@ -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;
diff --git a/pc4backstage/prj/stores/custom/FieldConfigStore.js b/pc4backstage/prj/stores/custom/FieldConfigStore.js
new file mode 100644
index 0000000..83d08a6
--- /dev/null
+++ b/pc4backstage/prj/stores/custom/FieldConfigStore.js
@@ -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 ();
+ }
+ //项目类型不显示通用字段的加密设置
+ if(this.fieldType=='prjtype'&&record.fieldtype==1){
+ return ();
+ }
+ //项目通用字段名称、状态不显示
+ if(this.fieldType=='prj'&&(record.fieldName=='name'||record.fieldName=='procode'||record.fieldName=='status')){
+ return ();
+ }
+ //任务字段名称、上级任务、进度、前置任务不显示
+ if(this.fieldType=='prjtsk'&&(record.fieldName=='subject'||record.fieldName=='parentid'||record.fieldName=='finish'||record.fieldName=='prefinish')){
+ return ();
+ }
+ return (
+ {
+ this.getEncryptFieldSetForm(record);
+ }}
+ >{getLabel(526997, '加密设置')}
+ );
+ }
+ return ();
+ },
+ };
+ }
+ 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 {
+ 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;
+ // 新增项目类型字段时需要给fieldtype:2
+ //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: ,
+ 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(
+
+ );
+ });
+ 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: (
+
+
1.{getLabel('524355','提示: 字段一旦加密后无法取消,同时加密后的字段不支持查询,请谨慎操作!')}
+
+ 2.{getLabel('531157','历史数据量可能较大, 此操作可能需要较长时间,对系统性能也可能会造成一定影响,请确认是否处理历史数据:')}
+
+ {
+ this.needInitData = v;
+ }}
+ />
+
+
+
+ ),
+ 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, '取消')
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/custom/FieldGroupStore.js b/pc4backstage/prj/stores/custom/FieldGroupStore.js
new file mode 100644
index 0000000..cc0f5a5
--- /dev/null
+++ b/pc4backstage/prj/stores/custom/FieldGroupStore.js
@@ -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{
+ 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: ,
+ 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: ,
+ 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(
+
+ );
+ });
+ return btnArr;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/custom/FieldInfoStore.js b/pc4backstage/prj/stores/custom/FieldInfoStore.js
new file mode 100644
index 0000000..44e989d
--- /dev/null
+++ b/pc4backstage/prj/stores/custom/FieldInfoStore.js
@@ -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": 启用,
+ "com": [{
+ "label": "",
+ "type": "CHECKBOX",
+ "editType": "2",
+ "key": "isopen"
+ }],
+ "width": "15%",
+ "useRecord": true,
+ "dataIndex": "isopen",
+ "key": "isopen"
+ }, {
+ "title": 必填,
+ "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;
+ })
+ }
+ }
+}
+
diff --git a/pc4backstage/prj/stores/custom/FieldLanguageStore.js b/pc4backstage/prj/stores/custom/FieldLanguageStore.js
new file mode 100644
index 0000000..087a857
--- /dev/null
+++ b/pc4backstage/prj/stores/custom/FieldLanguageStore.js
@@ -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: ,
+ 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(
+
+ );
+ });
+ return btnArr;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/custom/FieldTabStore.js b/pc4backstage/prj/stores/custom/FieldTabStore.js
new file mode 100644
index 0000000..49a40dd
--- /dev/null
+++ b/pc4backstage/prj/stores/custom/FieldTabStore.js
@@ -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;
+ }
+}
+
diff --git a/pc4backstage/prj/stores/custom/PrjCardTabSetStore.js b/pc4backstage/prj/stores/custom/PrjCardTabSetStore.js
new file mode 100644
index 0000000..5e6e170
--- /dev/null
+++ b/pc4backstage/prj/stores/custom/PrjCardTabSetStore.js
@@ -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 = "自定义页面链接地址可以为外网地址,如:
" +
+ "http://www.baidu.com
" +
+ "也可以是内部地址,如:
" +
+ "/test.jsp?a=1&b=2
" +
+ "可以带上参数传参,像这样:
" +
+ "/test.jsp?a=1&b=2
" +
+ "也可以写占位符{#id}传项目id,像这样:
" +
+ "/test.jsp?a=1&prjid={#id}&mypara2={#id}
" +
+ "即使不写占位符,默认也会接收到2个固定的参数:
" +
+ "isfromProjTab=1&projectid=项目id\t";
+ enTitleTip = "Custom page link address for network address, such as:
"+
+ "Http://www.baidu.com
Can also be internal address, such as:
"+
+ "/test.jsp?a=1&b=2
You can take parameter arguments, such as this:
"+
+ "/test.jsp?a=1&b=2
"+
+ "Can also like to write a placeholder {#id} project ID:
"+
+ "/test.jsp?a=1&prjid={#id}&mypara2={#id}
"+
+ "If not write placeholder, the default will also receive 2 fixed parameter:
"+
+ "isfromProjTab=1&projectid=id";
+ hnTitleTip = "自定義頁面鏈接地址可以爲外網地址,如:
" +
+ "http://www.baidu.com
" +
+ "也可以是內部地址,如:
" +
+ "/test.jsp?a=1&b=2
" +
+ "可以帶上參數傳參,像這樣:
" +
+ "/test.jsp?a=1&b=2
" +
+ "也可以寫占位符{#id}傳項目id,像這樣:
" +
+ "/test.jsp?a=1&prjid={#id}&mypara2={#id}
" +
+ "即使不寫占位符,默認也會接收到2個固定的參數:
" +
+ "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 = 链接地址;
+ }else if(laguageId == 8){
+ columns[2].title = Link Address;
+ }else if(laguageId == 9){
+ columns[2].title = 連結位址;
+ }
+ }else{
+ if(laguageId == 7){
+ columns[2].title = 链接地址;
+ }else if(laguageId == 8){
+ columns[2].title = Link Address;
+ }else if(laguageId == 9){
+ columns[2].title = 連結位址;
+ }
+ }
+
+ 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{
+ 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;
+ }
+
+}
+
diff --git a/pc4backstage/prj/stores/index.js b/pc4backstage/prj/stores/index.js
new file mode 100644
index 0000000..e2b78ab
--- /dev/null
+++ b/pc4backstage/prj/stores/index.js
@@ -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
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/listStore.js b/pc4backstage/prj/stores/listStore.js
new file mode 100644
index 0000000..298354b
--- /dev/null
+++ b/pc4backstage/prj/stores/listStore.js
@@ -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();
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/prjAppSetStore.js b/pc4backstage/prj/stores/prjAppSetStore.js
new file mode 100644
index 0000000..de6304a
--- /dev/null
+++ b/pc4backstage/prj/stores/prjAppSetStore.js
@@ -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;
diff --git a/pc4backstage/prj/stores/prjCodeStore.js b/pc4backstage/prj/stores/prjCodeStore.js
new file mode 100644
index 0000000..1d0185c
--- /dev/null
+++ b/pc4backstage/prj/stores/prjCodeStore.js
@@ -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;
diff --git a/pc4backstage/prj/stores/prjRemindStore.js b/pc4backstage/prj/stores/prjRemindStore.js
new file mode 100644
index 0000000..b3ab2b1
--- /dev/null
+++ b/pc4backstage/prj/stores/prjRemindStore.js
@@ -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:
+ });
+ if(this.remindId!=-1){
+ arr.push({
+ key: 'delete',
+ content: getLabel(91, "删除"),
+ icon:
+ });
+ arr.push({
+ key: 'addNewRemind',
+ content: getLabel(82210, "新建提醒"),
+ icon:
+ });
+ }
+ return arr;
+ }
+
+ getTopButton(){
+ return [];
+ }
+
+ 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;
+ }
+
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/prjTempletCardStore.js b/pc4backstage/prj/stores/prjTempletCardStore.js
new file mode 100644
index 0000000..05446b9
--- /dev/null
+++ b/pc4backstage/prj/stores/prjTempletCardStore.js
@@ -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;
+
diff --git a/pc4backstage/prj/stores/prjtypeStore.js b/pc4backstage/prj/stores/prjtypeStore.js
new file mode 100644
index 0000000..5e432db
--- /dev/null
+++ b/pc4backstage/prj/stores/prjtypeStore.js
@@ -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 = {
+ _isdelright = value;
+ }}/>
;
+ }
+ 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: {
+ _isdelright = value;
+ }}/>
,
+ 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 = {}; //校验规则
+ }
+
+}
diff --git a/pc4backstage/prj/stores/prjwfsetStore.js b/pc4backstage/prj/stores/prjwfsetStore.js
new file mode 100644
index 0000000..b6816d8
--- /dev/null
+++ b/pc4backstage/prj/stores/prjwfsetStore.js
@@ -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 = [];
+ }
+}
+
diff --git a/pc4backstage/prj/stores/project/PrjResourceStore.js b/pc4backstage/prj/stores/project/PrjResourceStore.js
new file mode 100644
index 0000000..1c6f662
--- /dev/null
+++ b/pc4backstage/prj/stores/project/PrjResourceStore.js
@@ -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;
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/project/ProcessListStore.js b/pc4backstage/prj/stores/project/ProcessListStore.js
new file mode 100644
index 0000000..0c6dd94
--- /dev/null
+++ b/pc4backstage/prj/stores/project/ProcessListStore.js
@@ -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;
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/project/ProjectStore.js b/pc4backstage/prj/stores/project/ProjectStore.js
new file mode 100644
index 0000000..8179083
--- /dev/null
+++ b/pc4backstage/prj/stores/project/ProjectStore.js
@@ -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;
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/projectLogStore.js b/pc4backstage/prj/stores/projectLogStore.js
new file mode 100644
index 0000000..327a978
--- /dev/null
+++ b/pc4backstage/prj/stores/projectLogStore.js
@@ -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;
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/taskInfoStore.js b/pc4backstage/prj/stores/taskInfoStore.js
new file mode 100644
index 0000000..05f7e5e
--- /dev/null
+++ b/pc4backstage/prj/stores/taskInfoStore.js
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/taskTempletCardStore.js b/pc4backstage/prj/stores/taskTempletCardStore.js
new file mode 100644
index 0000000..4bfb1d6
--- /dev/null
+++ b/pc4backstage/prj/stores/taskTempletCardStore.js
@@ -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;
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/taskTempletImpStore.js b/pc4backstage/prj/stores/taskTempletImpStore.js
new file mode 100644
index 0000000..65ed92f
--- /dev/null
+++ b/pc4backstage/prj/stores/taskTempletImpStore.js
@@ -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=[];
+ }
+}
diff --git a/pc4backstage/prj/stores/templetApproveStore.js b/pc4backstage/prj/stores/templetApproveStore.js
new file mode 100644
index 0000000..a67b9c9
--- /dev/null
+++ b/pc4backstage/prj/stores/templetApproveStore.js
@@ -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;
diff --git a/pc4backstage/prj/stores/templetListStore.js b/pc4backstage/prj/stores/templetListStore.js
new file mode 100644
index 0000000..4ab8bc6
--- /dev/null
+++ b/pc4backstage/prj/stores/templetListStore.js
@@ -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;
\ No newline at end of file
diff --git a/pc4backstage/prj/stores/worktypeStore.js b/pc4backstage/prj/stores/worktypeStore.js
new file mode 100644
index 0000000..49658f5
--- /dev/null
+++ b/pc4backstage/prj/stores/worktypeStore.js
@@ -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 = {}; //校验规则
+ }
+
+}
diff --git a/pc4backstage/prj/style/add.css b/pc4backstage/prj/style/add.css
new file mode 100644
index 0000000..b6ba3cf
--- /dev/null
+++ b/pc4backstage/prj/style/add.css
@@ -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撑高,请慎用overflow:hidden,暂不影响其他的*/
+
+.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;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/base.less b/pc4backstage/prj/style/base.less
new file mode 100644
index 0000000..07809f0
--- /dev/null
+++ b/pc4backstage/prj/style/base.less
@@ -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;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/card.less b/pc4backstage/prj/style/card.less
new file mode 100644
index 0000000..ad5c022
--- /dev/null
+++ b/pc4backstage/prj/style/card.less
@@ -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
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/coding.less b/pc4backstage/prj/style/coding.less
new file mode 100644
index 0000000..586a87b
--- /dev/null
+++ b/pc4backstage/prj/style/coding.less
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/common.less b/pc4backstage/prj/style/common.less
new file mode 100644
index 0000000..e79253a
--- /dev/null
+++ b/pc4backstage/prj/style/common.less
@@ -0,0 +1,14 @@
+.prj-table-edit-nonetop{
+ .wea-error{
+ .wea-cascader{
+ display: flex;
+ .wea-field-readonly{
+ line-height: 30px;
+ }
+ label{
+ align-items: center;
+ align-self: center;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/import.less b/pc4backstage/prj/style/import.less
new file mode 100644
index 0000000..7cf7153
--- /dev/null
+++ b/pc4backstage/prj/style/import.less
@@ -0,0 +1,17 @@
+.prj-import{
+ .prj-import-type{
+ margin: 8px 0;
+ .wea-form-item{
+ margin-bottom: 10px;
+ }
+ }
+ .prj-import-handle{
+ ul li:first-child{
+ margin-top: 15px;
+ }
+ ul li{
+ list-style-type:none;
+ margin: 10px 0;
+ }
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/index.js b/pc4backstage/prj/style/index.js
new file mode 100644
index 0000000..37b169e
--- /dev/null
+++ b/pc4backstage/prj/style/index.js
@@ -0,0 +1,9 @@
+
+import './common.less'
+import './add.css'
+import './card.less'
+import './task.less'
+import './import.less'
+import './queryproject.less'
+import './req.less'
+import './base.less'
\ No newline at end of file
diff --git a/pc4backstage/prj/style/prjField.less b/pc4backstage/prj/style/prjField.less
new file mode 100644
index 0000000..e6e6dde
--- /dev/null
+++ b/pc4backstage/prj/style/prjField.less
@@ -0,0 +1,16 @@
+.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;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/queryproject.less b/pc4backstage/prj/style/queryproject.less
new file mode 100644
index 0000000..327b34d
--- /dev/null
+++ b/pc4backstage/prj/style/queryproject.less
@@ -0,0 +1,14 @@
+.prj-query{
+ .prj-query-condition {
+ overflow-y: auto;
+ overflow-x: hidden;
+ }
+ .prj-query-btns {
+ width: 100%;
+ height: 60px;
+ padding-top: 20px;
+ text-align: center;
+ border-top: 1px solid #dadada;
+ background-color: #fff;
+ }
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/req.less b/pc4backstage/prj/style/req.less
new file mode 100644
index 0000000..b20c09e
--- /dev/null
+++ b/pc4backstage/prj/style/req.less
@@ -0,0 +1,4 @@
+body {
+ line-height: normal;
+ overflow: hidden;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/style/task.less b/pc4backstage/prj/style/task.less
new file mode 100644
index 0000000..f6209e5
--- /dev/null
+++ b/pc4backstage/prj/style/task.less
@@ -0,0 +1,4 @@
+.wea-prj-progressStyle{
+ display: inline-block;
+ width: 75%;
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/util/PrjUtil.js b/pc4backstage/prj/util/PrjUtil.js
new file mode 100644
index 0000000..cb0a509
--- /dev/null
+++ b/pc4backstage/prj/util/PrjUtil.js
@@ -0,0 +1,11 @@
+import isEmpty from 'lodash/isEmpty';
+
+export const getNewFiels=(fields={}) => {
+ let params = {};
+ if(!isEmpty(fields)){
+ for (let key in fields) {
+ params[fields[key].name] = fields[key].value
+ }
+ }
+ return params
+}
\ No newline at end of file
diff --git a/pc4backstage/prj/util/index.js b/pc4backstage/prj/util/index.js
new file mode 100644
index 0000000..5fbac53
--- /dev/null
+++ b/pc4backstage/prj/util/index.js
@@ -0,0 +1,202 @@
+import { Modal } from 'antd';
+import { WeaTools } from "ecCom";
+const getKey = WeaTools.getKey;
+import isEmpty from 'lodash/isEmpty';
+import isArray from 'lodash/isArray';
+
+export const transfStr = (name = '', ids = '', list = [], type = '') => {
+ let str = '';
+ const mirror = {
+ 37: "doc",
+ prjtsk: "task",
+ 18: "crm",
+ 152: "workflow",
+ 135: "project",
+ }
+ list.map(item => {
+ if (name === 'Upload' && type === 'image') {
+ str += '
'
+ }
+ if (name === 'Upload' && type === 'file') {
+ str += (`${item.filename}
`)
+ }
+ if (name === 'Browser') {
+ str += (`${item.name || item.showname}
`)
+ }
+ })
+ return str
+}
+
+export const getFormInitDatas = (condition = []) => {
+ let initdatas = {};
+ condition.map(c => {
+ let items = [];
+ c.items.map((field, index) => {
+ const key = getKey(field);
+ if (field.conditionType == "BROWSER") {
+ if (!isEmpty(field.browserConditionParam)) {
+ const replacesDatas = field.browserConditionParam.replaceDatas || field.browserConditionParam.valueObj;
+ if (!isEmpty(replacesDatas)) {
+ let values = [], names = [];
+ replacesDatas.forEach((d) => {
+ values.push(d.id);
+ names.push(d.lastname || d.name); // 人力按钮特殊处理
+ });
+ initdatas[key] = {
+ value: values.join(','),
+ valueSpan: names.join(','),
+ valueObj: replacesDatas
+ }
+ }
+ }
+ } else if (field.conditionType == 'DATE') {
+ let selectValue = '0', startValue = null, endValue = null;
+ if (!isEmpty(field.options)) selectValue = WeaTools.getSelectDefaultValue(field.options) || selectValue;
+ if (!isEmpty(field.value)) {
+ selectValue = field.value[field.domkey[0]];
+ startValue = field.value[field.domkey[1]];
+ endValue = field.value[field.domkey[2]];
+ }
+ initdatas[key] = {
+ value: [selectValue, startValue, endValue]
+ }
+ } else if (field.conditionType == 'SELECT') {
+ let value = WeaTools.getSelectDefaultValue(field.options);
+ if (field.value !== undefined) value = field.value;
+ if (value !== undefined) {
+ initdatas[key] = {
+ value: value
+ }
+ }
+ } else if (field.conditionType == 'SELECT_LINKAGE') {
+ let selectValue = WeaTools.getSelectDefaultValue(field.options) || '0';
+ initdatas[key] = {
+ value: [selectValue]
+ }
+ } else if (field.conditionType == "SCOPE") {
+ let sValue = field.startValue || '', eValue = field.endValue || '';
+ initdatas[key] = {
+ value: [sValue, eValue]
+ }
+ } else if (field.conditionType == 'RANGEPICKER') {
+ let sValue = field.startDate || field[field.domkey[0]] || '', eValue = field.endDate || field[field.domkey[1]] || '';
+ initdatas[key] = {
+ value: [sValue, eValue]
+ }
+ } else {
+
+ initdatas[key] = { value: field.value || "" };
+ }
+
+ });
+ });
+ return initdatas;
+}
+
+export const datediff = (sDate1, sDate2, sDate3, sDate4, manager, passnoworktime) => {
+ var aDate, oDate1, oDate2, iDays, odate3, odate4, tdate, otime1, otime2, oDatetime1, oDatetime2;
+
+ if (passnoworktime != 1) {
+
+ oDate1 = new Date(sDate1);
+ oDate2 = new Date(sDate2);
+ odate3 = new Date(sDate3);
+ odate4 = new Date(sDate4);
+
+ if (true || "" + oDate1.getFullYear() == "NaN") {
+ aDate = sDate1.split("-")
+ tdate = sDate3.split(":")
+ oDate1 = new Date(aDate[1] + '/' + aDate[2] + '/' + aDate[0]) //转换为12-18-2002格式
+ oDatetime1 = new Date(aDate[1] + '/' + aDate[2] + '/' + aDate[0] + " " + tdate[0] + ":" + tdate[1])
+
+ aDate = sDate2.split("-")
+ tdate = sDate4.split(":")
+ oDate2 = new Date(aDate[1] + '/' + aDate[2] + '/' + aDate[0])
+ oDatetime2 = new Date(aDate[1] + '/' + aDate[2] + '/' + aDate[0] + " " + tdate[0] + ":" + tdate[1])
+
+ }
+ if (oDate2 - oDate1 < 0) {
+ iDays = -1 //日期
+ } else if (oDate2 - oDate1 == 0) {
+ if (sDate4 < sDate3) {
+ iDays = -2 //时间
+ } else {
+ iDays = (Math.abs(oDatetime1 - oDatetime2) / 1000 / 60 / 60 / 24).toFixed(2)
+ }
+ } else {
+ iDays = (Math.abs(oDatetime1 - oDatetime2) / 1000 / 60 / 60 / 24).toFixed(2)
+ }
+
+ } else { //计算去掉不包含非工作日
+
+ $.ajax({
+ type: "post",
+ url: "/proj/process/GetWorkDays.jsp",
+ data: "begindate=" + sDate1 + "&begintime=" + sDate3 + "&enddate=" + sDate2 + "&endtime=" + sDate4 + "&manager=" + manager,
+ dataType: "text",
+ async: false,
+ success: function (data) {
+ iDays = data.trim();
+ }
+ });
+ }
+
+ return iDays;
+
+}
+
+export const openWindow = url => {
+ const width = screen.availWidth - 10;
+ const height = screen.availHeight - 50;
+ let szFeatures = 'top=0,';
+ szFeatures += 'left=0,';
+ szFeatures += `width=${width},`;
+ szFeatures += `height=${height},`;
+ szFeatures += 'directories=no,';
+ szFeatures += 'status=yes,toolbar=no,location=no,';
+ szFeatures += 'menubar=no,';
+ szFeatures += 'scrollbars=yes,';
+ szFeatures += 'resizable=yes';
+ window.open(url, '', szFeatures);
+};
+
+window.openFullWindowHaveBar = openWindow;
+window.openFullWindowForXtable = openWindow;
+
+window.prjTempletOpenPage = function (routeUrl) {
+ window.open((window.ecologyContentPath || '')+"/spa/prj/engine.html#" + routeUrl, "_blank");
+}
+
+// openFullWindowForXtable("/spa/prj/index.html#/main/prj/taskCard?taskid="+1) //标签页打开
+// prjOpenPage("/main/prj/taskCard?taskid="+1) //新窗口打开
+
+export const prjEditFormRules = (condition = []) => {
+ condition.map(c => {
+ let items = [];
+ c.items.map((field, index) => {
+ if (field.conditionType == "BROWSER") {
+ if (field.browserConditionParam.viewAttr == "3") {
+ field.rules = 'required|string'// 校验规则
+ }
+ } else {
+ if (field.viewAttr == "3") {
+ field.rules = 'required|string'// 校验规则
+ }
+ }
+ })
+ });
+ return condition;
+}
+
+export const getFormFields = (condition = []) => {
+ let fields = {};
+ condition && condition.map(f => {
+ const field = {};
+ let key = f.domkey[0];
+ let v = f.value;
+ field.label = `"${f.label}" `;
+ field.value = v;
+ fields[key] = field;
+ })
+ return fields;
+}