提交 12a6fed3 authored 作者: chscls@163.com's avatar chscls@163.com

查看权限

上级 e5db247a
...@@ -10,7 +10,6 @@ import TableCom from '../tableCompon'; ...@@ -10,7 +10,6 @@ import TableCom from '../tableCompon';
import { Toast } from 'antd-mobile'; import { Toast } from 'antd-mobile';
import router from 'umi/router'; import router from 'umi/router';
import IsNewTable from './isNewMobileTable'; import IsNewTable from './isNewMobileTable';
import NewWebTable from './isNewWebTable';
import maintain from '../assets/maintain.png'; import maintain from '../assets/maintain.png';
import moment from 'moment'; import moment from 'moment';
export default class ZdyTable extends Component { export default class ZdyTable extends Component {
...@@ -423,6 +422,7 @@ export default class ZdyTable extends Component { ...@@ -423,6 +422,7 @@ export default class ZdyTable extends Component {
formConfig, formConfig,
formCode, formCode,
formId, formId,
} = this.state; } = this.state;
let { let {
border, border,
...@@ -436,6 +436,8 @@ export default class ZdyTable extends Component { ...@@ -436,6 +436,8 @@ export default class ZdyTable extends Component {
modalInit, modalInit,
concealModel, // 场景设计器内置跳转函数 concealModel, // 场景设计器内置跳转函数
paddingBottom, paddingBottom,
taskAssignee,
userId,
isDynamic, // 是否为大数据页面 isDynamic, // 是否为大数据页面
} = this.props; } = this.props;
let style = {}; let style = {};
...@@ -548,33 +550,7 @@ export default class ZdyTable extends Component { ...@@ -548,33 +550,7 @@ export default class ZdyTable extends Component {
this.root = ref; this.root = ref;
}} }}
> >
{/* <NewWebTable
items={items}
checkAllHidden={this.checkAllHidden}
border={border}
isBorder={isBorder}
borderStyle={borderStyle}
fatherCode={fatherCode}
index={index}
datas={datas}
isEdit={isEdit}
currentFormKey={currentFormKey}
init={init}
get={get}
obj={obj}
mapData={mapData}
form={this.props.form}
sqlData={sqlData}
defaultValues={defaultValues}
width={width}
formCode={formCode}
style={style}
routerState={routerState} // 兼容表单设计器路由传参
messageData={messageData} // 场景设计器共享变量参数
formId={formId}
fatherObj={this.props.fatherObj}
max={max}
/> */}
<table <table
style={{ style={{
overflow: 'auto', overflow: 'auto',
...@@ -639,6 +615,8 @@ export default class ZdyTable extends Component { ...@@ -639,6 +615,8 @@ export default class ZdyTable extends Component {
<TableCom <TableCom
formCode={formCode} // 当前表单code formCode={formCode} // 当前表单code
modalInit={modalInit} modalInit={modalInit}
taskAssignee={taskAssignee}//提交人
userId={userId}
formId={formId} // 当前表单Id formId={formId} // 当前表单Id
i={i} // 当前组件下标 i={i} // 当前组件下标
j={j} // 当前行数下班 j={j} // 当前行数下班
...@@ -733,6 +711,8 @@ export default class ZdyTable extends Component { ...@@ -733,6 +711,8 @@ export default class ZdyTable extends Component {
}) })
: ''} : ''}
<IsNewTable <IsNewTable
taskAssignee={taskAssignee}//提交人
userId={userId}
isRowCol={isRowCol} isRowCol={isRowCol}
modalInit={modalInit} modalInit={modalInit}
items={items} items={items}
......
...@@ -34,6 +34,7 @@ export default class isNewTable extends Component { ...@@ -34,6 +34,7 @@ export default class isNewTable extends Component {
style, style,
modalInit, modalInit,
concealModel, concealModel,
taskAssignee,
} = this.props; } = this.props;
if (!isEdit) { if (!isEdit) {
// 展示栏 暂不做处理 // 展示栏 暂不做处理
...@@ -71,6 +72,8 @@ export default class isNewTable extends Component { ...@@ -71,6 +72,8 @@ export default class isNewTable extends Component {
}} }}
> >
<TableCom <TableCom
taskAssignee={taskAssignee}//提交人
userId={userId}
modalInit={modalInit} modalInit={modalInit}
formCode={formCode} formCode={formCode}
formId={formId} formId={formId}
...@@ -140,6 +143,7 @@ export default class isNewTable extends Component { ...@@ -140,6 +143,7 @@ export default class isNewTable extends Component {
<> <>
<TableCom <TableCom
formCode={formCode} formCode={formCode}
taskAssignee={taskAssignee}
formId={formId} formId={formId}
i={i} i={i}
j={j} j={j}
...@@ -181,6 +185,7 @@ export default class isNewTable extends Component { ...@@ -181,6 +185,7 @@ export default class isNewTable extends Component {
<> <>
<TableCom <TableCom
formCode={formCode} formCode={formCode}
taskAssignee={taskAssignee}
formId={formId} formId={formId}
i={i} i={i}
j={j} j={j}
...@@ -252,6 +257,7 @@ export default class isNewTable extends Component { ...@@ -252,6 +257,7 @@ export default class isNewTable extends Component {
}} }}
> >
<TableCom <TableCom
taskAssignee={taskAssignee}
modalInit={modalInit} modalInit={modalInit}
formCode={formCode} formCode={formCode}
formId={formId} formId={formId}
...@@ -298,6 +304,7 @@ export default class isNewTable extends Component { ...@@ -298,6 +304,7 @@ export default class isNewTable extends Component {
}} }}
> >
<TableCom <TableCom
taskAssignee={taskAssignee}
modalInit={modalInit} modalInit={modalInit}
formCode={formCode} formCode={formCode}
formId={formId} formId={formId}
......
/**
* web端表格
*/
import React, { Component } from 'react'
import { Row, Col } from 'antd';
import TableCom from '../tableCompon/index';
export default class isNewWebTable extends Component {
render() {
const {
items,
checkAllHidden,
isBorder,
borderStyle,
fatherCode,
index,
datas,
isEdit,
border,
currentFormKey,
init,
get,
obj,
mapData,
form,
sqlData,
defaultValues,
width,
routerState,
messageData,
formCode,
formId,
fatherObj,
style,
max,
modalInit
} = this.props
return (
<div
style={{
overflow: "auto",
margin: "auto" ,
border: border?'1px solid #333':'',
...style
}}
>
{items.map((row, i) => {
const allhidden = checkAllHidden(row)
return <Row
key={i}>
{row.map((cell, j) => {
let styles = {}
console.log(cell)
if (cell.content && cell.content.styles) {
try {
styles = JSON.parse(cell.content.styles)
} catch (e) {
console.log(`第${i}行第${j}列样式配置有误,${e}`)
}
}
return !allhidden && cell.hidden ?
""
: <Col
style={{
minWidth:200
}}
span={6}
key={j}
style={{
overflow: "auto",
width: i == 0 ?
((cell.content != null && cell.content.cwidth != null ? cell.content.cwidth : width) * (cell.col ? cell.col : 1))
: width * (cell.col ? cell.col : 1),
textAlign: cell.content && cell.content.calign ? cell.content.calign : "left",
...isBorder ? (cell?.content?.comName == "InputHidden" || !cell?.content?.comName ? {} : borderStyle) : {},
...styles
}} >
<TableCom
formCode={formCode} // 当前表单code
formId={formId} // 当前表单Id
i={i} // 当前组件下标
j={j} // 当前行数下班
fatherCode={fatherCode}
index={index}
fatherObj={fatherObj}
datas={datas}
uuid={cell.uuid}
isEdit={isEdit}
formKey={currentFormKey}
init={init}
modalInit={modalInit}
get={get} // 区分移动端或wen端
json={cell.content}
obj={obj || {}} // 是否存在默认值
mapData={mapData}
form={form} // antd form控件
sqlData={sqlData}
defaultValues={defaultValues || {}} // 接口中的默认值
routerState={routerState} // 兼容表单设计器路由传参
messageData={messageData} // 场景设计器共享变量参数
/>
</Col>
}
)
}
</Row>
})}
</div>
)
}
}
...@@ -303,6 +303,10 @@ export default class tableCom extends Component { ...@@ -303,6 +303,10 @@ export default class tableCom extends Component {
}; };
getRender = (com, props) => { getRender = (com, props) => {
if (com == 'p') return <p {...props} />;
if (com == 'ul') return <ul {...props} />;
if (com == 'li') return <li {...props} />;
if (com == 'video') return <video {...props} />;
if (com == 'span') return <span {...props} />; if (com == 'span') return <span {...props} />;
if (com == 'a') return <a {...props} />; if (com == 'a') return <a {...props} />;
if (com == 'div') return <div {...props} />; if (com == 'div') return <div {...props} />;
...@@ -1159,6 +1163,8 @@ export default class tableCom extends Component { ...@@ -1159,6 +1163,8 @@ export default class tableCom extends Component {
formCode: this.props.formCode, formCode: this.props.formCode,
formId: this.props.formId, formId: this.props.formId,
isEdit: this.props.isEdit, isEdit: this.props.isEdit,
taskAssignee:this.props.taskAssignee,
userId:this.props.userId
}, },
this.props.index, this.props.index,
this.props.fatherCode, this.props.fatherCode,
...@@ -1447,6 +1453,8 @@ export default class tableCom extends Component { ...@@ -1447,6 +1453,8 @@ export default class tableCom extends Component {
formKey, formKey,
isEdit, isEdit,
datas, datas,
taskAssignee,
userId
} = this.props; } = this.props;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state; const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form; const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
...@@ -1456,7 +1464,7 @@ export default class tableCom extends Component { ...@@ -1456,7 +1464,7 @@ export default class tableCom extends Component {
return <></>; return <></>;
} }
//私有 //私有
if(permRank==1){ if(!isEdit&&permRank==1&&taskAssignee!=userId){
return <></>; return <></>;
} }
if (json.comName == 'QRCode') { if (json.comName == 'QRCode') {
...@@ -1496,6 +1504,8 @@ export default class tableCom extends Component { ...@@ -1496,6 +1504,8 @@ export default class tableCom extends Component {
initialValue: fk, initialValue: fk,
})(<Input type="hidden" />)}{' '} })(<Input type="hidden" />)}{' '}
<ZdyTable <ZdyTable
taskAssignee={taskAssignee}
userId={userId}
key={fk} key={fk}
modalInit={modalInit} modalInit={modalInit}
datas={datas} datas={datas}
...@@ -3087,6 +3097,8 @@ export default class tableCom extends Component { ...@@ -3087,6 +3097,8 @@ export default class tableCom extends Component {
title={modalTitle} title={modalTitle}
> >
<ZdyTable <ZdyTable
taskAssignee={taskAssignee}
userId={userId}
modalInit={modalInit} modalInit={modalInit}
key={modalCode} key={modalCode}
datas={datas} datas={datas}
...@@ -3169,6 +3181,8 @@ export default class tableCom extends Component { ...@@ -3169,6 +3181,8 @@ export default class tableCom extends Component {
title={modalTitle} title={modalTitle}
> >
<ZdyTable <ZdyTable
taskAssignee={taskAssignee}
userId={userId}
modalInit={modalInit} modalInit={modalInit}
key={modalCode} key={modalCode}
datas={datas} datas={datas}
...@@ -3201,6 +3215,8 @@ export default class tableCom extends Component { ...@@ -3201,6 +3215,8 @@ export default class tableCom extends Component {
title={modalTitle} title={modalTitle}
> >
<ZdyTable <ZdyTable
taskAssignee={taskAssignee}
userId={userId}
modalInit={modalInit} modalInit={modalInit}
key={modalCode} key={modalCode}
datas={datas} datas={datas}
...@@ -3241,6 +3257,8 @@ export default class tableCom extends Component { ...@@ -3241,6 +3257,8 @@ export default class tableCom extends Component {
title={modalTitle} title={modalTitle}
> >
<ZdyTable <ZdyTable
taskAssignee={taskAssignee}
userId={userId}
modalInit={modalInit} modalInit={modalInit}
key={modalCode} key={modalCode}
datas={datas} datas={datas}
...@@ -3275,6 +3293,8 @@ export default class tableCom extends Component { ...@@ -3275,6 +3293,8 @@ export default class tableCom extends Component {
title={modalTitle} title={modalTitle}
> >
<ZdyTable <ZdyTable
taskAssignee={taskAssignee}
userId={userId}
modalInit={modalInit} modalInit={modalInit}
key={modalCode} key={modalCode}
datas={datas} datas={datas}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论