提交 92b7c78c authored 作者: 钟是志's avatar 钟是志

一站式bug修改. this.initExcel 方法

可能存在其他问题 要喊欢哥确认
上级 d2568fef
......@@ -13,12 +13,13 @@ import { HyperFormula } from 'hyperformula';
import TableCom from '../tableCompon';
import IsNewTable from './isNewMobileTable';
import maintain from '../assets/maintain.png';
export default class ZdyTable extends Component {
constructor(props) {
super(props);
this.state = {
isChange:false,
isChange: false,
selects: new Map(),
left: 0,
top: 0,
......@@ -54,11 +55,14 @@ export default class ZdyTable extends Component {
} = this.props;
if (isPreview || isChild) {
this.initExcel({ datas: this.props.datas, trees: this.props.trees },()=>this.setState({ ...this.state,
...this.props,
formConfig: { ...this.state.formConfig, style: this.props.style }, isReady: true,}));
this.initExcel({ datas: this.props.datas, trees: this.props.trees }, () => {
this.setState(
{
...this.state,
...this.props,
formConfig: { ...this.state.formConfig, style: this.props.style }, isReady: true,
});
});
return;
}
......@@ -203,7 +207,7 @@ export default class ZdyTable extends Component {
? this.props.formKey
: val.taskFormKey
? val.taskFormKey
: obj.init
: obj.init;
this.setState(
{
appId: val.id,
......@@ -235,7 +239,7 @@ export default class ZdyTable extends Component {
if (isQRCode) {
this.props.form.setFieldsValue(formDeafault);
}
this.initExcel(obj)
this.initExcel(obj);
},
);
} catch (e) {
......@@ -243,15 +247,16 @@ export default class ZdyTable extends Component {
}
}
importExcel = (res) => {
const{datas,trees} = this.configs
const sheets = res.sheets
const { datas, trees } = this.configs;
const sheets = res.sheets;
for (var s = 0; s < sheets.length; s++) {
const uuid = sheets[s].key;
const items = []
const cc = sheets[s].cells
const items = [];
const cc = sheets[s].cells;
for (var i = 0; i < cc.length; i++) {
const rows = [];
const rr = cc[i];
......@@ -297,7 +302,7 @@ export default class ZdyTable extends Component {
}
}
if(datas[uuid]==null){
if (datas[uuid] == null) {
trees.push({ title: sheets[s].name, key: uuid });
}
datas[uuid] = {
......@@ -308,142 +313,185 @@ export default class ZdyTable extends Component {
};
}
this.initExcel({ datas, trees },()=>this.setState({isChange:!this.state.isChange}))
console.log("公式导入excel成功")
this.initExcel({ datas, trees }, () => this.setState({ isChange: !this.state.isChange }));
console.log('公式导入excel成功');
}
};
hfInstance;
childExcel = (sheetData, datas, tr) => {
if (tr.children == null || tr.children.length == 0) {
hfInstance;
childExcel = (sheetData, datas, tr) => {
if (tr.children == null || tr.children.length == 0) {
} else {
for (var c = 0; c < tr.children.length; c++) {
this.childExcel(sheetData, datas, tr.children[c])
} else {
for (var c = 0; c < tr.children.length; c++) {
this.childExcel(sheetData, datas, tr.children[c]);
}
}
}
const data = datas[tr.key]
const all = []
for (var i = 0; i < data.items.length; i++) {
const row = data.items[i]
const r = []
for (var j = 0; j < row.length; j++) {
const col = row[j]
if (col.content?.comName == "Excel") {
r.push(col.content.initialValue)
} else {
r.push('')
const data = datas[tr.key];
const all = [];
for (var i = 0; i < data.items.length; i++) {
const row = data.items[i];
const r = [];
for (var j = 0; j < row.length; j++) {
const col = row[j];
if (col.content?.comName == 'Excel') {
r.push(col.content.initialValue);
} else {
r.push('');
}
}
all.push(r);
}
sheetData[tr.title] = all;
};
configs;
initExcel = (configs, callback) => {
if (configs == null || configs.trees == null){
if (callback) callback();
return ;
}
all.push(r)
}
sheetData[tr.title] = all
if (configs.trees != null) this.configs = configs;
}
configs
initExcel = (configs, callback) => {
const sheetData = {};
for (var key in configs.trees) {
if (configs == null || configs.trees == null) return
const tr = configs.trees[key];
this.childExcel(sheetData, configs.datas, tr);
}
if(configs.trees!=null) this.configs=configs
const hfInstance = HyperFormula.buildFromSheets(sheetData, {});
const sheetData = {}
for (var key in configs.trees) {
this.hfInstance = hfInstance;
if (callback) callback();
};
getCellValue = (i, j, currentTitle) => {
let hfInstance = this.props.hfInstance ? this.props.hfInstance : this.hfInstance;
const tr = configs.trees[key]
this.childExcel(sheetData, configs.datas, tr)
}
const hfInstance = HyperFormula.buildFromSheets(sheetData, {});
this.hfInstance = hfInstance
if (callback) callback()
}
getCellValue = (i, j, currentTitle) => {
let hfInstance = this.props.hfInstance?this.props.hfInstance:this.hfInstance
if (hfInstance && currentTitle) {
let x = hfInstance.getCellValue({ col: j, row: i, sheet: hfInstance.getSheetId(currentTitle) })
let x = hfInstance.getCellValue({ col: j, row: i, sheet: hfInstance.getSheetId(currentTitle) });
if (x && x.value != null) {
x = x.value
x = x.value;
}
return x;
}
}
componentWillReceiveProps(nextProps) {
const {
postData, // 数据源
isCg, // 用户点击草稿页面进入
isForm,
isPreview, // 是否为预览模式
isChild, // 是否为子表单
} = nextProps;
if (isPreview || isChild) {
this.setState({
...this.state,
...nextProps,
isReady: true,
formConfig: { ...this.state.formConfig, style: nextProps.style },
},()=>this.initExcel({ datas: nextProps.datas, trees: nextProps.trees }));
};
componentWillReceiveProps(nextProps) {
const {
postData, // 数据源
isCg, // 用户点击草稿页面进入
isForm,
isPreview, // 是否为预览模式
isChild, // 是否为子表单
} = nextProps;
return;
}
if (isPreview || isChild) {
this.setState({
...this.state,
...nextProps,
isReady: true,
formConfig: { ...this.state.formConfig, style: nextProps.style },
}, () => this.initExcel({ datas: nextProps.datas, trees: nextProps.trees }));
return;
}
try {
const val = postData;
/**
* 数据源不同进行以下区别处理
* this.props.table有传入值表明需要渲染流程中最新表单
*/
if (isForm) {
// 由表格的操作按钮进入
const mapData = {};
const sqlData = {};
const dataObjs = val.form.dataObjModels;
for (var i = 0; i < dataObjs.length; i++) {
const dob = dataObjs[i];
for (var j = 0; j < dob.columnModels.length; j++) {
mapData[dob.columnModels[j].base52] = dob.columnModels[j];
try {
const val = postData;
/**
* 数据源不同进行以下区别处理
* this.props.table有传入值表明需要渲染流程中最新表单
*/
if (isForm) {
// 由表格的操作按钮进入
const mapData = {};
const sqlData = {};
const dataObjs = val.form.dataObjModels;
for (var i = 0; i < dataObjs.length; i++) {
const dob = dataObjs[i];
for (var j = 0; j < dob.columnModels.length; j++) {
mapData[dob.columnModels[j].base52] = dob.columnModels[j];
}
}
const sqls = val.form.sqlModels;
for (var i = 0; i < sqls.length; i++) {
const dob = sqls[i].dataObjModel;
for (var j = 0; j < dob.columnModels.length; j++) {
sqlData[dob.columnModels[j].base52] = dob.columnModels[j];
}
}
const obj = JSON.parse(val.form.content);
const xxx = obj.datas[obj.init];
this.setState({
datas: obj.datas,
width: this.props.table ? obj.datas[val.formKey].width : xxx.width,
isRowCol: this.props.table ? obj.datas[val.formKey].isRowCol : xxx.isRowCol,
isBorder: this.props.table ? obj.datas[val.formKey].isBorder : xxx.isBorder,
mapData,
currentFormKey: this.props.table ? val.formKey : obj.init,
currentFormTitle: this.getCurrentFormTitle(obj, fk),
sqlData,
isEdit: !this.props.formKey,
items: this.props.table ? obj.datas[val.formKey].items : xxx.items,
defaultValues: val.form.defaultValues,
appId: val.appId,
isReady: true,
formConfig: xxx,
}, () => this.initExcel(obj));
return;
}
const sqls = val.form.sqlModels;
for (var i = 0; i < sqls.length; i++) {
const dob = sqls[i].dataObjModel;
for (var j = 0; j < dob.columnModels.length; j++) {
sqlData[dob.columnModels[j].base52] = dob.columnModels[j];
if (isCg === 'yes') {
// 用户从编辑按钮进入
const mapData = {};
const sqlData = {};
const sqls = val.unifiedServicePatternModel.sqlModels;
for (var i = 0; i < sqls.length; i++) {
const dob = sqls[i].dataObjModel;
for (var j = 0; j < dob.columnModels.length; j++) {
sqlData[dob.columnModels[j].base52] = dob.columnModels[j];
}
}
const dataObjs = val.unifiedServicePatternModel.dataObjModels;
for (var i = 0; i < dataObjs.length; i++) {
const dob = dataObjs[i];
for (var j = 0; j < dob.columnModels.length; j++) {
mapData[dob.columnModels[j].base52] = dob.columnModels[j];
}
}
const obj = JSON.parse(val.unifiedServicePatternModel.content);
const xxx = obj.datas[obj.init];
this.setState({
items: xxx.items,
init: { ...this.state.init, ...JSON.parse(val.content) },
datas: obj.datas,
isEdit: !this.props.formKey,
currentFormKey: obj.init,
currentFormTitle: this.getCurrentFormTitle(obj, obj.init),
width: xxx.width,
isBorder: xxx.isBorder,
isRowCol: xxx.isRowCol,
mapData,
sqlData,
defaultValues: val.unifiedServicePatternModel.defaultValues,
appId: val.appId,
isReady: true,
formConfig: xxx,
defaultBinds: this.props.table
? obj.datas[val.taskFormKey].defaultBinds
: xxx.defaultBinds,
}, () => this.initExcel(obj));
return;
}
const obj = JSON.parse(val.form.content);
const xxx = obj.datas[obj.init];
this.setState({
datas: obj.datas,
width: this.props.table ? obj.datas[val.formKey].width : xxx.width,
isRowCol: this.props.table ? obj.datas[val.formKey].isRowCol : xxx.isRowCol,
isBorder: this.props.table ? obj.datas[val.formKey].isBorder : xxx.isBorder,
mapData,
currentFormKey: this.props.table ? val.formKey : obj.init,
currentFormTitle: this.getCurrentFormTitle(obj, fk),
sqlData,
isEdit: !this.props.formKey,
items: this.props.table ? obj.datas[val.formKey].items : xxx.items,
defaultValues: val.form.defaultValues,
appId: val.appId,
isReady: true,
formConfig: xxx,
}, () => this.initExcel(obj));
return;
}
if (isCg === 'yes') {
// 用户从编辑按钮进入
const mapData = {};
const sqlData = {};
const sqls = val.unifiedServicePatternModel.sqlModels;
......@@ -463,246 +511,208 @@ componentWillReceiveProps(nextProps) {
}
}
const obj = JSON.parse(val.unifiedServicePatternModel.content);
const xxx = obj.datas[obj.init];
const xxx = obj.datas[this.props.formKey ? this.props.formKey : obj.init]; // 是否是存在历史表单传入值
const fk = this.props.formKey
? this.props.formKey
: val.taskFormKey
? val.taskFormKey
: obj.init;
this.setState({
items: xxx.items,
init: { ...this.state.init, ...JSON.parse(val.content) },
appId: val.id,
datas: obj.datas,
isEdit: !this.props.formKey,
currentFormKey: obj.init,
currentFormTitle: this.getCurrentFormTitle(obj, obj.init),
width: xxx.width,
isBorder: xxx.isBorder,
isRowCol: xxx.isRowCol,
mapData,
sqlData,
defaultValues: val.unifiedServicePatternModel.defaultValues,
appId: val.appId,
isEdit: !this.props.formKey,
currentFormKey: fk,
currentFormTitle: this.getCurrentFormTitle(obj, fk),
defaultBinds: this.props.table ? obj.datas[val.taskFormKey].defaultBinds : xxx.defaultBinds,
width: this.props.table ? obj.datas[val.taskFormKey].width : xxx.width,
isBorder: this.props.table ? obj.datas[val.taskFormKey].isBorder : xxx.isBorder,
isRowCol: this.props.table ? obj.datas[val.taskFormKey].isRowCol : xxx.isRowCol,
items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items,
isReady: true,
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) },
formConfig: xxx,
defaultBinds: this.props.table
? obj.datas[val.taskFormKey].defaultBinds
: xxx.defaultBinds,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
}, () => this.initExcel(obj));
return;
} catch (e) {
console.log('公式配置有误', e);
}
const mapData = {};
const sqlData = {};
const sqls = val.unifiedServicePatternModel.sqlModels;
for (var i = 0; i < sqls.length; i++) {
const dob = sqls[i].dataObjModel;
for (var j = 0; j < dob.columnModels.length; j++) {
sqlData[dob.columnModels[j].base52] = dob.columnModels[j];
}
checkAllHidden = row => {
for (var i = 0; i < row.length; i++) {
if (row[i].hidden == null || !row[i].hidden) {
return false;
}
}
const dataObjs = val.unifiedServicePatternModel.dataObjModels;
for (var i = 0; i < dataObjs.length; i++) {
const dob = dataObjs[i];
for (var i = 0; i < row.length; i++) {
delete row[i].hidden;
}
return true;
};
for (var j = 0; j < dob.columnModels.length; j++) {
mapData[dob.columnModels[j].base52] = dob.columnModels[j];
countMax = items => {
let max = 0;
items.forEach(r => {
if (r.length > max) {
max = r.length;
}
}
const obj = JSON.parse(val.unifiedServicePatternModel.content);
const xxx = obj.datas[this.props.formKey ? this.props.formKey : obj.init]; // 是否是存在历史表单传入值
const fk = this.props.formKey
? this.props.formKey
: val.taskFormKey
? val.taskFormKey
: obj.init
this.setState({
appId: val.id,
datas: obj.datas,
mapData,
sqlData,
defaultValues: val.unifiedServicePatternModel.defaultValues,
isEdit: !this.props.formKey,
currentFormKey: fk,
currentFormTitle: this.getCurrentFormTitle(obj, fk),
defaultBinds: this.props.table ? obj.datas[val.taskFormKey].defaultBinds : xxx.defaultBinds,
width: this.props.table ? obj.datas[val.taskFormKey].width : xxx.width,
isBorder: this.props.table ? obj.datas[val.taskFormKey].isBorder : xxx.isBorder,
isRowCol: this.props.table ? obj.datas[val.taskFormKey].isRowCol : xxx.isRowCol,
items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items,
isReady: true,
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) },
formConfig: xxx,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
}, () => this.initExcel(obj));
} catch (e) {
console.log('公式配置有误', e);
}
}
});
return max;
};
getCurrentFormTitle = (obj, key) => {
checkAllHidden = row => {
for (var i = 0; i < row.length; i++) {
if (row[i].hidden == null || !row[i].hidden) {
return false;
}
}
for (var i = 0; i < row.length; i++) {
delete row[i].hidden;
}
return true;
};
countMax = items => {
let max = 0;
items.forEach(r => {
if (r.length > max) {
max = r.length;
}
});
return max;
};
getCurrentFormTitle = (obj, key) => {
if (obj == null) return;
const { trees } = obj;
if (trees == null) return;
return this.getT(trees, key);
if(obj==null) return
const { trees } = obj
if(trees==null) return
return this.getT(trees,key)
};
getCurrentFormTitle2 = (key) => {
if (this.configs == null) return;
const { trees } = this.configs;
if (trees == null) return;
return this.getT(trees, key);
}
getCurrentFormTitle2 = ( key) => {
if(this.configs==null) return
const { trees } = this.configs
if(trees==null) return
return this.getT(trees,key)
};
getT = (trees, key) => {
for (var i = 0; i < trees.length; i++) {
}
getT=(trees,key)=>{
for (var i = 0; i < trees.length; i++) {
if (trees[i].children == null || trees[i].children.length == 0) {
if(trees[i].children==null||trees[i].children.length==0){
if (trees[i].key == key) {
return trees[i].title;
}
} else {
if (trees[i].key == key) {
return trees[i].title
return this.getT(trees[i].children, key);
}
}else{
}
};
render() {
return this.getT(trees[i].children,key)
const {
width,
isRowCol,
isBorder,
sqlData,
mapData,
defaultBinds,
defaultValues,
items,
init,
modalTitle,
currentFormKey,
currentFormTitle,
isEdit,
datas,
isReady,
formConfig,
formCode,
formId,
} = this.state;
const {
border,
get,
obj,
index,
fatherCode,
routerState, // 场景设计器共享路由参数
messageData, // 场景设计器共享变量参数 设计器监听到参数发生变化后会重新渲染组件
postData,
modalInit,
concealModel, // 场景设计器内置跳转函数
paddingBottom,
taskAssignee,
userId,
isDynamic, // 是否为大数据页面
isWebPrint, // 打印界面
isWebPrintEnd,
isPreview,
} = this.props;
let style = {};
if (formConfig.style != null) {
try {
style = JSON.parse(formConfig.style);
} catch (e) {
console.log(e);
style = {};
}
}
}
}
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 24 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 24 },
},
};
const max = this.countMax(items);
const borderStyle = {
borderRight: '1px solid gray',
borderTop: '1px solid gray',
borderLeft: '1px solid gray',
borderBottom: '1px solid gray',
};
const borderStyleTwo = {
// 处理隐藏组件边框样式问题
borderRight: '1px solid gray',
borderLeft: '1px solid gray',
borderTop: '1px solid gray',
};
let updateTime;
const styleDiv = this.props.height
? {
overflow: isDynamic ? 'hidden' : 'auto',
// overflowY: isDynamic && 'auto',
width: '100%',
height: this.props.height,
paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
}
: {
overflow: isDynamic ? 'hidden' : 'auto',
// overflowY: isDynamic && 'auto',
width: '100%',
paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
};
render() {
const {
width,
isRowCol,
isBorder,
sqlData,
mapData,
defaultBinds,
defaultValues,
items,
init,
modalTitle,
currentFormKey,
currentFormTitle,
isEdit,
datas,
isReady,
formConfig,
formCode,
formId,
} = this.state;
const {
border,
get,
obj,
index,
fatherCode,
routerState, // 场景设计器共享路由参数
messageData, // 场景设计器共享变量参数 设计器监听到参数发生变化后会重新渲染组件
postData,
modalInit,
concealModel, // 场景设计器内置跳转函数
paddingBottom,
taskAssignee,
userId,
isDynamic, // 是否为大数据页面
isWebPrint, // 打印界面
isWebPrintEnd,
isPreview
} = this.props;
let style = {};
if (formConfig.style != null) {
try {
style = JSON.parse(formConfig.style);
} catch (e) {
console.log(e);
style = {};
if (currentFormKey) {
console.log(currentFormKey);
}
}
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 24 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 24 },
},
};
const max = this.countMax(items);
const borderStyle = {
borderRight: '1px solid gray',
borderTop: '1px solid gray',
borderLeft: '1px solid gray',
borderBottom: '1px solid gray',
};
const borderStyleTwo = {
// 处理隐藏组件边框样式问题
borderRight: '1px solid gray',
borderLeft: '1px solid gray',
borderTop: '1px solid gray',
};
let updateTime;
const styleDiv = this.props.height
? {
overflow: isDynamic ? 'hidden' : 'auto',
// overflowY: isDynamic && 'auto',
width: '100%',
height: this.props.height,
paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
if (!isReady) return <></>;
if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll');
}
: {
overflow: isDynamic ? 'hidden' : 'auto',
// overflowY: isDynamic && 'auto',
width: '100%',
paddingBottom: paddingBottom != null ? paddingBottom : isWebPrint ? 0 : '10px',
};
if (!isReady) return <></>;
if (this.props.postData?.isUpdate) {
updateTime = moment(+this.props.postData?.updateTime).format('llll');
}
switch (get) {
case 'web':
return (
<>
{this.props.postData?.isUpdate ? (
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ marginRight: 30 }} src={maintain}></img>
switch (get) {
case 'web':
return (
<>
{this.props.postData?.isUpdate ? (
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ marginRight: 30 }} src={maintain}></img>
</div>
<p
style={{
textAlign: 'center',
width: '100%',
fontSize: '16px',
fontWeight: 'bold',
color: '#666666',
}}
>
{updateTime !== 'Invalid date'
? `升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
: '请耐心等待'}
</p>
</div>
<p
style={{
textAlign: 'center',
width: '100%',
fontSize: '16px',
fontWeight: 'bold',
color: '#666666',
}}
>
{updateTime !== 'Invalid date'
? `升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
: '请耐心等待'}
</p>
</div>
) : (
) : (
<div id="web_table">
<Form className="login-form">
{isEdit && defaultBinds
......@@ -726,7 +736,7 @@ render() {
return this.props.form.getFieldDecorator(name, {
initialValue: value,
})(<Input type="hidden" />);
})(<Input type="hidden"/>);
})
: ''}
......@@ -750,140 +760,140 @@ render() {
cellPadding="0"
>
<tbody>
{items.map((row, i) => {
const allhidden = this.checkAllHidden(row);
return (
<tr key={i}>
{row.map((cell, j) => {
if (!cell.content) {
return;
{items.map((row, i) => {
const allhidden = this.checkAllHidden(row);
return (
<tr key={i}>
{row.map((cell, j) => {
if (!cell.content) {
return;
}
let styles = {};
if (cell.content && cell.content.styles) {
try {
styles = JSON.parse(cell.content.styles);
} catch (e) {
console.log(`第${i}行第${j}列样式配置有误,${e}`);
}
let styles = {};
if (cell.content && cell.content.styles) {
try {
styles = JSON.parse(cell.content.styles);
} catch (e) {
console.log(`第${i}行第${j}列样式配置有误,${e}`);
}
return !allhidden && cell.hidden ? (
''
) : (
<td
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)
}
}
return !allhidden && cell.hidden ? (
''
) : (
<td
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)
}
rowSpan={cell.row}
colSpan={cell.col}
key={j}
style={{
overflow: 'auto',
textAlign:
cell.content && cell.content.calign
? cell.content.calign
: 'left',
...(isBorder
? cell?.content?.comName == 'InputHidden' ||
!cell?.content?.comName
? {}
: borderStyle
: {}),
// position: cell.content&&cell.content.comName ==="InputHidden"&&'absolute',
...styles,
display:
cell.content &&
(cell.content.comName === 'InputHidden' ||
cell.content.isHidden) &&
'none',
}}
>
<TableCom
importExcel={this.importExcel}
getCellValue={this.getCellValue}
getCurrentFormTitle={this.getCurrentFormTitle2}
hfInstance={this.hfInstance}
isWebPrintEnd={isWebPrintEnd}
isWebPrint={isWebPrint}
isPrint={this.props.isPrint}
formCode={formCode} // 当前表单code
modalInit={modalInit}
taskAssignee={taskAssignee} // 提交人
userId={userId}
formId={formId} // 当前表单Id
i={i} // 当前组件下标
j={j} // 当前行数下班
isPreview={isPreview}
fatherCode={fatherCode}
index={index}
fatherObj={this.props.fatherObj}
datas={datas}
uuid={cell.uuid}
isEdit={isEdit}
formKey={currentFormKey}
currentFormTitle={currentFormTitle}
init={init}
get={get} // 区分移动端或wen端
json={cell.content}
obj={obj || {}} // 是否存在默认值
mapData={mapData}
form={this.props.form} // antd form控件
sqlData={sqlData}
defaultValues={defaultValues || {}} // 接口中的默认值
routerState={routerState} // 兼容表单设计器路由传参
messageData={messageData} // 场景设计器共享变量参数
concealModel={concealModel || {}} // 场景设计器内置路由跳转函数
isDynamic={isDynamic} // 是否为场景配置器调用
/>
</td>
);
})}
</tr>
);
})}
rowSpan={cell.row}
colSpan={cell.col}
key={j}
style={{
overflow: 'auto',
textAlign:
cell.content && cell.content.calign
? cell.content.calign
: 'left',
...(isBorder
? cell?.content?.comName == 'InputHidden' ||
!cell?.content?.comName
? {}
: borderStyle
: {}),
// position: cell.content&&cell.content.comName ==="InputHidden"&&'absolute',
...styles,
display:
cell.content &&
(cell.content.comName === 'InputHidden' ||
cell.content.isHidden) &&
'none',
}}
>
<TableCom
importExcel={this.importExcel}
getCellValue={this.getCellValue}
getCurrentFormTitle={this.getCurrentFormTitle2}
hfInstance={this.hfInstance}
isWebPrintEnd={isWebPrintEnd}
isWebPrint={isWebPrint}
isPrint={this.props.isPrint}
formCode={formCode} // 当前表单code
modalInit={modalInit}
taskAssignee={taskAssignee} // 提交人
userId={userId}
formId={formId} // 当前表单Id
i={i} // 当前组件下标
j={j} // 当前行数下班
isPreview={isPreview}
fatherCode={fatherCode}
index={index}
fatherObj={this.props.fatherObj}
datas={datas}
uuid={cell.uuid}
isEdit={isEdit}
formKey={currentFormKey}
currentFormTitle={currentFormTitle}
init={init}
get={get} // 区分移动端或wen端
json={cell.content}
obj={obj || {}} // 是否存在默认值
mapData={mapData}
form={this.props.form} // antd form控件
sqlData={sqlData}
defaultValues={defaultValues || {}} // 接口中的默认值
routerState={routerState} // 兼容表单设计器路由传参
messageData={messageData} // 场景设计器共享变量参数
concealModel={concealModel || {}} // 场景设计器内置路由跳转函数
isDynamic={isDynamic} // 是否为场景配置器调用
/>
</td>
);
})}
</tr>
);
})}
</tbody>
</table>
{style.pageBreakAfter != null ? (
<div style={{ pageBreakAfter: style.pageBreakAfter }}></div>
) : (
''
)}
''
)}
</div>
</Col>
</Row>
</Form>
</div>
)}
</>
);
case 'mobile':
return (
<>
{this.props.postData?.isUpdate ? (
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ width: '100%' }} src={maintain}></img>
</>
);
case 'mobile':
return (
<>
{this.props.postData?.isUpdate ? (
<div style={{ margin: '100px 24px 24px' }}>
<div style={{ textAlign: 'center' }}>
<img style={{ width: '100%' }} src={maintain}></img>
</div>
<p
style={{
textAlign: 'center',
width: '100%',
fontSize: '16px',
fontWeight: 'bold',
color: '#666666',
}}
>
{updateTime !== 'Invalid date'
? `升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
: '请耐心等待'}
</p>
</div>
<p
style={{
textAlign: 'center',
width: '100%',
fontSize: '16px',
fontWeight: 'bold',
color: '#666666',
}}
>
{updateTime !== 'Invalid date'
? `升级维护中,预计${updateTime ?? '一万年'}恢复使用,请耐心等待。`
: '请耐心等待'}
</p>
</div>
) : (
) : (
<Form {...formItemLayout} id="mobile_table" className="login-form">
{defaultBinds
? Object.keys(defaultBinds).map(k => {
......@@ -906,13 +916,13 @@ render() {
return this.props.form.getFieldDecorator(name, {
initialValue: value,
})(<Input type="hidden" />);
})(<Input type="hidden"/>);
})
: ''}
<IsNewTable
getCellValue={this.getCellValue}
hfInstance={this.hfInstance}
getCurrentFormTitle={this.getCurrentFormTitle2}
getCellValue={this.getCellValue}
hfInstance={this.hfInstance}
getCurrentFormTitle={this.getCurrentFormTitle2}
taskAssignee={taskAssignee} // 提交人
userId={userId}
importExcel={this.importExcel}
......@@ -949,8 +959,8 @@ render() {
</Form>
)}
</>
);
</>
);
}
}
}
}
......@@ -63,7 +63,7 @@ class StandardTable extends Component {
render() {
const { selectedRowKeys, needTotalList } = this.state;
const {
data: { list, pagination },
loading,
......@@ -81,7 +81,9 @@ class StandardTable extends Component {
showQuickJumper: true,
...pagination,
};
if(typeof paginationProps.total === 'string'){
paginationProps.total = Number(paginationProps.total) || 0;
}
const rowSelection = {
selectedRowKeys,
onChange: this.handleRowSelectChange,
......@@ -116,7 +118,13 @@ class StandardTable extends Component {
loading={loading}
rowKey={rowKey || 'key'}
rowSelection={typeof noSelectRow !== 'undefined' && noSelectRow ? null : rowSelection}
dataSource={list}
dataSource={list.map((x) => {
return {
id: Math.random() * 10000 + '',
...x,
}
})}
bordered={bordered}
columns={columns}
size="small"
......
......@@ -3,13 +3,7 @@ import {Button, Form, Input, InputNumber, Modal, Select} from "antd";
export default class FormModal extends React.Component {
render() {
return (
<Modal
destroyOnClose
......@@ -26,4 +20,3 @@ export default class FormModal extends React.Component {
);
}
}
\ No newline at end of file
......@@ -851,7 +851,7 @@ export default class tableCom extends Component {
delete params[i];
}
}
if (getToken() != null) {
params.token = getToken();
}
......@@ -1471,7 +1471,6 @@ export default class tableCom extends Component {
return <></>;
return <QRCode {...this.state.option} key={this.props.uuid} />;
}
if (json.comName == 'Echart') {
return (
<ReactEcharts
......@@ -1503,7 +1502,6 @@ export default class tableCom extends Component {
if (formKey == fk) {
return <>片段表单key不能和自身相同</>;
}
return (
<>
{this.props.form.getFieldDecorator(this.props.uuid, {
......@@ -3124,6 +3122,7 @@ export default class tableCom extends Component {
);
}
if (get === 'web') {
if (!isEdit) {
return (
<Row
......@@ -3200,6 +3199,7 @@ export default class tableCom extends Component {
</Row>
);
} else {
return (
<>
{modalCode ? (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论