@@ -2174,39 +1861,34 @@ class CommonTableRc extends React.Component {
// 判断拼板状态
if (commonUtils.isNotEmptyArr(sScheduleStatusJson) && commonUtils.isNotEmptyArr(dataSource)) {
this.useVListNew = true;
- sScheduleStatusJson[0].render = itemStr => {
+ sScheduleStatusJson[0].render = (itemStr) => {
if (commonUtils.isJSON(itemStr)) {
const itemJson = commonUtils.convertStrToObj(itemStr);
const itemLength = itemJson.length;
const content = itemJson.map((t, i) => {
- const { sState, sColor = "#000000", sName = "" } = t;
+ const { sState, sColor = '#000000', sName = '' } = t;
return (
-
- {sName}
- {i + 1 === itemLength ? "" :
}
+
+ {sName}{ i + 1 === itemLength ? '' : }
);
- });
+ })
return (
-
{
- return {content}
;
- }}
- >
- {content}
-
+ whiteSpace: 'nowrap',
+ width: 'auto',
+ maxWidth: '100%',
+ height: '29px',
+ overflow: 'hidden',
+ lineHeight: '29px',
+ textOverflow: 'ellipsis'
+ }}>
+
{
+ return {content}
+ }}>
+ {content}
+
);
}
@@ -2221,16 +1903,16 @@ class CommonTableRc extends React.Component {
}
let bPagination = true; /* 默认表格分页s */
if (commonUtils.isNotEmptyObject(this.props)) {
- bPagination = commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination);
+ bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination));
}
let noVlistController = false;
- if (this.props.config && this.props.config.gdsconfigformslave.filter(item => item.sControlName === "bNoVlist")[0]) {
+ if(this.props.config && this.props.config.gdsconfigformslave.filter(item => item.sControlName === 'bNoVlist')[0]) {
noVlistController = true;
}
/* 特殊情况的表格 在虚拟列表情况 会无法滑动 */
let noVlistTable = false;
- if (this.props.noVlistTable) {
+ if(this.props.noVlistTable) {
noVlistTable = true;
}
// 判断是否有合并单元格, 有的话默认关闭虚拟滚动
@@ -2251,26 +1933,22 @@ class CommonTableRc extends React.Component {
const { tableClassName } = this.state;
const oTable = document.querySelectorAll(`.${tableClassName}`)[0];
if (oTable) {
- const oBody = oTable.querySelector(".ant-table-body");
+ const oBody = oTable.querySelector('.ant-table-body');
oBody && (oBody.scrollTop = 0);
}
window.vlistNewSearh = null;
- this.Vcomponents = VListNew({
- height: this.scrollY,
- vid: this.uniqueId,
- onScroll: () => {
- setTimeout(() => {
- let divs = document.getElementsByClassName("noInputInsert");
- if (divs.length) {
- Array.prototype.forEach.call(divs, item => {
- item.parentNode.parentNode.parentNode.parentNode.classList.add("insertTd");
- });
- }
- }, 20);
- },
- });
+ this.Vcomponents = VListNew({height: this.scrollY, vid: this.uniqueId, onScroll: () => {
+ setTimeout(() => {
+ let divs = document.getElementsByClassName('noInputInsert');
+ if (divs.length) {
+ Array.prototype.forEach.call(divs, item => {
+ item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd');
+ });
+ }
+ }, 20);
+ }});
}
- components = { ...this.Vcomponents, ...components };
+ components = {...this.Vcomponents, ...components};
} else {
// vid是多个列表在同个页面中,同时渲染会促发问题
// vid不可以为随机数,随机数会导致双击时,点击的两个VList id不同
@@ -2281,51 +1959,46 @@ class CommonTableRc extends React.Component {
const { tableClassName } = this.state;
const oTable = document.querySelectorAll(`.${tableClassName}`)[0];
if (oTable) {
- const oBody = oTable.querySelector(".ant-table-body");
+ const oBody = oTable.querySelector('.ant-table-body');
oBody && (oBody.scrollTop = 0);
}
window.vlistNewSearh = null;
- this.Vcomponents1 = VList({
- height: this.scrollY,
- vid: this.uniqueId,
- rowKey: this.rowKey,
- onScroll: () => {
- setTimeout(() => {
- let divs = document.getElementsByClassName("noInputInsert");
- if (divs.length) {
- Array.prototype.forEach.call(divs, item => {
- item.parentNode.parentNode.parentNode.parentNode.classList.add("insertTd");
- });
- }
- }, 20);
- },
- });
+ this.Vcomponents1 = VList({ height: this.scrollY, vid: this.uniqueId, rowKey: this.rowKey, onScroll: () => {
+ setTimeout(() => {
+ let divs = document.getElementsByClassName('noInputInsert');
+ if (divs.length) {
+ Array.prototype.forEach.call(divs, item => {
+ item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd');
+ });
+ }
+ }, 20);
+ } });
}
components = { ...this.Vcomponents1, ...components };
}
}
if (this.props.config && this.props.config.iFreezeColumn) {
tableColumn.forEach((val, index) => {
- if (tableColumn[index].fixedHelp) {
+ if(tableColumn[index].fixedHelp) {
tableColumn[index].fixed = false;
tableColumn[index].fixedHelp = false;
}
if (index < this.props.config.iFreezeColumn) {
- tableColumn[index].fixed = "left";
+ tableColumn[index].fixed = 'left';
tableColumn[index].fixedHelp = true;
}
});
}
// 处理拖拽排序
if (this.props.dragHandle) {
- const handleSortTitle = commonFunc.showMessage(this.props.app.commonConst, "sort") || "排序";
- const handleSort = tableColumn.filter(item => item.dataIndex === "handleSort").length;
+ const handleSortTitle = commonFunc.showMessage(this.props.app.commonConst, 'sort') || '排序' ;
+ const handleSort = tableColumn.filter(item => item.dataIndex === 'handleSort').length;
if (tableColumn[0]) {
function arrayMoveMutable(array, fromIndex, toIndex) {
const startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex;
if (startIndex >= 0 && startIndex < array.length) {
const endIndex = toIndex < 0 ? array.length + toIndex : toIndex;
- if (commonUtils.isNotEmptyObject(array[fromIndex].sWorkOrderUsed)) {
+ if(commonUtils.isNotEmptyObject(array[fromIndex].sWorkOrderUsed)) {
message.error(array[fromIndex].sWorkOrderUsed);
return;
}
@@ -2338,7 +2011,7 @@ class CommonTableRc extends React.Component {
arrayMoveMutable(array, fromIndex, toIndex);
return array;
}
- const DragHandle = sortableHandle(() =>
);
+ const DragHandle = sortableHandle(() =>
);
const SortableItem = sortableElement(props =>
|
);
const SortableContainer = sortableContainer(props =>
);
const onSortEnd = ({ oldIndex, newIndex }) => {
@@ -2349,17 +2022,23 @@ class CommonTableRc extends React.Component {
}
};
const DraggableContainer = props => (
-
+
);
const DraggableBodyRow = ({ className, style, ...restProps }) => {
const { dataSource } = this.state;
// function findIndex base on Table rowKey props and should always be a right array index
- const index = dataSource.findIndex(x => x.index === restProps["data-row-key"]);
- return
;
+ const index = dataSource.findIndex(x => x.index === restProps['data-row-key']);
+ return
;
};
// 处理渲染后丢失input focus的bug.
- let bDrag = this.props.enabled && !this.props.bForbiddenDrag; /* 是否可以拖动 */
- if (bDrag) {
+ let bDrag = this.props.enabled && !this.props.bForbiddenDrag;/* 是否可以拖动 */
+ if(bDrag) {
if (!this.DraggableContainer) {
this.DraggableContainer = DraggableContainer;
}
@@ -2367,20 +2046,22 @@ class CommonTableRc extends React.Component {
this.DraggableBodyRow = DraggableBodyRow;
}
}
- if (!handleSort) {
- components = { ...components, body: { wrapper: this.DraggableContainer, row: this.DraggableBodyRow } };
+ if(!handleSort) {
+ components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}};
} else {
- components = { ...components, body: { wrapper: this.DraggableContainer, row: this.DraggableBodyRow } };
+ components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}};
tableColumn.shift();
}
- tableColumn.unshift({
- title: handleSortTitle,
- dataIndex: "handleSort",
- fixed: "left",
- width: 40,
- className: "drag-visible",
- render: () =>
,
- });
+ tableColumn.unshift(
+ {
+ title: handleSortTitle,
+ dataIndex: 'handleSort',
+ fixed: 'left',
+ width: 40,
+ className: 'drag-visible',
+ render: () =>
,
+ },
+ )
}
}
@@ -2394,9 +2075,9 @@ class CommonTableRc extends React.Component {
}
}
- let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getRowSelection(this.props.name, "slave"); // 是否选择多选框的问题
+ let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getRowSelection(this.props.name, 'slave'); // 是否选择多选框的问题
if (this.props.config && !this.props.config.bisMutiSelect) {
- rowSelection = null;
+ rowSelection = null
}
const { expKeys } = this.state;
@@ -2404,54 +2085,36 @@ class CommonTableRc extends React.Component {
return {
components,
rowKey: this.rowKey,
- size: "middle",
- bordered: true /* 显示边框 */,
- className: !this.props.enabled ? styles.disabledProup : styles.proup /* 样式控制 */,
- scroll: { x: "max-content" } /* 宽度 */,
- dataSource /* 数据 */,
- columns: tableColumn /* 表头 */,
+ size: 'middle',
+ bordered: true, /* 显示边框 */
+ className: !this.props.enabled ? styles.disabledProup : styles.proup, /* 样式控制 */
+ scroll: { x: 'max-content' }, /* 宽度 */
+ dataSource, /* 数据 */
+ columns: tableColumn, /* 表头 */
// rowSelection: this.props.rowSelection !== undefined ? this.props.rowSelection : this.getRowSelection(this.props.name, 'slave'), /* 添加的复选框(checkbox)功能 */
rowSelection,
// pagination: false, /* 不分页 */
- rowClassName: this.setRowClassName.bind(this, "slave"),
+ rowClassName: this.setRowClassName.bind(this, 'slave'),
onRow: (record, index) => {
if (this.isDragAndDrop) {
return {
index,
- onClick: () => {
- this.onRowClick(record, index, undefined, this.props.name, "slave");
- },
- onMouseEnter: () => {
- this.onRowMouseEnter(record);
- },
- onMouseLeave: () => {
- this.onRowMouseLeave(record);
- },
- onDoubleClick: () => {
- this.onDoubleClick(this.props.name, record);
- },
- moveRow: (dragIndex, hoverIndex, dragKey, hoverKey) => {
- this.moveRow(dragIndex, hoverIndex, dragKey, hoverKey);
- },
- onDragClick: type => {
- this.onRowClick(record, index, type, this.props.name, "slave");
+ onClick: () => { this.onRowClick(record, index, undefined, this.props.name, 'slave'); },
+ onMouseEnter: () => { this.onRowMouseEnter(record); },
+ onMouseLeave: () => { this.onRowMouseLeave(record); },
+ onDoubleClick: () => { this.onDoubleClick(this.props.name, record); },
+ moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => {
+ this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey);
},
+ onDragClick: (type) => { this.onRowClick(record, index, type, this.props.name, 'slave'); },
};
} else {
return {
index,
- onClick: () => {
- this.onRowClick(record, index, undefined, this.props.name, "slave");
- },
- onDoubleClick: () => {
- this.onDoubleClick(this.props.name, record);
- },
- onMouseEnter: () => {
- this.onRowMouseEnter(record);
- },
- onMouseLeave: () => {
- this.onRowMouseLeave();
- },
+ onClick: () => { this.onRowClick(record, index, undefined, this.props.name, 'slave'); },
+ onDoubleClick: () => { this.onDoubleClick(this.props.name, record); },
+ onMouseEnter: () => { this.onRowMouseEnter(record); },
+ onMouseLeave: () => { this.onRowMouseLeave(); },
};
}
},
@@ -2461,32 +2124,31 @@ class CommonTableRc extends React.Component {
const expKeysNew = [...expKeys, record[this.rowKey]];
this.currentExpKeys = expKeysNew;
this.setState({
- expKeys: expKeysNew,
+ expKeys: expKeysNew
});
} else {
const expKeysNew = expKeys.filter(item => item !== record[this.rowKey]);
this.currentExpKeys = expKeysNew;
this.setState({
- expKeys: expKeysNew,
+ expKeys: expKeysNew
});
}
}
- this.onExpand(expanded, record, "slave"); /* 点击展开图标时触发s */
+ this.onExpand(expanded, record, 'slave'); /* 点击展开图标时触发s */
},
expandedRowKeys: expKeys.length || this.showExpAll || this.isAllowConExpendKeys ? expKeys : null,
- id: commonUtils.isEmptyArr(dataSource) ? "unDataBox" : "dataBox" /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */,
+ id: commonUtils.isEmptyArr(dataSource) ?
+ 'unDataBox' :
+ 'dataBox', /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */
...this.props.tableProps,
- pagination: bPagination
- ? {
- ...this.props.tableProps.pagination,
- onChange: (current, size) => {
- this.curPagination = {
- current,
- pageSize: size,
- };
- },
+ pagination: bPagination ? {
+ ...this.props.tableProps.pagination,
+ onChange: (current, size) => {
+ this.curPagination = {
+ current, pageSize: size
}
- : false /* 表格是否分页 */,
+ }
+ } : false, /* 表格是否分页 */
onChange: this.onChange,
};
};
@@ -2494,21 +2156,20 @@ class CommonTableRc extends React.Component {
/** 获取子从表复选框对象的props */
getSlaveRowSelection = (name, type) => {
const { bMutiSelect } = this.props.slaveInfo; /* 显示单选框还是复选框 */
- let { bisMutiSelect } = this.props.slaveInfo; /* 是否显示选择框 */
+ let { bisMutiSelect } = this.props.slaveInfo; /* 是否显示选择框 */
if (this.props.slaveInfo.config) {
- bisMutiSelect = this.props.slaveInfo.config.bisMutiSelect;
+ bisMutiSelect = this.props.slaveInfo.config.bisMutiSelect
}
- if (name === "control" || (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.indexOf("commonAuto") > -1)) {
- // 控制表中可以通过bisMutiSelect显示或者隐藏勾选框
+ if (name === 'control' || (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.indexOf('commonAuto') > -1)) { // 控制表中可以通过bisMutiSelect显示或者隐藏勾选框
if (bisMutiSelect) {
return {
preserveSelectedRowKeys: true,
- selectedRowKeys: type === "slaveInfo" ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys /* 已选择的数据集 */,
- onChange: this.handleSelectRowChange.bind(this, name) /* 选择行发生改变时调用的函数 */,
+ selectedRowKeys: type === 'slaveInfo' ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys, /* 已选择的数据集 */
+ onChange: this.handleSelectRowChange.bind(this, name), /* 选择行发生改变时调用的函数 */
getCheckboxProps: record => ({
- style: record.bSum && commonConfig.hasSum ? { display: "none" } : { display: "checkbox" },
- }) /* 过滤合计的选择框 */,
- type: bMutiSelect ? this.props.rowSelectionType : "radio" /* checkbox or radio */,
+ style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' },
+ }), /* 过滤合计的选择框 */
+ type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */
columnWidth: 37,
};
} else {
@@ -2517,12 +2178,12 @@ class CommonTableRc extends React.Component {
} else {
return {
preserveSelectedRowKeys: true,
- selectedRowKeys: type === "slaveInfo" ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys /* 已选择的数据集 */,
- onChange: this.handleSelectRowChange.bind(this, name) /* 选择行发生改变时调用的函数 */,
+ selectedRowKeys: type === 'slaveInfo' ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys, /* 已选择的数据集 */
+ onChange: this.handleSelectRowChange.bind(this, name), /* 选择行发生改变时调用的函数 */
getCheckboxProps: record => ({
- style: record.bSum && commonConfig.hasSum ? { display: "none" } : { display: "checkbox" },
- }) /* 过滤合计的选择框 */,
- type: bMutiSelect ? this.props.rowSelectionType : "radio" /* checkbox or radio */,
+ style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' },
+ }), /* 过滤合计的选择框 */
+ type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */
columnWidth: 37,
};
}
@@ -2531,8 +2192,10 @@ class CommonTableRc extends React.Component {
/** 获取table对象的props */
getSlaveTableProps = () => {
/* 给数据都添加上key */
- if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === "Y") {
- const { dataSource, tableColumn, tableProps, name: slaveInfoName, config: slaveInfoConfig } = this.props.slaveInfo;
+ if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === 'Y') {
+ const {
+ dataSource, tableColumn, tableProps, name: slaveInfoName, config: slaveInfoConfig,
+ } = this.props.slaveInfo;
// const scrollHeight = parseInt(document.body.clientHeight - 400, 10);
const components = {};
if (this.isDragAndDrop) {
@@ -2542,46 +2205,45 @@ class CommonTableRc extends React.Component {
components.header = { cell: ResizeableTitle };
}
- let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getSlaveRowSelection(slaveInfoName, "slaveInfo");
- if (slaveInfoConfig && !slaveInfoConfig.bisMutiSelect) {
- /* 如果子表配置不显示选择框 则不显示选择框 */
+ let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getSlaveRowSelection(slaveInfoName, 'slaveInfo');
+ if (slaveInfoConfig && !slaveInfoConfig.bisMutiSelect) { /* 如果子表配置不显示选择框 则不显示选择框 */
rowSelection = null;
}
/* 返回值 */
return {
components,
rowKey: tableProps.rowKey,
- size: "small",
- bordered: true /* 显示边框 */,
- className: !this.props.enabled ? styles.disabledProup : styles.proup /* 样式控制 */,
- scroll: { x: "max-content" } /* 宽度 */,
- dataSource /* 数据 */,
- columns: tableColumn /* 表头 */,
- rowSelection: rowSelection /* s 添加的复选框(checkbox)功能 */,
- pagination: false /* 不分页 */,
- rowClassName: this.setRowClassName.bind(this, "slaveInfo"),
+ size: 'small',
+ bordered: true, /* 显示边框 */
+ className: !this.props.enabled ? styles.disabledProup : styles.proup, /* 样式控制 */
+ scroll: { x: 'max-content' }, /* 宽度 */
+ dataSource, /* 数据 */
+ columns: tableColumn, /* 表头 */
+ rowSelection: rowSelection, /* s 添加的复选框(checkbox)功能 */
+ pagination: false, /* 不分页 */
+ rowClassName: this.setRowClassName.bind(this, 'slaveInfo'),
onRow: (record, index) => {
if (this.isDragAndDrop) {
return {
index,
onClick: () => {
- this.onRowClick(record, index, undefined, slaveInfoName, "slaveInfo");
+ this.onRowClick(record, index, undefined, slaveInfoName, 'slaveInfo');
},
onDoubleClick: () => {
- this.onDoubleClick(record, index, undefined, slaveInfoName, "slaveInfo");
+ this.onDoubleClick(record, index, undefined, slaveInfoName, 'slaveInfo');
},
- moveRow: (dragIndex, hoverIndex, dragKey, hoverKey) => {
- this.moveRow(dragIndex, hoverIndex, dragKey, hoverKey);
+ moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => {
+ this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey);
},
- onDragClick: type => {
- this.onRowClick(record, index, type, slaveInfoName, "slaveInfo");
+ onDragClick: (type) => {
+ this.onRowClick(record, index, type, slaveInfoName, 'slaveInfo');
},
};
} else {
return {
index,
onClick: () => {
- this.onRowClick(record, index, undefined, slaveInfoName, "slaveInfo");
+ this.onRowClick(record, index, undefined, slaveInfoName, 'slaveInfo');
},
onDoubleClick: () => {
this.onDoubleClick(slaveInfoName, record);
@@ -2590,13 +2252,13 @@ class CommonTableRc extends React.Component {
}
},
// footer: this.props.footer === undefined ? this.tableFooter : undefined,
- id: commonUtils.isEmptyArr(dataSource) ? "unDataBox" : "dataBox" /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */,
+ id: commonUtils.isEmptyArr(dataSource) ?
+ 'unDataBox' :
+ 'dataBox', /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */
...this.props.slaveInfo.tableProps,
onChange: this.onChange,
};
- } else {
- return null;
- }
+ } else { return null; }
};
getTableFilterData = () => {
@@ -2609,13 +2271,13 @@ class CommonTableRc extends React.Component {
} else {
filterData = dataSource.length;
}
- if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) {
- if (masterData.sZczlxShowName === "删除" || masterData.sZczlxShowName === "恢复") {
+ if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) {
+ if(masterData.sZczlxShowName === '删除' || masterData.sZczlxShowName === '恢复'){
filterData += 1;
}
}
return filterData;
- };
+ }
/** 获取showConfig */
getShowConfig = (props, sName, isSlaveInfo) => {
/* 返回值声明 */
@@ -2637,9 +2299,10 @@ class CommonTableRc extends React.Component {
if (isSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo) && commonUtils.isNotEmptyObject(this.props.slaveInfo.config)) {
const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter(item => item.sName === sName && item.bVisible);
if (commonUtils.isNotEmptyArr(showConfigArr)) {
- showConfig = showConfigArr[0];
+ showConfig = showConfigArr[0];
}
}
+
}
/* 返回值 */
return showConfig;
@@ -2651,30 +2314,25 @@ class CommonTableRc extends React.Component {
/* 通过sName过滤出对应的showConfig */
/* 通过sName过滤出对应的showConfig */
if (this.props.customConfig) {
- const showConfigArr = this.props.customConfig.filter(
- item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible
- );
+ const showConfigArr = this.props.customConfig.filter(item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible);
if (commonUtils.isNotEmptyArr(showConfigArr)) {
showConfig = showConfigArr;
}
} else {
if (this.props.config) {
- const showConfigArr = this.props.config.gdsconfigformslave.filter(
- item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible
- );
+ const showConfigArr = this.props.config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible);
if (commonUtils.isNotEmptyArr(showConfigArr)) {
showConfig = showConfigArr;
}
}
if (commonUtils.isNotEmptyObject(this.props.slaveInfo) && commonUtils.isNotEmptyObject(this.props.slaveInfo.config)) {
- const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter(
- item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible
- );
+ const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible);
if (commonUtils.isNotEmptyArr(showConfigArr)) {
showConfig = showConfigArr;
}
}
+
}
/* 返回值 */
return showConfig;
@@ -2683,66 +2341,65 @@ class CommonTableRc extends React.Component {
rowColorData = React.createRef();
getColorStyle = (record, isRowShow) => {
- let styleColorArrTotal = "";
+ let styleColorArrTotal = '';
const showConfigArr = this.getColorConfig(); /* 拿到颜色配置json */
if (commonUtils.isNotEmptyArr(showConfigArr) && showConfigArr.length > 0) {
for (const showConfig of showConfigArr) {
- let styleColorArr = "";
+ let styleColorArr = '';
const colorConditon = commonUtils.isNotEmptyObject(showConfig) ? showConfig.sColorTerms : null;
- if (commonUtils.isNotEmptyObject(colorConditon)) {
- let colorConditionArr = "";
+ if (commonUtils.isNotEmptyObject((colorConditon))) {
+ let colorConditionArr = '';
try {
colorConditionArr = JSON.parse(colorConditon); /* 转化为json */
} catch (e) {
- colorConditionArr = "";
+ colorConditionArr = '';
}
- colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ""; /* 判断是否是数组 */
+ colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ''; /* 判断是否是数组 */
for (const item of colorConditionArr) {
- let styleColor = "";
- const { column, condition, conditionValue, color, isRow } = item;
+ let styleColor = '';
+ const {
+ column, condition, conditionValue, color, isRow,
+ } = item;
if (record[column] !== undefined) {
- if (color && !document.getElementById(`color${color.replace("#", "-")}`)) {
- var style = document.createElement("style");
- style.type = "text/css";
- style.id = `color${color.replace("#", "-")}`;
+ if (color && !document.getElementById(`color${color.replace('#', '-')}`)) {
+ var style = document.createElement('style');
+ style.type = 'text/css';
+ style.id = `color${color.replace('#', '-')}`;
style.innerHTML = `
- .color${color.replace("#", "-")} td {
+ .color${color.replace('#', '-')} td {
background-color:${color}!important;
.ant-table-selection-column {
background-color:${color}!important;
}
}
`;
- document.getElementsByTagName("head")[0].appendChild(style);
+ document.getElementsByTagName('head')[0].appendChild(style);
}
- if (isRow && isRowShow && !commonUtils.isEmpty(record[column]) && commonUtils.isNotEmptyObject(record[column].toString())) {
- /* 配置行 */
+ if (isRow && isRowShow && !commonUtils.isEmpty(record[column]) && commonUtils.isNotEmptyObject(record[column].toString())) { /* 配置行 */
let { conditionValue: conditionValueOld } = item;
- const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld;
- if (condition === "=") {
- if (commonUtils.isNotEmptyObject(conditionValue) && conditionValue.includes("#")) {
- const sXName = conditionValue.replace("#", "").replace("#", "").trim();
- if (sXName && commonUtils.isNotEmptyObject(this.props[sXName])) {
+ const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld;
+ if (condition === '=') {
+ if(commonUtils.isNotEmptyObject(conditionValue) && conditionValue.includes('#')) {
+ const sXName = conditionValue.replace('#','').replace('#','').trim();
+ if(sXName && commonUtils.isNotEmptyObject(this.props[sXName])) {
const sXValue = this.props[sXName];
- styleColor = record[column] === sXValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
+ styleColor = record[column] === sXValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
}
} else {
- styleColor = record[column] === conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
+ styleColor = record[column] === conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
}
- } else if (condition === "!=") {
- styleColor = record[column] != conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
- } else if (condition === "like") {
- if (column.substring(0, 1) === "s") {
- styleColor = record[column]?.indexOf(conditionValue) > -1 ? `SetRow_${color} color${color.replace("#", "-")}` : "";
- }
- } else if (condition === ">") {
- styleColor = record[column] > conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
- } else if (condition === ">=") {
- styleColor = record[column] >= conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
- } else if (condition === "<") {
- styleColor = record[column] < conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
- } else if (condition === "<=") {
- styleColor = record[column] <= conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : "";
+ } else if (condition === '!=') {
+ styleColor = record[column] != conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
+ } else if (condition === 'like') {
+ if (column.substring(0, 1) === 's') { styleColor = record[column]?.indexOf(conditionValue) > -1 ? `SetRow_${color} color${color.replace('#', '-')}` : ''; }
+ } else if (condition === '>') {
+ styleColor = record[column] > conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
+ } else if (condition === '>=') {
+ styleColor = record[column] >= conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
+ } else if (condition === '<') {
+ styleColor = record[column] < conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
+ } else if (condition === '<=') {
+ styleColor = record[column] <= conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
}
}
}
@@ -2752,7 +2409,7 @@ class CommonTableRc extends React.Component {
if (Array.isArray(this.rowColorData.current) && index >= 0) {
this.rowColorData.current[index] = { key: record?.[this.rowKey], color };
} else {
- this.rowColorData.current = [...(this.rowColorData.current || []), { key: record?.[this.rowKey], color }];
+ this.rowColorData.current = [...this.rowColorData.current || [], { key: record?.[this.rowKey], color }];
}
} else {
if (Array.isArray(this.rowColorData.current) && index >= 0) this.rowColorData.current?.splice(index, 1);
@@ -2763,93 +2420,94 @@ class CommonTableRc extends React.Component {
}
}
return styleColorArrTotal;
- };
+ }
/** 获取单元格颜色配置 */
getCellColorConfig = (text, record, sName) => {
- let styleColorArrTotal = ""; /* 单元格文字颜色 */
- let styleColorArrTotalB = ""; /* 单元格背景颜色 */
- let styleColorArr = "";
- let styleColorArrB = "";
+ let styleColorArrTotal = ''; /* 单元格文字颜色 */
+ let styleColorArrTotalB = ''; /* 单元格背景颜色 */
+ let styleColorArr = '';
+ let styleColorArrB = '';
const styleColorArrTotalM = {};
const showConfigArr = this.getColorConfig(); /* 拿到颜色配置json */
if (commonUtils.isNotEmptyArr(showConfigArr) && showConfigArr.length > 0) {
for (const showConfig of showConfigArr) {
const colorConditon = commonUtils.isNotEmptyObject(showConfig) ? showConfig.sColorTerms : null;
- if (commonUtils.isNotEmptyObject(colorConditon)) {
- let colorConditionArr = "";
+ if (commonUtils.isNotEmptyObject((colorConditon))) {
+ let colorConditionArr = '';
try {
colorConditionArr = JSON.parse(colorConditon); /* 转化为json */
} catch (e) {
- colorConditionArr = "";
+ colorConditionArr = '';
}
- colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : "";
+ colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : '';
for (const item of colorConditionArr) {
- let styleColor = "";
+ let styleColor = '';
// eslint-disable-next-line no-unused-vars
- let styleBackground = "";
- const { column, condition, color, background, isRow } = item;
- if (!isRow) {
- /* 根据配置设置单元格颜色 */
+ let styleBackground = '';
+ const {
+ column, condition, color, background, isRow,
+ } = item;
+ if (!isRow) { /* 根据配置设置单元格颜色 */
let { conditionValue: conditionValueOld } = item;
- const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld;
- if (column === sName && (column === showConfig.sName || showConfig.sControlName?.startsWith("canOtherConfig"))) {
- /* 只控制该配置的单元格 */
- if (condition === "=") {
- styleColor = record[column] === conditionValue ? color : "";
- styleBackground = record[column] === conditionValue ? background : "";
- } else if (condition === "!=") {
- styleColor = record[column] != conditionValue ? color : "";
- styleBackground = record[column] !== conditionValue ? background : "";
- } else if (condition === "like") {
- if (sName.substring(0, 1) === "s") {
- styleColor = record[column]?.indexOf(conditionValue) > -1 ? color : "";
- styleBackground = record[column]?.indexOf(conditionValue) > -1 ? background : "";
+ const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld;
+ if (column === sName && (column === showConfig.sName || showConfig.sControlName?.startsWith('canOtherConfig'))) { /* 只控制该配置的单元格 */
+ if (condition === '=') {
+ styleColor = record[column] === conditionValue ? color : '';
+ styleBackground = record[column] === conditionValue ? background : '';
+ } else if (condition === '!=') {
+ styleColor = record[column] != conditionValue ? color : '';
+ styleBackground = record[column] !== conditionValue ? background : '';
+ } else if (condition === 'like') {
+ if (sName.substring(0, 1) === 's') {
+ styleColor = record[column]?.indexOf(conditionValue) > -1 ? color : '';
+ styleBackground = record[column]?.indexOf(conditionValue) > -1 ? background : '';
}
- } else if (condition === "!=") {
- styleColor = record[column] !== conditionValue ? color : "";
- styleBackground = record[column] !== conditionValue ? background : "";
- } else if (condition === ">") {
- styleColor = record[column] > conditionValue ? color : "";
- styleBackground = record[column] > conditionValue ? background : "";
- } else if (condition === ">=") {
- styleColor = record[column] >= conditionValue ? color : "";
- styleBackground = record[column] >= conditionValue ? background : "";
- } else if (condition === "<") {
- styleColor = record[column] < conditionValue ? color : "";
- styleBackground = record[column] < conditionValue ? background : "";
- } else if (condition === "<=") {
- styleColor = record[column] <= conditionValue ? color : "";
- styleBackground = record[column] <= conditionValue ? background : "";
- } else if (Array.isArray(condition)) {
- /* 通过其他列条件控制该字段的颜色显示 */
- if (commonUtils.isNotEmptyArr(condition)) {
+ } else if (condition === '!=') {
+ styleColor = record[column] !== conditionValue ? color : '';
+ styleBackground = record[column] !== conditionValue ? background : '';
+ } else if (condition === '>') {
+ styleColor = record[column] > conditionValue ? color : '';
+ styleBackground = record[column] > conditionValue ? background : '';
+ } else if (condition === '>=') {
+ styleColor = record[column] >= conditionValue ? color : '';
+ styleBackground = record[column] >= conditionValue ? background : '';
+ } else if (condition === '<') {
+ styleColor = record[column] < conditionValue ? color : '';
+ styleBackground = record[column] < conditionValue ? background : '';
+ } else if (condition === '<=') {
+ styleColor = record[column] <= conditionValue ? color : '';
+ styleBackground = record[column] <= conditionValue ? background : '';
+ } else if (Array.isArray(condition)) { /* 通过其他列条件控制该字段的颜色显示 */
+ if(commonUtils.isNotEmptyArr(condition)) {
for (const itemConditon of condition) {
- const { bFilterName, bFilterCondition, color, background } = itemConditon;
+ const {
+ bFilterName, bFilterCondition, color, background,
+ } = itemConditon;
let { bFilterValue: bFilterValueOld } = itemConditon;
- const bFilterValue = record[bFilterValueOld] ? record[bFilterValueOld] : bFilterValueOld;
- if (bFilterCondition === "=") {
- styleColor = record[bFilterName] === bFilterValue ? color : "";
- styleBackground = record[bFilterName] === bFilterValue ? background : "";
- } else if (bFilterCondition === "like") {
- if (sName.substring(0, 1) === "s") {
- styleColor = record[bFilterName].indexOf(bFilterValue) > -1 ? color : "";
- styleBackground = record[bFilterName].indexOf(bFilterValue) > -1 ? background : "";
+ const bFilterValue = record[bFilterValueOld] ? record[bFilterValueOld]: bFilterValueOld;
+ if (bFilterCondition === '=') {
+ styleColor = record[bFilterName] === bFilterValue ? color : '';
+ styleBackground = record[bFilterName] === bFilterValue ? background : '';
+ } else if (bFilterCondition === 'like') {
+ if (sName.substring(0, 1) === 's') {
+ styleColor = record[bFilterName].indexOf(bFilterValue) > -1 ? color : '';
+ styleBackground = record[bFilterName].indexOf(bFilterValue) > -1 ? background : '';
}
- } else if (bFilterCondition === "!=") {
- styleColor = record[bFilterName] !== bFilterValue ? color : "";
- styleBackground = record[bFilterName] !== bFilterValue ? background : "";
- } else if (bFilterCondition === ">") {
- styleColor = record[bFilterName] > bFilterValue ? color : "";
- styleBackground = record[bFilterName] > bFilterValue ? background : "";
- } else if (bFilterCondition === ">=") {
- styleColor = record[bFilterName] >= bFilterValue ? color : "";
- styleBackground = record[bFilterName] >= bFilterValue ? background : "";
- } else if (bFilterCondition === "<") {
- styleColor = record[bFilterName] < bFilterValue ? color : "";
- styleBackground = record[bFilterName] < bFilterValue ? background : "";
- } else if (bFilterCondition === "<=") {
- styleColor = record[bFilterName] <= bFilterValue ? color : "";
- styleBackground = record[bFilterName] <= bFilterValue ? background : "";
+ } else if (bFilterCondition === '!=') {
+ styleColor = record[bFilterName] !== bFilterValue ? color : '';
+ styleBackground = record[bFilterName] !== bFilterValue ? background : '';
+ } else if (bFilterCondition === '>') {
+ styleColor = record[bFilterName] > bFilterValue ? color : '';
+ styleBackground = record[bFilterName] > bFilterValue ? background : '';
+ } else if (bFilterCondition === '>=') {
+ styleColor = record[bFilterName] >= bFilterValue ? color : '';
+ styleBackground = record[bFilterName] >= bFilterValue ? background : '';
+ } else if (bFilterCondition === '<') {
+ styleColor = record[bFilterName] < bFilterValue ? color : '';
+ styleBackground = record[bFilterName] < bFilterValue ? background : '';
+ } else if (bFilterCondition === '<=') {
+ styleColor = record[bFilterName] <= bFilterValue ? color : '';
+ styleBackground = record[bFilterName] <= bFilterValue ? background : '';
}
}
}
@@ -2858,10 +2516,10 @@ class CommonTableRc extends React.Component {
}
styleColorArr += styleColor;
styleColorArrB += styleBackground;
- if (styleColor) {
+ if(styleColor) {
styleColorArr = styleColor;
}
- if (styleBackground) {
+ if(styleBackground) {
styleColorArrB = styleBackground;
}
}
@@ -2873,7 +2531,7 @@ class CommonTableRc extends React.Component {
const iIndex = showConfigArr.findIndex(item => item.sName === sName);
if (iIndex !== -1) {
const { sColorTerms } = showConfigArr[iIndex];
- if (sColorTerms && sColorTerms.startsWith("#")) {
+ if (sColorTerms && sColorTerms.startsWith('#')) {
styleColorArrTotal = sColorTerms;
}
}
@@ -2883,8 +2541,8 @@ class CommonTableRc extends React.Component {
};
/**
- * 部分字段不可编辑
- */
+ * 部分字段不可编辑
+ */
getSelectRowEditState = (sName, record, enabled) => {
const { config, name, masterData } = this.props;
let result = enabled;
@@ -2895,15 +2553,15 @@ class CommonTableRc extends React.Component {
const btnConfig = data.find(item => item && item.name === sName && item.enabled !== undefined);
if (btnConfig && enabled) {
const { enabled: enabledContent } = btnConfig;
- if (typeof enabledContent === "boolean") {
+ if (typeof enabledContent === 'boolean') {
result = enabledContent;
} else if (enabledContent) {
const tempData = {
props: {
- enabled,
+ enabled
},
master: masterData,
- [name]: record,
+ [name]: record
};
let strNew = enabledContent;
@@ -2922,7 +2580,7 @@ class CommonTableRc extends React.Component {
}
return result;
- };
+ }
// 获取表格行按钮状态
getTableBtnState = (btnName, record) => {
@@ -2935,10 +2593,10 @@ class CommonTableRc extends React.Component {
result = false;
}
/* 若红冲单据 则按钮锁定 不能操作 */
- if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === "1") {
+ if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === '1') {
result = false;
}
- if (btnName === "BtnAdd" && bLimitOperate) {
+ if(btnName === 'BtnAdd' && bLimitOperate){
result = false;
}
@@ -2949,15 +2607,15 @@ class CommonTableRc extends React.Component {
const btnConfig = data.find(item => item && item.name === btnName && item.enabled !== undefined);
if (btnConfig) {
const { enabled: enabledContent } = btnConfig;
- if (typeof enabledContent === "boolean") {
+ if (typeof enabledContent === 'boolean') {
result = enabledContent;
} else if (enabledContent) {
const tempData = {
props: {
- enabled,
+ enabled
},
master: masterData,
- [name]: record,
+ [name]: record
};
let strNew = enabledContent;
@@ -2970,52 +2628,51 @@ class CommonTableRc extends React.Component {
result = !!eval(evalStr);
// console.log('=====表格行按钮状态结果', result, { btnName, enabledContent, tempData, strNew, evalStr });
} catch (error) {
- console.log("=====表格行按钮状态错误", { error, enabledContent, strNew, tempData });
+ console.log('=====表格行按钮状态错误', { error, enabledContent, strNew, tempData });
}
}
}
return result;
- };
+ }
- bCheckBoxColumm = column => {
+ bCheckBoxColumm = (column) => {
const { gdsconfigformslave } = this.props.config || {};
const item = gdsconfigformslave?.find(i => i && i.sName === column?.dataIndex && i.bVisible);
- if (item?.sControlName?.startsWith("bCheckBox")) {
+ if (item?.sControlName?.startsWith('bCheckBox')) {
const checked = !!this.state.dataSource.length && !this.state.dataSource?.find(i => !i || !i[column?.dataIndex]);
- return (
- <>
-
{
- const { handleCheckBoxStatus } = this.props;
- typeof handleCheckBoxStatus === "function" && handleCheckBoxStatus(e.target.checked, column?.dataIndex, this.props.name);
- }}
- />
- {column?.title}
- >
- );
+ return <>
+ {
+ const { handleCheckBoxStatus } = this.props;
+ typeof handleCheckBoxStatus === 'function' && handleCheckBoxStatus(e.target.checked, column?.dataIndex, this.props.name)
+ }}
+ />
+ {column?.title}
+ >
}
- };
+ }
/** 获取table的表头信息(主要是table中的表头信息合并,[{title:1-1},{title:1-2}]变成[{title:1,children:[{title:1},{title:2}]}]) type:是否过滤 */
getTableColumn = (headerColumn, type, props) => {
// this.hasMergeHeader = false;
// 判断是否是表单详情
- const isSlaveInfo =
- props.name === "slaveInfo" ||
- (location.pathname === "/indexPage/commonCostomTabBill" &&
+ const isSlaveInfo = props.name === 'slaveInfo' ||
+ (
+ location.pathname === '/indexPage/commonCostomTabBill' &&
props.name &&
- props.name.includes("Info") &&
- commonUtils.isNotEmptyObject(this.props.slaveInfo));
+ props.name.includes('Info') &&
+ commonUtils.isNotEmptyObject(this.props.slaveInfo)
+ );
const config = isSlaveInfo ? this.props.slaveInfo.config : this.props.config;
- const isSlaveInfoM = isSlaveInfo && commonUtils.isNotEmptyObject(config) ? config.showName === "工单物资评审" : false;
+ const isSlaveInfoM = isSlaveInfo && commonUtils.isNotEmptyObject(config) ? config.showName === '工单物资评审' : false;
/* 返回值声明 */
const tableColumn = [];
let iIndex = 0;
- const specialRoute = commonUtils.isNotEmptyObject(this.props.app.currentPane) ? this.props.app.currentPane.route : ""; /* 获取路由名称 */
+ const specialRoute = commonUtils.isNotEmptyObject(this.props.app.currentPane) ? this.props.app.currentPane.route : ''; /* 获取路由名称 */
/* 遍历每一个表头标题 */
for (const column of headerColumn) {
/* 表头标题 */
@@ -3023,65 +2680,44 @@ class CommonTableRc extends React.Component {
const width = column.width;
const bNotEmpty = column.bNotEmpty;
/* 带'-'的表头是需要合并滴 */
- const index = commonUtils.isNotEmptyObject(title) ? title.indexOf("-") : -1;
+ const index = commonUtils.isNotEmptyObject(title) ? title.indexOf('-') : -1;
/* 合并走合并的,不合并就直接push */
let columnNew = {};
let sorter;
let search = true;
- if (
- props.tableProps !== undefined &&
- props.tableProps.rowKey !== undefined &&
- props.tableProps.rowKey !== "sId" &&
- !props.tableProps.sortSelf
- ) {
+ if (props.tableProps !== undefined && props.tableProps.rowKey !== undefined && props.tableProps.rowKey !== 'sId' && !props.tableProps.sortSelf) {
sorter = true;
} else {
const firstDataIndex = column.dataIndex.substring(0, 1);
- if (firstDataIndex === "d" || firstDataIndex === "i") {
- sorter = (a, b) =>
- (commonUtils.isEmpty(a[column.dataIndex]) ? 0 : a[column.dataIndex]) -
- (commonUtils.isEmpty(b[column.dataIndex]) ? 0 : b[column.dataIndex]);
- } else if (firstDataIndex === "t") {
- sorter = (a, b) =>
- moment(commonUtils.isEmpty(a[column.dataIndex]) ? "2000-01-01" : a[column.dataIndex]).diff(
- moment(commonUtils.isEmpty(b[column.dataIndex]) ? "2000-01-01" : b[column.dataIndex])
- );
+ if (firstDataIndex === 'd' || firstDataIndex === 'i') {
+ sorter = (a, b) => ((commonUtils.isEmpty(a[column.dataIndex]) ? 0 : a[column.dataIndex]) - (commonUtils.isEmpty(b[column.dataIndex]) ? 0 : b[column.dataIndex]));
+ } else if (firstDataIndex === 't') {
+ sorter = (a, b) => (moment(commonUtils.isEmpty(a[column.dataIndex]) ? '2000-01-01' : a[column.dataIndex]).diff(moment(commonUtils.isEmpty(b[column.dataIndex]) ? '2000-01-01' : b[column.dataIndex])));
} else {
- sorter = (a, b) =>
- (commonUtils.isEmpty(a[column.dataIndex]) ? "0" : a[column.dataIndex]).localeCompare(
- commonUtils.isEmpty(b[column.dataIndex]) ? "1" : b[column.dataIndex]
- );
+ sorter = (a, b) => ((commonUtils.isEmpty(a[column.dataIndex]) ? '0' : a[column.dataIndex]).localeCompare((commonUtils.isEmpty(b[column.dataIndex]) ? '1' : b[column.dataIndex])));
}
}
/* 工单、工艺卡、报价单 去掉排序 */
- if (
- this.props.name === "sParam" ||
- specialRoute.includes("workOrder") ||
- specialRoute.includes("processCard") ||
- specialRoute.includes("quotation")
- ) {
+ if (this.props.name === 'sParam' || specialRoute.includes('workOrder') || specialRoute.includes('processCard') || specialRoute.includes('quotation')) {
sorter = false;
}
/* 默认字段是排序的 通过配置bNotSort来设置字段不排序 */
if (config && commonUtils.isNotEmptyStr(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex))) {
- if (
- config.gdsconfigformslave.filter(item => item.sName === column.dataIndex).length > 0 &&
- config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSort
- ) {
+ if(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex).length > 0 && config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSort){
sorter = false;
}
}
if (config && commonUtils.isNotEmptyStr(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex))) {
- if (config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSearch) {
+ if(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSearch){
search = false;
}
}
if (column.dataIndex === "spicture" || column.dataIndex === "tableLastEmpty") {
sorter = false;
}
- let sTitleBgColor = commonUtils.isNotEmptyObject(column.sTitleBgColor) ? column.sTitleBgColor : ""; /* 标题背景颜色 */
- let sTitleColor = commonUtils.isNotEmptyObject(column.sTitleColor) ? column.sTitleColor : ""; /* 标题字体颜色 */
+ let sTitleBgColor =commonUtils.isNotEmptyObject(column.sTitleBgColor) ? column.sTitleBgColor : ''; /* 标题背景颜色 */
+ let sTitleColor =commonUtils.isNotEmptyObject(column.sTitleColor) ? column.sTitleColor : ''; /* 标题字体颜色 */
const styleObj = {};
if (commonUtils.isNotEmptyObject(sTitleBgColor)) {
styleObj.background = sTitleBgColor;
@@ -3091,7 +2727,7 @@ class CommonTableRc extends React.Component {
}
const renderTitle = () => {
// 树形表格在第一个column上加上全部展开/收起功能
- let expandedAllIcon = "";
+ let expandedAllIcon = '';
const columnIndex = headerColumn.findIndex(item => column.title === item.title);
let { data } = this.props;
let { expKeys } = this.state;
@@ -3100,45 +2736,41 @@ class CommonTableRc extends React.Component {
data = commonUtils.isNotEmptyArr(data) ? data : [];
const childrenList = [];
- const getChildrenList = data => {
+ const getChildrenList = (data) => {
data.forEach(item => {
- if (item && typeof item.children === "object") {
+ if (item && typeof item.children === 'object') {
childrenList.push(item);
getChildrenList(item.children);
}
});
- };
+ }
getChildrenList(data);
- if (columnIndex === 0 && childrenList.length) {
- // 第一个column并且数据中有children
+ if (columnIndex === 0 && childrenList.length) { // 第一个column并且数据中有children
this.showExpAll = true;
this.tableCollapsed = !expKeys.length;
- const marginLeft = this.props.bMutiSelect ? "6px" : "2px";
+ const marginLeft = this.props.bMutiSelect ? '6px' : '2px';
expandedAllIcon = (
);
- };
- handleFastSearch = params => {
+ }
+ handleFastSearch = (params) => {
const { sName, record, oldKey } = params;
const { config, searchRowKeys = [], onBtnSearch } = this.props;
const newKey = oldKey || commonUtils.createSid();
const sFirstFieldName = `sFirst-${newKey}`;
- const { masterData } = this.props.onChange("master", sFirstFieldName, { [sFirstFieldName]: sName }, null, null, true);
+ const { masterData } = this.props.onChange('master', sFirstFieldName, { [sFirstFieldName]: sName }, null, null, true);
const sFirstValue = masterData[sFirstFieldName];
- const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? "s" : sFirstValue.substring(0, 1);
- const sSecondConditionPro = firstDataIndex === "s" && sFirstValue.endsWith("_pro");
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1);
+ const sSecondConditionPro = firstDataIndex === 's' && sFirstValue.endsWith('_pro');
const iIndex = config.gdsconfigformslave.findIndex(item => item.sName === sFirstValue);
- masterData[`sSecond-${newKey}`] =
- sSecondConditionPro && iIndex > -1 && config.gdsconfigformslave[iIndex].sDropDownType === "sql"
- ? commonConfig.seaJudge.s_proDropDown[0].sId
- : sSecondConditionPro
- ? commonConfig.seaJudge.s_pro[0].sId
- : commonConfig.seaJudge[firstDataIndex][0].sId;
- masterData[`${firstDataIndex}Third-${newKey}`] =
- firstDataIndex === "b" ? false : firstDataIndex === "t" ? moment().format("YYYY-MM-DD") : masterData[`${firstDataIndex}Third-${newKey}`];
+ masterData[`sSecond-${newKey}`] = sSecondConditionPro && iIndex > -1 && config.gdsconfigformslave[iIndex].sDropDownType === 'sql' ?
+ commonConfig.seaJudge.s_proDropDown[0].sId : sSecondConditionPro ?
+ commonConfig.seaJudge.s_pro[0].sId : commonConfig.seaJudge[firstDataIndex][0].sId;
+ masterData[`${firstDataIndex}Third-${newKey}`] = firstDataIndex === 'b' ? false : firstDataIndex === 't' ? moment().format('YYYY-MM-DD') : masterData[`${firstDataIndex}Third-${newKey}`];
const sThirdName = `${firstDataIndex}Third-${newKey}`;
masterData[`${sThirdName}`] = record[sName];
@@ -7707,7 +6654,7 @@ class CommonTableRc extends React.Component {
onBtnSearch();
});
};
- handleClearFastSearch = oldKey => {
+ handleClearFastSearch = (oldKey) => {
const { searchRowKeys = [], onBtnSearch, masterData = {} } = this.props;
if (searchRowKeys.length > 1) {
const searchRowKeysNew = searchRowKeys.filter(item => item !== oldKey);
@@ -7717,22 +6664,22 @@ class CommonTableRc extends React.Component {
} else if (searchRowKeys.length === 1) {
const sThirdName = Object.keys(masterData).find(key => key.indexOf(`Third-${oldKey}`) !== -1);
if (sThirdName) {
- masterData[sThirdName] = "";
+ masterData[sThirdName] = '';
this.props.onSaveState({ masterData }, () => {
onBtnSearch();
});
}
}
- };
+ }
// 进行拖动排序,数据展现必须按照iOrder 进行排序展现,必须进行选择才能拖动(废弃)
moveRowOld = (dragIndex, hoverIndex) => {
const { name } = this.props;
const { selectedRowKeys } = this.state;
if (commonUtils.isEmptyArr(selectedRowKeys)) {
- message.warning("请选择后进行拖动");
+ message.warning('请选择后进行拖动');
} else {
// let mHoverIndex = hoverIndex;
- selectedRowKeys.forEach(item => {
+ selectedRowKeys.forEach((item) => {
const { dataSource } = this.state;
const iIndex = dataSource.findIndex(newItem => item === newItem[this.rowKey]);
const dragRow = dataSource[iIndex];
@@ -7740,10 +6687,7 @@ class CommonTableRc extends React.Component {
const newState = update(this.state, {
dataSource: {
- $splice: [
- [iIndex, 1],
- [hoverIndex, 0, dragRow],
- ],
+ $splice: [[iIndex, 1], [hoverIndex, 0, dragRow]],
},
});
this.setState(newState);
@@ -7752,37 +6696,37 @@ class CommonTableRc extends React.Component {
const { dataSource } = this.state;
dataSource.forEach((item, index) => {
if (commonUtils.isEmpty(item.handleType)) {
- item.handleType = "update";
+ item.handleType = 'update';
}
item.iOrder = index + 1;
});
this.setState(dataSource);
this.props.onRowMove({ [`${name}Data`]: dataSource });
}
- };
+ }
/* 拖拽改变对应层级 */
- moveRow = (dragIndex, hoverIndex, dragKey, hoverKey) => {
- if (this.props.onMoveRow) {
- this.props.onMoveRow(dragIndex, hoverIndex, dragKey, hoverKey, this.props);
+ moveRow = (dragIndex, hoverIndex,dragKey,hoverKey) => {
+ if(this.props.onMoveRow) {
+ this.props.onMoveRow(dragIndex, hoverIndex,dragKey,hoverKey);
}
};
BtnUploadDivProps = () => {
return {
- accept: this.BtnUploadDivPropsAttr.current?.sActiveKey || "*/*",
- beforeUpload: file => {
+ accept: this.BtnUploadDivPropsAttr.current?.sActiveKey || '*/*',
+ beforeUpload: (file) => {
const config = this.BtnUploadDivPropsAttr.current;
- if (config?.sActiveKey && typeof config?.sActiveKey === "string") {
- const isAllow = config?.sActiveKey?.split(",").includes(file.type);
+ if (config?.sActiveKey && typeof config?.sActiveKey === 'string') {
+ const isAllow = config?.sActiveKey?.split(',').includes(file.type);
if (!isAllow) {
- message.error(`请选择正确的文件类型,包含${config?.sActiveKey || ""}`);
+ message.error(`请选择正确的文件类型,包含${config?.sActiveKey || ''}`);
}
return isAllow;
}
return true;
- },
- };
- };
+ }
+ }
+ }
/** 渲染 */
render() {
@@ -7818,7 +6762,7 @@ class CommonTableRc extends React.Component {
if (commonUtils.isNotEmptyObject(previewImage)) {
if (commonUtils.isNotEmptyArr(this.props.data)) {
if (this.props.data[0].sPicturePath) {
- for (const item of this.props.data) {
+ for(const item of this.props.data) {
const dataUrl = `${commonConfig.file_host}file/download?savePathStr=${item.sPicturePath}&sModelsId=100&token=${token}`; /* 缩略图 */
data.push(dataUrl);
}
@@ -7833,9 +6777,9 @@ class CommonTableRc extends React.Component {
const divProps = {
action: `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`,
onChange: this.handleUploadChange,
- accept: "*/*",
+ accept: '*/*',
showUploadList: false,
- multiple: true,
+ multiple:true,
beforeUpload: this.handleBeforeUpload,
};
/* 获取look的props */
@@ -7869,7 +6813,7 @@ class CommonTableRc extends React.Component {
/* 通用弹窗功能 */
let commonPopupProps = {};
- let commonPopupTitle = "选择弹窗";
+ let commonPopupTitle = '选择弹窗';
let bCommonPopup = false; /* 多列弹出窗11 */
let bCommonPopup1 = false; /* 单列弹出窗 */
let bCommonPopupTree = false; /* 树形列弹出窗 */
@@ -7878,59 +6822,35 @@ class CommonTableRc extends React.Component {
let commonPopupConfig = {};
const { config, sModelsId, app, selectedRowKeys } = this.props;
if (commonUtils.isNotEmptyObject(config)) {
- const iIndex = config.gdsconfigformslave.findIndex(
- item =>
- commonUtils.isNotEmptyObject(item.sControlName) &&
- (item.sControlName.includes("BtnPopup") || item.sControlName.includes("BtnHeadPopup")) &&
- item.bVisible &&
- item.sDropDownType === "popup"
- );
+ const iIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup')) && item.bVisible && item.sDropDownType === 'popup');
if (iIndex > -1) {
commonPopupConfig = config.gdsconfigformslave[iIndex];
- if (commonPopupShowConfig?.sControlName === "BtnPopupsAlumiteBomBillNo" || commonPopupShowConfig?.sControlName === "BtnChooseProcess") {
+ if(commonPopupShowConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo' || commonPopupShowConfig?.sControlName === 'BtnChooseProcess') {
commonPopupConfig = commonPopupShowConfig;
- if (commonPopupShowConfig?.sControlName === "BtnChooseProcess") {
+ if(commonPopupShowConfig?.sControlName === 'BtnChooseProcess') {
bCommonPopupProcess = true;
}
}
- commonPopupTitle =
- commonUtils.isNotEmptyObject(commonPopupConfig) && commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName)
- ? commonPopupConfig.sActiveName
- : commonPopupTitle;
- commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupRecord)
- ? commonPopupConfig.sActiveId === "1"
- ? commonUtils.isEmpty(commonPopupRecord.sSrcFormName)
- ? commonPopupTitle
- : commonPopupRecord.sSrcFormName
- : commonPopupTitle
- : commonPopupTitle;
- const sFormId = commonUtils.isNotEmptyObject(commonPopupRecord)
- ? commonPopupConfig.sActiveId === "1"
- ? commonUtils.isEmpty(commonPopupRecord.sFormId)
- ? commonPopupRecord.sSrcFormId
- : commonPopupRecord.sFormId
- : commonPopupConfig.sActiveId
- : commonPopupConfig.sActiveId;
+ commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupConfig) && commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName) ? commonPopupConfig.sActiveName : commonPopupTitle;
+ commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupRecord) ? ( commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sSrcFormName) ? commonPopupTitle : commonPopupRecord.sSrcFormName : commonPopupTitle ) : commonPopupTitle;
+ const sFormId = commonUtils.isNotEmptyObject(commonPopupRecord) ? ( commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sFormId) ? commonPopupRecord.sSrcFormId : commonPopupRecord.sFormId : commonPopupConfig.sActiveId ) : commonPopupConfig.sActiveId;
commonPopupProps = {
app: {
...this.props.app,
currentPane: {
- name: "commonPopup",
- bEdit:
- commonUtils.isNotEmptyObject(app.currentPane) &&
- commonUtils.isNotEmptyObject(app.currentPane.route) &&
- app.currentPane.route.includes("commonBillDeliver"),
+ name: 'commonPopup',
+ bEdit: (commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.route) && app.currentPane.route.includes('commonBillDeliver')),
config: commonPopupConfig,
conditonValues: this.props.getSqlCondition(commonPopupConfig),
- title: commonPopupTitle,
- route: "/indexPage/commonList",
- formRoute: "/indexPage/commonList",
+ title:commonPopupTitle,
+ route: '/indexPage/commonList',
+ formRoute: '/indexPage/commonList',
formId: sFormId,
key: sModelsId + commonPopupConfig.sId,
- sModelsType: bCommonPopupProcess ? "search/commonProcess" : "search/commonPopup",
- select: this.handleSelectCommonPopup,
- selectCancel: this.handleSelectCancel.bind(this, "commonPopupVisible"),
+ sModelsType: bCommonPopupProcess ? 'search/commonProcess' : 'search/commonPopup',
+ select:this.handleSelectCommonPopup,
+ selectCancel: this.handleSelectCancel.bind(this, 'commonPopupVisible'),
},
},
dispatch: this.props.dispatch,
@@ -7938,57 +6858,38 @@ class CommonTableRc extends React.Component {
id: randomId,
onOpenNewTab: this.onOpenNewTab,
outerMasterData: this.props.masterData,
- realizeHeight: this.props.realizeHeight /* 拖动偏移高度 */,
+ realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */
};
}
/* 多列弹出窗 */
- const commonPopupIndex = config.gdsconfigformslave.findIndex(
- item =>
- commonUtils.isNotEmptyObject(item.sControlName) &&
- (item.sControlName.includes("BtnPopup") || item.sControlName.includes("BtnHeadPopup")) &&
- !["BtnPopup1"].includes(item.sControlName) &&
- !item.sControlName.startsWith("BtnPopupEdit") &&
- item.bVisible &&
- item.sDropDownType === "popup"
- );
+ const commonPopupIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup') ) && !['BtnPopup1'].includes(item.sControlName) && !item.sControlName.startsWith('BtnPopupEdit') && item.bVisible && item.sDropDownType === 'popup');
if (commonPopupIndex > -1) {
bCommonPopup = true;
}
/* 单列弹出窗 */
- const commonPopupIndex1 = config.gdsconfigformslave.findIndex(
- item =>
- commonUtils.isNotEmptyObject(item.sControlName) &&
- item.sControlName.includes("BtnPopup1") &&
- item.bVisible &&
- item.sDropDownType === "popup"
- );
+ const commonPopupIndex1 = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.includes('BtnPopup1') && item.bVisible && item.sDropDownType === 'popup');
if (commonPopupIndex1 > -1) {
bCommonPopup1 = true;
bCommonPopup = false;
}
/* commonListTree弹出窗 */
- const commonPopupIndexTree = config.gdsconfigformslave.findIndex(
- item =>
- commonUtils.isNotEmptyObject(item.sControlName) &&
- item.sControlName === "BtnPopupListTree" &&
- item.bVisible &&
- item.sDropDownType === "popup"
- );
+ const commonPopupIndexTree = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName === 'BtnPopupListTree' && item.bVisible && item.sDropDownType === 'popup');
if (commonPopupIndexTree > -1) {
bCommonPopupTree = true;
}
+
}
}
/* 字段弹窗功能 */
let commonFieldPopupProps = {};
let bFieldPopup = true; /* 多列弹出窗 */
- let commonFieldPopupTitle = "选择弹窗";
- const commonFileDownloadTitle = "附件列表弹窗";
- const isBtnPopupEdit = this.state.commonFieldPopupShowConfig?.sControlName?.startsWith("BtnPopupEdit");
+ let commonFieldPopupTitle = '选择弹窗';
+ const commonFileDownloadTitle = '附件列表弹窗';
+ const isBtnPopupEdit = this.state.commonFieldPopupShowConfig?.sControlName?.startsWith('BtnPopupEdit');
if (commonUtils.isNotEmptyObject(this.props)) {
let commonFieldPopupConfig = {};
const { config, sModelsId } = this.props;
@@ -7998,37 +6899,31 @@ class CommonTableRc extends React.Component {
iIndex = 0;
commonFieldPopupConfig = commonFieldPopupShowConfig;
} else {
- iIndex = config.gdsconfigformslave.findIndex(
- item => commonUtils.isNotEmptyObject(item.sName) && (item.sDropDownType === "popup" || item.sDropDownType === "popupSingle")
- );
+ iIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sName) && (item.sDropDownType === 'popup' || item.sDropDownType === 'popupSingle'));
if (iIndex > -1) {
commonFieldPopupConfig = config.gdsconfigformslave[iIndex];
}
}
if (iIndex > -1) {
- if (commonFieldPopupConfig.sDropDownType === "popupSingle") {
- /* 如果下拉类型是单列弹出窗 则为单列 */
+ if(commonFieldPopupConfig.sDropDownType === 'popupSingle') { /* 如果下拉类型是单列弹出窗 则为单列 */
bFieldPopup = false;
}
- commonFieldPopupTitle =
- commonUtils.isNotEmptyObject(commonFieldPopupConfig) && commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName)
- ? commonFieldPopupConfig.sActiveName
- : commonFieldPopupTitle;
+ commonFieldPopupTitle = commonUtils.isNotEmptyObject(commonFieldPopupConfig) && commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName) ? commonFieldPopupConfig.sActiveName : commonFieldPopupTitle;
commonFieldPopupProps = {
app: {
...this.props.app,
currentPane: {
- name: "commonPopup",
+ name: 'commonPopup',
config: commonFieldPopupConfig,
- title: commonFieldPopupTitle,
- route: "/indexPage/commonList",
- formRoute: "/indexPage/commonList",
+ title:commonFieldPopupTitle,
+ route: '/indexPage/commonList',
+ formRoute: '/indexPage/commonList',
formId: commonFieldPopupConfig.sActiveId,
key: sModelsId + commonFieldPopupConfig.sId,
- sModelsType: "search/commonPopup",
- select: this.handleSelectCommonFieldPopup,
- selectCancel: this.handleSelectCancel.bind(this, "commonFieldPopupVisible"),
+ sModelsType: 'search/commonPopup',
+ select:this.handleSelectCommonFieldPopup,
+ selectCancel: this.handleSelectCancel.bind(this, 'commonFieldPopupVisible'),
},
},
dispatch: this.props.dispatch,
@@ -8036,20 +6931,16 @@ class CommonTableRc extends React.Component {
id: randomId,
onOpenNewTab: this.onOpenNewTab,
outerMasterData: this.props.masterData,
- realizeHeight: this.props.realizeHeight /* 拖动偏移高度 */,
+ realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */
};
- if (this.props.enabled && commonFieldPopupConfig?.sControlName?.includes("popupSingle_edit")) {
- commonFieldPopupProps.app.currentPane.conditonValues = this.props.getSqlCondition(
- commonFieldPopupConfig,
- this.props.name,
- commonFieldPopupShowRecord
- );
+ if (this.props.enabled && commonFieldPopupConfig?.sControlName?.includes('popupSingle_edit')) {
+ commonFieldPopupProps.app.currentPane.conditonValues = this.props.getSqlCondition(commonFieldPopupConfig, this.props.name, commonFieldPopupShowRecord);
} else {
commonFieldPopupProps.app.currentPane.conditonValues = this.props.getSqlCondition(commonFieldPopupConfig);
}
if (isBtnPopupEdit) {
const selectData = tableProps.dataSource[this.rowClickRef.current] || {};
- const sMemoData = selectData?.[this.state.commonFieldPopupShowConfig?.sActiveKey] || "[]";
+ const sMemoData = selectData?.[this.state.commonFieldPopupShowConfig?.sActiveKey] || '[]';
commonFieldPopupProps.app.sMemoData = JSON.parse(sMemoData);
commonFieldPopupProps.app.originSlaveData = selectData;
commonFieldPopupProps.app.currentPane.bEdit = isBtnPopupEdit;
@@ -8059,42 +6950,33 @@ class CommonTableRc extends React.Component {
}
}
+
/* 蓝色链接弹Modal窗功能 */
let commonModalProps = {};
- let commonModalTitle = "查看";
+ let commonModalTitle = '查看';
if (commonUtils.isNotEmptyObject(this.props)) {
const { config, sModelsId, app, selectedRowKeys, enabled } = this.props;
if (commonUtils.isNotEmptyObject(config)) {
- commonModalTitle =
- commonUtils.isNotEmptyObject(commonModalShowConfig) && commonUtils.isNotEmptyObject(commonModalShowConfig.sActiveName)
- ? commonModalShowConfig.sActiveName
- : commonModalTitle;
- const sFormId =
- commonUtils.isNotEmptyObject(commonModalRecord) && commonUtils.isNotEmptyObject(commonModalShowConfig)
- ? commonModalShowConfig.sActiveId === "1"
- ? commonUtils.isEmpty(commonModalRecord.sFormId)
- ? commonModalRecord.sSrcFormId
- : commonModalRecord.sFormId
- : commonModalShowConfig.sActiveId
- : commonModalShowConfig?.sActiveId;
+ commonModalTitle = commonUtils.isNotEmptyObject(commonModalShowConfig) && commonUtils.isNotEmptyObject(commonModalShowConfig.sActiveName) ? commonModalShowConfig.sActiveName : commonModalTitle;
+ const sFormId = commonUtils.isNotEmptyObject(commonModalRecord) && commonUtils.isNotEmptyObject(commonModalShowConfig) ? ( commonModalShowConfig.sActiveId === '1' ? commonUtils.isEmpty(commonModalRecord.sFormId) ? commonModalRecord.sSrcFormId : commonModalRecord.sFormId : commonModalShowConfig.sActiveId ) : commonModalShowConfig?.sActiveId;
commonModalProps = {
app: {
...this.props.app,
currentPane: {
- name: "commonModal",
- bEdit: commonModalShowConfig?.sName === "dStockAuxiliaryQty" ? enabled : false,
+ name: 'commonModal',
+ bEdit: commonModalShowConfig?.sName === 'dStockAuxiliaryQty'? enabled:false,
config: commonModalShowConfig,
- conditonValues: commonModalShowConfig ? this.props.getSqlCondition(commonModalShowConfig, this.props.name, commonModalRecord) : {},
- title: commonModalTitle,
- route: "/indexPage/commonList",
- formRoute: "/indexPage/commonList",
+ conditonValues: commonModalShowConfig ? this.props.getSqlCondition(commonModalShowConfig, this.props.name, commonModalRecord) :{},
+ title:commonModalTitle,
+ route: '/indexPage/commonList',
+ formRoute: '/indexPage/commonList',
formId: sFormId,
key: sModelsId + commonModalShowConfig?.sId,
- sModelsType: "search/commonPopup",
- select: this.handleSelectCommonPopup,
- selectCancel: this.handleSelectCancel.bind(this, "commonModalVisible"),
- slaveDataSource: commonModalShowConfig?.sName === "dStockAuxiliaryQty" ? [commonModalRecord] : [],
+ sModelsType: 'search/commonPopup',
+ select:this.handleSelectCommonPopup,
+ selectCancel: this.handleSelectCancel.bind(this, 'commonModalVisible'),
+ slaveDataSource :commonModalShowConfig?.sName === 'dStockAuxiliaryQty'? [commonModalRecord]: [],
},
},
dispatch: this.props.dispatch,
@@ -8102,29 +6984,30 @@ class CommonTableRc extends React.Component {
id: randomId,
onOpenNewTab: this.onOpenNewTab,
outerMasterData: this.props.masterData,
- realizeHeight: this.props.realizeHeight /* 拖动偏移高度 */,
- bEdit: commonModalShowConfig?.sName === "dAvailableAuxiliaryQty" ? enabled : false,
+ realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */
+ bEdit:commonModalShowConfig?.sName === 'dAvailableAuxiliaryQty'? enabled:false
};
// if(commonModalShowConfig?.sName === 'dSumCompleteAvailableStockQty' ){
// commonModalProps.data = commonModalData;
// }
+
}
}
+
/* 表格可展开明细 */
- let slaveTableProps = "";
- let expandedRow = "";
- if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === "Y") {
+ let slaveTableProps = '';
+ let expandedRow = '';
+ if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === 'Y') {
slaveTableProps = this.getSlaveTableProps();
- expandedRow = record => {
+ expandedRow = (record) => {
let filterData = 0;
- let columns = "";
+ let columns = '';
let planLoading = false;
- if (this.props.name === "slave" || location.pathname === "/indexPage/commonCostomTabBill") {
- /* 过滤嵌套表 */
+ if (this.props.name === 'slave' || location.pathname === '/indexPage/commonCostomTabBill') { /* 过滤嵌套表 */
/* 获取loading 加载状态 */
const planLoadingSate = this.props.slaveInfo.tableProps.planLoadingSate;
- const planCurrentId = commonUtils.isNotEmptyObject(planLoadingSate) ? planLoadingSate.sId : "";
+ const planCurrentId = commonUtils.isNotEmptyObject(planLoadingSate) ? planLoadingSate.sId : '';
if (record[this.rowKey] === planCurrentId) {
planLoading = planLoadingSate.planLoading;
}
@@ -8133,32 +7016,26 @@ class CommonTableRc extends React.Component {
columns = this.state.tableInfoColumn;
const GetChildFilterData = this.props.onTableFilterData;
if (GetChildFilterData !== undefined) {
- const slaveInfoData = this.props.onTableFilterData("slave", AllData, record);
+ const slaveInfoData = this.props.onTableFilterData('slave', AllData, record);
if (commonUtils.isNotEmptyArr(slaveInfoData) && slaveInfoData.length > 0) {
filterData = slaveInfoData;
}
}
}
return (
-