+ // {this.handleGetMsg(returnData.msg)}
+ //
+ // ),
+ // okText: '确认',
+ // onOk() {},
+ // });
+ // } else {
+ // message.error(returnData.erroMsg);
+ // }
+ // } else {
+ // message.error('审核失败!');
+ // }
+ // return false;
+ // }
+ // }
+ //
+ // if (returnData.code === 1) {
+ // bResult = true;
+ // } else if (returnData.code === -8) {
+ // Modal.info({
+ // title: '温馨提示:',
+ // content: (
+ //
+
{
+ return
+ {
+ // eslint-disable-next-line array-callback-return
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ // const record = dataSource[i]; /* 获取每行数据 */
+ let colorValue = '#000000';
+ if (t?.background) {
+ colorValue = t.background;
+ } else {
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 0:
+ colorValue = '#808080'; /* 0:灰色 */
+ break;
+ case 1:
+ colorValue = '#808080'; /* 1:灰色 */
+ break;
+ case 2:
+ colorValue = '#ff4d4f'; /* 2:红色 */
+ break;
+ case 3:
+ colorValue = '#d4b106'; /* 3:黄色 */
+ break;
+ case 4:
+ colorValue = '#000000'; /* 黑色 */
+ break;
+ case 5:
+ colorValue = '#49aa19'; /* 5:绿色 */
+ break;
+ default:
+ colorValue = '#000000';
+ }
+ }
+ return (
+
+ {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ''}
+ { i + 1 === sPartItemLength ? '' : }
+
+ );
+ })
+ }
+
+ }}>
+
+ {
+ // eslint-disable-next-line array-callback-return
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ // const record = dataSource[i]; /* 获取每行数据 */
+ let colorValue = '#000000';
+ if (t?.background) {
+ colorValue = t.background;
+ } else {
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 0:
+ colorValue = '#808080'; /* 0:灰色 */
+ break;
+ case 1:
+ colorValue = '#808080'; /* 1:灰色 */
+ break;
+ case 2:
+ colorValue = '#ff4d4f'; /* 2:红色 */
+ break;
+ case 3:
+ colorValue = '#d4b106'; /* 3:黄色 */
+ break;
+ case 4:
+ colorValue = '#000000'; /* 黑色 */
+ break;
+ case 5:
+ colorValue = '#49aa19'; /* 5:绿色 */
+ break;
+ default:
+ colorValue = '#000000';
+ }
+ }
+ return (
+
+ {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ''}
+ { i + 1 === sPartItemLength ? '' : }
+
+ );
+ })
+ }
+
+
+
+ );
+ }
+ };
+ } else {
+ sPartNameStatus[0].render = (itemStr) => {
+ if (itemStr) {
+ const sPartItem = itemStr.split('->');
+ return (
+
+ {
+ // eslint-disable-next-line array-callback-return
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ const ArrItemStr = t.split('#')[0]; /* 工序名称 */
+ const ArrItemNum = t.split('#')[1]; /* 状态 */
+ const ArrItemName = t.split('#')[2]; /* 机台名称 */
+ const ArrItemBanZhu = t.split('#')[3]; /* 班组 */
+ const ArrItemTime = t.split('#')[4]; /* 排单时间 */
+ const ArrItemPCNum = t.split('#')[5]; /* 排程数 */
+ const ArrItemSBNum = t.split('#')[6]; /* 上报数 */
+ const ArrItem7Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 8 ? t.split('#')[8] : ''; /* 包数 */
+ const ArrItem8Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 9 ? t.split('#')[9]: ''; /* 每包数量 */
+ const ArrItem9Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 10 ? t.split('#')[10]: ''; /* 零头数量 */
+ let ArrItemNumChange = '';
+ let icon;
+ // eslint-disable-next-line default-case
+ switch (Number(ArrItemNum)) {
+ case 0:
+ ArrItemNumChange = '未排程';
+ icon =
;
+ break;
+ case 1:
+ ArrItemNumChange = '未完成';
+ icon =
;
+ break;
+ case 2:
+ ArrItemNumChange = '生产中';
+ icon =
;
+ break;
+ case 3:
+ ArrItemNumChange = '暂停';
+ icon =
;
+ break;
+ case 4:
+ ArrItemNumChange = '取消';
+ icon =
;
+ break;
+ case 5:
+ ArrItemNumChange = '完成';
+ icon =
;
+ break;
+ }
+ // eslint-disable-next-line no-unused-vars
+ const content = (
+
+
工序名称:{ArrItemStr}
+
状态:{ArrItemNumChange}
+
机台名称:{ArrItemName}
+
班组:{ArrItemBanZhu}
+
排单时间:{ArrItemTime}
+
排程数:{ArrItemPCNum}
+
上报数:{ArrItemSBNum}
+ {
+ ArrItem7Num ?
包数:{ArrItem7Num}
:''
+ }
+ {
+ ArrItem8Num ?
每包数量:{ArrItem8Num}
:''
+ }
+ {
+ ArrItem9Num ?
零头数量:{ArrItem9Num}
:''
+ }
+
+ );
+ // 数字转换图标
+ return (
+
+ {icon}
+
{ArrItemStr}
+ {/*{ i + 1 === sPartItemLength ? '' :
}*/}
+
+ );
+ })
+ }
+
+
+
+ );
+ }
+ };
+ }
+ }
+ // 判断材料准备状态
+ if (commonUtils.isNotEmptyArr(sMaterialsStatus) && commonUtils.isNotEmptyArr(dataSource)) {
+ this.useVListNew = true;
+ const sModelsType = commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.app) ? this.props.app.currentPane.sModelsType : '';
+ if (true || sModelsType === 'production/productionPlanInfo' || sModelsType === 'productionMainPlan/productionMainPlan' || (commonUtils.isNotEmptyObject(sModelsType) && sModelsType.includes('view/')) || location.pathname.toLowerCase().indexOf('oee') > -1) {
+ /* 动态列Jsonn解析 */
+ if (commonUtils.isNotEmptyArr(sMaterialsStatus) && commonUtils.isNotEmptyArr(dataSource)) {
+ sMaterialsStatus.forEach((jsonStatus, index) => {
+ const dWidth = jsonStatus.width * 2;
+ const sBackGroundColor = jsonStatus.bReadonly ? '#f1f2f8' : '';
+ if (commonUtils.isNotEmptyArr(jsonStatus.children)) { /* 嵌套列头JSON解析 */
+ for (const obj of jsonStatus.children) {
+ obj.render = (itemStr) => {
+ if (commonUtils.isJSON(itemStr)) {
+ const sPartItem = JSON.parse(itemStr);
+ /* 取箭头弹出的窗体配置 */
+ let showConfig = {};
+ let linkStyle = '';/* 弹窗 */
+ if (commonUtils.isNotEmptyArr(this.props.config) && commonUtils.isNotEmptyArr(this.props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr('sMaterialsStatus')) {
+ const showConfigArr = this.props.config.gdsconfigformslave.filter(item => item.sName === 'sMaterialsStatus' && item.bVisible);
+ if (commonUtils.isNotEmptyArr(showConfigArr)) {
+ showConfig = showConfigArr[0];
+ if (commonUtils.isNotEmptyObject(showConfig) && showConfig.sDropDownType === 'picArr' && !commonUtils.isEmpty(showConfig.sActiveId) && commonUtils.isEmptyArr(this.props.sGroupByList)) {
+ linkStyle = 'sMaterialsStatusStyle';
+ }
+ }
+ }
+ return (
+
{
+ return
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ let colorValue = '#000000';
+ if (t?.background) {
+ colorValue = t.background;
+ } else {
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 0:
+ colorValue = '#000000'; /* 0:黑色 */
+ break;
+ case 1:
+ colorValue = '#ff4d4f'; /* 1:红色 */
+ break;
+ case 2:
+ colorValue = '#49aa19'; /* 2:绿色 */
+ break;
+ case 3:
+ colorValue = '#49aa19'; /* 3:绿色 */
+ break;
+ case 4:
+ colorValue = '#ff4d4f'; /* 4:红色 */
+ break;
+ default:
+ colorValue = '#000000';
+ }
+ }
+ return (
+
+ {commonUtils.isNotEmptyObject(t.sMaterialsName) ?
+
+ {t.sMaterialsName}
+ : ''}
+ { i + 1 === sPartItemLength ? '' : -}
+
+ );
+ })
+ }
+
+ }}>
+
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ let colorValue = '#000000';
+ if (t?.background) {
+ colorValue = t.background;
+ } else {
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 0:
+ colorValue = '#000000'; /* 0:黑色 */
+ break;
+ case 1:
+ colorValue = '#ff4d4f'; /* 1:红色 */
+ break;
+ case 2:
+ colorValue = '#49aa19'; /* 2:绿色 */
+ break;
+ case 3:
+ colorValue = '#49aa19'; /* 3:绿色 */
+ break;
+ case 4:
+ colorValue = '#ff4d4f'; /* 4:红色 */
+ break;
+ default:
+ colorValue = '#000000';
+ }
+ }
+ return (
+
+ {commonUtils.isNotEmptyObject(t.sMaterialsName) ?
+
+ {t.sMaterialsName}
+ : ''}
+ { i + 1 === sPartItemLength ? '' : -}
+
+ );
+ })
+ }
+
+
+ );
+ } else {
+ return itemStr;
+ }
+ };
+ };
+ } else { /* 无嵌套列头JSON列解析 */
+ sMaterialsStatus[index].render = (itemStr) => {
+ if (commonUtils.isJSON(itemStr)) {
+ const sPartItem = JSON.parse(itemStr);
+ /* 取箭头弹出的窗体配置 */
+ let showConfig = {};
+ let linkStyle = '';/* 弹窗 */
+ if (commonUtils.isNotEmptyArr(this.props.config) && commonUtils.isNotEmptyArr(this.props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr('sMaterialsStatus')) {
+ const showConfigArr = this.props.config.gdsconfigformslave.filter(item => item.sName === 'sMaterialsStatus' && item.bVisible);
+ if (commonUtils.isNotEmptyArr(showConfigArr)) {
+ showConfig = showConfigArr[0];
+ if (commonUtils.isNotEmptyObject(showConfig) && showConfig.sDropDownType === 'picArr' && !commonUtils.isEmpty(showConfig.sActiveId) && commonUtils.isEmptyArr(this.props.sGroupByList)) {
+ linkStyle = 'sMaterialsStatusStyle';
+ }
+ }
+ }
+ return (
+
{
+ return
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ let colorValue = '#000000';
+ if (t?.background) {
+ colorValue = t.background;
+ } else {
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 0:
+ colorValue = '#000000'; /* 0:黑色 */
+ break;
+ case 1:
+ colorValue = '#ff4d4f'; /* 1:红色 */
+ break;
+ case 2:
+ colorValue = '#49aa19'; /* 2:绿色 */
+ break;
+ case 3:
+ colorValue = '#49aa19'; /* 3:绿色 */
+ break;
+ case 4:
+ colorValue = '#ff4d4f'; /* 4:红色 */
+ break;
+ default:
+ colorValue = '#000000';
+ }
+ }
+ return (
+
+ {commonUtils.isNotEmptyObject(t.sMaterialsName) ?
+
+ {t.sMaterialsName}
+ : ''}
+ { i + 1 === sPartItemLength ? '' : -}
+
+ );
+ })
+ }
+
+ }}>
+
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ let colorValue = '#000000';
+ if (t?.background) {
+ colorValue = t.background;
+ } else {
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 0:
+ colorValue = '#000000'; /* 0:黑色 */
+ break;
+ case 1:
+ colorValue = '#ff4d4f'; /* 1:红色 */
+ break;
+ case 2:
+ colorValue = '#49aa19'; /* 2:绿色 */
+ break;
+ case 3:
+ colorValue = '#49aa19'; /* 3:绿色 */
+ break;
+ case 4:
+ colorValue = '#ff4d4f'; /* 4:红色 */
+ break;
+ default:
+ colorValue = '#000000';
+ }
+ }
+ return (
+
+ {commonUtils.isNotEmptyObject(t.sMaterialsName) ?
+
+ {t.sMaterialsName}
+ : ''}
+ { i + 1 === sPartItemLength ? '' : -}
+
+ );
+ })
+ }
+
+
+ );
+ } else {
+ return
{itemStr}
;
+ }
+ };
+ }
+ });
+ }
+ }
+ }
+ /* 动态列Jsonn解析 */
+ if (commonUtils.isNotEmptyArr(dynamicColumn) && commonUtils.isNotEmptyArr(dataSource)) {
+ dynamicColumn.forEach((jsonStatus, index) => {
+ if (commonUtils.isNotEmptyArr(jsonStatus.children)) { /* 嵌套列头JSON解析 */
+ const childrenJson = jsonStatus.children.filter(itemChild=> itemChild.dataIndex && itemChild.dataIndex.includes('json'));
+ for (const obj of childrenJson) {
+ obj.render = (itemStr) => {
+ if (commonUtils.isNotEmptyObject(itemStr) && commonUtils.isJSON(itemStr)) {
+ const sPartItem = JSON.parse(itemStr);
+ return (
+
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ // const sPartItemLength = sPartItem.length;
+ let colorValue = '#000000';
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 1:
+ colorValue = '#ff0000'; /* 1:红色 */
+ break;
+ case 2:
+ colorValue = '#49aa19'; /* 2:绿色 */
+ break;
+ case 3:
+ colorValue = '#ffff00'; /* 3:黄色 */
+ break;
+ case 0:
+ colorValue = ''; /* 3:不要颜色 */
+ break;
+ default:
+ colorValue = '';
+ }
+ return (
+
+ );
+ })
+ }
+
+ );
+ }
+ };
+ };
+ } else { /* 无嵌套列头JSON列解析 */
+ dynamicColumn[index].render = (itemStr) => {
+ if (commonUtils.isNotEmptyObject(itemStr) && commonUtils.isJSON(itemStr)) {
+ const sPartItem = JSON.parse(itemStr);
+ return (
+
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ // const sPartItemLength = sPartItem.length;
+ let colorValue = '#000000';
+ const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState;
+ switch (Number(sState)) { // 根据状态显示颜色
+ case 1:
+ colorValue = '#ff0000'; /* 1:红色 */
+ break;
+ case 2:
+ colorValue = '#49aa19'; /* 2:绿色 */
+ break;
+ case 3:
+ colorValue = '#ffff00'; /* 3:黄色 */
+ break;
+ default:
+ colorValue = '#666';
+ }
+ return (
+
+ );
+ })
+ }
+
+ );
+ } else {
+ return itemStr;
+ }
+ };
+ }
+ });
+ }
+
+ // 判断时间状态
+ if (commonUtils.isNotEmptyArr(sTimeStatus) && commonUtils.isNotEmptyArr(dataSource)) {
+ sTimeStatus[0].render = (itemStr) => {
+ if (commonUtils.isJSON(itemStr)) {
+ const sPartItem = JSON.parse(itemStr);
+ const linkStyle = 'sTimeStatusStyle';/* 弹窗 */
+ return (
+
+ {
+ // eslint-disable-next-line array-callback-return;
+ sPartItem.map((t, i) => {
+ const sPartItemLength = sPartItem.length;
+ const sColor = t.sColor;
+ const dWidth = t.dRate !== undefined && t.dRate !== 0 ? `${t.dRate * 500}px` : '100px';
+ const content = (
+
+
{`${t.sName} :${t.sValue}`}
+
+ );
+
+ return (
+
+
+ {t.sValue}
+
+
+ );
+ })
+ }
+
+ );
+ } else {
+ return itemStr;
+ }
+ };
+ }
+ // 判断拼板状态
+ if (commonUtils.isNotEmptyArr(sScheduleStatusJson) && commonUtils.isNotEmptyArr(dataSource)) {
+ this.useVListNew = true;
+ 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;
+ return (
+
+ {sName}{ i + 1 === itemLength ? '' : }
+
+ );
+ })
+ return (
+
+
{
+ return {content}
+ }}>
+ {content}
+
+
+ );
+ }
+ };
+ }
+ let components = {};
+ if (this.isDragAndDrop) {
+ components.header = { cell: ResizeableTitle };
+ components.body = { row: DragableBodyRow };
+ } else {
+ components.header = { cell: ResizeableTitle };
+ }
+ let bPagination = true; /* 默认表格分页s */
+ if (commonUtils.isNotEmptyObject(this.props)) {
+ 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]) {
+ noVlistController = true;
+ }
+
+ /* 特殊情况的表格 在虚拟列表情况 会无法滑动 */
+ let noVlistTable = false;
+ if(this.props.noVlistTable) {
+ noVlistTable = true;
+ }
+ // 判断是否有合并单元格, 有的话默认关闭虚拟滚动
+ // if (this.mergeCellStateMap) {
+ // for (let key in this.mergeCellStateMap) {
+ // if (this.mergeCellStateMap[key]) {
+ // noVlistController= true;
+ // }
+ // }
+ // }
+
+ // if (!noVlistTable) {
+ // if (this.props.slaveInfo || this.useVListNew) {
+ // if (!this.uniqueId || window.vlistNewSearh) {
+ // this.uniqueId = this.props.formId ? `${this.props.formId}_${lodash.uniqueId()}` : lodash.uniqueId();
+ // }
+ // if (!this.Vcomponents || window.vlistNewSearh) {
+ // const { tableClassName } = this.state;
+ // const oTable = document.querySelectorAll(`.${tableClassName}`)[0];
+ // if (oTable) {
+ // 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);
+ // }});
+ // }
+ // components = {...this.Vcomponents, ...components};
+ // } else {
+ // // vid是多个列表在同个页面中,同时渲染会促发问题
+ // // vid不可以为随机数,随机数会导致双击时,点击的两个VList id不同
+ // if (!this.uniqueId || window.vlistNewSearh) {
+ // this.uniqueId = this.props.formId ? `${this.props.formId}_${lodash.uniqueId()}` : lodash.uniqueId();
+ // }
+ // if (!this.Vcomponents1 || window.vlistNewSearh) {
+ // const { tableClassName } = this.state;
+ // const oTable = document.querySelectorAll(`.${tableClassName}`)[0];
+ // if (oTable) {
+ // const oBody = oTable.querySelector('.ant-table-body');
+ // oBody && (oBody.scrollTop = 0);
+ // }
+ // window.vlistNewSearh = null;
+ // this.Vcomponents1 = VListNew({ 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) {
+ tableColumn[index].fixed = false;
+ tableColumn[index].fixedHelp = false;
+ }
+ if (index < this.props.config.iFreezeColumn) {
+ tableColumn[index].fixed = 'left';
+ tableColumn[index].fixedHelp = true;
+ }
+ });
+ }
+ // 处理拖拽排序
+ if (this.props.dragHandle) {
+ 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)) {
+ message.error(array[fromIndex].sWorkOrderUsed);
+ return;
+ }
+ const [item] = array.splice(fromIndex, 1);
+ array.splice(endIndex, 0, item);
+ }
+ }
+ function arrayMoveImmutable(array, fromIndex, toIndex) {
+ array = [...array];
+ arrayMoveMutable(array, fromIndex, toIndex);
+ return array;
+ }
+ const DragHandle = sortableHandle(() =>
);
+ const SortableItem = sortableElement(props =>
|
);
+ const SortableContainer = sortableContainer(props =>
);
+ const onSortEnd = ({ oldIndex, newIndex }) => {
+ const { dataSource } = this.state;
+ if (oldIndex !== newIndex) {
+ const newData = arrayMoveImmutable([].concat(dataSource), oldIndex, newIndex).filter(el => !!el);
+ this.props.onDrag(newData, this.props.name);
+ }
+ };
+ 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
;
+ };
+ // 处理渲染后丢失input focus的bug.
+ let bDrag = this.props.enabled && !this.props.bForbiddenDrag;/* 是否可以拖动 */
+ if(bDrag) {
+ if (!this.DraggableContainer) {
+ this.DraggableContainer = DraggableContainer;
+ }
+ if (!this.DraggableBodyRow) {
+ this.DraggableBodyRow = DraggableBodyRow;
+ }
+ }
+ if(!handleSort) {
+ components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}};
+ } else {
+ components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}};
+ tableColumn.shift();
+ }
+ tableColumn.unshift(
+ {
+ title: '排序',
+ dataIndex: 'handleSort',
+ fixed: 'left',
+ width: 40,
+ className: 'drag-visible',
+ render: () =>
,
+ },
+ )
+ }
+ }
+
+ /**
+ * 更新缓存数据
+ */
+ if (Array.isArray(tableColumn) && this.props.config) {
+ const storageColumn = JSON.parse(sessionStorage.getItem(`${this.props.formId}_${this.props.config.sId}`));
+ if (storageColumn) {
+ sessionStorage.setItem(`${this.props.formId}_${this.props.config.sId}`, JSON.stringify(tableColumn));
+ }
+ }
+
+ 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
+ }
+ const { expKeys } = this.state;
+
+ /* 返回值 */
+ return {
+ components,
+ rowKey: this.rowKey,
+ 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'),
+ 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'); },
+ };
+ } 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(); },
+ };
+ }
+ },
+ onExpand: (expanded, record) => {
+ if (this.showExpAll) {
+ if (expanded) {
+ const expKeysNew = [...expKeys, record[this.rowKey]];
+ this.currentExpKeys = expKeysNew;
+ this.setState({
+ expKeys: expKeysNew
+ });
+ } else {
+ const expKeysNew = expKeys.filter(item => item !== record[this.rowKey]);
+ this.currentExpKeys = expKeysNew;
+ this.setState({
+ expKeys: expKeysNew
+ });
+ }
+ }
+ this.onExpand(expanded, record, 'slave'); /* 点击展开图标时触发s */
+ },
+ expandedRowKeys: expKeys.length || this.showExpAll || this.isAllowConExpendKeys ? expKeys : null,
+ 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
+ }
+ }
+ } : false, /* 表格是否分页 */
+ onChange: this.onChange,
+ };
+ };
+
+ /** 获取子从表复选框对象的props */
+ getSlaveRowSelection = (name, type) => {
+ const { bMutiSelect } = this.props.slaveInfo; /* 显示单选框还是复选框 */
+ let { bisMutiSelect } = this.props.slaveInfo; /* 是否显示选择框 */
+ if (this.props.slaveInfo.config) {
+ bisMutiSelect = this.props.slaveInfo.config.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), /* 选择行发生改变时调用的函数 */
+ getCheckboxProps: record => ({
+ style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' },
+ }), /* 过滤合计的选择框 */
+ type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */
+ columnWidth: 37,
+ };
+ } else {
+ return null;
+ }
+ } else {
+ return {
+ preserveSelectedRowKeys: true,
+ 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 */
+ columnWidth: 37,
+ };
+ }
+ };
+
+ /** 获取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;
+ // const scrollHeight = parseInt(document.body.clientHeight - 400, 10);
+ const components = {};
+ if (this.isDragAndDrop) {
+ components.header = { cell: ResizeableTitle };
+ components.body = { row: DragableBodyRow };
+ } else {
+ components.header = { cell: ResizeableTitle };
+ }
+
+ 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'),
+ onRow: (record, index) => {
+ if (this.isDragAndDrop) {
+ return {
+ index,
+ onClick: () => {
+ this.onRowClick(record, index, undefined, slaveInfoName, 'slaveInfo');
+ },
+ onDoubleClick: () => {
+ this.onDoubleClick(record, index, undefined, slaveInfoName, 'slaveInfo');
+ },
+ moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => {
+ this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey);
+ },
+ onDragClick: (type) => {
+ this.onRowClick(record, index, type, slaveInfoName, 'slaveInfo');
+ },
+ };
+ } else {
+ return {
+ index,
+ onClick: () => {
+ this.onRowClick(record, index, undefined, slaveInfoName, 'slaveInfo');
+ },
+ onDoubleClick: () => {
+ this.onDoubleClick(slaveInfoName, record);
+ },
+ };
+ }
+ },
+ // footer: this.props.footer === undefined ? this.tableFooter : undefined,
+ id: commonUtils.isEmptyArr(dataSource) ?
+ 'unDataBox' :
+ 'dataBox', /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */
+ ...this.props.slaveInfo.tableProps,
+ onChange: this.onChange,
+ };
+ } else { return null; }
+ };
+
+ getTableFilterData = () => {
+ const { dataSource } = this.state;
+ const { masterData } = this.props;
+ let filterData = 0;
+ const GetFilterData = this.props.OnGetFilterData;
+ if (GetFilterData !== undefined) {
+ filterData = this.props.OnGetFilterData(this.props.name, this.props.bFinished);
+ } else {
+ filterData = dataSource.length;
+ }
+ if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) {
+ if(masterData.sZczlxShowName === '删除' || masterData.sZczlxShowName === '恢复'){
+ filterData += 1;
+ }
+ }
+ return filterData;
+ }
+ /** 获取showConfig */
+ getShowConfig = (props, sName, isSlaveInfo) => {
+ /* 返回值声明 */
+ let showConfig = [];
+ /* 通过sName过滤出对应的showConfig */
+ if (props.customConfig) {
+ const showConfigArr = props.customConfig.filter(item => item.sName === sName && item.bVisible);
+ if (commonUtils.isNotEmptyArr(showConfigArr)) {
+ showConfig = showConfigArr[0];
+ }
+ } else {
+ if (props.config) {
+ const showConfigArr = props.config.gdsconfigformslave.filter(item => item.sName === sName && item.bVisible);
+ if (commonUtils.isNotEmptyArr(showConfigArr)) {
+ showConfig = showConfigArr[0];
+ }
+ }
+
+ 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];
+ }
+ }
+
+ }
+ /* 返回值 */
+ return showConfig;
+ };
+
+ /** 获取颜色Config */
+ getColorConfig = () => {
+ let showConfig = [];
+ /* 通过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);
+ 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);
+ 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);
+ if (commonUtils.isNotEmptyArr(showConfigArr)) {
+ showConfig = showConfigArr;
+ }
+ }
+
+ }
+ /* 返回值 */
+ return showConfig;
+ };
+
+ rowColorData = React.createRef();
+
+ getColorStyle = (record, isRowShow) => {
+ let styleColorArrTotal = '';
+ const showConfigArr = this.getColorConfig(); /* 拿到颜色配置json */
+ if (commonUtils.isNotEmptyArr(showConfigArr) && showConfigArr.length > 0) {
+ for (const showConfig of showConfigArr) {
+ let styleColorArr = '';
+ const colorConditon = commonUtils.isNotEmptyObject(showConfig) ? showConfig.sColorTerms : null;
+ if (commonUtils.isNotEmptyObject((colorConditon))) {
+ let colorConditionArr = '';
+ try {
+ colorConditionArr = JSON.parse(colorConditon); /* 转化为json */
+ } catch (e) {
+ colorConditionArr = '';
+ }
+ colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ''; /* 判断是否是数组 */
+ for (const item of colorConditionArr) {
+ 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('#', '-')}`;
+ style.innerHTML = `
+ .color${color.replace('#', '-')} td {
+ background-color:${color}!important;
+ .ant-table-selection-column {
+ background-color:${color}!important;
+ }
+ }
+ `;
+ document.getElementsByTagName('head')[0].appendChild(style);
+ }
+ 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 sXValue = this.props[sXName];
+ styleColor = record[column] === sXValue ? `SetRow_${color} color${color.replace('#', '-')}` : '';
+ }
+ } else {
+ 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('#', '-')}` : '';
+ }
+ }
+ }
+ styleColorArr += styleColor;
+ const index = this.rowColorData.current?.findIndex(i => i && i.key === record?.[this.rowKey]);
+ if (styleColor) {
+ 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 }];
+ }
+ } else {
+ if (Array.isArray(this.rowColorData.current) && index >= 0) this.rowColorData.current?.splice(index, 1);
+ }
+ }
+ }
+ styleColorArrTotal += `${styleColorArr} `;
+ }
+ }
+ return styleColorArrTotal;
+ }
+ /** 获取单元格颜色配置 */
+ getCellColorConfig = (text, record, sName) => {
+ 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 = '';
+ try {
+ colorConditionArr = JSON.parse(colorConditon); /* 转化为json */
+ } catch (e) {
+ colorConditionArr = '';
+ }
+ colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : '';
+ for (const item of colorConditionArr) {
+ let styleColor = '';
+ // eslint-disable-next-line no-unused-vars
+ 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 : '';
+ }
+ } 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;
+ 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 : '';
+ }
+ } 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 : '';
+ }
+ }
+ }
+ }
+ }
+ }
+ styleColorArr += styleColor;
+ styleColorArrB += styleBackground;
+ if(styleColor) {
+ styleColorArr = styleColor;
+ }
+ if(styleBackground) {
+ styleColorArrB = styleBackground;
+ }
+ }
+ }
+ styleColorArrTotal = styleColorArr;
+ styleColorArrTotalB = styleColorArrB;
+ }
+ }
+ const iIndex = showConfigArr.findIndex(item => item.sName === sName);
+ if (iIndex !== -1) {
+ const { sColorTerms } = showConfigArr[iIndex];
+ if (sColorTerms && sColorTerms.startsWith('#')) {
+ styleColorArrTotal = sColorTerms;
+ }
+ }
+ styleColorArrTotalM.styleColorArrTotal = styleColorArrTotal;
+ styleColorArrTotalM.styleColorArrTotalB = styleColorArrTotalB;
+ return styleColorArrTotalM;
+ };
+
+ /**
+ * 部分字段不可编辑
+ */
+ getSelectRowEditState = (sName, record, enabled) => {
+ const { config, name, masterData } = this.props;
+ let result = enabled;
+ const { sInstruct: sInstructStr } = config;
+ const sInstruct = commonUtils.convertStrToObj(sInstructStr, {});
+ const { data = [] } = sInstruct;
+
+ const btnConfig = data.find(item => item && item.name === sName && item.enabled !== undefined);
+ if (btnConfig && enabled) {
+ const { enabled: enabledContent } = btnConfig;
+ if (typeof enabledContent === 'boolean') {
+ result = enabledContent;
+ } else if (enabledContent) {
+ const tempData = {
+ props: {
+ enabled
+ },
+ master: masterData,
+ [name]: record
+ };
+
+ let strNew = enabledContent;
+ Object.keys(tempData).forEach(key => {
+ const reg = new RegExp(`${key}\\.`, "g");
+ strNew = strNew.replace(reg, `tempData["${key}"].`);
+ });
+ try {
+ const evalStr = eval("`" + strNew + "`");
+ result = !!eval(evalStr);
+ // console.log('=====表格行按钮状态结果', result, { sName, enabledContent, tempData, strNew, evalStr });
+ } catch (error) {
+ // console.log('=====表格行按钮状态错误', { error, enabledContent, strNew, tempData });
+ }
+ }
+ }
+
+ return result;
+ }
+
+ // 获取表格行按钮状态
+ getTableBtnState = (btnName, record) => {
+ let result = false;
+ const { enabled, config, masterData, name, sUseInfo, bLimitOperate } = this.props;
+ result = enabled;
+ /* 订单占用,则该行锁定 不能操作 */
+ const { sWorkOrderUsed } = record;
+ if (commonUtils.isNotEmptyObject(sWorkOrderUsed)) {
+ result = false;
+ }
+ /* 若红冲单据 则按钮锁定 不能操作 */
+ if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === '1') {
+ result = false;
+ }
+ if(btnName === 'BtnAdd' && bLimitOperate){
+ result = false;
+ }
+
+ const { sInstruct: sInstructStr } = config;
+ const sInstruct = commonUtils.convertStrToObj(sInstructStr, {});
+ const { data = [] } = sInstruct;
+
+ const btnConfig = data.find(item => item && item.name === btnName && item.enabled !== undefined);
+ if (btnConfig) {
+ const { enabled: enabledContent } = btnConfig;
+ if (typeof enabledContent === 'boolean') {
+ result = enabledContent;
+ } else if (enabledContent) {
+ const tempData = {
+ props: {
+ enabled
+ },
+ master: masterData,
+ [name]: record
+ };
+
+ let strNew = enabledContent;
+ Object.keys(tempData).forEach(key => {
+ const reg = new RegExp(`${key}\\.`, "g");
+ strNew = strNew.replace(reg, `tempData["${key}"].`);
+ });
+ try {
+ const evalStr = eval("`" + strNew + "`");
+ result = !!eval(evalStr);
+ // console.log('=====表格行按钮状态结果', result, { btnName, enabledContent, tempData, strNew, evalStr });
+ } catch (error) {
+ console.log('=====表格行按钮状态错误', { error, enabledContent, strNew, tempData });
+ }
+ }
+ }
+
+ return result;
+ }
+
+ bCheckBoxColumm = (column) => {
+ const { gdsconfigformslave } = this.props.config || {};
+ const item = gdsconfigformslave?.find(i => i && i.sName === column?.dataIndex && i.bVisible);
+ 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}
+ >
+ }
+ }
+
+ /** 获取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' &&
+ props.name &&
+ 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 tableColumn = [];
+ let iIndex = 0;
+ const specialRoute = commonUtils.isNotEmptyObject(this.props.app.currentPane) ? this.props.app.currentPane.route : ''; /* 获取路由名称 */
+ /* 遍历每一个表头标题 */
+ for (const column of headerColumn) {
+ /* 表头标题 */
+ const title = column.title;
+ const width = column.width;
+ const bNotEmpty = column.bNotEmpty;
+ /* 带'-'的表头是需要合并滴 */
+ 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) {
+ 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])));
+ } else {
+ 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')) {
+ 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){
+ 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){
+ 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 : ''; /* 标题字体颜色 */
+ const styleObj = {};
+ if (commonUtils.isNotEmptyObject(sTitleBgColor)) {
+ styleObj.background = sTitleBgColor;
+ }
+ if (commonUtils.isNotEmptyObject(sTitleColor)) {
+ styleObj.color = sTitleColor;
+ }
+ const renderTitle = () => {
+ // 树形表格在第一个column上加上全部展开/收起功能
+ let expandedAllIcon = '';
+ const columnIndex = headerColumn.findIndex(item => column.title === item.title);
+ let { data } = this.props;
+ let { expKeys } = this.state;
+ expKeys = commonUtils.isNotEmptyArr(expKeys) ? expKeys : [];
+ expKeys = this.currentExpKeys || expKeys;
+ data = commonUtils.isNotEmptyArr(data) ? data : [];
+
+ const childrenList = [];
+ const getChildrenList = (data) => {
+ data.forEach(item => {
+ if (item && typeof item.children === 'object') {
+ childrenList.push(item);
+ getChildrenList(item.children);
+ }
+ });
+ }
+ getChildrenList(data);
+ if (columnIndex === 0 && childrenList.length) { // 第一个column并且数据中有children
+ this.showExpAll = true;
+ this.tableCollapsed = !expKeys.length;
+ const marginLeft = this.props.bMutiSelect ? '6px' : '2px';
+ expandedAllIcon = (
+ ,
+ {
+ const checkedObj = commonFileDownloadList.filter(item => item.checked);
+ if (commonUtils.isNotEmptyArrNew(checkedObj)) {
+ const fileUrl = checkedObj.map(item => item.url).toString();
+ this.handleFileDownload(fileUrl);
+ }
+ }
+ }>下载选中,
+ 关闭,
+ ]}
+ >
+ {
+ commonFileDownloadList.map(item => {
+ const { url, checked } = item;
+ const fileName = url.split('/').pop().split('_').pop();
+ const fileType = fileName.split('.').pop().toLowerCase();
+ const previewFileList = ['jpg', 'png', 'jepg', 'webp', 'svg', 'bmp', 'apng', 'pdf'];
+ return (
+
+
+
+ )
+ })
+ }
+
+ : ''
+ }
+ {
+ pdfFileVisible ?
+ {
+ this.setState({
+ pdfFileVisible: false
+ });
+ }}
+ >
+
+ : ''
+ }
+ {
+ bOperateMoreVisible ?
+ {
+ this.setState({
+ bOperateMoreVisible: false
+ });
+ }}
+ >
+
+
+
+ : ''
+ }
+
+ {officePreviewVisible && }
+ {/* 简单对话框 */}
+ { this.state.simpleModalVisible && this.setState({ simpleModalVisible: false, simpleModalWord: '' })}
+ >
+
+ }
+
+ );
+ }
+}
+
+const CommonTable = (props) => {
+ const { name, data = [] } = props;
+ const [headerColumn, setHeaderColumn] = useState([]);
+ const addState = {};
+ if (name !== 'master') {
+ const config = props.onMergeSlaveConfig && props.onMergeSlaveConfig(props.config);
+ if (commonUtils.isNotEmptyObject(config)) {
+ addState.config = config;
+ addState.headerColumn = commonFunc.getHeaderConfig(addState.config).map(i => {
+ const value = Array.isArray(headerColumn) && headerColumn.find(j => j && j.dataIndex === i.dataIndex);
+ value && (i.width = value.width);
+ return i;
+ });
+ }
+ }
+
+ // 增加行号iRowNum
+ const [updateRowNumTime, setUpdateRowNumTime] = useState(0);
+ addState.updateRowNumTime = updateRowNumTime;
+ useEffect(() => {
+ handleSetIRowNum(data, props);
+ setUpdateRowNumTime(pre => pre + 1);
+ }, [JSON.stringify(data)]);
+
+ if (props.defaultExpandAllRows !== undefined && props.data === undefined) {
+ return '';
+ }
+
+ const handleMoveLine = ({ index, direction }) => {
+ if (direction === "up" && index === 0) {
+ message.error("当前已是首行,无法上移!");
+ return;
+ } else if (direction === "down" && index === data.length - 1) {
+ message.error("当前已是末行,无法下移!");
+ return;
+ }
+
+ const indexNew = direction === "up" ? index - 1 : index + 1;
+ const iOrder1 = data[index].iOrder;
+ const iOrder2 = data[indexNew].iOrder;
+ data[index].iOrder = iOrder2;
+ data[indexNew].iOrder = iOrder1;
+
+ const tempItem = data[index];
+ data[index] = {...data[indexNew], handleType: data[indexNew].handleType || "update"};
+ data[indexNew] = {...tempItem, handleType: tempItem.handleType || "update"};
+
+ props.onSaveState({
+ [`${props.name}Data`]: data
+ });
+ };
+
+ addState.onMoveLine = handleMoveLine;
+
+ if (sessionStorage.getItem(`${props.formId}_${props.config?.sId}_tableHeight`)) {
+ addState.fixedHeight = Number(sessionStorage.getItem(`${props.formId}_${props.config.sId}_tableHeight`));
+ if (props.tableProps?.AutoTableHeight) {
+ delete props.tableProps.AutoTableHeight;
+ }
+ }
+ const setTempFixedHeight = (height) => {
+ sessionStorage.setItem(`${props.formId}_${props.config.sId}_tableHeight`, height);
+ window.vlistNewSearh = true;
+ setUpdateRowNumTime(pre => pre + 1);
+ }
+ const uniqueTableId = `table_${props.formId}_${props.config?.sId}`;
+
+ return (
+
+
+
+
+ );
+};
+
+const handleSetIRowNum = (data, props) => {
+ data.forEach((item, index) => {
+ item.iRowNum = index + 1;
+ if (['12710101117007068710620'].includes(props?.app?.currentPane?.formId)) {
+ item.sVersionNum = item.iRowNum.toString().padStart(2, 0);
+ }
+
+ // 排除成品盘点、材料盘点(数据太多,循环页面卡死)
+ if (props.name === 'slaveChild' && !['192116810113315264733417750', '192116810113315228128521360'].includes(props?.app?.currentPane?.formId)) {
+ /* 序号根据sSqlConditonId分组 序号重排 */
+ const groupedData = commonUtils.groupBy(data, item => item.sSqlConditionId);
+ if (commonUtils.isNotEmptyObject(groupedData)) {
+ for (const key of Object.keys(groupedData)) {
+ const eachData = groupedData[key];
+ if (commonUtils.isNotEmptyArr(eachData)) {
+ eachData.forEach((item, index) => {
+ /* 采购 */
+ item.iRowNum = index +1;
+ const iIndex = data.findIndex(row => row.sId === item.sId);
+ if(iIndex > -1) {
+ data[iIndex] ={...data[iIndex], iRowNum: index +1}
+ }
+
+ });
+ }
+ }
+ }
+ }
+ if(location.pathname !== '/indexPage/commonClassify'){
+ if (commonUtils.isNotEmptyArr(item.children)) {
+ handleSetIRowNum(item.children, props);
+ }
+ }
+ });
+}
+
+const MoveLineComponent = (props) => {
+
+ if (!location.pathname.includes('commonSubBill')) {
+ return "";
+ }
+
+ const [position, setPosition] = useState({ bottom: 0 });
+ const positionRef = useRef(position);
+ positionRef.current = position;
+
+ const divProps = {
+ className: styles.moveLine,
+ style: position,
+ onMouseDown: e => {
+ const initialBottom = position.bottom;
+ const initialY = e.clientY;
+
+ const moveHandler = (moveEvent) => {
+ const newY = moveEvent.clientY;
+ const newBottom = initialBottom - (newY - initialY);
+ setPosition({ bottom: newBottom });
+ };
+
+ const upHandler = () => {
+ const preHeight = document.querySelector(`#${props.uniqueTableId}`).querySelector('.ant-table-body').getBoundingClientRect().height;
+ props.setTempFixedHeight(Math.max(preHeight - positionRef.current.bottom, 37));
+ setPosition({ bottom: 0 });
+ document.body.onselectstart = () => true;
+ document.removeEventListener('mousemove', moveHandler);
+ document.removeEventListener('mouseup', upHandler);
+ };
+
+ document.body.onselectstart = () => false;
+ document.addEventListener('mousemove', moveHandler);
+ document.addEventListener('mouseup', upHandler);
+ }
+ };
+
+ return ;
+}
+
+export default CommonTable;
diff --git a/src/components/Common/CommonTable/index.less b/src/components/Common/CommonTable/index.less
new file mode 100644
index 0000000..1513909
--- /dev/null
+++ b/src/components/Common/CommonTable/index.less
@@ -0,0 +1,141 @@
+.subForm {
+ margin-bottom: 10px;
+ position: relative;
+ .extraAction {
+ position: absolute;
+ top: -30px;
+ right: 0;
+ .del {
+ background: #fd674a;
+ border: 1px solid #fd674a;
+ &:hover {
+ color: #fff;
+ border: 1px solid #fb795f!important;
+ background: #fb795f!important;
+ }
+ }
+ }
+ .summaryCell{
+ color: red;
+ font-weight: bold;
+ white-space:nowrap; /* 合计不换行 */
+ overflow: hidden;/*超出部分隐藏*/
+ text-overflow:ellipsis;/*超出部分文字以...显示*/
+ display: block;
+ }
+ .summaryCellTotal{
+ color: black;
+ font-weight: bold;
+ }
+}
+.disabledProup {
+ .iconAdd i:hover:before {
+ color: rgba(0, 0, 0, 0.43);
+ }
+ .editSelect > div:hover {
+ border-color: transparent!important;
+ background: transparent!important;
+ }
+ .editSelect > div:hover span {
+ color: rgba(0, 0, 0, 0.25);
+ }
+ .editSelect > div > div > div {
+ color: #000!important;
+ }
+ .inputNum input:hover {
+ border: 2px solid transparent!important;
+ background: transparent!important;
+ }
+ input[disabled]:hover {
+ background: none!important;
+ }
+ .tableDataPicker input:hover {
+ border: 1px solid #e6d8d8!important;
+ }
+}
+.disabledProup, .proup {
+ :global {
+ .ant-table-scroll > div:last-child {
+ position: relative;
+ }
+
+ }
+}
+:global {
+ .react-resizable {
+ position: relative;
+ background-clip: padding-box;
+ }
+ .react-resizable-handle {
+ position: absolute;
+ width: 10px;
+ height: 100%;
+ bottom: 0;
+ right: -5px;
+ cursor: col-resize;
+ z-index: 1;
+ }
+ th[bnotresize] .react-resizable-handle{
+ cursor: default;
+ }
+ .tableNoPadding {
+ .ant-table-row {
+ td{
+ padding: 0 !important;
+ }
+ }
+ }
+ .vlist-td-display {
+ display: none;
+ }
+ .virtuallist>table>tbody>tr:nth-of-type(2) {
+ .vlist-td-display {
+ display: table-cell;
+ }
+ }
+}
+
+.tdCell {
+ .fastSearchBtn {
+ position: absolute;
+ top: 0;
+ right: 0;
+ background-color: #fff7e6;
+ display: none;
+ &:hover {
+ color: #2f54eb;
+ zoom: 1.1;
+ }
+ }
+ &:hover {
+ .fastSearchBtn {
+ display: block;
+ }
+ }
+}
+
+.colorInfo {
+ display: flex;
+ flex-wrap: wrap;
+ font-size: 10px;
+}
+
+.moveLine {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ height: 2px;
+ border: 2px dashed #448ef7;
+ z-index: 2;
+ cursor: ns-resize;
+ opacity: 0;
+
+ &:hover {
+ opacity: 1;
+ }
+
+ &:active {
+ border-color: #72c240;
+ }
+}
\ No newline at end of file
diff --git a/src/components/Common/CommonTableNew/index.less b/src/components/Common/CommonTableNew/index.less
new file mode 100644
index 0000000..b5beeb7
--- /dev/null
+++ b/src/components/Common/CommonTableNew/index.less
@@ -0,0 +1,5 @@
+.tableNew {
+ border: 1px solid red;
+ width: 100%;
+ height: 100%;
+}
\ No newline at end of file
diff --git a/src/components/Common/CommonTableNew/index.tsx b/src/components/Common/CommonTableNew/index.tsx
new file mode 100644
index 0000000..1a27e62
--- /dev/null
+++ b/src/components/Common/CommonTableNew/index.tsx
@@ -0,0 +1,65 @@
+import React from 'react';
+import { Table } from 'antd';
+import type { TableProps } from 'antd';
+import * as commonUtils from '@/utils/utils';
+
+import style from './index.less';
+
+
+interface PropsType {
+ data: TableProps['dataSource'];
+ headerColumn: TableProps['columns'];
+}
+
+const TableNew: React.FC = (props) => {
+ const tableProps = {
+ columns: TableHeader(props),
+ dataSource: TableData(props),
+ scroll: {
+ // x: 'max-content',
+ y: '100%',
+ }
+ };
+
+ return (
+
+
{...tableProps} />
+
+ );
+};
+
+
+// 处理数据
+const TableData = (props: PropsType): PropsType['data'] => {
+ const { data = [] } = props;
+ return data;
+}
+
+// 处理表头
+const TableHeader = (props: PropsType): PropsType['headerColumn'] => {
+ const { headerColumn = [], data = [] } = props;
+
+ return headerColumn.map((colunm) => {
+ colunm.ellipsis = true;
+ // colunm.textWrap = 'word-break',
+ if (!('dataIndex' in colunm)) return colunm;
+ const { dataIndex } = colunm;
+ if (dataIndex === 'sPartNameStatus') {
+ interface TextJsonItem {
+ sProcessName: string;
+ sState: number;
+ }
+ return {
+ ...colunm,
+ render: (text: string, record: object) => {
+ const textJson: TextJsonItem[] = commonUtils.convertStrToObj(text.replace(",]", ']'), []) as TextJsonItem[];
+ console.log('=====xxx', text, textJson);
+ return textJson.map(item => item.sProcessName).join('->');
+ },
+ };
+ }
+ return colunm;
+ });
+}
+
+export default TableNew;
\ No newline at end of file
diff --git a/src/components/Common/EditorModal/index.js b/src/components/Common/EditorModal/index.js
new file mode 100644
index 0000000..6800951
--- /dev/null
+++ b/src/components/Common/EditorModal/index.js
@@ -0,0 +1,101 @@
+/* eslint-disable */
+import React, { Component } from 'react';
+import '@ant-design/compatible/assets/index.css';
+import AntdDraggableModal from '@/components/Common/AntdDraggableModal';
+import BraftEditor from 'braft-editor'
+import 'braft-editor/dist/index.css'
+
+export default class EditorModal extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.controls = [
+ 'undo', 'redo', 'separator',
+ 'font-size', 'line-height', 'letter-spacing', 'separator',
+ 'text-color', 'bold', 'italic', 'underline', 'strike-through', 'separator',
+ 'superscript', 'subscript', 'remove-styles', 'separator', 'text-indent', 'text-align', 'separator',
+ 'headings', 'list-ul', 'list-ol', 'blockquote', 'code', 'separator',
+ 'link', 'separator', 'hr', 'separator',
+ 'separator',
+ 'clear', 'media',
+ ]
+ this.state = {
+ editorState: BraftEditor.createEditorState(null)
+ };
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.curEditorProps) {
+ if (nextProps.curEditorProps.value) {
+ this.setState({
+ editorState: BraftEditor.createEditorState(nextProps.curEditorProps.value)
+ })
+ } else {
+ this.setState({
+ editorState: BraftEditor.createEditorState(null)
+ })
+ }
+ }
+ }
+
+ handleEditorChange = (editorState) => {
+ this.setState({ editorState })
+ }
+
+ handleCloseModal = () => {
+ this.props.onSaveState({
+ curEditorProps: {
+ ...this.props.curEditorProps,
+ visible: false
+ }
+ })
+ }
+
+ handleOk = () => {
+ let { masterData, curEditorProps } = this.props;
+ let addState = {};
+ const value = this.state.editorState.toHTML();
+ let handleType = masterData.handleType ? masterData.handleType : 'update';/* 获取操作类型 */
+ addState.handleType = handleType;
+ addState[curEditorProps.sName] = value;
+ this.props.onSaveState({ masterData: {...masterData, ...addState}, curEditorProps: {...curEditorProps, value} });
+ this.handleCloseModal();
+ };
+
+ handleCancel = () => {
+ this.handleCloseModal();
+ };
+
+ /** 渲染 */
+ render() {
+ const { curEditorProps = {} } = this.props;
+ let visible = false;
+ if (Object.keys(curEditorProps).length) {
+ visible = curEditorProps.visible;
+ }
+ return (
+
+ {
+ visible ?
+
+ : ''
+ }
+
+ );
+ }
+}
diff --git a/src/components/Common/FileImposition/index.js b/src/components/Common/FileImposition/index.js
new file mode 100644
index 0000000..33e7209
--- /dev/null
+++ b/src/components/Common/FileImposition/index.js
@@ -0,0 +1,485 @@
+/* eslint-disable */
+import React, { useState, useEffect } from "react";
+import {
+ Button,
+ Upload,
+ message,
+ Progress,
+ Modal,
+ notification,
+ Spin
+} from "antd";
+import { UploadOutlined } from "@ant-design/icons";
+import AntdDraggableModal from "@/components/Common/AntdDraggableModal";
+import * as commonBusiness from "@/components/Common/commonBusiness";
+import * as commonFunc from "@/components/Common/commonFunc";
+import StaticEditTable from "@/components/Common/CommonTable";
+import * as commonUtils from "@/utils/utils";
+import * as commonServices from "@/services/services";
+import styles from "./index.less";
+
+const FileImpositionEvent = props => {
+ const [mianhuaUrl, setMiaohuaUrl] = useState("");
+ const [fileQueryUrl, setFileQueryUrl] = useState("");
+ const [uploadFileUrl, setUploadFileUrl] = useState("");
+
+ useEffect(() => {
+ fetch("/pinban.json")
+ .then(response => response.json())
+ .then(data => {
+ const { mianhuaUrl, fileQueryUrl, uploadFileUrl } = data;
+ setMiaohuaUrl(mianhuaUrl);
+ setFileQueryUrl(fileQueryUrl);
+ setUploadFileUrl(uploadFileUrl);
+ })
+ .catch(error => {
+ console.error("Error fetching JSON data:", error);
+ });
+
+ const { masterData = {} } = props;
+ const { sGenerate_files } = masterData;
+ const { fileList = [] } = commonUtils.convertStrToObj(sGenerate_files);
+ const pinbanData = fileList.map((filename, index) => ({
+ sId: index,
+ fileType: filename.split(".").pop(),
+ sFileName: filename
+ }));
+ props.onSaveState({
+ pinbanData
+ });
+ }, []);
+
+ const [bCreating, setBCreating] = useState(false);
+
+ return {
+ ...props,
+ mianhuaUrl,
+ fileQueryUrl,
+ uploadFileUrl,
+ bCreating,
+ setBCreating
+ };
+};
+
+const FileImposition = baseProps => {
+ const { visible } = baseProps;
+ if (!visible) return "";
+ const props = FileImpositionEvent(baseProps);
+ const { onCancel, onOk, fileName, bCreating } = props;
+
+ const divProps = {
+ action: props.uploadFileUrl,
+ onChange: handleUploadChange.bind(this, props),
+ accept: "*/*",
+ showUploadList: false,
+ multiple: true
+ // customRequest: async options => {
+ // const { file, onSuccess, onError } = options;
+ // const formData = new FormData();
+ // formData.append("file", file);
+
+ // formData.append("savePathStr", "24120138_3");
+ // try {
+ // const response = await fetch(
+ // `${commonConfig.file_host}file/uploadMultiMh`,
+ // {
+ // method: "POST",
+ // body: formData
+ // }
+ // );
+
+ // if (response.ok) {
+ // const result = await response.json();
+ // console.log("=====result", result);
+ // } else {
+ // onError(new Error("文件上传失败"));
+ // }
+ // } catch (error) {
+ // onError(error);
+ // }
+ // }
+ };
+
+ const sGenerate_files = commonUtils.convertStrToObj(
+ props.masterData.sGenerate_files
+ );
+ const { previewUrl } = sGenerate_files;
+
+ return (
+ {
+ if (previewUrl) {
+ Modal.confirm({
+ title: "温馨提示:",
+ content: 已生成拼板,是否需要合成新拼板?
,
+ onOk() {
+ handleCreateFile(props);
+ }
+ });
+ } else {
+ handleCreateFile(props);
+ }
+ }}
+ >
+ 合成拼板
+ ,
+ {
+ if (!previewUrl) {
+ message.info("请先合成拼板!");
+ return;
+ }
+
+ props.onSaveState({
+ pdfFileVisible: true,
+ previewUrl: previewUrl,
+ previeTitle: "拼板预览"
+ });
+ }}
+ >
+ 拼板预览
+ ,
+
+ 取消
+ ,
+ {
+ props.onSubmit();
+ onCancel();
+ }}
+ >
+ 确定
+
+ ]}
+ >
+
+
+ 附件上传
+
+ {fileName}
+
+
+
+
+
+
+ );
+};
+
+const handleCreateFile = async props => {
+ props.setBCreating(true);
+ const { pinbanSelectedRowKeys = [], pinbanData = [] } = props;
+
+ if (!pinbanData.length) {
+ message.info("请先上传附件!");
+ return;
+ }
+
+ let rowKeys = pinbanSelectedRowKeys;
+
+ if (!pinbanSelectedRowKeys.length) {
+ const result = await new Promise(resolve => {
+ Modal.confirm({
+ title: "温馨提示:",
+ content: 未勾选附件,是否用全部附件合成拼板?
,
+ okText: "是",
+ cancelText: "否",
+ onOk() {
+ resolve(true);
+ },
+ onCancel() {
+ resolve(false);
+ }
+ });
+ });
+ if (!result) {
+ props.setBCreating(false);
+ return;
+ }
+
+ rowKeys = pinbanData.map(item => item.sId);
+ }
+
+ const returnData = await commonServices.postValueService(
+ "miaohua",
+ {
+ method: "auth.create_session",
+ user_name: "xly",
+ user_pass: "1234"
+ },
+ props.mianhuaUrl
+ );
+
+ const { data = {} } = returnData;
+ const { session } = data;
+ if (!session) {
+ handleDealError(props);
+ return;
+ }
+
+ const files = pinbanData
+ .filter(item => rowKeys.includes(item.sId))
+ .map(item => item.sFileName);
+
+ const returnData1 = await commonServices.postValueService(
+ "miaohua",
+ {
+ method: "hub.start_from_whitepaper_with_files_and_variables",
+ session,
+ whitepaper_name: "XLY-SR",
+ input_name: "erp-s&r",
+ options: {
+ variables: {
+ OrderID: "20250222001",
+ srheight: "957",
+ srwidth: "275",
+ fcounts: "616,176",
+ StyleP: "label"
+ },
+ files
+ }
+ },
+ props.mianhuaUrl
+ );
+
+ const { data: data1 = {} } = returnData1;
+ const { workable_id } = data1;
+ if (!workable_id) {
+ handleDealError(props);
+ return;
+ }
+
+ notification.open({
+ key: "fileCreating",
+ placement: "topRight",
+ message: "温馨提示",
+ description: (
+
+
+ {" 拼板文件生成中..."}
+
+ )
+ });
+
+ let times = 0;
+ const timer = setInterval(() => {
+ times += 1;
+ commonServices
+ .postValueService("miaohua", { workable_id }, props.fileQueryUrl)
+ .then(({ data }) => {
+ const { code } = data;
+ if (code === 0) {
+ props.setBCreating(false);
+ const { sGenerate_files: previewUrl } =
+ data.data?.dataList?.[0] || {};
+ if (previewUrl) {
+ const sGenerate_files = commonUtils.convertStrToObj(
+ props.masterData.sGenerate_files
+ );
+
+ clearInterval(timer);
+ notification.open({
+ key: "fileCreating",
+ placement: "topRight",
+ message: "温馨提示",
+ description: 拼板文件生成完成!
,
+ duration: 3
+ });
+
+ props.onSaveState1({
+ masterData: {
+ ...props.masterData,
+ sGenerate_files: JSON.stringify({
+ ...sGenerate_files,
+ workableId: workable_id,
+ previewUrl
+ }),
+ handleType: props.masterData.handleType || "update"
+ }
+ });
+ }
+ }
+ })
+ .catch(e => {
+ console.log("=====e", e);
+ });
+
+ if (times > 100) {
+ clearInterval(timer);
+ notification.open({
+ key: "fileCreating",
+ placement: "topRight",
+ message: "温馨提示",
+ description: 拼板文件生成完成!
,
+ duration: 3
+ });
+ handleDealError(props);
+ }
+ }, 5000);
+};
+
+const handleDealError = props => {
+ message.error("获取数据失败");
+ props.setBCreating(false);
+};
+
+const handleGetStrokeColor = percent => {
+ if (percent < 30) {
+ return "#F50";
+ } else if (percent >= 30 && percent < 90) {
+ return "#FF9900";
+ } else {
+ return "#87D068";
+ }
+};
+
+const handleUploadChange = (props, info) => {
+ const { file } = info;
+ const { status, percent } = file;
+ if (status === undefined) return;
+ const percentNew = Number(percent.toFixed(2));
+ if (["done", "error"].includes(status)) {
+ message.open({
+ type: status === "done" ? "success" : "error",
+ content: status === "done" ? "文件上传成功" : "文件上传失败",
+ duration: 3
+ });
+ if (status === "done") {
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const sGenerate_files = commonUtils.convertStrToObj(
+ props.masterData.sGenerate_files
+ );
+ let { fileList = [] } = sGenerate_files;
+ fileList = [
+ ...fileList,
+ ...sPicturePath.split(",").map(item => item.split("/").pop())
+ ];
+ props.onSaveState1({
+ masterData: {
+ ...props.masterData,
+ sGenerate_files: JSON.stringify({
+ ...sGenerate_files,
+ fileList
+ }),
+ handleType: props.masterData.handleType || "update"
+ }
+ });
+ }
+ } else {
+ message.open({
+ key: "xlyupload",
+ type: percent === 100 ? "success" : "loading",
+ content: (
+ <>
+ 上传进度:
+
+
+
+ >
+ ),
+ duration: percent === 100 ? 3 : 0
+ });
+ }
+};
+
+const FileTable = props => {
+ const pinbanConfig = {};
+ pinbanConfig.gdsconfigformslave = [
+ {
+ bVisible: true,
+ sName: "sFileName",
+ showName: "附件名称",
+ iFitWidth: 400
+ },
+ {
+ bVisible: true,
+ sName: "fileType",
+ showName: "附件类型"
+ }
+ ];
+ pinbanConfig.bMutiSelect = true;
+ pinbanConfig.bisMutiSelect = true;
+
+ const pinbanColumn = commonFunc.getHeaderConfig(pinbanConfig);
+
+ const tableProps = {
+ ...commonBusiness.getTableTypes("pinban", {
+ ...props,
+ pinbanConfig
+ }),
+ headerColumn: pinbanColumn,
+ fixedHeight: 311,
+ enabled: false
+ };
+ return ;
+};
+
+const RreviewModal = props => {
+ const { pdfFileVisible, previewUrl, previeTitle } = props;
+
+ return (
+ {
+ props.onSaveState({
+ pdfFileVisible: false
+ });
+ }}
+ >
+
+
+
+
+ );
+};
+
+export default FileImposition;
diff --git a/src/components/Common/FileImposition/index.less b/src/components/Common/FileImposition/index.less
new file mode 100644
index 0000000..6783772
--- /dev/null
+++ b/src/components/Common/FileImposition/index.less
@@ -0,0 +1,14 @@
+.content {
+ margin-top: 10px;
+ width: 100%;
+ height: calc(100% - 40px);
+ border-bottom: 1px solid #d9d9d9;
+}
+
+.pdfModal {
+ :global {
+ .ant-modal-body {
+ padding: 0 !important;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/Common/OfficePreview/index.js b/src/components/Common/OfficePreview/index.js
new file mode 100644
index 0000000..e505618
--- /dev/null
+++ b/src/components/Common/OfficePreview/index.js
@@ -0,0 +1,64 @@
+/* eslint-disable */
+import { Modal } from "antd";
+import React, { useEffect, useRef } from "react";
+import commonConfig from "@/utils/config";
+import PrintPdf from "@/components/PrintPdf/PrintPdf";
+import jsPreviewDocx from "@js-preview/docx";
+import jsPreviewExcel from "@js-preview/excel";
+import "@js-preview/docx/lib/index.css";
+import "@js-preview/excel/lib/index.css";
+
+const OfficePreview = props => {
+ const { officePreviewVisible, officeFileUrl, onCancel, app } = props;
+ const title = officeFileUrl
+ .split("/")
+ .pop()
+ .split("_")
+ .pop();
+ const fileUrl = `${
+ commonConfig.file_host
+ }file/download?savePathStr=${encodeURIComponent(
+ officeFileUrl
+ )}&sModelsId=100&token=${app.token}`;
+ const fileType = title
+ .split(".")
+ .pop()
+ .toUpperCase();
+ const officeRef = useRef(null);
+ useEffect(() => {
+ if (fileType === "XLSX") {
+ const myExcelPreviewer = jsPreviewExcel.init(officeRef.current);
+ myExcelPreviewer.preview(fileUrl);
+ } else if (fileType === "DOCX") {
+ const myDocxPreviewer = jsPreviewDocx.init(officeRef.current);
+ myDocxPreviewer.preview(fileUrl);
+ }
+ }, []);
+ return (
+
+
+
+ {fileType === "PDF" && (
+
+ )}
+
+
+
+ );
+};
+
+export default OfficePreview;
diff --git a/src/components/Common/ReactDebounce/config.js b/src/components/Common/ReactDebounce/config.js
new file mode 100644
index 0000000..9f582f1
--- /dev/null
+++ b/src/components/Common/ReactDebounce/config.js
@@ -0,0 +1,9 @@
+export default {
+ triggerMs: 0,
+ trigger: 'onChange',
+ valuePropMs: 0,
+ valuePropName: 'value',
+ uncontroll: false,
+ getValueFromEvent: e => e,
+ shouldComponentUpdate: undefined,
+};
diff --git a/src/components/Common/ReactDebounce/debounce.js b/src/components/Common/ReactDebounce/debounce.js
new file mode 100644
index 0000000..9344e9f
--- /dev/null
+++ b/src/components/Common/ReactDebounce/debounce.js
@@ -0,0 +1,11 @@
+export default function (func, ms) {
+ let tid;
+ return (...args) => {
+ if (tid) {
+ clearTimeout(tid);
+ }
+ tid = setTimeout(() => {
+ func(...args);
+ }, ms);
+ };
+}
diff --git a/src/components/Common/ReactDebounce/index.jsx b/src/components/Common/ReactDebounce/index.jsx
new file mode 100644
index 0000000..a24e951
--- /dev/null
+++ b/src/components/Common/ReactDebounce/index.jsx
@@ -0,0 +1,174 @@
+import React from 'react';
+import debounce from './debounce';
+import shouldUpdate from './should-update';
+import defaultOptions from './config';
+
+export default (options = defaultOptions, ...restParam) => {
+ let theOptions = {
+ ...defaultOptions,
+ getValueFromEvent: (e) => {
+ if (!e || !e.target) {
+ return e;
+ }
+ const { target } = e;
+ return target[theOptions.valuePropName];
+ },
+ };
+
+ if (typeof (options) === 'number') {
+ theOptions = {
+ ...theOptions,
+ triggerMs: options,
+ };
+ if (typeof (restParam[1]) === 'boolean') {
+ theOptions = {
+ ...theOptions,
+ uncontroll: restParam[1],
+ };
+ }
+ if (typeof (restParam[0]) === 'number') {
+ theOptions = {
+ ...theOptions,
+ valuePropMs: restParam[0],
+ };
+ }
+ }
+
+ if (typeof (options) === 'object' && !Array.isArray(options)) {
+ theOptions = {
+ ...theOptions,
+ ...options,
+ };
+ }
+
+ return (ReactElement) => {
+ class ReactFormFieldDebounce extends React.Component {
+ constructor(props) {
+ super(props);
+ this.isMount = false;
+ this.lastValue = '';
+ this.shouldUpdatePropsList = (() => {
+ let thePropsList = Object.keys(ReactElement.propTypes || {});
+ if (thePropsList.length === 0) {
+ thePropsList = Object.keys(props || {});
+ }
+ return thePropsList
+ .filter(e => e !== theOptions.valuePropName)
+ .filter(e => e !== theOptions.trigger)
+ .filter(e => !e.match(/^data-/))
+ .filter(e => typeof (props[e]) !== 'function');
+ })();
+ this.state = {};
+ if (Object.prototype.hasOwnProperty.call(props, theOptions.valuePropName)) {
+ this.state[theOptions.valuePropName] = props[theOptions.valuePropName];
+ this.lastValue = props[theOptions.valuePropName];
+ }
+ }
+
+ componentDidMount() {
+ this.isMount = true;
+ const self = this;
+ if (theOptions.uncontroll) {
+ self.setState({ [theOptions.valuePropName]: undefined });
+ }
+ }
+
+ componentWillReceiveProps(nextProps) {
+ if (shouldUpdate([theOptions.valuePropName], this.props, nextProps)) {
+ if (this.lastValue !== nextProps[theOptions.valuePropName]) {
+ this.valueUpdateDebounce(nextProps[theOptions.valuePropName]);
+ }
+ }
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ if (theOptions.shouldComponentUpdate) {
+ return theOptions.shouldComponentUpdate.call({
+ state: this.state,
+ props: this.props,
+ }, nextProps, nextState);
+ }
+ if (this.state !== nextState) {
+ return true;
+ }
+ if (shouldUpdate(this.shouldUpdatePropsList, this.props, nextProps)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ componentDidUpdate() {
+ const self = this;
+ if (theOptions.uncontroll) {
+ if (typeof (this.state[theOptions.valuePropName]) !== 'undefined') {
+ self.setState({ [theOptions.valuePropName]: undefined });
+ }
+ }
+ }
+
+ componentWillUnmount() {
+ this.isMount = false;
+ }
+
+
+ onChange = (() => {
+ let updb = this.props[theOptions.trigger];
+ if (theOptions.triggerMs >= 0) {
+ updb = debounce((value) => {
+ this.props[theOptions.trigger](value);
+ }, theOptions.triggerMs);
+ }
+ return updb;
+ })()
+
+ handleOnChange = (event) => {
+ const value = theOptions.getValueFromEvent(event);
+ if (!theOptions.uncontroll) {
+ this.setState({ [theOptions.valuePropName]: value });
+ }
+ this.lastValue = value;
+ this.onChange(value);
+ if (event && event.target) {
+ theOptions.uncontroll = false;
+ }
+ }
+
+ valueUpdateDebounce = (() => {
+ if (theOptions.valuePropMs >= 0) {
+ return debounce((value) => {
+ this.lastValue = value;
+ this.setState({ [theOptions.valuePropName]: value });
+ }, theOptions.valuePropMs);
+ }
+ return (value) => {
+ this.lastValue = value;
+ this.setState({ [theOptions.valuePropName]: value });
+ };
+ })()
+
+ render() {
+ const theProps = {
+ ...this.props,
+ ...this.state,
+ };
+ if (theOptions.uncontroll) {
+ if (typeof (theProps[theOptions.valuePropName]) === 'undefined') {
+ delete theProps[theOptions.valuePropName];
+ }
+ }
+ if (Object.prototype.hasOwnProperty.call(theProps, theOptions.trigger)) {
+ theProps[theOptions.trigger] = this.handleOnChange;
+ }
+
+ return ();
+ }
+ }
+
+ ReactFormFieldDebounce.defaultProps = ReactElement.defaultProps;
+ ReactFormFieldDebounce.propTypes = ReactElement.propTypes;
+ ReactFormFieldDebounce.displayName = `ReactFormFieldDebounce(${ReactElement.name})`;
+
+ return ReactFormFieldDebounce;
+ };
+};
diff --git a/src/components/Common/ReactDebounce/merge-config.js b/src/components/Common/ReactDebounce/merge-config.js
new file mode 100644
index 0000000..69722e0
--- /dev/null
+++ b/src/components/Common/ReactDebounce/merge-config.js
@@ -0,0 +1,39 @@
+export default function (defaultOptions, options, ...args) {
+ let resultOption = {
+ ...defaultOptions,
+ getValueFromEvent: (e) => {
+ if (!e || !e.target) {
+ return e;
+ }
+ const { target } = e;
+ return target[resultOption.valuePropName];
+ },
+ };
+ if (typeof (options) === 'number') {
+ resultOption = {
+ ...resultOption,
+ triggerMs: options,
+ };
+ if (typeof (args[1]) === 'boolean') {
+ resultOption = {
+ ...resultOption,
+ uncontroll: args[1],
+ };
+ }
+ if (typeof (args[0]) === 'number') {
+ resultOption = {
+ ...resultOption,
+ valuePropMs: args[0],
+ };
+ }
+ }
+
+ if (typeof (options) === 'object' && !Array.isArray(options)) {
+ resultOption = {
+ ...resultOption,
+ ...options,
+ };
+ }
+
+ return resultOption;
+}
diff --git a/src/components/Common/ReactDebounce/should-update.js b/src/components/Common/ReactDebounce/should-update.js
new file mode 100644
index 0000000..66d4ecd
--- /dev/null
+++ b/src/components/Common/ReactDebounce/should-update.js
@@ -0,0 +1,9 @@
+export default (list, thisProps, nextProps) => {
+ if (!Array.isArray(list) || list.length === 0) {
+ return false;
+ }
+ if (typeof (thisProps) !== 'object' || typeof (nextProps) !== 'object') {
+ return false;
+ }
+ return list.some(e => thisProps[e] !== nextProps[e]);
+};
diff --git a/src/components/Common/SearchComponent/index.js b/src/components/Common/SearchComponent/index.js
new file mode 100644
index 0000000..67fdc45
--- /dev/null
+++ b/src/components/Common/SearchComponent/index.js
@@ -0,0 +1,1458 @@
+/* eslint-disable */
+import React, { Component } from 'react';
+import { MinusCircleOutlined, PlusOutlined, SettingOutlined } from '@ant-design/icons';
+import { Form, Icon as LegacyIcon } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Row, Col, Button, message, Space } from 'antd';
+import moment from 'moment';
+import commonConfig from '@/utils/config';
+import * as commonUtils from '@/utils/utils';
+import * as commonFunc from '@/components/Common/commonFunc';
+import * as commonServices from '@/services/services';
+import ShowType from '@/components/Common/CommonComponent';
+import StaticEditTable from '@/components//Common/CommonTable';
+import * as commonBusiness from '@/components/Common/commonBusiness';/* 单据业务功能 */
+import AntdDraggableModal from '@/components/Common/AntdDraggableModal';
+import styles from './index.less';
+import SvgIcon from "../../SvgIcon";
+
+const FormItem = Form.Item;
+
+export default class SearchComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.sDateFormat = 'YYYY-MM-DD';
+ }
+
+ async componentWillMount(sSearchSolutionId) {
+ const { token, sModelsId, formSrcRoute, sModelsType, app} = this.props;
+ const dataUrl = `${commonConfig.server_host}syssearch/getSyssearchData/${sModelsId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; /* 获取快捷查找方案 */
+ const dataReturn = (await commonServices.getService(token, dataUrl)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ let addState = {};
+ if (!commonUtils.isEmpty(sSearchSolutionId)) { // 保存后重新获取快捷查找,直接默认到最新
+ const { masterData, searchRowKeys } = this.props;
+ masterData.sSearchSolutionId = sSearchSolutionId;
+ masterData.bCheck = true; // 为了复制到
+ masterData.sSolutionName = returnData.filter(item => item.sId === sSearchSolutionId)[0].sName;
+ if (commonUtils.isNotEmptyArr(searchRowKeys)) {
+ searchRowKeys.forEach((item) => {
+ masterData[`${item}disabled`] = false;
+ });
+ }
+ addState.masterData = masterData;
+ addState.modalVisible = false;
+ addState.modalSolutionNameVisible = false;
+ } else if (commonUtils.isNotEmptyArr(returnData)) { /* 初始化默认查询方案的参数 */
+ const iIndex = returnData.findIndex(item => item.bDefault);
+ const defaultSearchSolution = iIndex > -1 ? returnData[iIndex] : returnData[0];
+ addState = await this.defaultSearchSolution(defaultSearchSolution);
+ if(commonUtils.isNotEmptyArr(addState.newFilterCondition)) {
+ const newFilterConditionStr = JSON.stringify(addState.newFilterCondition) ;
+ const newConditionStr = JSON.stringify(defaultSearchSolution.sCondition) ;
+ if(commonUtils.isNotEmptyObject(newFilterConditionStr) && commonUtils.isNotEmptyObject(newConditionStr)){
+ if(newFilterConditionStr !== defaultSearchSolution.sCondition){
+ returnData[0].sCondition = newFilterConditionStr;
+ }
+ }
+ }
+ }
+ this.props.onSaveState({ sGroupByList: addState.sGroupByList, searchSolution: returnData, ...addState });
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ }
+
+ async componentWillReceiveProps(nextProps) {
+ const {
+ formData, slaveConfig, bSearchConfig, searchSolution,
+ } = nextProps;
+ let {
+ searchColumns, searchRowKeys, masterData,
+ } = nextProps;
+ const { sModelsType } = nextProps;
+ if (commonUtils.isEmptyArr(searchColumns) && formData.length > 0 && !bSearchConfig && slaveConfig) {
+ const findFilter = commonFunc.getConfigFieldNameData(slaveConfig, 'bFind');
+ searchColumns = [];
+ findFilter.forEach((item) => {
+ searchColumns.push({
+ sValue: item.showName, sId: item.sName, sDropDownType: item.sDropDownType, showDropDown: item.showDropDown, sConfigId: item.sId, sAssignField: item.sAssignField,
+ sSqlCondition: item.sSqlCondition,
+ });
+ });
+ let addState;
+ if (commonUtils.isEmptyArr(searchRowKeys)) { /* 初始化没有默认方案时的 默认查询值 */
+ searchRowKeys = [];
+ if (commonUtils.isNotEmptyArr(searchColumns)) {
+ const key = commonUtils.createSid();
+ searchRowKeys.push(key);
+ masterData = commonUtils.isEmptyObject(masterData) ? (sModelsType === 'commonClassify' ? { bCheck: false } : { bCheck: true }) : masterData;
+ const sFirstValue = searchColumns[0].sId;
+ masterData[`sFirst-${key}`] = searchColumns[0].sId;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ masterData[`sSecond-${key}`] = commonConfig.seaJudge[firstDataIndex][0].sId;
+ }
+ } else {
+ addState = await this.defaultSearchSolution(searchSolution[0]);
+ }
+ this.props.onSaveState({
+ searchColumns, searchRowKeys, masterData, bSearchConfig: true, ...addState,
+ });
+ }
+ const { masterConfig, app } = nextProps;
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ let { searchColumnShowColumn } = nextProps;
+ if (commonUtils.isEmptyArr(searchColumnShowColumn)) {
+ const searchColumnShowConfig = {};
+ const columniOrder = commonFunc.showMessage(app.commonConst, 'columniOrder');/* 排序 */
+ const columnShowName = commonFunc.showMessage(app.commonConst, 'columnShowName');/* 显示名 */
+ const columniFitWidth = commonFunc.showMessage(app.commonConst, 'columniFitWidth');/* 宽度 */
+ const columnbVisible = commonFunc.showMessage(app.commonConst, 'columnbVisible');/* 是否显示 */
+ const columnChinese = commonFunc.showMessage(app.commonConst, 'columnChinese');/* 中文 */
+ const columnEnglish = commonFunc.showMessage(app.commonConst, 'columnEnglish');/* 英文 */
+ const columnBig5 = commonFunc.showMessage(app.commonConst, 'columnBig5');/* 繁体 */
+ const columnsType = commonFunc.showMessage(app.commonConst, 'columnsType');/* 汇总类型 */
+ const columnSQL = commonFunc.showMessage(app.commonConst, 'columnSQL');/* SQL语句 */
+ searchColumnShowConfig.gdsconfigformslave = [
+ {
+ bVisible: false,
+ sName: 'sId',
+ bNotEmpty: true,
+ showName: 'sId',
+ }, {
+ bVisible: true,
+ sName: 'iOrder',
+ bNotEmpty: true,
+ showName: '排序',
+ }, {
+ bVisible: true,
+ sName: 'sName',
+ bNotEmpty: true,
+ bReadonly: true,
+ showName: '字段名',
+ }, {
+ bVisible: true,
+ sName: 'sChinese',
+ bNotEmpty: true,
+ showName: '中文名',
+ }, {
+ bVisible: true,
+ sName: 'sEnglish',
+ bNotEmpty: true,
+ showName: '英文名',
+ }, {
+ bVisible: true,
+ sName: 'sBig5',
+ bNotEmpty: true,
+ showName: '繁体',
+ }, {
+ bVisible: true,
+ sName: 'iFitWidth',
+ bNotEmpty: true,
+ showName: '宽度',
+ }, {
+ bVisible: true,
+ sName: 'sType',
+ sDropDownType: 'const',
+ bNotEmpty: true,
+ showName: '汇总类型',
+ iVisCount: 1,
+ showDropDown: [{ value: '请选择', sId: '' },
+ { value: '分组', sId: 'groupBy' },
+ { value: '最大值', sId: 'max' },
+ { value: '最小值', sId: 'min' },
+ { value: '平均数', sId: 'avg' },
+ { value: '求和', sId: 'sum' },
+ { value: '行数', sId: 'count' },
+ { value: 'sql语句', sId: 'sql' }],
+ }, {
+ bVisible: true,
+ sName: 'sSql',
+ bNotEmpty: true,
+ showName: 'SQL语句',
+ }, {
+ bVisible: true,
+ sName: 'bShow',
+ bNotEmpty: true,
+ showName: '是否显示',
+ }];
+ searchColumnShowColumn = [{
+ title: columniOrder,
+ dataIndex: 'iOrder',
+ width: 60,
+ }, {
+ title: columnShowName,
+ dataIndex: 'sName',
+ width: 120,
+ }, {
+ title: columnChinese,
+ dataIndex: 'sChinese',
+ width: 80,
+ }, {
+ title: columnEnglish,
+ dataIndex: 'sEnglish',
+ width: 80,
+ }, {
+ title: columnBig5,
+ dataIndex: 'sBig5',
+ width: 80,
+ }, {
+ title: columniFitWidth,
+ dataIndex: 'iFitWidth',
+ width: 80,
+ }, {
+ title: columnbVisible,
+ dataIndex: 'bShow',
+ width: 60,
+ }, {
+ title: columnsType,
+ dataIndex: 'sType',
+ width: 120,
+ }, {
+ title: columnSQL,
+ dataIndex: 'sSql',
+ width: 269,
+ }];
+ const tableConfig = masterConfig.gdsconfigformslave;
+ const searchColumnShowData = [];
+ for (const child of tableConfig) {
+ if (child.sName !== '' && child.bVisible && child.showName !== '') {
+ searchColumnShowData.push({
+ sId: child.sId,
+ iOrder: child.iOrder,
+ sChinese: child.sChinese,
+ sEnglish: child.sEnglish,
+ sBig5: child.sBig5,
+ sName: child.sName,
+ iFitWidth: child.iFitWidth,
+ sType: '',
+ sSql: '',
+ bShow: false,
+ });
+ }
+ }
+ const searchColumnShowAllData = JSON.parse(JSON.stringify(searchColumnShowData));
+ this.props.onSaveState({
+ searchColumnShowColumn, searchColumnShowData, searchColumnShowAllData, searchColumnShowConfig,
+ });
+ }
+ }
+ }
+
+ componentDidMount() {
+ this.props.onSaveState({ onBtnSearch: this.handleSearch });
+ }
+
+ onKeyUp = (e) => {
+ if (e.key === 'Enter') {
+ setTimeout(() => {
+ this.handleSearch();
+ }, 500);
+ }
+ }
+
+ async defaultSearchSolution(searchSolutionDataRow) {
+ /* 判断是否有分组 */
+ const sGroupByList = commonUtils.isNotEmptyObject(searchSolutionDataRow) ? searchSolutionDataRow.sGroupByList : '[]';
+ const column = [];
+ if (commonUtils.isNotEmptyArr(sGroupByList)) {
+ /* 有分组查询 */
+ for (const child of sGroupByList) {
+ if (child.sName !== '' && child.bShow) {
+ column.push({
+ title: child.sChinese,
+ dataIndex: child.sName,
+ width: child.iFitWidth,
+ bFind: true,
+ bNotEmpty: false,
+ });
+ }
+ }
+ }
+ const { expand } = false;
+ const highlightColor = false;
+ const { sModelsType, sModelsId, app } = this.props;
+ const { userinfo } = app;
+ const masterData = sModelsType && sModelsType.includes('commonClassify') ? { bCheck: false } : { bCheck: true };
+ const searchRowKeys = [];
+ masterData.sSearchSolutionId = searchSolutionDataRow.sId;
+ masterData.sSolutionName = searchSolutionDataRow.sName; /* 修改方案名称,拿到选中方案名称 */
+ const filterCondition = JSON.parse(searchSolutionDataRow.sCondition);
+ const ownerFlag = userinfo.sId === searchSolutionDataRow.sUserId || (searchSolutionDataRow.sType === 'common' && this.props.app.userinfo.sType === 'sysadmin');
+ const filterConditionAsync = async () => {
+ for (let i = 0, len = filterCondition.length; i < len; i += 1) {
+ const item = filterCondition[i];
+ const key = commonUtils.createSid();
+ searchRowKeys.push(key);
+ const sFirstValue = item.bFilterName;
+ masterData[`${key}disabled`] = !ownerFlag;
+ masterData[`sFirst-${key}`] = sFirstValue;
+ const sSecondValue = item.bFilterCondition;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' :
+ (sSecondValue === 'betweenTime' || sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday' || sSecondValue === 'week'|| sSecondValue === 'weekPre' || sSecondValue === 'month' || sSecondValue === 'monthPre') && sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ masterData[`sSecond-${key}`] = item.bFilterCondition;
+ if (sSecondValue === 'day') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment().format(this.sDateFormat);
+ } else if (sSecondValue === 'unDayDo') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment().format(this.sDateFormat);
+ } else if (sSecondValue === 'daybefore') { /* 今天之前 */
+ masterData[`${firstDataIndex}Third-${key}`] = moment().subtract(1,"days").format(this.sDateFormat);
+ if(sFirstValue?.includes('_pro')){
+ item.bFilterValue = masterData[`${firstDataIndex}Third-${key}`]
+ }
+ } else if (sSecondValue === 'tomorrowbefore') { /* 明天之前 */
+ masterData[`${firstDataIndex}Third-${key}`] = moment().add(1,"days").format(this.sDateFormat);
+ if(sFirstValue?.includes('_pro')){
+ item.bFilterValue = masterData[`${firstDataIndex}Third-${key}`]
+ }
+ } else if (sSecondValue === 'aftertomorrowbefore') { /* 后天之前 */
+ masterData[`${firstDataIndex}Third-${key}`] = moment().add(2,"days").format(this.sDateFormat);
+ if(sFirstValue?.includes('_pro')){
+ item.bFilterValue = masterData[`${firstDataIndex}Third-${key}`]
+ }
+ } else if (sSecondValue === 'betweenDay') {
+ const dateBetween = [];
+ console.log('bFilterValue', item.bFilterValue);
+ if(commonUtils.isEmptyObject(item.bFilterValue) || item.bFilterValue.split(',').length < 2) {
+ dateBetween.push(moment());
+ dateBetween.push(moment());
+ if(sFirstValue?.includes('_pro') && commonUtils.isNotEmptyArr(dateBetween)){
+ const tStartDate = moment(dateBetween[0]).format(this.sDateFormat);
+ const tEndDate = moment(dateBetween[1]).add(1,"days").format(this.sDateFormat);
+ let bFilterNewValue = `${tStartDate},${tEndDate}`;
+ item.bFilterValue = bFilterNewValue;
+ }
+ } else if (item.bFilterValue.split(',').length === 2) {
+ if (item.bFilterValue.split(',')[0] !== 'null') {
+ dateBetween.push(moment(item.bFilterValue.split(',')[0]));
+ dateBetween.push(moment(item.bFilterValue.split(',')[1]).subtract(1, 'days')); /* 日期区间需要将bFilterValue日期减一天 */
+ }
+ }
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'betweenYestday') {
+ const dateBetween = [];
+ if(commonUtils.isEmptyObject(item.bFilterValue) || item.bFilterValue.split(',').length < 2) {
+ dateBetween.push(moment().subtract(1,"days"));
+ dateBetween.push(moment().subtract(1,"days"));
+ if(sFirstValue?.includes('_pro') && commonUtils.isNotEmptyArr(dateBetween)){
+ const tStartDate = moment(dateBetween[0]).format(this.sDateFormat);
+ const tEndDate = moment(dateBetween[1]).add(1,"days").format(this.sDateFormat);
+ let bFilterNewValue = `${tStartDate},${tEndDate}`;
+ item.bFilterValue = bFilterNewValue;
+ }
+ } else if (item.bFilterValue.split(',').length === 2) {
+ if (item.bFilterValue.split(',')[0] !== 'null') {
+ dateBetween.push(moment(item.bFilterValue.split(',')[0]));
+ dateBetween.push(moment(item.bFilterValue.split(',')[1]).subtract(1, 'days')); /* 日期区间需要将bFilterValue日期减一天 */
+ }
+ }
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'month') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('month'));
+ dateBetween.push(moment().endOf('month'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'monthPre') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('month').subtract('month', 1));
+ dateBetween.push(moment().endOf('month').subtract('month', 1).endOf('month'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'week') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('week'));
+ dateBetween.push(moment().endOf('week'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'weekPre') {
+ const dateBetween = [];
+ dateBetween.push(moment(moment().week(moment().week() - 1).startOf('week').valueOf()));
+ dateBetween.push(moment(moment().week(moment().week() - 1).endOf('week').valueOf()));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (item.bFilterCondition === 'between' || item.bFilterCondition === 'betweenTime') {
+ if (item.bFilterValue.split(',').length === 2) {
+ const dateBetween = [];
+ if (item.bFilterValue.split(',')[0] !== 'null') {
+ dateBetween.push(moment(item.bFilterValue.split(',')[0]));
+ dateBetween.push(moment(item.bFilterValue.split(',')[1]).subtract(1, 'days')); /* 日期区间需要将bFilterValue日期减一天 */
+ }
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else {
+ masterData[`${firstDataIndex}Third-${key}`] = moment(item.bFilterValue);
+ }
+ } else if (sSecondValue === 'period') {
+ if (firstDataIndex === 'p') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('month'));
+ dateBetween.push(moment().endOf('month'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (firstDataIndex === 'm') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment(new Date());
+ } else if (firstDataIndex === 'y') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment(new Date());
+ }
+ } else if (firstDataIndex === 't') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment(item.bFilterValue);
+ } else if(sModelsId === '12710101117200946822170' && sFirstValue === 'sTXT50' && commonUtils.isEmptyObject(item.bFilterValue)){
+ if(commonUtils.isNotEmptyObject(app)&& commonUtils.isNotEmptyObject(app.currentPane)) {
+ const { conditonValues } = app.currentPane;
+ if(commonUtils.isNotEmptyObject(conditonValues)) {
+ masterData[`${firstDataIndex}Third-${key}`] = commonUtils.isNotEmptyObject(conditonValues.sAnlnName) ?
+ conditonValues.sAnlnName : '';
+ }
+ }
+ } else {
+ const { slaveConfig } = this.props;
+ if (commonUtils.isNotEmptyObject(slaveConfig)) {
+ const iIndex = slaveConfig.gdsconfigformslave.findIndex(itemData => itemData.sName === sFirstValue);
+ if (iIndex > -1 && slaveConfig.gdsconfigformslave[iIndex].sDropDownType === 'sql') {
+ const sqlDropDownData = await this.props.getSqlDropDownData(this.props.sModelsId, 'master', slaveConfig.gdsconfigformslave[iIndex]);
+ const { dropDownData } = sqlDropDownData;
+ const iValueIndex = dropDownData.findIndex(itemData => itemData.sId === item.bFilterValue);
+ if (iValueIndex > -1) {
+ masterData[`${firstDataIndex}Third-${key}`] = dropDownData[iValueIndex].sName;
+ masterData[`${firstDataIndex}Third-${key}Id`] = item.bFilterValue;
+ }
+ } else {
+ masterData[`${firstDataIndex}Third-${key}`] = item.bFilterValue;
+ }
+ } else {
+ masterData[`${firstDataIndex}Third-${key}`] = item.bFilterValue;
+ }
+ }
+ }
+ };
+ filterConditionAsync();
+ return {
+ masterData, searchRowKeys, slaveGroupColumn: column, sGroupByList, expand, highlightColor, newFilterCondition: filterCondition
+ };
+ }
+ handeToggle = () => {
+ /* 是否展开多出的条件内容 */
+ const { expand } = this.props;
+ this.props.onSaveState({ expand: !expand });
+ };
+
+ handleSearchProps(showConfig) {
+ const { masterData } = this.props;
+ return {
+ form: this.props.form,
+ getSqlDropDownData: this.props.getSqlDropDownData,
+ getSqlCondition: this.props.getSqlCondition,
+ handleSqlDropDownNewRecord: this.props.handleSqlDropDownNewRecord,
+ getFloatNum: this.props.getFloatNum,
+ getDateFormat: this.props.getDateFormat,
+ onChange: this.handleMasterChange,
+ showConfig,
+ formItemLayout: {},
+ textArea: false,
+ enabled: true,
+ dataValue: commonUtils.isNotEmptyObject(masterData) ? masterData[showConfig.sName] : '',
+ bTable: false,
+ formRoute: this.props.formRoute,
+ sSqlCondition:showConfig.sSqlCondition,
+ name: 'master',
+ record: masterData,
+ };
+ }
+
+ handleSearch = (_, isQueryCondition) => {
+ window.vlistNewSearh = true;
+ const {
+ searchRowKeys, masterData, slaveConfig, slaveInfoConfig, setSearchSlaveInfo,
+ slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config, slave11Config, slave12Config,
+ slave13Config, slave14Config, slave15Config, slaveOrderBy, sModelsId,
+ } = this.props;
+ const filterCondition = []; /* 数据筛选条件 */
+ searchRowKeys.map((key) => {
+ const { [`sFirst-${key}`]: sFirstValue, [`sSecond-${key}`]: sSecondValue } = masterData;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' :
+ (sSecondValue === 'betweenTime' || sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday' || sSecondValue === 'week'|| sSecondValue === 'weekPre' || sSecondValue === 'month' || sSecondValue === 'monthPre') && sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ const sThirdName = `${firstDataIndex}Third-${key}`;
+ let thirdValue = masterData[sThirdName];
+ const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === sFirstValue);
+ if (iIndex > -1 && slaveConfig.gdsconfigformslave[iIndex].sDropDownType === 'sql') {
+ if (!commonUtils.isEmpty(masterData[`${sThirdName}Id`])) {
+ thirdValue = masterData[`${sThirdName}Id`];
+ } if (!commonUtils.isEmpty(masterData[sFirstValue])) {
+ thirdValue = masterData[sFirstValue];
+ }
+ }
+ if (!commonUtils.isEmpty(thirdValue) || firstDataIndex === 'b') {
+ if (firstDataIndex === 'p') {
+ const tStartDate = sSecondValue === 'betweenTime' ? (commonUtils.isNotEmptyObject(thirdValue[0]) ? moment(thirdValue[0]).format('YYYY-MM-DD HH:mm:ss') : null) : (commonUtils.isNotEmptyObject(thirdValue[0]) ? moment(thirdValue[0]).format(this.sDateFormat) : null);
+ const tEndDate = sSecondValue === 'betweenTime' ? (commonUtils.isNotEmptyObject(thirdValue[1]) ? moment(thirdValue[1]).format('YYYY-MM-DD HH:mm:ss') : null) : (commonUtils.isNotEmptyObject(thirdValue[1]) ? moment(thirdValue[1]).add(1, 'days').format(this.sDateFormat) : null);
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: `${tStartDate},${tEndDate}`,
+ });
+ } else if (firstDataIndex === 'm') {
+ const tStartDate = sSecondValue === 'betweenTime' ? moment(thirdValue).format('YYYY-MM-DD HH:mm:ss') : moment(thirdValue).startOf('month').format(this.sDateFormat);
+ const tEndDate = sSecondValue === 'betweenTime' ? moment(thirdValue).format('YYYY-MM-DD HH:mm:ss') : moment(thirdValue).endOf('month').add(1, 'days').format(this.sDateFormat);
+ filterCondition.push({
+ bFilterName: `t${sFirstValue.substring(1, sFirstValue.length)}`,
+ bFilterCondition: sSecondValue,
+ bFilterValue: `${tStartDate},${tEndDate}`,
+ });
+ }else if (firstDataIndex === 'y') {
+ const tStartDate = sSecondValue === 'betweenTime' ? moment(thirdValue).format('YYYY-MM-DD HH:mm:ss') : moment(thirdValue).startOf('year').format(this.sDateFormat);
+ const tEndDate = sSecondValue === 'betweenTime' ? moment(thirdValue).format('YYYY-MM-DD HH:mm:ss') : moment(thirdValue).endOf('year').add(1, 'days').format(this.sDateFormat);
+ filterCondition.push({
+ bFilterName: `t${sFirstValue.substring(1, sFirstValue.length)}`,
+ bFilterCondition: sSecondValue,
+ bFilterValue: `${tStartDate},${tEndDate}`,
+ });
+ } else if (firstDataIndex === 't') {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: moment(thirdValue).format(this.sDateFormat),
+ });
+ } else if (firstDataIndex === 'b') {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: thirdValue ? true : false,
+ });
+ } else {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: thirdValue,
+ });
+ }
+ }
+ return true;
+ });
+ /* 判断是否要加载过滤树数据 */
+ const filterTreeConfigArr = slaveConfig.gdsconfigformslave.filter(item => item.bTree);
+ if (commonUtils.isNotEmptyArr(filterTreeConfigArr)) {
+ const filterTreeConfig = filterTreeConfigArr[0];
+ this.props.onGetFilterTreeData(filterTreeConfig, filterCondition, 1);
+ let { treeSelectedKeys } = this.props;
+ if (commonUtils.isNotEmptyArr(treeSelectedKeys)) { /* 清除原来选中树节点 */
+ treeSelectedKeys = [];
+ this.props.onSaveState({
+ treeSelectedKeys, treeFilterCondition: [],
+ });
+ }
+ }
+ /*
+ 修改日期:2021-03-17
+ 修改人:吕杰
+ 区域:以下一行
+ 需求变更:fix 2135 搜索时添加loading动画
+ */
+ // 添加props传入的判断条件
+ // let customfilterCondition = filterCondition.slice(0);
+ // if (customSlaveFilterCondition) {
+ // customfilterCondition = filterCondition.concat(customSlaveFilterCondition);
+ // }
+
+ /**
+ * 获取 bFilterName 首字母为t
+ */
+ if (isQueryCondition && sModelsId === '12710101117253309349270') {
+ return filterCondition.filter(i => i && ['t', 'p'].includes(i.bFilterName?.[0]));;
+ }
+
+ this.props.onSaveState({ pageLoading: true });
+ /* commonListTab搜索时 根据当前Tab页签所在表格进行查询 */
+ if(commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes('commonListTab')) {
+ this.props.onGetSearchData(slaveConfig, filterCondition, undefined,undefined,undefined,undefined,undefined,undefined,undefined, slave0Config);
+ } else {
+ this.props.onGetData(slaveConfig, filterCondition, undefined,undefined,slaveOrderBy,undefined,undefined,undefined,undefined,
+ slave0Config, slave1Config, slave2Config, slave3Config, slave4Config, slave5Config, slave6Config, slave7Config, slave8Config, slave9Config, slave10Config, slave11Config, slave12Config, slave13Config, slave14Config, slave15Config);
+ }
+ if (setSearchSlaveInfo === 'Y') {
+ if (commonUtils.isNotEmptyObject(slaveInfoConfig)) {
+ this.props.onGetDataInfo(slaveInfoConfig, filterCondition);
+ }
+ } else {
+ this.props.onSaveState({
+ expKeys: [],
+ slaveInfoSelectedRowKeys: [],
+ slaveInfoSelectedData: [],
+ slaveInfoData: [], /* 清除生产主计划,生产排程明细表数据 */
+ });
+ }
+ }
+
+ /**
+ * @param {*} name json
+ * @param {*} bFilterName 首字母修改
+ * @returns
+ */
+ handleFirstNameEqual = (name, bFilterName) => {
+ if (typeof bFilterName === 'string' && typeof name === 'string' && ['m', 'y'].includes(name[0])) {
+ return bFilterName.substring(1) === name.substring(1);
+ }
+ }
+
+ /** 修改主表数据 */
+ handleMasterChange = async (name, sFieldName, changeValue, sId, dropDownData) => {
+ // let { expand } = false;
+ if (sFieldName === 'sSearchSolutionId') {
+ const {
+ searchSolution, slaveConfig, slaveInfoConfig, setSearchSlaveInfo,
+ } = this.props;
+
+ const searchCondition = this.handleSearch(_ , true);
+ const iIndex = searchSolution.findIndex(item => item.sId === changeValue[sFieldName]);
+ let filterCondition = JSON.parse(searchSolution[iIndex].sCondition || "[]");
+ if (Array.isArray(searchCondition) && searchCondition.length) {
+ if (Array.isArray(filterCondition) && filterCondition.length) {
+ const keys = searchCondition.map(i => i?.bFilterName).filter(Boolean);
+ filterCondition = filterCondition.filter(i => !keys.includes(i?.bFilterName) && !keys.find(j => this.handleFirstNameEqual(i?.bFilterName, j)));
+ }
+ filterCondition = [...searchCondition, ...filterCondition || []];
+ }
+
+ const addState = await this.defaultSearchSolution({ ...searchSolution[iIndex] || {}, sCondition: JSON.stringify(filterCondition) });
+ this.props.onSaveState({ ...addState });
+ this.props.onGetData(slaveConfig, filterCondition, '', '', '', '', addState.sGroupByList,);
+ /* 判断是否要加载过滤树数据 */
+ const filterTreeConfigArr = slaveConfig.gdsconfigformslave.filter(item => item.bTree);
+ if (commonUtils.isNotEmptyArr(filterTreeConfigArr)) {
+ const filterTreeConfig = filterTreeConfigArr[0];
+ this.props.onGetFilterTreeData(filterTreeConfig, filterCondition, 1);
+ let { treeSelectedKeys } = this.props;
+ if (commonUtils.isNotEmptyArr(treeSelectedKeys)) { /* 清除原来选中树节点 */
+ treeSelectedKeys = [];
+ this.props.onSaveState({
+ treeSelectedKeys, treeFilterCondition: [],
+ });
+ }
+ }
+ if (setSearchSlaveInfo === 'Y') {
+ if (commonUtils.isNotEmptyObject(slaveInfoConfig)) {
+ this.props.onGetDataInfo(slaveInfoConfig, JSON.parse(searchSolution[iIndex].sCondition));
+ }
+ }
+ // /* 当搜索条件有一个为空时,则展开 */
+ // const searchSolutions = JSON.parse(searchSolution[iIndex].sCondition);
+ // const showConfigArr = searchSolutions.filter(item => commonUtils.isEmpty(item.bFilterValue) || item.bFilterValue === false);
+ // /* 当搜索条件只有一行时,不展开 */
+ // if (searchSolutions.length > 1 && commonUtils.isNotEmptyArr(showConfigArr) && showConfigArr.length > 0) {
+ // expand = true;
+ // }
+ // this.props.onSaveState({ expand });
+ } else if (sFieldName.includes('sFirst-')) {
+ const { slaveConfig } = this.props;
+ const { masterData } = this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true);
+ const sFirstValue = masterData[sFieldName];
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1);
+ const key = sFieldName.substring('sFirst-'.length, sFieldName.length);
+ const sSecondConditionPro = firstDataIndex === 's' && sFirstValue.endsWith('_pro'); /* 字段名以s开头,sFilterName以pro结尾,则只有等于条件 */
+ const iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === sFirstValue);
+ masterData[`sSecond-${key}`] = sSecondConditionPro && iIndex > -1 && slaveConfig.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-${key}`] = firstDataIndex === 'b' ? false : firstDataIndex === 't' ? moment().format(this.sDateFormat) : masterData[`${firstDataIndex}Third-${key}`];
+ this.props.onSaveState({ masterData });
+ } else if (sFieldName.includes('sSecond-')) {
+ const { masterData } = this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true);
+ const sSecondValue = masterData[sFieldName];
+ const key = sFieldName.substring('sSecond-'.length, sFieldName.length);
+ const sFirstValue = masterData[`sFirst-${key}`];
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' :
+ (sSecondValue === 'betweenTime' || sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday' || sSecondValue === 'week' || sSecondValue === 'weekPre' || sSecondValue === 'month' || sSecondValue === 'monthPre') && sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ if (sSecondValue === 'day') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment().format(this.sDateFormat);
+ }else if (sSecondValue === 'unDayDo') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment().format(this.sDateFormat);
+ } else if (sSecondValue === 'daybefore') { /* 今天之前 */
+ masterData[`${firstDataIndex}Third-${key}`] = moment().subtract(1,"days").format(this.sDateFormat);
+ } else if (sSecondValue === 'tomorrowbefore') { /* 明天之前 */
+ masterData[`${firstDataIndex}Third-${key}`] = moment().add(1,"days").format(this.sDateFormat);
+ } else if (sSecondValue === 'aftertomorrowbefore') { /* 后天之前 */
+ masterData[`${firstDataIndex}Third-${key}`] = moment().add(2,"days").format(this.sDateFormat);
+ } else if (sSecondValue === 'betweenDay') {
+ const dateBetween = [];
+ dateBetween.push(moment());
+ dateBetween.push(moment());
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'betweenYestday') {
+ const dateBetween = [];
+ dateBetween.push(moment().subtract(1,"days"));
+ dateBetween.push(moment().subtract(1,"days"));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'month') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('month'));
+ dateBetween.push(moment().endOf('month'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'monthPre') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('month').subtract('month', 1));
+ dateBetween.push(moment().endOf('month').subtract('month', 1).endOf('month'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'week') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('week'));
+ dateBetween.push(moment().endOf('week'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'weekPre') {
+ const dateBetween = [];
+ dateBetween.push(moment(moment().week(moment().week() - 1).startOf('week').valueOf()));
+ dateBetween.push(moment(moment().week(moment().week() - 1).endOf('week').valueOf()));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ } else if (sSecondValue === 'period') { /* 本期间 */
+ if (firstDataIndex === 'm') {
+ masterData[`${firstDataIndex}Third-${key}`] = moment(new Date());
+ } else if (firstDataIndex === 'p') {
+ const dateBetween = [];
+ dateBetween.push(moment().startOf('month'));
+ dateBetween.push(moment().endOf('month'));
+ masterData[`${firstDataIndex}Third-${key}`] = dateBetween;
+ }
+ }
+ this.props.onSaveState({ masterData });
+ } else {
+ this.props.onChange('master', sFieldName, changeValue, sId, dropDownData);
+ }
+ };
+
+ handleFields = (searchColumns) => {
+ /* 默认快捷过滤 */
+ if (commonUtils.isEmptyArr(searchColumns)) { return; }
+ const { masterData, searchRowKeys } = this.props;
+ const children = searchRowKeys.map((key) => {
+ const { [`sFirst-${key}`]: sFirstValue, [`sSecond-${key}`]: sSecondValue, [`${key}disabled`]: disabled } = masterData;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' :
+ (sSecondValue === 'betweenTime' || sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday' || sSecondValue === 'week' || sSecondValue === 'weekPre' || sSecondValue === 'period' || sSecondValue === 'month' || sSecondValue === 'monthPre') && sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ const showFirstConfig = {
+ sId: commonUtils.createSid(),
+ sName: `sFirst-${key}`,
+ sDropDownType: 'sql',
+ iVisCount: 1,
+ bNotEmpty: true,
+ dropDownData: this.props.searchColumns,
+ };
+
+ const sThirdName = `${firstDataIndex}Third-${key}`;
+ let DropDownType = '';
+ let showDropDown = '';
+ let sAssignField = '';
+ let sSqlCondition = '';
+ let sId = '';
+ const searchColumnsCurrent = searchColumns.filter(item => item.sId === sFirstValue);
+ if (commonUtils.isNotEmptyArr(searchColumnsCurrent) && searchColumnsCurrent.length > 0) {
+ sId = searchColumnsCurrent[0].sConfigId;
+ DropDownType = searchColumnsCurrent[0].sDropDownType;
+ sSqlCondition = searchColumnsCurrent[0].sSqlCondition;
+ ([{ showDropDown, sAssignField }] = searchColumnsCurrent);
+ }
+ const sSecondConditionPro = firstDataIndex === 's' && sFirstValue.endsWith('_pro'); /* 字段名以s开头,sFilterName以pro结尾,则只有等于条件 */
+ const showSecondConfig = {
+ sId: commonUtils.createSid(),
+ sName: `sSecond-${key}`,
+ sDropDownType: 'sql',
+ bNotEmpty: true,
+ iVisCount: 1,
+ dropDownData: sSecondConditionPro && DropDownType === 'sql' ? commonConfig.seaJudge.s_proDropDown : sSecondConditionPro ? commonConfig.seaJudge.s_pro : commonConfig.seaJudge[firstDataIndex],
+ bCanInput: false,
+ };
+ const showThirdConfig = {
+ sId,
+ sName: sThirdName,
+ sDropDownType: DropDownType,
+ bNotEmpty: false,
+ showDropDown: DropDownType === 'const' ? undefined : showDropDown,
+ dropDownData: DropDownType === 'const' ? commonUtils.objectToArr(commonUtils.convertStrToObj(showDropDown)) : undefined,
+ sAssignField,
+ sSqlCondition,
+ iVisCount: 1,
+ bCanInput: false,
+ bSearchComponent: true, /* 是否是搜素方案的下拉 */
+ };
+ const showTypeFirstProps = this.handleSearchProps(showFirstConfig);
+ const showTypeSecondProps = this.handleSearchProps(showSecondConfig);
+ const showTypeThirdProps = this.handleSearchProps(showThirdConfig);
+ showTypeFirstProps.enabled = true; /* 管理员设置的方案,普通用户不可编辑 showTypeFirstProps.enabled = !disabled; */
+ showTypeSecondProps.enabled = true; /* showTypeSecondProps.enabled = !disabled; */
+ showTypeThirdProps.enabled = true && !(sSecondValue === 'day' || sSecondValue === 'unDayDo' || sSecondValue === 'daybefore' || sSecondValue === 'tomorrowbefore' || sSecondValue === 'aftertomorrowbefore' || sSecondValue === 'weekPre' || sSecondValue === 'week' || sSecondValue === 'month' || sSecondValue === 'monthPre');/* showTypeThirdProps.enabled = !disabled */
+ showTypeFirstProps.formItemLayout = { wrapperCol: { span: 24 } };
+ showTypeSecondProps.formItemLayout = { wrapperCol: { span: 24 } };
+ showTypeThirdProps.formItemLayout = { wrapperCol: { span: 24 } };
+ showTypeThirdProps.allowClear = true;
+ const { dataValue } = showTypeThirdProps;
+ if (sThirdName.substring(0, 1) === 'b') {
+ showTypeThirdProps.enabled = true; /* 选择框不管什么情况,都是可编辑状态 */
+ } else if (commonUtils.isEmptyObject(dataValue) || commonUtils.isEmptyArr(dataValue)) {
+ showTypeThirdProps.enabled = true; /* 第三个查找条件值为空时,要能直接输入 */
+ }
+ if (sSecondValue === 'betweenTime') {
+ showThirdConfig.sDateFormat = 'YYYY-MM-DD HH:mm:ss';
+ /* showTime为true显示可以选择具体时间 */
+ showTypeThirdProps.showTime = sSecondValue === 'betweenTime';
+ } else if (sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday' ) {
+ showThirdConfig.sDateFormat = 'YYYY-MM-DD';
+ /* showTime为true显示可以选择具体时间 */
+ showTypeThirdProps.showTime = false;
+
+ if(firstDataIndex && firstDataIndex === 'm') {
+ showThirdConfig.sDateFormat = 'YYYY-MM';
+ } else if (firstDataIndex && firstDataIndex === 'y') {
+ showThirdConfig.sDateFormat = 'YYYY';
+ }
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ {
+ key > 0 && !disabled ? (
+ this.handleRemove(key)} />
+ ) : null
+ }
+
+
+
+ );
+ });
+ return children;
+ };
+
+ handleAdd = () => {
+ /* 添加条件 */
+ const { searchRowKeys, searchColumns, masterData } = this.props;
+ const key = commonUtils.createSid();
+ searchRowKeys.push(key);
+ const sFirstValue = searchColumns[0].sId;
+ masterData[`sFirst-${key}`] = searchColumns[0].sId;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ masterData[`sSecond-${key}`] = commonConfig.seaJudge[firstDataIndex][0].sId;
+ this.props.onSaveState({ searchRowKeys, masterData });
+ };
+
+ handleRemove = (key, disabled) => {
+ /* 移除添加条件 */
+ const { searchRowKeys } = this.props;
+ if (searchRowKeys.length > 1 && !disabled) {
+ const iIndex = searchRowKeys.findIndex(item => item === key);
+ searchRowKeys.splice(iIndex, 1);
+ this.props.onSaveState({ searchRowKeys });
+ }
+ };
+
+ handleSave = (e) => {
+ /* 保存快捷过滤模板 */
+ e.preventDefault();
+ this.props.form.validateFields((err, values) => {
+ /* 验证通过与不通过走不同的流程 */
+ if (err) { /* 验证失败 */
+ /* 直接渲染显示错误提示 */
+ for (const sFieldName of Object.keys(err)) {
+ const key = sFieldName.substring('Third-'.length + 1, sFieldName.length);
+ const sFirstValue = values[`sFirst-${key}`];
+ const iIndex = this.props.searchColumns.findIndex(item => item.sId === sFirstValue);
+ const showName = iIndex > -1 ? this.props.searchColumns[iIndex].sValue : '';
+ message.error(err[sFieldName].errors[0].message.replace('undefined', showName));
+ }
+ } else { /* 验证成功 */
+ this.props.onSaveState({
+ modalVisible: true,
+ });
+ }
+ });
+ };
+ handleUpd= (e) => {
+ /* 方案名称修改 */
+ e.preventDefault();
+ this.props.form.validateFields((err, values) => {
+ /* 验证通过与不通过走不同的流程 */
+ if (err) { /* 验证失败 */
+ /* 直接渲染显示错误提示 */
+ for (const sFieldName of Object.keys(err)) {
+ const key = sFieldName.substring('Third-'.length + 1, sFieldName.length);
+ const sFirstValue = values[`sFirst-${key}`];
+ const iIndex = this.props.searchColumns.findIndex(item => item.sId === sFirstValue);
+ const showName = iIndex > -1 ? this.props.searchColumns[iIndex].sValue : '';
+ message.error(err[sFieldName].errors[0].message.replace('undefined', showName));
+ }
+ } else { /* 验证成功 */
+ this.props.onSaveState({
+ modalSolutionNameVisible: true,
+ });
+ }
+ });
+ };
+ /* 列显示配置 */
+ handleSaveColumnSetting = async () => {
+ const {
+ masterData, sModelsId, searchColumnShowAllData, formSrcRoute,
+ } = this.props;
+ const sSearchSolutionId = commonUtils.isNotEmptyObject(masterData) ? masterData.sSearchSolutionId : '';
+ if (commonUtils.isNotEmptyObject(sSearchSolutionId)) {
+ const searchUrl = `${commonConfig.server_host}searchgroupby/getSearchgroupbyData/${sModelsId}/${sSearchSolutionId}?token=token&sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const dataReturn = (await commonServices.getService(this.props.app.token, searchUrl)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ if (commonUtils.isNotEmptyArr(returnData)) {
+ const newsearchColumnShowData = JSON.parse(JSON.stringify(searchColumnShowAllData));
+ for (const child of returnData) {
+ const iIndex = newsearchColumnShowData.findIndex(item => item.sName === child.sName.toString());
+ if (iIndex > -1) {
+ newsearchColumnShowData[iIndex].iOrder = child.iOrder;
+ newsearchColumnShowData[iIndex].sChinese = child.sChinese;
+ newsearchColumnShowData[iIndex].sEnglish = child.sEnglish;
+ newsearchColumnShowData[iIndex].sBig5 = child.sBig5;
+ newsearchColumnShowData[iIndex].iFitWidth = child.iFitWidth;
+ newsearchColumnShowData[iIndex].bShow = child.bShow;
+ newsearchColumnShowData[iIndex].sType = child.sType;
+ newsearchColumnShowData[iIndex].sSql = child.sSql;
+ }
+ }
+ this.props.onSaveState({
+ searchColumnShowData: newsearchColumnShowData,
+ });
+ } else {
+ this.props.onSaveState({
+ searchColumnShowData: JSON.parse(JSON.stringify(searchColumnShowAllData)),
+ });
+ }
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ }
+ this.props.onSaveState({
+ columnSettingVisible: true,
+ });
+ }
+ handleDefault = async () => {
+ const { sModelsId, masterData, formSrcRoute } = this.props;
+ const dataUrl = `${commonConfig.server_host}syssearch/updateSyssearch?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const value = {
+ sFormId: sModelsId,
+ sId: masterData.sSearchSolutionId,
+ bDefault: true,
+ };
+ const dataReturn = (await commonServices.postValueService(this.props.app.token, value, dataUrl)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ message.success(dataReturn.msg);
+ await this.componentWillMount(returnData[0].sId);
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ }
+
+ handleOk = (e) => {
+ e.preventDefault();
+ this.props.form.validateFields(async (err) => {
+ /* 验证通过与不通过走不同的流程 */
+ if (err) { /* 验证失败 */
+ /* 直接渲染显示错误提示 */
+ for (const sFieldName of Object.keys(err)) {
+ message.error(err[sFieldName].errors[0].message);
+ }
+ } else { /* 验证成功 */
+ const {
+ sModelsId, masterData, searchRowKeys, formSrcRoute,
+ } = this.props;
+ const dataUrl = `${commonConfig.server_host}syssearch/addSyssearch?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const filterCondition = [];
+ searchRowKeys.map((key) => {
+ const { [`sFirst-${key}`]: sFirstValue, [`sSecond-${key}`]: sSecondValue } = masterData;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' :
+ (sSecondValue === 'betweenTime' || sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday' || sSecondValue === 'week' || sSecondValue === 'weekhPre' || sSecondValue === 'month' || sSecondValue === 'monthPre') && sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ const sThirdName = `${firstDataIndex}Third-${key}`;
+ const thirdValue = masterData[sThirdName] === undefined ? '' : masterData[sThirdName]; /* 不过滤空条件 */
+ if (thirdValue !== undefined) {
+ if (firstDataIndex === 'p') {
+ const tStartDate = commonUtils.isNotEmptyObject(thirdValue[0]) ? moment(thirdValue[0]).format(this.sDateFormat) : null;
+ const tEndDate = commonUtils.isNotEmptyObject(thirdValue[0]) ? moment(thirdValue[1]).add(1, 'days').format(this.sDateFormat) : null;
+ let bFilterNewValue = `${tStartDate},${tEndDate}`;
+ if(sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday') {
+ bFilterNewValue = '';
+ }
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: bFilterNewValue,
+ });
+ } else if (firstDataIndex === 't') {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: moment(thirdValue).format(this.sDateFormat),
+ });
+ } else {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: thirdValue,
+ });
+ }
+ }
+ return true;
+ });
+ const value = {
+ sFormId: sModelsId,
+ sCondition: filterCondition,
+ sName: masterData.sSolutionName,
+ };
+ const dataReturn = (await commonServices.postValueService(this.props.app.token, value, dataUrl)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ message.success(dataReturn.msg);
+ await this.componentWillMount(returnData[0].sId);
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ }
+ });
+ };
+
+ handleSolutionNameOk = (e) => {
+ e.preventDefault();
+ this.props.form.validateFields(async (err) => {
+ /* 验证通过与不通过走不同的流程 */
+ if (err) { /* 验证失败 */
+ /* 直接渲染显示错误提示 */
+ for (const sFieldName of Object.keys(err)) {
+ message.error(err[sFieldName].errors[0].message);
+ }
+ } else { /* 验证成功 */
+ const {
+ sModelsId, masterData, searchRowKeys, formSrcRoute,
+ } = this.props;
+ const dataUrl = `${commonConfig.server_host}syssearch/updateSyssearch?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const filterCondition = [];
+ searchRowKeys.map((key) => {
+ const { [`sFirst-${key}`]: sFirstValue, [`sSecond-${key}`]: sSecondValue } = masterData;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' :
+ (sSecondValue === 'betweenTime' || sSecondValue === 'between' || sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday'|| sSecondValue === 'week' || sSecondValue === 'weekPre' || sSecondValue === 'month' || sSecondValue === 'monthPre') && sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ const sThirdName = `${firstDataIndex}Third-${key}`;
+ const thirdValue = masterData[sThirdName] === undefined ? '' : masterData[sThirdName]; /* 不过滤空条件 */
+ if (thirdValue !== undefined) {
+ if (firstDataIndex === 'p') {
+ const tStartDate = moment(thirdValue[0]).format(this.sDateFormat);
+ const tEndDate = moment(thirdValue[1]).add(1, 'days').format(this.sDateFormat);
+ let bFilterNewValue = `${tStartDate},${tEndDate}`;
+ if(sSecondValue === 'betweenDay' || sSecondValue === 'betweenYestday') {
+ bFilterNewValue = '';
+ }
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue === 'monthPre' ? 'between' : sSecondValue,
+ bFilterValue: bFilterNewValue,
+ });
+ } else if (firstDataIndex === 't') {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: moment(thirdValue).format(this.sDateFormat),
+ });
+ } else {
+ filterCondition.push({
+ bFilterName: sFirstValue,
+ bFilterCondition: sSecondValue,
+ bFilterValue: thirdValue,
+ });
+ }
+ }
+ return true;
+ });
+ const value = {
+ sFormId: sModelsId,
+ sCondition: filterCondition,
+ sName: masterData.sSolutionName,
+ sId: masterData.sSearchSolutionId,
+ };
+ const dataReturn = (await commonServices.postValueService(this.props.app.token, value, dataUrl)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ message.success(dataReturn.msg);
+ await this.componentWillMount(returnData[0].sId);
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ }
+ });
+ };
+ handleDel = async (e) => {
+ /* 删除快捷过滤模板 */
+ e.preventDefault(); /* 防止动画删除 */
+ const {
+ slaveConfig, slaveInfoConfig, masterData, sModelsId, formSrcRoute, setSearchSlaveInfo,
+ } = this.props;
+ if (commonUtils.isNotEmptyObject(masterData) && !commonUtils.isEmpty(masterData.sSearchSolutionId)) {
+ const dataUrl = `${commonConfig.server_host}syssearch/deleteSyssearch/${sModelsId}/${masterData.sSearchSolutionId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const dataReturn = (await commonServices.getService(this.props.app.token, dataUrl)).data;
+ if (dataReturn.code === 1) {
+ message.success(dataReturn.msg);
+ await this.componentWillMount();
+ const { searchSolution } = this.props;
+ if (commonUtils.isNotEmptyArr(searchSolution)) {
+ /* 如果初始没有方案,即为[],则进行重置 */
+ if (searchSolution[0].sCondition === '[]') {
+ this.handleReset();
+ }
+ this.props.onGetData(slaveConfig, JSON.parse(searchSolution[0].sCondition));
+ if (setSearchSlaveInfo === 'Y') {
+ if (commonUtils.isNotEmptyObject(slaveInfoConfig)) {
+ this.props.onGetDataInfo(slaveInfoConfig, JSON.parse(searchSolution[0].sCondition));
+ }
+ }
+ } else {
+ this.handleReset();
+ }
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ }
+ };
+
+ handleReset = async () => {
+ /* 清空搜索条件 */
+ const { searchColumns, sModelsType } = this.props;
+ const searchRowKeys = [];
+ const key = commonUtils.createSid();
+ const masterData = sModelsType && sModelsType.includes('commonClassify') ? { bCheck: false } : { bCheck: true };
+ // masterData.sSearchSolutionId = masterDataOld.sSearchSolutionId;
+ searchRowKeys.push(key);
+ if (commonUtils.isNotEmptyArr(searchColumns)) {
+ const sFirstValue = searchColumns[0].sId;
+ masterData[`sFirst-${key}`] = searchColumns[0].sId;
+ const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1) === 't' ? 'p' : sFirstValue.substring(0, 1);
+ masterData[`sSecond-${key}`] = commonConfig.seaJudge[firstDataIndex][0].sId;
+ const { clearArray } = this.props;
+ if (!commonUtils.isEmpty(clearArray)) {
+ for (const item of clearArray) {
+ const { confirm, clearFilters } = item;
+ confirm();
+ clearFilters();
+ }
+ }
+
+ let obj = {
+ searchRowKeys,
+ masterData,
+ clearArray: [],
+ searchText: '',
+ slaveFilterCondition: [],
+ // slaveGroupColumn: [],
+ // sGroupByList: [],
+ // slaveData: [],
+ // treeFilterCondition: [],
+ // treeSelectedKeys: [],
+ // slaveFilterData: [],
+ // slaveSelectedRowKeys: [],
+ // slaveSelectedData: [],
+ };
+ await this.props.onSaveState(obj);
+ }
+ // this.handleSearch();
+ };
+
+ handleCancel = async (modelVisible) => {
+ /* 关闭弹窗 */
+ this.props.onSaveState({ [modelVisible]: false });
+ };
+ /* 列自定义配置-删除功能 */
+ handleCloumnSettingDelete = async (modelVisible) => {
+ /* 关闭弹窗 */
+ const { masterData, sModelsId, formSrcRoute } = this.props;
+ const sSearchSolutionId = commonUtils.isNotEmptyObject(masterData) ? masterData.sSearchSolutionId : '';
+ const deleteUrl = `${commonConfig.server_host}searchgroupby/deleteSearchgroupby/${sModelsId}/${sSearchSolutionId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const dataReturn = (await commonServices.getService(this.props.app.token, deleteUrl)).data;
+ if (dataReturn.code === 1) {
+ message.success(dataReturn.msg);
+ await this.componentWillMount(sSearchSolutionId); /* 搜索刷新下拉方案 */
+ this.handleSearch();
+ this.props.onSaveState({ slaveGroupColumn: [], [modelVisible]: false });
+ } else {
+ this.props.getServiceError(dataReturn);
+ }
+ };
+ /* 列自定义配置窗体保存功能 */
+ handleColumnSettingSave =async (modelVisible) => {
+ /* 获取勾选是否显示的列的数据/拿到显示参数/调用接口 */
+ const {
+ searchColumnShowData, masterData, sModelsId, formSrcRoute,
+ } = this.props;
+ const sSearchSolutionId = commonUtils.isNotEmptyObject(masterData) ? masterData.sSearchSolutionId : '';
+ const sSearchgroupbyData = searchColumnShowData.filter(item => item.bShow);
+ const addurl = `${commonConfig.server_host}/searchgroupby/addSearchgroupby?token=token&sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ /* 参数 */
+ const body = {
+ sFormId: sModelsId,
+ sSearchId: sSearchSolutionId,
+ sSearchgroupbyData,
+ };
+ // /* 获取数据 */
+ const json = await commonServices.postValueService(this.props.app.token, body, addurl);
+ /* code为1代表获取数据成功 */
+ if (json.data.code === 1) {
+ message.success(json.data.msg);
+ /* 刷新查询方案 */
+ await this.componentWillMount(sSearchSolutionId);
+ this.handleCloumnSettingSearch(modelVisible, sSearchgroupbyData);
+ } else {
+ message.error(json.data.msg);
+ }
+ }
+
+ /* 列自定义配置-查询结果 */
+ handleCloumnSettingSearch = (modelVisible, sGroupByList) => {
+ /* 查询结果 */
+ /* 表头替换,数据集替换 */
+ const {
+ searchColumnShowData, slaveConfig, slaveInfoConfig, slaveFilterCondition, setSearchSlaveInfo,
+ } = this.props;
+ const column = [];
+ for (const child of searchColumnShowData) {
+ if (child.sName !== '' && child.bShow) {
+ column.push({
+ title: child.sChinese,
+ dataIndex: child.sName,
+ width: child.iFitWidth,
+ bFind: true,
+ bNotEmpty: false,
+ });
+ }
+ }
+ /* 调handleSearch搜索 */
+ this.props.onGetData(slaveConfig, slaveFilterCondition, '', '', '', '', sGroupByList);
+ if (setSearchSlaveInfo === 'Y') {
+ if (commonUtils.isNotEmptyObject(slaveInfoConfig)) {
+ this.props.onGetDataInfo(slaveInfoConfig, slaveFilterCondition);
+ }
+ }
+ this.props.onSaveState({
+ slaveGroupColumn: column,
+ [modelVisible]: false,
+ sGroupByList,
+ });
+ };
+ render() {
+ const {
+ searchSolution, searchColumns, expand, activeTagId, sType, modalVisible, modalSolutionNameVisible, confirmLoading, masterData, columnSettingVisible, app,
+ } = this.props;
+ const highlightColor = true;
+ const showSearchSolutionConfig = {
+ sId: commonUtils.createSid(),
+ sName: 'sSearchSolutionId',
+ sDropDownType: 'sql',
+ iVisCount: 1,
+ sVisColumnName: 'sName',
+ dropDownData: searchSolution,
+ placeholder: commonFunc.showMessage(app.commonConst, 'pleaseChooseSolution'), /* 请选择方案 */
+ };
+ const showTypeSearchSolutionProps = this.handleSearchProps(showSearchSolutionConfig);
+ showTypeSearchSolutionProps.formItemLayout = { wrapperCol: { span: 24 } };
+ /* 过滤另存方案界面显示 */
+ const showSolutionNameConfig = {
+ sId: commonUtils.createSid(),
+ sName: 'sSolutionName',
+ sDropDownType: '',
+ bNotEmpty: modalVisible,
+ showName: commonFunc.showMessage(app.commonConst, 'solutionName'), /* 方案名称 */
+ };
+ /* 修改方案名称界面显示 */
+ const updSolutionNameConfig = {
+ sId: commonUtils.createSid(),
+ sName: 'sSolutionName',
+ sDropDownType: '',
+ bNotEmpty: modalSolutionNameVisible,
+ showName: commonFunc.showMessage(app.commonConst, 'solutionName'), /* 方案名称 */
+ };
+ let bBtnDelDisabled = false;
+ let bBtnColumnSetting = false;/* 列显示配置按钮是否可用 */
+ if (commonUtils.isNotEmptyArr(searchSolution) && commonUtils.isNotEmptyObject(masterData)) {
+ const iIndex = searchSolution.findIndex(item => item.sId === masterData.sSearchSolutionId);
+ if (iIndex > -1) {
+ bBtnDelDisabled = this.props.app.userinfo.sType !== 'sysadmin' && searchSolution[iIndex].sType === 'common';
+ bBtnColumnSetting = bBtnDelDisabled;
+ }
+ /* 清空方案时,列显示配置按钮不可用 */
+ const sSearchSolutionId = commonUtils.isNotEmptyObject(masterData.sSearchSolutionId) ? masterData.sSearchSolutionId : '';
+ if (commonUtils.isEmptyObject(sSearchSolutionId)) {
+ bBtnColumnSetting = true;
+ }
+ } else {
+ bBtnColumnSetting = true; /* 没有方案时 */
+ }
+ const showTypeSolutionNameProps = this.handleSearchProps(showSolutionNameConfig);
+ const updSolutionNameConfigProps = this.handleSearchProps(updSolutionNameConfig);/* 修改方案名称 */
+ /* 列自定义配置 */
+ const searchColumnShowProps = {
+ ...commonBusiness.getTableTypes('searchColumnShow', this.props),
+ tableBelone: 'table',
+ enabled: true,
+ onDoubleClick: undefined,
+ sUseInfo: '',
+ tableProps: { rowKey: 'sId', AutoTableHeight: 450 },
+ };
+ const AddCondition = commonFunc.showMessage(app.commonConst, 'AddCondition');/* 添加条件 */
+ const BtnSave = commonFunc.showMessage(app.commonConst, 'BtnSave');/* 保存 */
+ const BtnUpd = commonFunc.showMessage(app.commonConst, 'BtnUpd');/* 修改 */
+ const setDelete = commonFunc.showMessage(app.commonConst, 'setDelete');/* 删除 */
+ const setDefault = commonFunc.showMessage(app.commonConst, 'setDefault');/* 设置默认 */
+ const columnDisplaySetting = commonFunc.showMessage(app.commonConst, 'ColumnDisplaySetting');/* 列显示配置 */
+ const btnSearch = commonFunc.showMessage(app.commonConst, 'btnSearch');/* 搜索 */
+ const clearOut = commonFunc.showMessage(app.commonConst, 'ClearOut');/* 清空 */
+ const btnSaveAndSearch = commonFunc.showMessage(app.commonConst, 'btnSaveAndSearch');/* 保存并查询 */
+ const solutionFilterSave = commonFunc.showMessage(app.commonConst, 'solutionFilterSave');
+ const solutionFilterNameUpd = commonFunc.showMessage(app.commonConst, 'solutionFilterNameUpd');
+
+ const modalCom = (
+ setTimeout(() => {
+ this.handleOk(e);
+ }, 300)}
+ onCancel={this.handleCancel.bind(this, 'modalVisible')}
+ okText="确认"
+ cancelText="取消"
+ confirmLoading={confirmLoading}
+ maskClosable={false}
+ >
+
+
+
+
+ );
+ const modalSolutionNameCom = (
+
+
+
+
+
+ );
+ const columnSettingCom = (
+ {setDelete},
+ {btnSaveAndSearch},
+ ]}
+ >
+
+
+ );
+ return (
+
+ {commonUtils.isEmptyArr(searchColumns) ? '' :
+
+
+
+
+
+
+ {this.handleFields(searchColumns)}
+
+ {
+ (activeTagId === 'default' || (sType === 'common' && this.props.app.userinfo.sType !== 'sysadmin')) ?
+
+
+
+
+
+
+
+ {BtnSave}
+
+
+
+
+ :
+
+
+
+ {AddCondition}
+
+
+
+
+
+
+ {BtnSave}
+
+
+
+
+
+
+ {BtnUpd}
+
+
+
+
+
+
+ {setDelete}
+
+
+
+
+
+
+ {setDefault}
+
+
+
+
+
+
+ {columnDisplaySetting}
+
+
+
+
+
+ }
+
+
+
+
+ } />
+
+
+
+ {btnSearch}
+ {clearOut}
+
+
+ {modalVisible && modalCom}
+ {modalSolutionNameVisible && modalSolutionNameCom}
+ {columnSettingVisible && columnSettingCom}
+
+ }
+
+ );
+ }
+}
diff --git a/src/components/Common/SearchComponent/index.less b/src/components/Common/SearchComponent/index.less
new file mode 100644
index 0000000..2a76f4a
--- /dev/null
+++ b/src/components/Common/SearchComponent/index.less
@@ -0,0 +1,91 @@
+@import '~@/variable.less';
+.fastFilter {
+ position: relative;
+ background: #fff;
+ margin: 0 10px;
+ padding: 8px 8px 3px 8px;
+ z-index: 20;
+ .clear_both();
+ .solutionList{
+ width: 180px;
+ float: left;
+ .clear_both();
+ }
+ .advRow {
+ float: left;
+ width: 600px;
+ height: 32px;
+ overflow: hidden;
+ position: relative;
+ .clear_both();
+ .filterList{
+ padding-left: 8px;
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 10;
+ width: 100%;
+ background: #fff;
+ .filterBtn{
+ display: none;
+ width: 100%;
+ }
+ }
+ }
+ .advRowActive {
+ overflow: unset;
+ .filterList{
+ padding-top: 8px;
+ background: #eef1f6;
+ box-shadow: 0 0 1px 1px @active_color;
+ .filterBtn{
+ display: block;
+ }
+ }
+ }
+ .toggleBtn{
+ width: 32px;
+ margin-left: 8px;
+ float: left;
+ }
+ .advCol {
+ float: left;
+ margin-left: 16px;
+ }
+}
+.addFilterBox {
+ display: block;
+ overflow: hidden;
+ position: relative;
+ z-index: 9;
+ margin-bottom: 0px;
+ padding-right: 36px;
+ &:first-child{
+ .removeBtn{
+ display: none;
+ }
+ }
+ .removeBtn{
+ position: absolute;
+ top: 9px;
+ right: 11px;
+ z-index: 5;
+ }
+}
+.minuseIcon {
+ position: absolute;
+ right: 1px;
+ top: -5px;
+ z-index: 10
+}
+
+.advButton {
+ position: relative;
+ margin-right: 7px;
+ margin-bottom: 7px;
+}
+
+.advButton button {
+ width: 100%;
+}
+
diff --git a/src/components/Common/ShowImage/ShowImage.js b/src/components/Common/ShowImage/ShowImage.js
new file mode 100644
index 0000000..8df8075
--- /dev/null
+++ b/src/components/Common/ShowImage/ShowImage.js
@@ -0,0 +1,160 @@
+import React, { Component } from 'react';
+import { Image } from 'antd';
+import './ShowImage.less';
+import FullScreen from '../../../assets/quanping.svg';
+
+export default class ShowImg extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ f: this.props.firstIndex,
+ R: 0,
+ S: 1,
+ i: 0,
+ SS: 1,
+ data: this.props.data,
+ fullScreen: false,
+ // eslint-disable-next-line react/no-unused-state
+ showimgs: this.props.showimgs,
+ maxNum: this.props.data !== undefined ? this.props.data.length - 1 : 0,
+ imgVisible: false,
+ };
+ }
+ componentDidMount() {
+
+ }
+ componentWillReceiveProps(props) {
+ this.setState({ f: props.firstIndex });
+ }
+ // 向左预览
+ leftshow = () => {
+ const { maxNum } = this.state;
+ if (this.state.f === 0) {
+ this.setState({
+ f: maxNum, R: 0, S: 1, i: 0, SS: 1,
+ });
+ } else {
+ this.setState({
+ f: this.state.f - 1, R: 0, S: 1, i: 0, SS: 1,
+ });
+ }
+ // eslint-disable-next-line react/no-string-refs
+ this.refs.imgstyle.setAttribute('src', this.props.data[this.state.f]);
+ }
+
+ // 向右预览
+ rightshow = () => {
+ const { maxNum } = this.state;
+ if (this.state.f === maxNum) {
+ this.setState({
+ f: 0, R: 0, S: 1, i: 0, SS: 1,
+ });
+ } else {
+ this.setState({
+ f: this.state.f + 1, R: 0, S: 1, i: 0, SS: 1,
+ });
+ }
+ // eslint-disable-next-line react/no-string-refs
+ this.refs.imgstyle.setAttribute('src', this.props.data[this.state.f]);
+ }
+
+ // 顺时针旋转
+ rotateright = () => {
+ this.setState({ R: this.state.R + 90 });
+ // eslint-disable-next-line react/no-string-refs
+ this.refs.imgstyle.style.transform = `rotate(${this.state.R}deg) scale(${this.state.SS},${this.state.SS})`;
+ }
+
+ // 逆时针旋转
+ rotateleft = () => {
+ this.setState({ R: this.state.R - 90 });
+ // eslint-disable-next-line react/no-string-refs
+ this.refs.imgstyle.style.transform = `rotate(${this.state.R}deg) scale(${this.state.SS},${this.state.SS})`;
+ }
+
+ // 放大
+ showbig = () => {
+ if (this.state.i >= 0) {
+ this.setState({ S: this.state.S + 1, i: this.state.i + 1, SS: 1 * (this.state.S + 0.1) });
+ } else {
+ this.setState({ S: this.state.S - 1, i: this.state.i + 1, SS: 1 / (this.state.S - 1) });
+ }
+ // eslint-disable-next-line react/no-string-refs
+ this.refs.imgstyle.style.transform = `rotate(${this.state.R}deg) scale(${this.state.SS},${this.state.SS})`;
+ }
+
+ // 缩小
+ showmin = () => {
+ if (this.state.i <= 0) {
+ this.setState({ S: this.state.S + 1, i: this.state.i - 1, SS: 1 / (this.state.S + 1) });
+ } else {
+ this.setState({ S: this.state.S - 1, i: this.state.i - 1, SS: 1 * (this.state.S - 1) });
+ }
+ // eslint-disable-next-line react/no-string-refs
+ this.refs.imgstyle.style.transform = `rotate(${this.state.R}deg) scale(${this.state.SS},${this.state.SS})`;
+ }
+
+ // 全屏
+ fullScreen = () => {
+ this.setState({
+ imgVisible: true,
+ });
+ // this.setState({ fullScreen: !this.state.fullScreen });
+ }
+
+ render() {
+ const {
+ toggleshow, showimgs, imgOffsetWidth, imgOffsetHeight, bFullScreen,
+ } = this.props;
+ const {
+ data, f, R, SS, fullScreen,
+ } = this.state;
+ const bigWidth = imgOffsetWidth !== undefined && imgOffsetWidth !== null ? imgOffsetWidth : '950';
+ const bigHeight = imgOffsetHeight !== undefined && imgOffsetHeight !== null ? imgOffsetHeight : '600';
+ return (
+
+ {
+ showimgs ?
+
+
+
+
+
+ {/* eslint-disable-next-line react/no-string-refs */}
+

+
{
+ this.setState({
+ imgVisible: value,
+ });
+ },
+ }}
+ />
+
+
+
+ : null
+ }
+
+ );
+ }
+}
diff --git a/src/components/Common/ShowImage/ShowImage.less b/src/components/Common/ShowImage/ShowImage.less
new file mode 100644
index 0000000..bfd53de
--- /dev/null
+++ b/src/components/Common/ShowImage/ShowImage.less
@@ -0,0 +1,216 @@
+.draggableImage{
+ z-index: 1200;
+ position: fixed;
+ top:50%;
+ left:20%;
+}
+.custcontent{
+ text-align: center;
+ margin-top: 40px;
+}
+:global{
+ @font-face {
+ font-family: 'icon'; /* project id 942104 */
+ src: url('//at.alicdn.com/t/font_942104_lhzztf6om6j.eot');
+ src: url('//at.alicdn.com/t/font_942104_lhzztf6om6j.eot?#iefix') format('embedded-opentype'),
+ url('//at.alicdn.com/t/font_942104_lhzztf6om6j.woff') format('woff'),
+ url('//at.alicdn.com/t/font_942104_lhzztf6om6j.ttf') format('truetype'),
+ url('//at.alicdn.com/t/font_942104_lhzztf6om6j.svg#iconfont') format('svg');
+ }
+ .icon {
+ font-family:"icon" !important;
+ font-size:16px;
+ font-style:normal;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ }
+ .icon-close:before { content: "\eaf2"; }
+ .icon-left:before { content: "\e77f"; }
+ .icon-right:before { content: "\e783"; }
+ .icon-lturn:before { content: "\e787"; }
+ .icon-rturn:before { content: "\e788"; }
+ .icon-imgbig:before { content: "\e781"; }
+ .icon-imgmin:before { content: "\e780"; }
+
+ .title{
+ text-align: center;
+ font-size: 20px;
+ font-weight: 600;
+ }
+ .showimg{
+ display: none;
+ }
+//图片缩放
+.dilong{
+ position: fixed;
+ top: 0px;
+ bottom: 0px;
+ left: 0px;
+ right: 0px;
+ background: #000;
+ opacity: 0.6;
+ //background-color: rgba(0,0,0,.85);
+ //box-shadow: 0 0 3px 1px rgba(0,0,0,.3);
+ z-index: 1000;
+}
+.bigimg{
+ position: fixed;
+ overflow: auto;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ margin: auto;
+ width: 950px;
+ height: 600px;
+ background: #fff;
+ border: 1px solid #a7aaa6;
+ border-radius: 5px;
+ z-index: 1100
+}
+.bigimg p i{
+ cursor: pointer
+}
+.close{
+ position:absolute;
+ top: 20px;
+ right: 20px;
+ z-index: 66;
+}
+.left{
+ position: absolute;
+ top: 50%;
+ left:5%;
+ transform: translate(-50% ,-50%);
+ z-index: 66;
+}
+.right{
+ position: absolute;
+ top: 50%;
+ left: 90%;
+ transform: translate(-50% ,-50%);
+ z-index: 66;
+}
+.rotateright{
+ position: absolute;
+ top: 90%;
+ left: 45%;
+ transform: translate(-50% ,-50%);
+ z-index: 66;
+}
+.rotateleft{
+ position: absolute;
+ top: 90%;
+ left: 35%;
+ transform: translate(-50% ,-50%);
+ z-index: 66;
+}
+.showbig{
+ position: absolute;
+ top: 90%;
+ left: 55%;
+ transform: translate(-50% ,-50%);
+ z-index: 66;
+}
+.showmin{
+ position: absolute;
+ top: 90%;
+ left: 65%;
+ transform: translate(-50% ,-50%);
+ z-index: 66;
+}
+.previewBox {
+ width: 100%;
+ height: ~"calc(100% - 43px)";
+ overflow: auto;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ img{
+ width: 700px!important;
+ }
+}
+.imgstyle{
+ //width: 800px;
+ //height: 600px;
+ // position: absolute;
+ // top: 54%;
+ // left: 50%;
+ transform: translate(-50% ,-50%) rotate(0deg) scale(1,1);
+ z-index: 6
+ }
+ .imgheader{
+ //background-color: rgba(0,0,0,.5);
+ border-bottom: 1px solid #f1f1f1;
+ border-radius: 3px;
+ position: relative;
+ height: 43px;
+ padding-left:20px;
+ text-align: left;
+ font-size: 18px;
+ padding: 5px;
+ z-index: 66;
+ }
+ .rotateright_top{
+ position: absolute;
+ top:20px;
+ right:42%;
+ transform: translate(-50% ,-50%);
+ }
+ .rotateleft_top{
+ position: absolute;
+ top:20px;
+ right:34%;
+ transform: translate(-50% ,-50%);
+ }
+ .full_screen {
+ position: absolute;
+ top:18px;
+ right:26%;
+ transform: translate(-50% ,-50%);
+ }
+ .showbig_top{
+ position: absolute;
+ top:20px;
+ right: 18%;
+ transform: translate(-50% ,-50%);
+ }
+ .showmin_top{
+ position: absolute;
+ top:20px;
+ right: 10%;
+ transform: translate(-50% ,-50%);
+ }
+ .left_top{
+ position:absolute;
+ top:205px;
+ left: 3%;
+ }
+ .right_top{
+ position:absolute;
+ top:205px;
+ right: 3%;
+ }
+ .close_top{
+ position:absolute;
+ top:5px;
+ right: 3%;
+ }
+ .headtitle{
+ color: #999;
+ width: 100px;
+ text-align: center;
+ }
+
+ .ant-image-preview-mask {
+ z-index: 2000;
+ background-color: #FFF;
+ }
+ .ant-image-preview-wrap {
+ z-index: 2001;
+ }
+ .ant-image-preview-operations-wrapper {
+ z-index: 2002;
+ background-color: #434343;
+ }
+}
diff --git a/src/components/Common/SlaveMemo copy 2.js b/src/components/Common/SlaveMemo copy 2.js
new file mode 100644
index 0000000..c17b539
--- /dev/null
+++ b/src/components/Common/SlaveMemo copy 2.js
@@ -0,0 +1,264 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Input, message } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import ShowType from './CommonComponent';/* 通用方法 */
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+import moment from 'moment';
+
+const { TextArea } = Input;
+const FormItem = Form.Item;
+export default class SlaveMemo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.handleTextareaChange = this.handleTextareaChange.bind(this);
+ this.state = { textareaValue: '' };
+ this.max = 2000;
+ this.min = 0;
+ this.sDateFormat = 'YYYY-MM-DD';
+ this.bInit = true; // 是否初始化
+ // this.isChoosedate = btnName.toLowerCase().endsWith('choosedate');
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ /* state和this属性赋值 */
+ const { sCurrMemoProps } = nextProps;
+ if (this.bInit && sCurrMemoProps && sCurrMemoProps.bVisibleMemo) {
+ this.bInit = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps) && sCurrMemoProps.btnName === undefined) {
+ this.setState({ textareaValue: nextProps.sCurrMemoProps.sValue });
+ } else {
+ this.setState({ textareaValue: nextProps.sValue });
+ }
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ this.max = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig.sMaxValue) ? nextProps.sCurrMemoProps.sMemoConfig.sMaxValue : this.max); /* 最大值(数据格式:数字) */
+ this.min = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig.sMinValue) ? nextProps.sCurrMemoProps.sMemoConfig.sMinValue : this.min); /* 最小值(数据格式:数字) */
+ }
+ }
+ }
+ handleOk = () => {
+ const { sCurrMemoProps, slaveMemoConfig, masterData } = this.props;
+ const sValue = {};
+ const name = sCurrMemoProps.name;
+ const bVisibleMemo = sCurrMemoProps.bVisibleMemo;
+ const sMemoField = sCurrMemoProps.sMemoField;
+ const sRecord = sCurrMemoProps.sRecord;
+ const btnName = sCurrMemoProps.btnName ? sCurrMemoProps.btnName : '';
+
+ if (!Array.isArray(slaveMemoConfig) || !slaveMemoConfig.length) {
+ if (!sCurrMemoProps?.bNoMemo && sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') && !this.state.textareaValue?.trim()) {
+ return message.warning('请填写内容');
+ }
+ }
+
+ let valueKey = '';
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig) && commonUtils.isNotEmptyObject(masterData)) {
+ // eslint-disable-next-line array-callback-return
+ slaveMemoConfig.map((item) => {
+ /**
+ * 修改日期:2021-03-24
+ * 修改人:吕杰
+ * 区域:以下 18 行
+ * BUG:
+ * 说明:过滤伪字段,为下拉框时替换为id
+ * 原代码:
+ */
+ let realName = item.sName;
+ if (item.sRelation && item.sRelation !== 'noQuery') { // 伪字段处理
+ if (item.sDropDownType && item.sDropDownType === 'sql') { // 下拉框处理
+ /** 此处存在替换隐患,暂无好的解决方案(存在多个Name且需要替换的位置不确定时,无解决方案) */
+ realName = realName.replace('Name', 'Id');
+ } else { // 过滤
+ // eslint-disable-next-line array-callback-return
+ return;
+ }
+ }
+ sValue[realName] = masterData[realName];
+ if (btnName.toLowerCase().endsWith('choosedate') && realName.length > 0 && realName.substring(0, 1) === 'p') {
+ const tStartDate = moment(sValue[realName][0]).format(this.sDateFormat);
+ const tEndDate = moment(sValue[realName][1]).add(1, 'days').format(this.sDateFormat);
+ sValue[realName][0] = tStartDate;
+ sValue[realName][1] = tEndDate;
+ }
+ valueKey += `${realName},`;
+ });
+ sValue.valueKey = valueKey;
+ }
+ sValue.textareaValue = this.state.textareaValue;
+ if (btnName.indexOf('BtnRepair') > -1) {
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnName))[0];
+ if (commonUtils.isNotEmptyObject(btnConfig)) {
+ this.props.onBtnEent(btnConfig, btnName, sValue);
+ }
+ if (btnName.toLowerCase().endsWith('choosedate')) {
+ const iIndex = slaveMemoConfig.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ /* 日期凭证调用存储过程后清除时间区间 */
+ masterData.pChooseDate = null;
+ }
+ }
+ } else if (btnName.indexOf('BtnForceComplete') > -1) {
+ this.props.onGetMemo(name, sValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ } else {
+ this.props.onGetMemo(name, this.state.textareaValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ }
+ this.bInit = true;
+ };
+ handleSlaveMemoMasterChange = async (name, sFieldName, changeValue, sId, dropDownData, isWait, masterDataNew) => {
+ const { masterData: masterDataOld, enabled } = this.props;
+ const addState = { enabled };
+ const masterData = masterDataNew === undefined ? masterDataOld === undefined ? {} : masterDataOld : masterDataNew;
+ const returnData = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData);
+ if (isWait) {
+ return { ...returnData, ...addState };
+ } else {
+ this.props.onSaveState({ ...returnData, ...addState });
+ return returnData;
+ }
+ }
+
+ handleCancel = () => {
+ this.bInit = true;
+ this.props.onGetMemoCancel();
+ };
+ /* 设置textareaValue */
+ handleTextareaChange(e) {
+ this.setState({
+ textareaValue: e.target.value,
+ });
+ }
+ handleViewClick = (name, sName, sId) => {
+ this.props.onViewClick(name, sName, sId);
+ };
+ /** 渲染 */
+ render() {
+ const {
+ sCurrMemoProps,
+ masterData,
+ app,
+ sModelsId,
+ form,
+ slaveMemoConfig,
+ } = this.props;
+ let bVisibleMemo;
+ let sMemoField;
+ let btnName = '';
+ const title = '详细';
+ let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
+ let bNoMemo = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ bNoMemo = sCurrMemoProps.bNoMemo;
+ bVisibleMemo = sCurrMemoProps.bVisibleMemo;
+ sMemoField = sCurrMemoProps.sMemoField;
+ btnName = sCurrMemoProps.btnName ? sCurrMemoProps.btnName : '';
+ if (sCurrMemoProps.bOnlyShow !== undefined) { /* 查看状态下备注弹窗只能查看不能修改 */
+ bEnabledTextArea = sCurrMemoProps.bOnlyShow;
+ }
+ }
+ let bVisibleTextArea = true;
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig)) {
+ if (slaveMemoConfig[0].sName === 'sDevelopMemo') {
+ bVisibleTextArea = false; /* 开发备注多行文本不显示 */
+ }
+ }
+ // const tStartDate = moment(); /* 开始时间 */
+ // 判断是否备注双击弹出的弹窗
+ // if (fromToorBar) {
+ // bVisibleMemo = false;
+ // }
+ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 18 } };
+ return (
+
+ {
+ bVisibleMemo ?
+
+
+ {
+ btnName.indexOf('BtnRepair') > -1 ?
+
+ : ''
+ }
+ {!bNoMemo && sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') ? (
+
+ ) : null}
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
diff --git a/src/components/Common/SlaveMemo copy.js b/src/components/Common/SlaveMemo copy.js
new file mode 100644
index 0000000..c17b539
--- /dev/null
+++ b/src/components/Common/SlaveMemo copy.js
@@ -0,0 +1,264 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Input, message } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import ShowType from './CommonComponent';/* 通用方法 */
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+import moment from 'moment';
+
+const { TextArea } = Input;
+const FormItem = Form.Item;
+export default class SlaveMemo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.handleTextareaChange = this.handleTextareaChange.bind(this);
+ this.state = { textareaValue: '' };
+ this.max = 2000;
+ this.min = 0;
+ this.sDateFormat = 'YYYY-MM-DD';
+ this.bInit = true; // 是否初始化
+ // this.isChoosedate = btnName.toLowerCase().endsWith('choosedate');
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ /* state和this属性赋值 */
+ const { sCurrMemoProps } = nextProps;
+ if (this.bInit && sCurrMemoProps && sCurrMemoProps.bVisibleMemo) {
+ this.bInit = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps) && sCurrMemoProps.btnName === undefined) {
+ this.setState({ textareaValue: nextProps.sCurrMemoProps.sValue });
+ } else {
+ this.setState({ textareaValue: nextProps.sValue });
+ }
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ this.max = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig.sMaxValue) ? nextProps.sCurrMemoProps.sMemoConfig.sMaxValue : this.max); /* 最大值(数据格式:数字) */
+ this.min = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig.sMinValue) ? nextProps.sCurrMemoProps.sMemoConfig.sMinValue : this.min); /* 最小值(数据格式:数字) */
+ }
+ }
+ }
+ handleOk = () => {
+ const { sCurrMemoProps, slaveMemoConfig, masterData } = this.props;
+ const sValue = {};
+ const name = sCurrMemoProps.name;
+ const bVisibleMemo = sCurrMemoProps.bVisibleMemo;
+ const sMemoField = sCurrMemoProps.sMemoField;
+ const sRecord = sCurrMemoProps.sRecord;
+ const btnName = sCurrMemoProps.btnName ? sCurrMemoProps.btnName : '';
+
+ if (!Array.isArray(slaveMemoConfig) || !slaveMemoConfig.length) {
+ if (!sCurrMemoProps?.bNoMemo && sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') && !this.state.textareaValue?.trim()) {
+ return message.warning('请填写内容');
+ }
+ }
+
+ let valueKey = '';
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig) && commonUtils.isNotEmptyObject(masterData)) {
+ // eslint-disable-next-line array-callback-return
+ slaveMemoConfig.map((item) => {
+ /**
+ * 修改日期:2021-03-24
+ * 修改人:吕杰
+ * 区域:以下 18 行
+ * BUG:
+ * 说明:过滤伪字段,为下拉框时替换为id
+ * 原代码:
+ */
+ let realName = item.sName;
+ if (item.sRelation && item.sRelation !== 'noQuery') { // 伪字段处理
+ if (item.sDropDownType && item.sDropDownType === 'sql') { // 下拉框处理
+ /** 此处存在替换隐患,暂无好的解决方案(存在多个Name且需要替换的位置不确定时,无解决方案) */
+ realName = realName.replace('Name', 'Id');
+ } else { // 过滤
+ // eslint-disable-next-line array-callback-return
+ return;
+ }
+ }
+ sValue[realName] = masterData[realName];
+ if (btnName.toLowerCase().endsWith('choosedate') && realName.length > 0 && realName.substring(0, 1) === 'p') {
+ const tStartDate = moment(sValue[realName][0]).format(this.sDateFormat);
+ const tEndDate = moment(sValue[realName][1]).add(1, 'days').format(this.sDateFormat);
+ sValue[realName][0] = tStartDate;
+ sValue[realName][1] = tEndDate;
+ }
+ valueKey += `${realName},`;
+ });
+ sValue.valueKey = valueKey;
+ }
+ sValue.textareaValue = this.state.textareaValue;
+ if (btnName.indexOf('BtnRepair') > -1) {
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnName))[0];
+ if (commonUtils.isNotEmptyObject(btnConfig)) {
+ this.props.onBtnEent(btnConfig, btnName, sValue);
+ }
+ if (btnName.toLowerCase().endsWith('choosedate')) {
+ const iIndex = slaveMemoConfig.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ /* 日期凭证调用存储过程后清除时间区间 */
+ masterData.pChooseDate = null;
+ }
+ }
+ } else if (btnName.indexOf('BtnForceComplete') > -1) {
+ this.props.onGetMemo(name, sValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ } else {
+ this.props.onGetMemo(name, this.state.textareaValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ }
+ this.bInit = true;
+ };
+ handleSlaveMemoMasterChange = async (name, sFieldName, changeValue, sId, dropDownData, isWait, masterDataNew) => {
+ const { masterData: masterDataOld, enabled } = this.props;
+ const addState = { enabled };
+ const masterData = masterDataNew === undefined ? masterDataOld === undefined ? {} : masterDataOld : masterDataNew;
+ const returnData = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData);
+ if (isWait) {
+ return { ...returnData, ...addState };
+ } else {
+ this.props.onSaveState({ ...returnData, ...addState });
+ return returnData;
+ }
+ }
+
+ handleCancel = () => {
+ this.bInit = true;
+ this.props.onGetMemoCancel();
+ };
+ /* 设置textareaValue */
+ handleTextareaChange(e) {
+ this.setState({
+ textareaValue: e.target.value,
+ });
+ }
+ handleViewClick = (name, sName, sId) => {
+ this.props.onViewClick(name, sName, sId);
+ };
+ /** 渲染 */
+ render() {
+ const {
+ sCurrMemoProps,
+ masterData,
+ app,
+ sModelsId,
+ form,
+ slaveMemoConfig,
+ } = this.props;
+ let bVisibleMemo;
+ let sMemoField;
+ let btnName = '';
+ const title = '详细';
+ let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
+ let bNoMemo = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ bNoMemo = sCurrMemoProps.bNoMemo;
+ bVisibleMemo = sCurrMemoProps.bVisibleMemo;
+ sMemoField = sCurrMemoProps.sMemoField;
+ btnName = sCurrMemoProps.btnName ? sCurrMemoProps.btnName : '';
+ if (sCurrMemoProps.bOnlyShow !== undefined) { /* 查看状态下备注弹窗只能查看不能修改 */
+ bEnabledTextArea = sCurrMemoProps.bOnlyShow;
+ }
+ }
+ let bVisibleTextArea = true;
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig)) {
+ if (slaveMemoConfig[0].sName === 'sDevelopMemo') {
+ bVisibleTextArea = false; /* 开发备注多行文本不显示 */
+ }
+ }
+ // const tStartDate = moment(); /* 开始时间 */
+ // 判断是否备注双击弹出的弹窗
+ // if (fromToorBar) {
+ // bVisibleMemo = false;
+ // }
+ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 18 } };
+ return (
+
+ {
+ bVisibleMemo ?
+
+
+ {
+ btnName.indexOf('BtnRepair') > -1 ?
+
+ : ''
+ }
+ {!bNoMemo && sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') ? (
+
+ ) : null}
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
diff --git a/src/components/Common/SlaveMemo.js b/src/components/Common/SlaveMemo.js
new file mode 100644
index 0000000..c17b539
--- /dev/null
+++ b/src/components/Common/SlaveMemo.js
@@ -0,0 +1,264 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Input, message } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import ShowType from './CommonComponent';/* 通用方法 */
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+import moment from 'moment';
+
+const { TextArea } = Input;
+const FormItem = Form.Item;
+export default class SlaveMemo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.handleTextareaChange = this.handleTextareaChange.bind(this);
+ this.state = { textareaValue: '' };
+ this.max = 2000;
+ this.min = 0;
+ this.sDateFormat = 'YYYY-MM-DD';
+ this.bInit = true; // 是否初始化
+ // this.isChoosedate = btnName.toLowerCase().endsWith('choosedate');
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ /* state和this属性赋值 */
+ const { sCurrMemoProps } = nextProps;
+ if (this.bInit && sCurrMemoProps && sCurrMemoProps.bVisibleMemo) {
+ this.bInit = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps) && sCurrMemoProps.btnName === undefined) {
+ this.setState({ textareaValue: nextProps.sCurrMemoProps.sValue });
+ } else {
+ this.setState({ textareaValue: nextProps.sValue });
+ }
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ this.max = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig.sMaxValue) ? nextProps.sCurrMemoProps.sMemoConfig.sMaxValue : this.max); /* 最大值(数据格式:数字) */
+ this.min = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps.sMemoConfig.sMinValue) ? nextProps.sCurrMemoProps.sMemoConfig.sMinValue : this.min); /* 最小值(数据格式:数字) */
+ }
+ }
+ }
+ handleOk = () => {
+ const { sCurrMemoProps, slaveMemoConfig, masterData } = this.props;
+ const sValue = {};
+ const name = sCurrMemoProps.name;
+ const bVisibleMemo = sCurrMemoProps.bVisibleMemo;
+ const sMemoField = sCurrMemoProps.sMemoField;
+ const sRecord = sCurrMemoProps.sRecord;
+ const btnName = sCurrMemoProps.btnName ? sCurrMemoProps.btnName : '';
+
+ if (!Array.isArray(slaveMemoConfig) || !slaveMemoConfig.length) {
+ if (!sCurrMemoProps?.bNoMemo && sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') && !this.state.textareaValue?.trim()) {
+ return message.warning('请填写内容');
+ }
+ }
+
+ let valueKey = '';
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig) && commonUtils.isNotEmptyObject(masterData)) {
+ // eslint-disable-next-line array-callback-return
+ slaveMemoConfig.map((item) => {
+ /**
+ * 修改日期:2021-03-24
+ * 修改人:吕杰
+ * 区域:以下 18 行
+ * BUG:
+ * 说明:过滤伪字段,为下拉框时替换为id
+ * 原代码:
+ */
+ let realName = item.sName;
+ if (item.sRelation && item.sRelation !== 'noQuery') { // 伪字段处理
+ if (item.sDropDownType && item.sDropDownType === 'sql') { // 下拉框处理
+ /** 此处存在替换隐患,暂无好的解决方案(存在多个Name且需要替换的位置不确定时,无解决方案) */
+ realName = realName.replace('Name', 'Id');
+ } else { // 过滤
+ // eslint-disable-next-line array-callback-return
+ return;
+ }
+ }
+ sValue[realName] = masterData[realName];
+ if (btnName.toLowerCase().endsWith('choosedate') && realName.length > 0 && realName.substring(0, 1) === 'p') {
+ const tStartDate = moment(sValue[realName][0]).format(this.sDateFormat);
+ const tEndDate = moment(sValue[realName][1]).add(1, 'days').format(this.sDateFormat);
+ sValue[realName][0] = tStartDate;
+ sValue[realName][1] = tEndDate;
+ }
+ valueKey += `${realName},`;
+ });
+ sValue.valueKey = valueKey;
+ }
+ sValue.textareaValue = this.state.textareaValue;
+ if (btnName.indexOf('BtnRepair') > -1) {
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnName))[0];
+ if (commonUtils.isNotEmptyObject(btnConfig)) {
+ this.props.onBtnEent(btnConfig, btnName, sValue);
+ }
+ if (btnName.toLowerCase().endsWith('choosedate')) {
+ const iIndex = slaveMemoConfig.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ /* 日期凭证调用存储过程后清除时间区间 */
+ masterData.pChooseDate = null;
+ }
+ }
+ } else if (btnName.indexOf('BtnForceComplete') > -1) {
+ this.props.onGetMemo(name, sValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ } else {
+ this.props.onGetMemo(name, this.state.textareaValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ }
+ this.bInit = true;
+ };
+ handleSlaveMemoMasterChange = async (name, sFieldName, changeValue, sId, dropDownData, isWait, masterDataNew) => {
+ const { masterData: masterDataOld, enabled } = this.props;
+ const addState = { enabled };
+ const masterData = masterDataNew === undefined ? masterDataOld === undefined ? {} : masterDataOld : masterDataNew;
+ const returnData = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData);
+ if (isWait) {
+ return { ...returnData, ...addState };
+ } else {
+ this.props.onSaveState({ ...returnData, ...addState });
+ return returnData;
+ }
+ }
+
+ handleCancel = () => {
+ this.bInit = true;
+ this.props.onGetMemoCancel();
+ };
+ /* 设置textareaValue */
+ handleTextareaChange(e) {
+ this.setState({
+ textareaValue: e.target.value,
+ });
+ }
+ handleViewClick = (name, sName, sId) => {
+ this.props.onViewClick(name, sName, sId);
+ };
+ /** 渲染 */
+ render() {
+ const {
+ sCurrMemoProps,
+ masterData,
+ app,
+ sModelsId,
+ form,
+ slaveMemoConfig,
+ } = this.props;
+ let bVisibleMemo;
+ let sMemoField;
+ let btnName = '';
+ const title = '详细';
+ let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
+ let bNoMemo = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ bNoMemo = sCurrMemoProps.bNoMemo;
+ bVisibleMemo = sCurrMemoProps.bVisibleMemo;
+ sMemoField = sCurrMemoProps.sMemoField;
+ btnName = sCurrMemoProps.btnName ? sCurrMemoProps.btnName : '';
+ if (sCurrMemoProps.bOnlyShow !== undefined) { /* 查看状态下备注弹窗只能查看不能修改 */
+ bEnabledTextArea = sCurrMemoProps.bOnlyShow;
+ }
+ }
+ let bVisibleTextArea = true;
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig)) {
+ if (slaveMemoConfig[0].sName === 'sDevelopMemo') {
+ bVisibleTextArea = false; /* 开发备注多行文本不显示 */
+ }
+ }
+ // const tStartDate = moment(); /* 开始时间 */
+ // 判断是否备注双击弹出的弹窗
+ // if (fromToorBar) {
+ // bVisibleMemo = false;
+ // }
+ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 18 } };
+ return (
+
+ {
+ bVisibleMemo ?
+
+
+ {
+ btnName.indexOf('BtnRepair') > -1 ?
+
+ : ''
+ }
+ {!bNoMemo && sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') ? (
+
+ ) : null}
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
diff --git a/src/components/Common/SlaveMemo1 copy 2.js b/src/components/Common/SlaveMemo1 copy 2.js
new file mode 100644
index 0000000..37bfd51
--- /dev/null
+++ b/src/components/Common/SlaveMemo1 copy 2.js
@@ -0,0 +1,253 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Input } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import ShowType from './CommonComponent';/* 通用方法 */
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+import moment from 'moment';
+
+const { TextArea } = Input;
+const FormItem = Form.Item;
+export default class SlaveMemo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.handleTextareaChange = this.handleTextareaChange.bind(this);
+ this.state = { textareaValue: '' };
+ this.max = 2000;
+ this.min = 0;
+ this.sDateFormat = 'YYYY-MM-DD';
+ this.bInit = true; // 是否初始化
+ // this.isChoosedate = btnName.toLowerCase().endsWith('choosedate');
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ /* state和this属性赋值 */
+ const { sCurrMemoProps1 } = nextProps;
+ if (this.bInit && sCurrMemoProps1 && sCurrMemoProps1.bVisibleMemo) {
+ this.bInit = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1) && sCurrMemoProps1.btnName === undefined) {
+ this.setState({ textareaValue: nextProps.sCurrMemoProps1.sValue });
+ } else {
+ this.setState({ textareaValue: nextProps.sValue });
+ }
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1)) {
+ this.max = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig.sMaxValue) ? nextProps.sCurrMemoProps1.sMemoConfig.sMaxValue : this.max); /* 最大值(数据格式:数字) */
+ this.min = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig.sMinValue) ? nextProps.sCurrMemoProps1.sMemoConfig.sMinValue : this.min); /* 最小值(数据格式:数字) */
+ }
+ }
+ }
+ handleOk = () => {
+ const { sCurrMemoProps1, slaveMemoConfig, masterData } = this.props;
+ const sValue = {};
+ const name = sCurrMemoProps1.name;
+ const bVisibleMemo = sCurrMemoProps1.bVisibleMemo;
+ const sMemoField = sCurrMemoProps1.sMemoField;
+ const sRecord = sCurrMemoProps1.sRecord;
+ const btnName = sCurrMemoProps1.btnName ? sCurrMemoProps1.btnName : '';
+ let valueKey = '';
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig) && commonUtils.isNotEmptyObject(masterData)) {
+ // eslint-disable-next-line array-callback-return
+ slaveMemoConfig.map((item) => {
+ /**
+ * 修改日期:2021-03-24
+ * 修改人:吕杰
+ * 区域:以下 18 行
+ * BUG:
+ * 说明:过滤伪字段,为下拉框时替换为id
+ * 原代码:
+ */
+ let realName = item.sName;
+ if (item.sRelation && item.sRelation !== 'noQuery') { // 伪字段处理
+ if (item.sDropDownType && item.sDropDownType === 'sql') { // 下拉框处理
+ /** 此处存在替换隐患,暂无好的解决方案(存在多个Name且需要替换的位置不确定时,无解决方案) */
+ realName = realName.replace('Name', 'Id');
+ } else { // 过滤
+ // eslint-disable-next-line array-callback-return
+ return;
+ }
+ }
+ sValue[realName] = masterData[realName];
+ if (btnName.toLowerCase().endsWith('choosedate') && realName.length > 0 && realName.substring(0, 1) === 'p') {
+ const tStartDate = moment(sValue[realName][0]).format(this.sDateFormat);
+ const tEndDate = moment(sValue[realName][1]).add(1, 'days').format(this.sDateFormat);
+ sValue[realName][0] = tStartDate;
+ sValue[realName][1] = tEndDate;
+ }
+ valueKey += `${realName},`;
+ });
+ sValue.valueKey = valueKey;
+ }
+ sValue.textareaValue = this.state.textareaValue;
+ if (btnName.indexOf('BtnRepair') > -1) {
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnName))[0];
+ if (commonUtils.isNotEmptyObject(btnConfig)) {
+ this.props.onBtnEent(btnConfig, btnName, sValue);
+ }
+ if (btnName.toLowerCase().endsWith('choosedate')) {
+ const iIndex = slaveMemoConfig.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ /* 日期凭证调用存储过程后清除时间区间 */
+ masterData.pChooseDate = null;
+ }
+ }
+ } else if (btnName.indexOf('BtnForceComplete') > -1) {
+ this.props.onGetMemo(name, sValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ } else {
+ this.props.onGetMemo(name, this.state.textareaValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ }
+ this.bInit = true;
+ };
+ handleSlaveMemoMasterChange = async (name, sFieldName, changeValue, sId, dropDownData, isWait, masterDataNew) => {
+ const { masterData: masterDataOld, enabled } = this.props;
+ const addState = { enabled };
+ const masterData = masterDataNew === undefined ? masterDataOld === undefined ? {} : masterDataOld : masterDataNew;
+ const returnData = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData);
+ if (isWait) {
+ return { ...returnData, ...addState };
+ } else {
+ this.props.onSaveState({ ...returnData, ...addState });
+ return returnData;
+ }
+ }
+
+ handleCancel = () => {
+ this.bInit = true;
+ this.props.onGetMemoCancel();
+ };
+ /* 设置textareaValue */
+ handleTextareaChange(e) {
+ this.setState({
+ textareaValue: e.target.value,
+ });
+ }
+ handleViewClick = (name, sName, sId) => {
+ this.props.onViewClick(name, sName, sId);
+ };
+ /** 渲染 */
+ render() {
+ const {
+ sCurrMemoProps1,
+ masterData,
+ app,
+ sModelsId,
+ form,
+ slaveMemoConfig,
+ } = this.props;
+ let bVisibleMemo;
+ let sMemoField;
+ let btnName = '';
+ const title = '详细';
+ let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1)) {
+ bVisibleMemo = sCurrMemoProps1.bVisibleMemo;
+ sMemoField = sCurrMemoProps1.sMemoField;
+ btnName = sCurrMemoProps1.btnName ? sCurrMemoProps1.btnName : '';
+ if (sCurrMemoProps1.bOnlyShow !== undefined) { /* 查看状态下备注弹窗只能查看不能修改 */
+ bEnabledTextArea = sCurrMemoProps1.bOnlyShow;
+ }
+ }
+ let bVisibleTextArea = true;
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig)) {
+ if (slaveMemoConfig[0].sName === 'sDevelopMemo') {
+ bVisibleTextArea = false; /* 开发备注多行文本不显示 */
+ }
+ }
+ // const tStartDate = moment(); /* 开始时间 */
+ // 判断是否备注双击弹出的弹窗
+ // if (fromToorBar) {
+ // bVisibleMemo = false;
+ // }
+ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 18 } };
+ return (
+
+ {
+ bVisibleMemo ?
+
+
+ {
+ btnName.indexOf('BtnRepair') > -1 ?
+
+ : ''
+ }
+ {sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') ? (
+
+ ) : null}
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
diff --git a/src/components/Common/SlaveMemo1 copy.js b/src/components/Common/SlaveMemo1 copy.js
new file mode 100644
index 0000000..37bfd51
--- /dev/null
+++ b/src/components/Common/SlaveMemo1 copy.js
@@ -0,0 +1,253 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Input } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import ShowType from './CommonComponent';/* 通用方法 */
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+import moment from 'moment';
+
+const { TextArea } = Input;
+const FormItem = Form.Item;
+export default class SlaveMemo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.handleTextareaChange = this.handleTextareaChange.bind(this);
+ this.state = { textareaValue: '' };
+ this.max = 2000;
+ this.min = 0;
+ this.sDateFormat = 'YYYY-MM-DD';
+ this.bInit = true; // 是否初始化
+ // this.isChoosedate = btnName.toLowerCase().endsWith('choosedate');
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ /* state和this属性赋值 */
+ const { sCurrMemoProps1 } = nextProps;
+ if (this.bInit && sCurrMemoProps1 && sCurrMemoProps1.bVisibleMemo) {
+ this.bInit = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1) && sCurrMemoProps1.btnName === undefined) {
+ this.setState({ textareaValue: nextProps.sCurrMemoProps1.sValue });
+ } else {
+ this.setState({ textareaValue: nextProps.sValue });
+ }
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1)) {
+ this.max = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig.sMaxValue) ? nextProps.sCurrMemoProps1.sMemoConfig.sMaxValue : this.max); /* 最大值(数据格式:数字) */
+ this.min = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig.sMinValue) ? nextProps.sCurrMemoProps1.sMemoConfig.sMinValue : this.min); /* 最小值(数据格式:数字) */
+ }
+ }
+ }
+ handleOk = () => {
+ const { sCurrMemoProps1, slaveMemoConfig, masterData } = this.props;
+ const sValue = {};
+ const name = sCurrMemoProps1.name;
+ const bVisibleMemo = sCurrMemoProps1.bVisibleMemo;
+ const sMemoField = sCurrMemoProps1.sMemoField;
+ const sRecord = sCurrMemoProps1.sRecord;
+ const btnName = sCurrMemoProps1.btnName ? sCurrMemoProps1.btnName : '';
+ let valueKey = '';
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig) && commonUtils.isNotEmptyObject(masterData)) {
+ // eslint-disable-next-line array-callback-return
+ slaveMemoConfig.map((item) => {
+ /**
+ * 修改日期:2021-03-24
+ * 修改人:吕杰
+ * 区域:以下 18 行
+ * BUG:
+ * 说明:过滤伪字段,为下拉框时替换为id
+ * 原代码:
+ */
+ let realName = item.sName;
+ if (item.sRelation && item.sRelation !== 'noQuery') { // 伪字段处理
+ if (item.sDropDownType && item.sDropDownType === 'sql') { // 下拉框处理
+ /** 此处存在替换隐患,暂无好的解决方案(存在多个Name且需要替换的位置不确定时,无解决方案) */
+ realName = realName.replace('Name', 'Id');
+ } else { // 过滤
+ // eslint-disable-next-line array-callback-return
+ return;
+ }
+ }
+ sValue[realName] = masterData[realName];
+ if (btnName.toLowerCase().endsWith('choosedate') && realName.length > 0 && realName.substring(0, 1) === 'p') {
+ const tStartDate = moment(sValue[realName][0]).format(this.sDateFormat);
+ const tEndDate = moment(sValue[realName][1]).add(1, 'days').format(this.sDateFormat);
+ sValue[realName][0] = tStartDate;
+ sValue[realName][1] = tEndDate;
+ }
+ valueKey += `${realName},`;
+ });
+ sValue.valueKey = valueKey;
+ }
+ sValue.textareaValue = this.state.textareaValue;
+ if (btnName.indexOf('BtnRepair') > -1) {
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnName))[0];
+ if (commonUtils.isNotEmptyObject(btnConfig)) {
+ this.props.onBtnEent(btnConfig, btnName, sValue);
+ }
+ if (btnName.toLowerCase().endsWith('choosedate')) {
+ const iIndex = slaveMemoConfig.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ /* 日期凭证调用存储过程后清除时间区间 */
+ masterData.pChooseDate = null;
+ }
+ }
+ } else if (btnName.indexOf('BtnForceComplete') > -1) {
+ this.props.onGetMemo(name, sValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ } else {
+ this.props.onGetMemo(name, this.state.textareaValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ }
+ this.bInit = true;
+ };
+ handleSlaveMemoMasterChange = async (name, sFieldName, changeValue, sId, dropDownData, isWait, masterDataNew) => {
+ const { masterData: masterDataOld, enabled } = this.props;
+ const addState = { enabled };
+ const masterData = masterDataNew === undefined ? masterDataOld === undefined ? {} : masterDataOld : masterDataNew;
+ const returnData = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData);
+ if (isWait) {
+ return { ...returnData, ...addState };
+ } else {
+ this.props.onSaveState({ ...returnData, ...addState });
+ return returnData;
+ }
+ }
+
+ handleCancel = () => {
+ this.bInit = true;
+ this.props.onGetMemoCancel();
+ };
+ /* 设置textareaValue */
+ handleTextareaChange(e) {
+ this.setState({
+ textareaValue: e.target.value,
+ });
+ }
+ handleViewClick = (name, sName, sId) => {
+ this.props.onViewClick(name, sName, sId);
+ };
+ /** 渲染 */
+ render() {
+ const {
+ sCurrMemoProps1,
+ masterData,
+ app,
+ sModelsId,
+ form,
+ slaveMemoConfig,
+ } = this.props;
+ let bVisibleMemo;
+ let sMemoField;
+ let btnName = '';
+ const title = '详细';
+ let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1)) {
+ bVisibleMemo = sCurrMemoProps1.bVisibleMemo;
+ sMemoField = sCurrMemoProps1.sMemoField;
+ btnName = sCurrMemoProps1.btnName ? sCurrMemoProps1.btnName : '';
+ if (sCurrMemoProps1.bOnlyShow !== undefined) { /* 查看状态下备注弹窗只能查看不能修改 */
+ bEnabledTextArea = sCurrMemoProps1.bOnlyShow;
+ }
+ }
+ let bVisibleTextArea = true;
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig)) {
+ if (slaveMemoConfig[0].sName === 'sDevelopMemo') {
+ bVisibleTextArea = false; /* 开发备注多行文本不显示 */
+ }
+ }
+ // const tStartDate = moment(); /* 开始时间 */
+ // 判断是否备注双击弹出的弹窗
+ // if (fromToorBar) {
+ // bVisibleMemo = false;
+ // }
+ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 18 } };
+ return (
+
+ {
+ bVisibleMemo ?
+
+
+ {
+ btnName.indexOf('BtnRepair') > -1 ?
+
+ : ''
+ }
+ {sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') ? (
+
+ ) : null}
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
diff --git a/src/components/Common/SlaveMemo1.js b/src/components/Common/SlaveMemo1.js
new file mode 100644
index 0000000..37bfd51
--- /dev/null
+++ b/src/components/Common/SlaveMemo1.js
@@ -0,0 +1,253 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Input } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import ShowType from './CommonComponent';/* 通用方法 */
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+import moment from 'moment';
+
+const { TextArea } = Input;
+const FormItem = Form.Item;
+export default class SlaveMemo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.handleTextareaChange = this.handleTextareaChange.bind(this);
+ this.state = { textareaValue: '' };
+ this.max = 2000;
+ this.min = 0;
+ this.sDateFormat = 'YYYY-MM-DD';
+ this.bInit = true; // 是否初始化
+ // this.isChoosedate = btnName.toLowerCase().endsWith('choosedate');
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ /* state和this属性赋值 */
+ const { sCurrMemoProps1 } = nextProps;
+ if (this.bInit && sCurrMemoProps1 && sCurrMemoProps1.bVisibleMemo) {
+ this.bInit = false;
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1) && sCurrMemoProps1.btnName === undefined) {
+ this.setState({ textareaValue: nextProps.sCurrMemoProps1.sValue });
+ } else {
+ this.setState({ textareaValue: nextProps.sValue });
+ }
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1)) {
+ this.max = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig.sMaxValue) ? nextProps.sCurrMemoProps1.sMemoConfig.sMaxValue : this.max); /* 最大值(数据格式:数字) */
+ this.min = commonUtils.convertStrToNumber(commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig) && commonUtils.isNotEmptyObject(nextProps.sCurrMemoProps1.sMemoConfig.sMinValue) ? nextProps.sCurrMemoProps1.sMemoConfig.sMinValue : this.min); /* 最小值(数据格式:数字) */
+ }
+ }
+ }
+ handleOk = () => {
+ const { sCurrMemoProps1, slaveMemoConfig, masterData } = this.props;
+ const sValue = {};
+ const name = sCurrMemoProps1.name;
+ const bVisibleMemo = sCurrMemoProps1.bVisibleMemo;
+ const sMemoField = sCurrMemoProps1.sMemoField;
+ const sRecord = sCurrMemoProps1.sRecord;
+ const btnName = sCurrMemoProps1.btnName ? sCurrMemoProps1.btnName : '';
+ let valueKey = '';
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig) && commonUtils.isNotEmptyObject(masterData)) {
+ // eslint-disable-next-line array-callback-return
+ slaveMemoConfig.map((item) => {
+ /**
+ * 修改日期:2021-03-24
+ * 修改人:吕杰
+ * 区域:以下 18 行
+ * BUG:
+ * 说明:过滤伪字段,为下拉框时替换为id
+ * 原代码:
+ */
+ let realName = item.sName;
+ if (item.sRelation && item.sRelation !== 'noQuery') { // 伪字段处理
+ if (item.sDropDownType && item.sDropDownType === 'sql') { // 下拉框处理
+ /** 此处存在替换隐患,暂无好的解决方案(存在多个Name且需要替换的位置不确定时,无解决方案) */
+ realName = realName.replace('Name', 'Id');
+ } else { // 过滤
+ // eslint-disable-next-line array-callback-return
+ return;
+ }
+ }
+ sValue[realName] = masterData[realName];
+ if (btnName.toLowerCase().endsWith('choosedate') && realName.length > 0 && realName.substring(0, 1) === 'p') {
+ const tStartDate = moment(sValue[realName][0]).format(this.sDateFormat);
+ const tEndDate = moment(sValue[realName][1]).add(1, 'days').format(this.sDateFormat);
+ sValue[realName][0] = tStartDate;
+ sValue[realName][1] = tEndDate;
+ }
+ valueKey += `${realName},`;
+ });
+ sValue.valueKey = valueKey;
+ }
+ sValue.textareaValue = this.state.textareaValue;
+ if (btnName.indexOf('BtnRepair') > -1) {
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnName))[0];
+ if (commonUtils.isNotEmptyObject(btnConfig)) {
+ this.props.onBtnEent(btnConfig, btnName, sValue);
+ }
+ if (btnName.toLowerCase().endsWith('choosedate')) {
+ const iIndex = slaveMemoConfig.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ /* 日期凭证调用存储过程后清除时间区间 */
+ masterData.pChooseDate = null;
+ }
+ }
+ } else if (btnName.indexOf('BtnForceComplete') > -1) {
+ this.props.onGetMemo(name, sValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ } else {
+ this.props.onGetMemo(name, this.state.textareaValue, sMemoField, sRecord, bVisibleMemo, btnName);
+ }
+ this.bInit = true;
+ };
+ handleSlaveMemoMasterChange = async (name, sFieldName, changeValue, sId, dropDownData, isWait, masterDataNew) => {
+ const { masterData: masterDataOld, enabled } = this.props;
+ const addState = { enabled };
+ const masterData = masterDataNew === undefined ? masterDataOld === undefined ? {} : masterDataOld : masterDataNew;
+ const returnData = await this.props.onChange(name, sFieldName, changeValue, sId, dropDownData, true, masterData);
+ if (isWait) {
+ return { ...returnData, ...addState };
+ } else {
+ this.props.onSaveState({ ...returnData, ...addState });
+ return returnData;
+ }
+ }
+
+ handleCancel = () => {
+ this.bInit = true;
+ this.props.onGetMemoCancel();
+ };
+ /* 设置textareaValue */
+ handleTextareaChange(e) {
+ this.setState({
+ textareaValue: e.target.value,
+ });
+ }
+ handleViewClick = (name, sName, sId) => {
+ this.props.onViewClick(name, sName, sId);
+ };
+ /** 渲染 */
+ render() {
+ const {
+ sCurrMemoProps1,
+ masterData,
+ app,
+ sModelsId,
+ form,
+ slaveMemoConfig,
+ } = this.props;
+ let bVisibleMemo;
+ let sMemoField;
+ let btnName = '';
+ const title = '详细';
+ let bEnabledTextArea = false; /* 多行文本默认可输入 非编辑状态多行文本禁止输入 */
+ if (commonUtils.isNotEmptyObject(sCurrMemoProps1)) {
+ bVisibleMemo = sCurrMemoProps1.bVisibleMemo;
+ sMemoField = sCurrMemoProps1.sMemoField;
+ btnName = sCurrMemoProps1.btnName ? sCurrMemoProps1.btnName : '';
+ if (sCurrMemoProps1.bOnlyShow !== undefined) { /* 查看状态下备注弹窗只能查看不能修改 */
+ bEnabledTextArea = sCurrMemoProps1.bOnlyShow;
+ }
+ }
+ let bVisibleTextArea = true;
+ if (commonUtils.isNotEmptyArr(slaveMemoConfig)) {
+ if (slaveMemoConfig[0].sName === 'sDevelopMemo') {
+ bVisibleTextArea = false; /* 开发备注多行文本不显示 */
+ }
+ }
+ // const tStartDate = moment(); /* 开始时间 */
+ // 判断是否备注双击弹出的弹窗
+ // if (fromToorBar) {
+ // bVisibleMemo = false;
+ // }
+ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 18 } };
+ return (
+
+ {
+ bVisibleMemo ?
+
+
+ {
+ btnName.indexOf('BtnRepair') > -1 ?
+
+ : ''
+ }
+ {sMemoField !== undefined && !btnName.toLowerCase().endsWith('choosedate') ? (
+
+ ) : null}
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
diff --git a/src/components/Common/ToolBar/ToolBarNew.js b/src/components/Common/ToolBar/ToolBarNew.js
new file mode 100644
index 0000000..391ae79
--- /dev/null
+++ b/src/components/Common/ToolBar/ToolBarNew.js
@@ -0,0 +1,4212 @@
+/* eslint-disable */
+/* eslint-disable spaced-comment,no-lonely-if */
+/* eslint-disable prefer-destructuring */
+import React, { Component } from 'react';
+import moment from 'moment';
+import lodash from 'lodash';
+import { DownloadOutlined, DownOutlined, UploadOutlined } from '@ant-design/icons';
+import { Menu, Spin, Input, Checkbox, Upload, Modal, Progress } from 'antd-v4';
+import { message } from '@/utils/common/message';
+import commonConfig from '@/utils/config';
+import * as commonUtils from '@/utils/utils';
+import StatementInfo from '@/components/CommonElementEvent/StatementInfo';
+import FilfileManageInfo from '@/components/CommonElementEvent/FilfileManageInfo';
+import BatchPriceUpdate from '@/components/CommonElementEvent/BatchPriceUpdate';
+import BatchNPriceUpdate from '@/components/CommonElementEvent/BatchNPriceUpdate';/* 产品单价价格批量更新 */
+import AffixMenu from '@/routes/common/AffixMenu';
+import * as commonBusiness from '@/components/Common/commonBusiness';
+import * as commonFunc from '@/components/Common/commonFunc';
+import AntdDraggableModal from '@/components/Common/AntdDraggableModal';
+import SlaveMemo from '@/components/Common/SlaveMemo';
+import SlaveMemo1 from '@/components/Common/SlaveMemo1';
+import * as commonServices from '@/services/services';
+import BatchWorkListPriceUpdate from '@/components/CommonElementEvent/BatchWorkListPriceUpdate';
+import CommonListSelect from '@/components/Common/CommonListSelect';
+import EditorModal from '@/components/Common/EditorModal';
+import styles from './index.less';
+import SvgIcon from "../../SvgIcon";
+import instructSet from "@/components/Common/CommonInstructSet";
+import FileImposition from '@/components/Common/FileImposition';
+
+const { SubMenu } = Menu;
+const MenuItemGroup = Menu.ItemGroup;
+
+let time;
+const throttle = (fn, wtime) => {
+ return (...arg) => {
+ if (!time || (Date.now() - time > wtime)) {
+ time = Date.now();
+ fn(...arg);
+ }
+ }
+}
+
+class ToolBarComponent extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.state = {
+ menuData: [], /* 导航工具栏 */
+ enabled: false,
+ bCheck: false,
+ bInvalid: false,
+ reportData: [], /* 报表数据 */
+ reportSelectedRowKeys: [],
+ inputChange: '',
+ checked: false,
+ checkedId: '',
+ printData :[], /* 打印数据集 */
+ };
+ }
+
+ componentWillMount() {
+ this.componentWillReceiveProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ const {
+ masterConfig, gdsjurisdiction, report, masterData, app, menuChildData,
+ } = nextProps;
+ let {
+ searchUpDownData, enabled, bCheck, bInvalid, visibleStatement, visibleBatchPriceUpdate, visibleBatchNPriceUpdate, reportData, reportSelectedRowKeys,
+ } = this.state;
+ const btnShowData = [];
+ commonConfig.btnData.forEach((item) => {
+ btnShowData.push({ ...item });
+ });
+ let menuData = [];
+
+ if (commonUtils.isNotEmptyObject(masterConfig) && commonUtils.isEmptyArr(menuData)) {
+ const buttonConfig = masterConfig.gdsconfigformslave.filter(item => item.sName === '' && item.showName !== '' && item.sControlName !== '');
+ /** 筛选出显示的按钮 */
+ buttonConfig.forEach((child) => {
+ const index = btnShowData.findIndex(item => item.sControlName === child.sControlName);
+ if (child.bVisible && child.sControlName.substring(0, 3) === 'Btn' && btnShowData.findIndex(item => item.sControlName === child.sControlName) === -1) {
+ child.iconName = 'menu-unfold';
+ if (child.sControlName === 'BtnBatchExamine') { child.iconName = 'check'; }
+ if (child.sControlName === 'BtnBatchCancelExamine') { child.iconName = 'rollback'; }
+ if (child.sControlName === 'BtnUpload') { child.iconName = 'upload'; }
+ if (child.sControlName === 'BtnUploadicon') { child.iconName = 'upload'; }
+ if (child.sControlName === 'BtnUploadPic') { child.iconName = 'upload'; }
+ if (child.sControlName === 'BtnCalculation') { child.iconName = 'calculator'; }
+ if (child.sControlName === 'BtnAddBug') { child.iconName = 'plus'; }
+ if (child.sControlName === 'BtnAddTo') { child.iconName = 'plus'; }
+ if (child.sControlName === 'BtnSubmit') { child.iconName = 'submit'; }
+ if (child.sControlName === 'BtnSubmitCancel') { child.iconName = 'submitCancel'; }
+ if (child.sControlName === 'BtnBatchSubmit') { child.iconName = 'batchSubmit'; }
+ if (child.sControlName === 'BtnEventAdjust') { child.iconName = 'batchSubmitCancel'; }
+
+ btnShowData.push(child);
+ } else if (!child.bVisible && index > -1) {
+ btnShowData.splice(index, 1);
+ } else if (index > -1) {
+ btnShowData[index].sColor = child.sColor;
+ btnShowData[index].showName = child.showName;
+ btnShowData[index].interface = commonUtils.isNotEmptyArr(child.interface) ? child.interface : []; /* 按钮接口参数 */
+ btnShowData[index] = { ...child, ...btnShowData[index] };
+ }
+ });
+ /** 根据权限,筛选出显示的按钮 */
+ gdsjurisdiction.forEach((child) => {
+ const index = btnShowData.findIndex(item => item.sControlName === child.sAction);
+ if (index > -1) {
+ btnShowData.splice(index, 1);
+ }
+ });
+ /* 管理员有重置按钮,非管理员无重置按钮 */
+ const { sType } = app.userinfo;
+ if (sType !== 'sysadmin') {
+ const index = btnShowData.findIndex(item => item.sControlName === 'BtnResetpwd');
+ if (index > -1) {
+ btnShowData.splice(index, 1);
+ }
+ }
+ /* 筛选出一级菜单 */
+ menuData = btnShowData.filter(item => !item.sControlName.includes('.'));
+ /* 初始值的二级菜单 */
+ // const secondMenu = btnShowData.filter(item => item.sControlName.includes('.'));
+ /** 配置后匹配二级菜单 */
+ menuData.forEach((menu) => {
+ menu.child = [];
+ /** 匹配相应的子菜单 */
+ const childData = btnShowData.filter(item => item.sControlName.startsWith(`${menu.sControlName}.`) && item.sControlName.split('.').length <= 2);
+ if (menu.sControlName === 'BtnPrint') {
+ /* 打印的二级菜单集合 */
+ const reportChild = [];
+ if (commonUtils.isNotEmptyArr(report)) {
+ for (const each of report) {
+ reportChild.push({
+ sControlName: `BtnPrint.${each.sId}`,
+ showName: each.sReportName,
+ disabled: false,
+ sActiveId: each.sId,
+ sId: each.sId,
+ });
+ }
+ }
+ menu.child.push(...reportChild);
+ } else if (menu.sControlName === 'BtnPrintCustomer' && commonUtils.isNotEmptyObject(menuChildData)) {
+ const reportChild = [];
+ if (commonUtils.isNotEmptyArr(menuChildData)) {
+ for (const each of menuChildData) {
+ reportChild.push({
+ sControlName: `BtnPrintCus.${each.sId}`,
+ showName: each.sReportName,
+ disabled: false,
+ sActiveId: each.sId,
+ sId: each.sId,
+ });
+ }
+ }
+ menu.child.push(...reportChild);
+ } else if (commonUtils.isNotEmptyArr(childData)) {
+ childData.forEach((childTwo) => {
+ if (childTwo.sControlName === 'BtnBsOperation.BtnUpCheck' || childTwo.sControlName === 'BtnBsOperation.BtnDownCheck') {
+ const childDataThree = btnShowData.filter(item => item.sControlName.startsWith(`${childTwo.sControlName}.`) && item.sControlName.split('.').length === 3);
+ childTwo.child = childDataThree;
+ }
+ });
+ menu.child.push(...childData);
+ }
+ });
+ }
+
+ /* 按照后台配置加载按钮顺序 */
+ if(commonUtils.isNotEmptyArr(menuData)) {
+ menuData = menuData.sort((item, item2) => item.iOrder - item2.iOrder);
+ }
+
+ if (enabled !== nextProps.enabled) {
+ enabled = nextProps.enabled;
+ }
+ if (visibleStatement !== nextProps.visibleStatement) {
+ visibleStatement = nextProps.visibleStatement;
+ }
+ if (visibleBatchPriceUpdate !== nextProps.visibleBatchPriceUpdate) {
+ visibleBatchPriceUpdate = nextProps.visibleBatchPriceUpdate;
+ }
+ if (visibleBatchNPriceUpdate !== nextProps.visibleBatchNPriceUpdate) {
+ visibleBatchNPriceUpdate = nextProps.visibleBatchNPriceUpdate;
+ }
+ if (reportData !== nextProps.reportData) {
+ reportData = nextProps.reportData;
+ }
+ if (reportSelectedRowKeys !== nextProps.reportSelectedRowKeys) {
+ reportSelectedRowKeys = nextProps.reportSelectedRowKeys;
+ }
+ if (commonUtils.isNotEmptyObject(masterData) && bCheck !== masterData.bCheck) {
+ bCheck = masterData.bCheck;
+ }
+ if (commonUtils.isNotEmptyObject(masterData) && bInvalid !== masterData.bInvalid) {
+ bInvalid = masterData.bInvalid;
+ }
+ if (JSON.stringify(searchUpDownData) !== JSON.stringify(nextProps.searchUpDownData)) {
+ searchUpDownData = nextProps.searchUpDownData;
+ }
+
+ // 当前页面全部数据
+ const allTableData = commonFunc.getAllTableData(nextProps);
+ // 当前页面所有选中数据
+ const allTableSelectedData = Object.keys(allTableData).reduce((result, tableName) => {
+ const tableData = allTableData[tableName];
+ if (!Array.isArray(tableData)) {
+ result = {
+ ...result,
+ [tableName]: tableData
+ };
+ } else {
+ const { [`${tableName}SelectedRowKeys`]: selectedRowKeys = [] } = nextProps;
+ result = {
+ ...result,
+ [tableName]: tableData.filter(item => selectedRowKeys.includes(item.sSlaveId) || selectedRowKeys.includes(item.sId))
+ };
+ }
+ return result;
+ }, {});
+ this.setState({
+ menuData, searchUpDownData, enabled, bCheck, bInvalid, visibleStatement, visibleBatchPriceUpdate, visibleBatchNPriceUpdate, reportData, reportSelectedRowKeys, allTableSelectedData,
+ });
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ const { masterConfig } = nextProps;
+ const {
+ menuData, searchUpDownData, enabled, bCheck, bInvalid, visibleStatement, visibleBatchPriceUpdate, visibleBatchNPriceUpdate, visibleBatchWorkListPriceUpdate, reportData, reportSelectedRowKeys,
+ } = this.state;
+ const {
+ adDisabled,
+ } = this.props;
+ return masterConfig !== undefined && Object.keys(masterConfig).length > 0 &&
+ (JSON.stringify(menuData) !== JSON.stringify(nextState.menuData) ||
+ JSON.stringify(masterConfig) !== JSON.stringify(nextState.masterConfig) ||
+ JSON.stringify(searchUpDownData) !== JSON.stringify(nextState.searchUpDownData) ||
+ JSON.stringify(reportData) !== JSON.stringify(nextState.initialReportData) ||
+ JSON.stringify(reportSelectedRowKeys) !== JSON.stringify(nextState.reportSelectedRowKeys) ||
+ enabled !== nextState.enabled || bCheck !== nextState.bCheck || visibleStatement !== nextState.visibleStatement ||
+ visibleBatchPriceUpdate !== nextState.visibleBatchPriceUpdate ||
+ visibleBatchNPriceUpdate !== nextState.visibleBatchNPriceUpdate ||
+ visibleBatchWorkListPriceUpdate !== nextState.visibleBatchWorkListPriceUpdate ||
+ bInvalid !== nextState.bInvalid || adDisabled !== nextProps.adDisabled);
+ }
+ componentDidUpdate(prevProps) {
+ const {
+ slaveSelectedRowKeys, slaveInfoSelectedRowKeys, slaveData, slaveInfoData, masterData,
+ } = prevProps;
+ if (JSON.stringify(slaveData) !== JSON.stringify(this.props.slaveData) || JSON.stringify(slaveInfoData) !== JSON.stringify(this.props.slaveInfoData) ||
+ JSON.stringify(slaveSelectedRowKeys) !== JSON.stringify(this.props.slaveSelectedRowKeys) ||
+ JSON.stringify(masterData) !== JSON.stringify(this.props.masterData) ||
+ JSON.stringify(slaveInfoSelectedRowKeys) !== JSON.stringify(this.props.slaveInfoSelectedRowKeys)) {
+ this.handleBtnEnabled(this.props, false);
+ }
+
+ if (!this.btnSendDialogLoaded) {
+ const { masterConfig = {} } = this.props;
+ const { gdsconfigformslave = [] } = masterConfig;
+ const sBtnSendDialogConfigList = gdsconfigformslave.filter(item => item.sControlName && item.sControlName.includes('BtnSendDialog'));
+ if (commonUtils.isNotEmptyArr(sBtnSendDialogConfigList) && !this.props.onToolBarBtnClick) {
+ this.btnSendDialogLoaded = true;
+ this.props.onSaveState({
+ onToolBarBtnClick: this.handleClick,
+ sBtnSendDialogConfigList
+ });
+ }
+ };
+ }
+ /** 获取有三级菜单的父级菜单属性 */
+ getMenuProps = (menu, type) => {
+ const { iconName, showName: showNameOld, sIcon } = menu;
+ const { menuStatus, bShown, showName: showNameNew } = this.getMenuStatus(menu);
+ const showName = showNameNew || showNameOld;
+ const obj = {};
+ obj.key = menu.sControlName;
+ obj.name = showName;
+ obj.disabled = menuStatus;
+ obj.style = bShown ? {} : { display: 'none' };
+ obj.className = this.getMenuStatus(menu) && this.props.billList === 'billList' ? styles.toolBarSubDisabled : styles.toolBarSub;
+ if (menu.sControlName !== undefined && (menu.sControlName === 'BtnBsOperation.BtnUpCheck' || menu.sControlName === 'BtnBsOperation.BtnDownCheck')) {
+ obj.onMouseEnter = this.handleMouseEnter; /* 根据二级菜单获取三级数据 */
+ }
+ // if (menu.sControlName !== undefined && (menu.sControlName.indexOf('BtnBsOperation.BtnUpCheck') > -1 || menu.sControlName.indexOf('BtnBsOperation.BtnDownCheck') > -1) && menu.sControlName.split('.').length === 3) {
+ // obj.onMouseEnter = this.handleMouseEnter; /* 根据二级菜单获取三级数据 */
+ // }
+ obj['data-sactiveid'] = menu.sActiveId;
+ if (type === 'icon') {
+ const imageDom = this.getImageDom(sIcon) || ();
+ obj.title = {imageDom}{showName};
+ } else if (type === 'title') {
+ obj.title = showName;
+ } else if (type === 'key' && commonUtils.isEmpty(menu.sControlName)) {
+ obj.key = menu.sId;
+ }
+ return obj;
+ };
+
+ /** 获取父级菜单属性 */
+ getMenuStatus = (menu) => {
+ let bShown = true;
+
+ // 如果配置了按钮自定义状态,走自定义逻辑
+ const statusObj = this.getMenuStatusCostom(menu);
+ const { bContinue, bContinueMenuStatus } = statusObj;
+ if (!bContinue && !bContinueMenuStatus) { // 如果不在配置中,走默认逻辑
+ return statusObj;
+ } else if (bContinueMenuStatus) { // 如果只配置了show没有配置enabled,show取自定义结果,enabled走默认逻辑
+ bShown = statusObj.bShown;
+ }
+
+ let { masterData, formRoute } = this.props;
+
+ // 主表数据是当前表格已选中数据
+ if (formRoute === '/indexPage/commonListLeft') {
+ const { slaveSelectedData } = this.props;
+ if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
+ masterData = slaveSelectedData[0];
+ }
+ }
+
+ const { sortEnabled } = this.props;
+ const {
+ enabled, adDisabled, sModelsType, masterConfig, activeKey, sModelsId,
+ } = this.props;
+ if (commonUtils.isEmptyObject(masterData)) {
+ masterData = {};
+ }
+ const { bInvalid, bSubmit } = masterData;
+ let { bCheck, bNextCheck } = masterData;
+ /* 是否有审核按钮 基础模块转换的commonNewBill复制到只需通过有无审核按钮判断 */
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName && item.sControlName.includes('BtnCheck'));
+ let bBtnCheck = true;
+ if(iIndex > -1) {
+ bBtnCheck = true;
+ }else {
+ bBtnCheck = false;
+ }
+ if(location.pathname ==='/indexPage/commonClassify'){ /* 通用分类 若配置没有审核按钮 则默认bCheck不为空 */
+ if(iIndex === -1) {
+ bCheck= false;
+ }
+ }
+
+ let disabledData = []; /* 置灰按钮集合 */
+ if (adDisabled) {
+ disabledData = ['BtnAdd', 'BtnAddChild', 'BtnUpd', 'BtnDel', 'BtnSave', 'BtnCancel', 'BtnSetPeriod'];
+ } else if (!adDisabled) {
+ if (!enabled) {
+ if (bInvalid) { // 已作废
+ disabledData = ['BtnUpd', 'BtnDel', 'BtnSave', 'BtnCancel', 'BtnExamine', 'BtnCancelExamine', 'BtnCopyTo', 'BtnCopyFrom', 'BtnBsOperation.BtnInvalid', 'BtnInvalid'];
+ } else if (bCheck) { // 已审核
+ if (!commonUtils.isEmpty(sModelsType) && sModelsType.includes('element/')) {
+ if (sModelsType === 'element/customerInfo') {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnCheck');
+ if (iIndex > -1) {
+ disabledData = ['BtnDel', 'BtnSave', 'BtnCancel', 'BtnExamine', 'BtnCopyFrom', 'BtnCancelInvalid', 'BtnImport']; //'BtnUpd',
+ } else {
+ disabledData = ['BtnSave', 'BtnCancel', 'BtnCancelExamine', 'BtnCopyFrom', 'BtnCancelInvalid'];
+ }
+ } else {
+ disabledData = ['BtnSave', 'BtnCancel', 'BtnCancelExamine', 'BtnCopyFrom', 'BtnCancelInvalid'];
+ }
+ } else {
+ /* 已审核查看状态 修改 删除 保存 取消 审核 复制从 取消作废置灰 */
+ disabledData = ['BtnUpd', 'BtnDel', 'BtnSave', 'BtnCancel', 'BtnExamine', 'BtnCopyFrom', 'BtnCancelInvalid', 'BtnImport'];
+ }
+ } else {
+ /** 查看状态 修改 删除 保存 取消 审核 复制从置灰 */
+ disabledData = ['BtnSave', 'BtnCancel', 'BtnCopy2Custom', 'BtnCancelExamine', 'BtnCopyTo', 'BtnCopyFrom', 'BtnCancelInvalid'];
+ if (!commonUtils.isEmpty(sModelsType) && sModelsType.includes('element/')) {
+ /* 除了客户信息,其他基础信息在查看状态状态下 复制到常亮 */
+ disabledData = ['BtnSave', 'BtnCancel', 'BtnCancelExamine', 'BtnCopyFrom', 'BtnCancelInvalid'];
+ if (sModelsType === 'element/customerInfo') {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnCheck');
+ if (iIndex > -1) {
+ disabledData = ['BtnSave', 'BtnCancel', 'BtnCancelExamine', 'BtnCopyTo', 'BtnCopyFrom', 'BtnCancelInvalid'];
+ }
+ }
+ }
+ }
+ } else {
+ /* 修改状态 */
+ if (sModelsType === 'production/productionPlanInfo' || sModelsType === 'productionMainPlan/productionMainPlan') {
+ disabledData = ['BtnAdd', 'BtnAddChild', 'BtnUpd', 'BtnDel', 'BtnFirst', 'BtnPrior', 'BtnNext', 'BtnLast', 'BtnUpCheck', 'BtnDownCheck', 'BtnExamine', 'BtnCancelExamine', 'BtnCopyTo', 'BtnBsOperation.BtnInvalid', 'BtnBsOperation.BtnCancelInvalid', 'BtnCancelInvalid', 'BtnInvalid'];
+ } else {
+ disabledData = ['BtnRefresh', 'BtnAdd', 'BtnInit', 'BtnExportSql','Btn', 'BtnAddChild', 'BtnUpd', 'BtnDel', 'BtnFirst', 'BtnPrior', 'BtnNext', 'BtnLast', 'BtnUpCheck', 'BtnDownCheck', 'BtnExamine', 'BtnCancelExamine', 'BtnCopyTo', 'BtnBsOperation.BtnInvalid', 'BtnBsOperation.BtnCancelInvalid', 'BtnPrint', 'BtnCancelInvalid', 'BtnInvalid'];
+ }
+ }
+ }
+
+ if (bSubmit) {
+ // 提交后不能修改
+ if (!disabledData.includes('BtnUpd')) {
+ disabledData.push('BtnUpd');
+ }
+ if (!disabledData.includes('BtnDel')) {
+ disabledData.push('BtnDel');
+ }
+ if (!disabledData.includes('BtnSave')) {
+ disabledData.push('BtnSave');
+ }
+ if (!disabledData.includes('BtnEventCancel')) {
+ disabledData.push('BtnEventCancel');
+ }
+ // 提交后提交按钮变灰
+ if (!disabledData.includes('BtnSubmit')) {
+ disabledData.push('BtnSubmit');
+ }
+ // 提交后取消提交按钮变亮
+ if (disabledData.indexOf('BtnSubmitCancel') !== -1) {
+ disabledData.splice(disabledData.indexOf('BtnSubmitCancel'), 1);
+ }
+ } else {
+ // 未提交时取消提交按钮变灰
+ if (!disabledData.includes('BtnSubmitCancel')) {
+ disabledData.push('BtnSubmitCancel');
+ disabledData.push('BtnEventOrder');
+ }
+ }
+
+ // 修改或者审核后提交、取消提交按钮都变灰
+ if (enabled || bCheck) {
+ if (!disabledData.includes('BtnSubmit')) {
+ disabledData.push('BtnSubmit');
+ }
+ if (!disabledData.includes('BtnSubmitCancel')) {
+ disabledData.push('BtnSubmitCancel');
+ }
+ }
+ if(bCheck) { /* 已审核状态下 审核按钮灰色 */
+ if (!disabledData.includes('BtnEventOrder')) {
+ disabledData.push('BtnEventOrder');
+ }
+
+ // if (!disabledData.includes('BtnEventSubmit')) {
+ // disabledData.push('BtnEventSubmit');
+ // }
+ // /* 已审核状态下 消审亮 */
+ // if (disabledData.indexOf('BtnEventSubmitCancel') !== -1) {
+ // disabledData.splice(disabledData.indexOf('BtnEventSubmitCancel'), 1);
+ // }
+
+ /* 已审核状态下 驳回灰色 */
+ // if (!disabledData.includes('BtnEventCancel')) {
+ // disabledData.push('BtnEventCancel');
+ // }
+
+ // if (!disabledData.includes('BtnBatchExamine')) {
+ // disabledData.push('BtnBatchExamine');
+ // }
+ }
+ /* 未审核状态 ,审核按钮亮,销审按钮灰色 */
+ if(!bCheck) {
+ if (!disabledData.includes('BtnEventSubmitCancel')) {
+ disabledData.push('BtnEventSubmitCancel');
+ }
+ if (!disabledData.includes('BtnBatchCancelExamine')) {
+ disabledData.push('BtnBatchCancelExamine');
+ }
+ }
+
+ /* 若下游已审核,则上游的消审按钮置灰 */
+ if(bNextCheck) {
+ if (!disabledData.includes('BtnEventSubmitCancel')) {
+ disabledData.push('BtnEventSubmitCancel');
+ }
+
+ if (!disabledData.includes('BtnBatchCancelExamine')) {
+ disabledData.push('BtnBatchCancelExamine');
+ }
+ }
+
+ /*
+ 将按钮的sButtonParam中的b开头字段的值 与 主表中相同字段的值做对比
+ 值相同 代表审核通过 对应按钮置灰
+ **/
+ const sButtonParamBtn = masterConfig.gdsconfigformslave.filter(
+ item =>
+ commonUtils.isNotEmptyStr(item.showName)
+ && commonUtils.isNotEmptyStr(item.sControlName)
+ && commonUtils.isNotEmptyStr(item.sButtonParam)
+ );
+
+ sButtonParamBtn.forEach(btn => {
+ const { sButtonParam = {} } = commonUtils.convertStrToObj(btn.sButtonParam);
+ const key = Object.keys(sButtonParam).find(item => item && item.substring(0, 1) === 'b');
+ if (key) {
+ const bCheckCostom = masterData[key] === sButtonParam[key];
+ if (bCheckCostom) {
+ disabledData.push(btn.sControlName);
+ }
+ }
+ });
+
+
+
+ // 生产排程搜索时不可以上下移动
+ if (sortEnabled === false) {
+ if(sModelsType === 'production/productionPlanInfo') {
+ // disabledData.push('BtnSave');
+ }
+ disabledData.push('BtnRepairstartdate');
+ }
+
+ /* 通用上传按钮 除了新增,其他状态下都是亮的*/
+ if (menu.sControlName === 'BtnUpload') {
+ const { handleType } = masterData;
+ if (handleType === 'add') {
+ disabledData.push('BtnUpload');
+ }
+ }
+ // 其它自定义按钮不在以上 不能操作数据里
+ if (menu.disabled) {
+ disabledData.push(menu.sControlName);
+ }
+ // 订单已审核 价格批量更新亮 */
+ if (commonUtils.isNotEmptyObject(menu.sControlName) && menu.sControlName.includes('PriceUpdate')) {
+ const { bCheck } = masterData;
+ if (!bCheck) {
+ disabledData.push(menu.sControlName);
+ }
+ }
+ /* 导入未清按钮 只有编辑亮的*/
+ if (menu.sControlName === 'BtnImportFormData') {
+ if (!enabled) {
+ disabledData.push('BtnImportFormData');
+ }
+ }
+
+ /* 盘点导出模板数据 只有非编辑 按钮亮*/
+ if (menu.sControlName === 'BtnOutTemplateData') {
+ if (enabled) {
+ disabledData.push('BtnOutTemplateData');
+ }
+ }
+
+
+ if (sModelsType === 'productionMainPlan/productionMainPlan') {
+ // 主计划中保存,取消保存按钮默认不可点击
+ if (disabledData.indexOf('BtnSave') === -1) {
+ disabledData.push('BtnSave');
+ }
+ if (disabledData.indexOf('BtnRefresh') === -1) {
+ disabledData.push('BtnRefresh');
+ }
+ // 生产主计划数据集有改动的时候才会高亮保存按钮
+ // 生产主计划保存按钮和确认计划的按钮互斥,存一
+ if (this.props.dataChanged === true) {
+ // 列表有所改动
+ // 显示保存,禁用确认计划
+ if (disabledData.indexOf('BtnSave') !== -1) {
+ disabledData.splice(disabledData.indexOf('BtnSave'), 1);
+ }
+ if (disabledData.indexOf('BtnRefresh') !== -1) {
+ disabledData.splice(disabledData.indexOf('BtnRefresh'), 1);
+ }
+ if (disabledData.indexOf('BtnUnifiedPlanning') === -1) {
+ disabledData.push('BtnUnifiedPlanning');
+ }
+ }
+ // if (this.props.dataChanged === false) {
+ // if (disabledData.indexOf('BtnUnifiedPlanning') !== -1) {
+ // disabledData.splice(disabledData.indexOf('BtnUnifiedPlanning'), 1);
+ // }
+ // if (disabledData.indexOf('BtnSave') === -1) {
+ // disabledData.push('BtnSave');
+ // disabledData.push('BtnRefresh'); /* 生产主计划刷新按钮的亮与灰与保存按钮同步 */
+ // }
+ // }
+ }
+
+ if (sModelsType === 'system/sisformulaInfo') { // 方案保存开放复制方案
+ disabledData.splice(disabledData.indexOf('BtnCopyTo'), 1);
+ }
+
+ /* 审核中的按钮 所有按钮都置灰 */
+ if( commonUtils.isNotEmptyObject(masterData) && masterData.sStatus === '2') {
+ const disabledDataNew = ['BtnUpd', 'BtnDel', 'BtnRevert', 'BtnSave', 'BtnCopyTo', 'BtnCancel', 'BtnExamine','BtnCancelExamine', 'BtnCopyFrom', 'BtnCancelInvalid', 'BtnImport',
+ 'BtnBsOperation.BtnInvalid', 'BtnBsOperation.BtnCancelInvalid', 'BtnUpload', 'BtnSend','BtnEject', 'BtnBsOperation.BtnUpCheck',
+ 'BtnBsOperation'
+ ];
+ if(commonUtils.isNotEmptyArr(disabledDataNew)) {
+ for (const item of disabledDataNew) {
+ const iIndex = disabledData.findIndex(each => each === item);
+ if(iIndex === -1) {
+ disabledData.push(item);
+ }
+ }
+ }
+ }
+
+ /* 红冲中的单据 根据条件进行所有按钮置灰 */
+ if(commonUtils.isNotEmptyObject(masterData) && ((masterData.bCheck && commonUtils.isNotEmptyObject(masterData.sMinusSrcId)) || commonUtils.isNotEmptyObject(masterData.sMinusUsed) )) {
+ disabledData = ['BtnUpd', 'BtnDel', 'BtnRevert', 'BtnSave', 'BtnCopyTo', 'BtnCancel', 'BtnExamine','BtnCancelExamine', 'BtnCopyFrom', 'BtnCancelInvalid', 'BtnImport',
+ 'BtnBsOperation.BtnInvalid', 'BtnBsOperation.BtnCancelInvalid', 'BtnUpload', 'BtnSend','BtnEject', 'BtnBsOperation.BtnUpCheck',
+ 'BtnBsOperation'
+ ];
+ }
+
+ /* 红冲中的单据 红冲按钮置灰色 */
+ if(commonUtils.isNotEmptyObject(masterData) && (commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed) )) {
+ disabledData.push('BtnCopyTo.ActProductionMaterials'); /* 红冲单据按钮若已红冲 则置灰色 */
+ }
+
+ /* 工艺卡启用按钮 只有审核是亮的 */
+ if(location.pathname.includes('processCardPackTableTree')) {
+ if (!masterData.bCheck) {
+ disabledData.push('BtnEventEnable');
+ }
+ }
+ /* 单据的自定义按钮,控制它在保存后才高亮 */
+
+ if(location.pathname.includes('Bill')) {
+ if (commonUtils.isNotEmptyObject(menu.sControlName) && (
+ menu.sControlName.indexOf('BtnEvent') > -1
+ || menu.sControlName.indexOf('BtnRepair') > -1
+ || menu.sControlName.indexOf('BtnSubmit') > -1
+ || menu.sControlName.indexOf('BtnBatchSubmit') > -1
+ ) ) {
+ if(enabled) { /* 只有非编辑编辑状态 按钮会亮 */
+ disabledData.push(menu.sControlName);
+ }
+ }
+ if (commonUtils.isNotEmptyObject(menu.sControlName) && menu.sControlName.indexOf('BtnCalc') > -1) {
+ if(!enabled) { /* 只有编辑状态 按钮会亮 */
+ disabledData.push(menu.sControlName);
+ }
+ }
+ }
+
+ if(location.pathname.includes('systemPermission')) {
+ if(activeKey === '3') { /* 用户权限 */
+ if (commonUtils.isNotEmptyObject(menu.sControlName) && menu.sControlName.indexOf('BtnRepairGroup') > -1) {
+ disabledData.push(menu.sControlName);
+ }
+ }else { /* 组权限 */
+ if (commonUtils.isNotEmptyObject(menu.sControlName) && menu.sControlName.indexOf('BtnRepairUser') > -1) {
+ disabledData.push(menu.sControlName);
+ }
+ }
+
+ }
+
+
+ if (menu.sColor === 'alwaysAbled') {
+ const iIndex = disabledData.findIndex(item => item === menu.sControlName)
+ if (iIndex !== -1) {
+ disabledData.splice(iIndex, 1);
+ }
+ if(sModelsId === '12710101117055564119120' || sModelsId === '12710101117170330526240') { /* 物资评审 采购申请常亮 */
+ const iCIndex = disabledData.findIndex(item => item === 'BtnCopyTo');
+ if (iCIndex !== -1) {
+ disabledData.splice(iCIndex, 1);
+ }
+ }
+
+ }
+
+ let bReturn = true;
+ if (menu.sControlName !== undefined && menu.sControlName.indexOf('.') > -1) {
+ bReturn = disabledData.findIndex(item => item === menu.sControlName.substring(0, menu.sControlName.indexOf('.'))) > -1;
+ if (!bReturn) {
+ bReturn = disabledData.findIndex(item => item === menu.sControlName) > -1;
+ }
+ } else {
+ bReturn = disabledData.findIndex(item => item === menu.sControlName) > -1;
+ }
+ bReturn = bReturn || (this.props.getMenuStatus !== undefined && this.props.getMenuStatus(menu));
+ return { menuStatus: bReturn, bShown };
+ };
+
+ // 获取父级菜单属性(自定义逻辑)
+ getMenuStatusCostom = (menu) => {
+ const { sInstruct: sInstructStr } = this.props.masterConfig || {};
+ const sInstruct = commonUtils.convertStrToObj(sInstructStr, {});
+ const { data = [], conditionGroup = {} } = sInstruct;
+ let menuStatus = false;
+ let bShown = true;
+
+ const { showName: showNameDefault } = menu;
+ let { sControlName } = menu;
+ if (sControlName && sControlName.includes('BtnPrint')) {
+ sControlName = 'BtnPrint';
+ }
+ let showName = showNameDefault;
+ const btnConfig = data.find(
+ item =>
+ item.name &&
+ item.name.split(',').includes(sControlName) &&
+ (item.enabled !== undefined || item.show !== undefined)
+ );
+ if (btnConfig === undefined) return { bContinue: true };
+
+ const getStatus = (type, defaultValue) => {
+ const { [type]: condition = "" } = btnConfig;
+ if (condition === '') return defaultValue;
+ if (typeof condition === "boolean") {
+ return condition;
+ } else if (condition.includes("conditionGroup")) {
+ const [, conditionName] = condition.split(".");
+ const conditionNew = conditionGroup[conditionName];
+ const result = this.getStatusResult(conditionNew, defaultValue);
+ return condition.includes("!") ? !result : result;
+ } else if (typeof condition === "string") {
+ return this.getStatusResult(condition, defaultValue);
+ }
+
+ return defaultValue;
+ }
+
+ menuStatus = !getStatus('enabled', menuStatus);
+ bShown = getStatus('show', bShown);
+
+ const { showText } = btnConfig;
+ if (typeof showText === 'string') {
+ showName = showText;
+ } else if (commonUtils.isNotEmptyArr(showText)) {
+ for (let i = 0; i < showText.length; i++) {
+ let tempResult = false;
+ const item = showText[i];
+ const { condition, text } = item;
+ if (condition.includes("conditionGroup")) {
+ const [, conditionName] = condition.split(".");
+ const conditionNew = conditionGroup[conditionName];
+ tempResult = this.getStatusResult(conditionNew, tempResult);
+ tempResult = condition.includes("!") ? !tempResult : tempResult;
+ } else {
+ tempResult = this.getStatusResult(condition, tempResult);
+ }
+ if (tempResult) {
+ showName = text;
+ break;
+ }
+ }
+ }
+
+ // 是否继续走原先的逻辑(当没有配置enabled时)
+ const bContinueMenuStatus = btnConfig.enabled === undefined;
+
+ return { menuStatus, bShown, showName, bContinueMenuStatus };
+ }
+
+ matchResult = (rowData, sFileName, conditionStr, conditionValue) => {
+ let rowDataValue = rowData[sFileName];
+ try {
+ if (rowDataValue === undefined || rowDataValue === null || rowData === 'null') {
+ rowDataValue = '';
+ } else {
+ rowDataValue = rowDataValue.toString();
+ }
+ } catch (error) {}
+ switch (conditionStr) {
+ case '===':
+ return rowDataValue === conditionValue;
+ case '==':
+ return rowDataValue === conditionValue;
+ case '>=':
+ return rowDataValue >= conditionValue;
+ case '<=':
+ return rowDataValue <= conditionValue;
+ case '>':
+ return rowDataValue > conditionValue;
+ case '<':
+ return rowDataValue < conditionValue;
+ case '!=':
+ return rowDataValue != conditionValue;
+ case '!==':
+ return rowDataValue !== conditionValue;
+ default:
+ throw new Error('conditionStr is not valid');
+ }
+ }
+
+ getStatusResult = (str, defaultValue) => {
+ let strNew = str.replace(/\s+/g, '');
+ let result = defaultValue;
+ const { allTableSelectedData: tempData } = this.state;
+ tempData.props = {
+ sSrcModelsId: this.props.sSrcModelsId,
+ enabled: !!this.props.enabled
+ };
+ Object.keys(tempData).forEach(key => {
+ const reg = new RegExp(`${key}\\.`, "g");
+ strNew = strNew.replace(reg, `tempData["${key}"].`);
+ });
+
+
+ try {
+ // 截取字符串中 ${tableName@all.fieldName.判断符号.判断内容} 格式的内容
+ const reg1 = /\$\{[^{}@]+@[^{}\.]+\.[^{}\.]+\.[^{}\.]+\.[^{}\.]*\}/g;
+ strNew = strNew.replace(reg1, (matchStr) => {
+ const matchStrNew = matchStr.substring(2, matchStr.length - 1);
+ const [tableName, restStr] = matchStrNew.split("@");
+ const [filterType, sFileName, conditionStr, conditionValue] = restStr.split('.');
+ let matchResult = matchStr;
+
+ const tableData = tempData[tableName] || [];
+ const selectedRowKeys = this.props[`${tableName}SelectedRowKeys`] || [];
+ const selectedData = tableData.filter(rowData => selectedRowKeys.includes(rowData.sSlaveId) || selectedRowKeys.includes(rowData.sId));
+ if (commonUtils.isEmptyObject(selectedData)) return false;
+ if (filterType === 'all') {
+ matchResult = !selectedData.some(rowData => !this.matchResult(rowData, sFileName, conditionStr, conditionValue));
+ } else if (filterType === 'one') {
+ matchResult = selectedData.some(rowData => this.matchResult(rowData, sFileName, conditionStr, conditionValue));
+ }
+ return matchResult;
+ });
+
+ const evalStr = eval("`" + strNew + "`");
+ console.log('=====数据处理结果', { tempData, str, strNew, evalStr });
+ result = eval(evalStr);
+ } catch (error) {
+ console.log('=====error', error);
+ // clearInterval(this.modaltimer);
+ // this.modaltimer = setTimeout(() => {
+ // Modal.error({
+ // width: 1000,
+ // title: "按钮状态指令集错误信息",
+ // content:
+ //
按钮状态运算错误!
+ //
请检查按钮状态运算语法!
+ //
按钮状态运算内容:
+ //
{str}
+ //
按钮状态运算被替代后的结果:
+ //
{strNew}
+ //
,
+ // okText: "知道了"
+ // });
+ // }, 1000);
+ return defaultValue;
+ }
+
+ if (typeof result !== "boolean") {
+ clearInterval(this.modaltimer);
+ this.modaltimer = setTimeout(() => {
+ clearInterval(this.modaltimer);
+ Modal.error({
+ width: 1000,
+ title: "按钮状态指令集错误信息",
+ content:
+
按钮状态运算返回值不是布尔值!
+
请检查按钮状态运算语法!
+
按钮状态运算内容:
+
{str}
+
按钮状态运算被替代后的结果:
+
{strNew}
+
按钮状态运算返回值:
+
{result}
+
,
+ okText: "知道了"
+ });
+ }, 1000);
+ return defaultValue;
+ }
+
+ console.log('=====result', result);
+ return result;
+ }
+
+ getDisabledProps = (name) => {
+ if (commonUtils.isNotEmptyObject(name)) {
+ const { enabled } = this.props;
+ const obj = {};
+ obj.disabled = enabled;
+ return obj;
+ }
+ };
+
+ /* */
+ handleBtnEnabled = (props, isReturn) => {
+ const { masterConfig: masterConfigOld } = props;
+ if (commonUtils.isNotEmptyObject(masterConfigOld)) {
+ const masterConfig = JSON.parse(JSON.stringify(masterConfigOld));
+ const buttonConfig = masterConfig.gdsconfigformslave.filter(item => item.sName === '' && item.showName !== '' && item.sControlName !== '');
+ if (commonUtils.isNotEmptyArr(buttonConfig)) {
+ for (const btnItem of buttonConfig) {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => btnItem.sId === item.sId);
+ let btndisabled = false;
+ if (commonUtils.isNotEmptyStr(btnItem.sButtonEnabled)) {
+ btndisabled = this.handleAnalysisBtnEnabled(props, btnItem, masterConfig.gdsconfigformslave);
+ }
+ if (!!masterConfig.gdsconfigformslave[iIndex].disabled !== btndisabled) {
+ masterConfig.gdsconfigformslave[iIndex].disabled = btndisabled; // = { ...masterConfig.gdsconfigformslave[iIndex], disabled: btndisabled };
+ }
+ }
+ }
+ if (isReturn) {
+ return { ...masterConfig };
+ } else if (JSON.stringify(masterConfig) === JSON.stringify(masterConfigOld)) {
+ return;
+ } else {
+ const addState = {};
+ addState.masterConfig = { ...masterConfig };
+ this.props.onSaveState({ ...addState });
+ }
+ }
+ }
+
+ handleAnalysisBtnEnabled = (props, currConfig, gdsconfigformslave) => {
+ const { sButtonEnabled } = currConfig;
+ let btndisabled = false;
+ if (commonUtils.isNotEmptyObject(sButtonEnabled)) {
+ const btnObj = JSON.parse(sButtonEnabled);
+ const solution = btnObj.solution;
+ const rowSelected = btnObj.rowSelected;
+ const buttonFilter = btnObj.button; /* 需要控制的按钮集 */
+ const dataArr = btnObj.data; /* 根据数据控制按钮亮与灰色 */
+
+ // 解析配置中 solution:["新工单"]
+ if (!(commonUtils.isNotEmptyArr(solution) && solution.includes(props.masterData.sSolutionName))) {
+ btndisabled = true;
+ // return btndisabled;
+ }
+
+ let disabledRowSelected;
+ // 解析配置中 rowSelected: [{name:'master',rule:'&&'},{name:'slave',rule:'&&'}],
+ if (commonUtils.isNotEmptyArr(rowSelected)) {
+ let rule;
+ let selectRt;
+ let i = 0;
+ for (const item of rowSelected) {
+ const name = item.name;
+ i += 1;
+ if (commonUtils.isNotEmptyArr(props[`${name}SelectedRowKeys`])) {
+ selectRt = true; // 表示 满足当前条件,
+ } else {
+ selectRt = false;
+ }
+ /* 只有1个配置:
+ selectRt = true 当满足当前条件,按钮应该为亮,即当前btndisabled =false,不返回继续往下进行判断
+ selectRt = false 不当满足当前条件,按钮应该为灰色,即当前btndisabled =true,已经有条件不满足,按钮可直接定为灰色的,即直接返回true
+ */
+ if (i === 1) {
+ disabledRowSelected = selectRt;
+ } else if (i > 1 && rule === '&&') {
+ disabledRowSelected = selectRt && disabledRowSelected;
+ } else if (i > 1 && rule === '||') {
+ disabledRowSelected = selectRt || disabledRowSelected;
+ }
+ rule = item.rule;
+ }
+ if (!disabledRowSelected) {
+ btndisabled = true;
+ // return btndisabled;
+ }
+ }
+ // gdsconfigformslave[iIndex].disabled 为true 表示按钮至灰, false 表示按钮亮,可使用
+ let disabledButtonFilter;
+ if (commonUtils.isNotEmptyArr(buttonFilter)) {
+ let rule;
+ let buttonRt;
+ let i = 0;
+ for (const item of buttonFilter) {
+ i += 1;
+ const name = item.name;
+ const currDisabled = !item.enabled;
+ const iIndex = gdsconfigformslave.findIndex(config => config.sControlName === name);
+ if (iIndex === -1) {
+ continue;
+ }
+ const tempDisabled = gdsconfigformslave[iIndex].disabled;
+ if (tempDisabled === currDisabled) {
+ buttonRt = true;
+ } else {
+ buttonRt = false;
+ }
+ if (i === 1) {
+ disabledButtonFilter = buttonRt;
+ } else if (i > 1 && rule === '&&') {
+ disabledButtonFilter = buttonRt && disabledRowSelected;
+ } else if (i > 1 && rule === '||') {
+ disabledButtonFilter = buttonRt || disabledRowSelected;
+ }
+ rule = item.rule;
+ }
+ if (!disabledButtonFilter) {
+ btndisabled = true;
+ // return btndisabled;
+ }
+ }
+ /* 按钮根据需要能按字段值来控制 */
+ if (commonUtils.isNotEmptyArr(dataArr)) {
+ const currButtonName = currConfig.sControlName; /* 当前按钮 */
+ let flag = btndisabled;
+ for (const item of dataArr) {
+ const {
+ name, fieldName, condition, value,showBtn, hideBtn,
+ } = item;
+ const {[`${name}Data`]: tableData, [`${name}SelectedRowKeys`]: selectedRowKeys, masterData} = this.props;
+ let tableDataRow = {};
+ if (name === 'master') {
+ tableDataRow = masterData;
+ } else {
+ const filterData = commonUtils.isNotEmptyArr(tableData) && commonUtils.isNotEmptyArr(selectedRowKeys) ? tableData.filter(item => selectedRowKeys.includes(item.sId) || selectedRowKeys.includes(item.sSlaveId)) : [];
+ if (commonUtils.isNotEmptyArr(filterData)) {
+ tableDataRow = filterData[0];
+ }
+ }
+ if (commonUtils.isNotEmptyObject(tableDataRow)) {
+ if (condition === '>') {
+ if (tableDataRow[fieldName] > value) {
+ if(commonUtils.isNotEmptyArr(showBtn)) {
+ const iIndex= showBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = false; /* 按钮亮 */
+ }
+ }
+ if(commonUtils.isNotEmptyArr(hideBtn)) {
+ const iIndex= hideBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = true; /* 按钮灰 */
+ }
+ }
+ }
+ } else if (condition === '===') {
+ if (tableDataRow[fieldName] === value) {
+ if(commonUtils.isNotEmptyArr(showBtn)) {
+ const iIndex= showBtn.findIndex(item => item.indexOf(currButtonName) > -1);
+ if(iIndex > -1) {
+ flag = false; /* 按钮亮 */
+ }
+ }
+ if(commonUtils.isNotEmptyArr(hideBtn)) {
+ const iIndex= hideBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = true; /* 按钮灰 */
+ }
+ }
+ }
+ }else if (condition === '!==') {
+ if (tableDataRow[fieldName] !== value) {
+ if(commonUtils.isNotEmptyArr(showBtn)) {
+ const iIndex= showBtn.findIndex(item => item.indexOf(currButtonName) > -1);
+ if(iIndex > -1) {
+ flag = false; /* 按钮亮 */
+ }
+ }
+ if(commonUtils.isNotEmptyArr(hideBtn)) {
+ const iIndex= hideBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = true; /* 按钮灰 */
+ }
+ }
+ }
+ } else if (condition === '<') {
+ if (tableDataRow[fieldName] < value) {
+ if(commonUtils.isNotEmptyArr(showBtn)) {
+ const iIndex= showBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = false; /* 按钮亮 */
+ }
+ }
+ if(commonUtils.isNotEmptyArr(hideBtn)) {
+ const iIndex= hideBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = true; /* 按钮灰 */
+ }
+ }
+ }
+ } else if (condition === 'like') {
+ if (fieldName.substring(0, 1) === 's') {
+ if(commonUtils.isNotEmptyArr(showBtn)) {
+ const iIndex= showBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = false; /* 按钮亮 */
+ }
+ }
+ if(commonUtils.isNotEmptyArr(hideBtn)) {
+ const iIndex= hideBtn.findIndex(item => item.indexOf(currButtonName));
+ if(iIndex > -1) {
+ flag = true; /* 按钮灰 */
+ }
+ }
+ }
+ }
+ }
+ }
+ btndisabled = flag;
+ }
+ /* End */
+ }
+ return btndisabled;
+ }
+
+ /** 根据二级菜单获取三级数据 */
+ handleMouseEnter = (e) => {
+ if (commonUtils.isNotEmptyStr(e.key) && this.props.onSearchUpDownThird !== undefined) {
+ this.props.onSearchUpDownThird(e.key);
+ }
+ };
+
+ handleMouseEnterTooBar = () => {
+ const focusedElement = document.activeElement;
+ if (focusedElement.tagName.toLowerCase() === "input") {
+ focusedElement.blur();
+ }
+ }
+
+ handleImport = async (proName, proInParam, other) => {
+ this.props.onSaveState({
+ loading: true,
+ });
+ const {
+ sModelsId, masterData, slaveData, slaveDelData: slaveDelDataOld, app,
+ } = this.props;
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === 'BtnCommonImport'))[0];// sButtonEnabled sButtonParam
+ if (!commonUtils.isNotEmptyObject(btnConfig) || !commonUtils.isNotEmptyStr(btnConfig.sButtonParam)) {
+ message.error('请配置按钮的存储过程');
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+
+ const sButtonParam = btnConfig.sButtonParam;
+ const btn = JSON.parse(sButtonParam);
+ const sProName = btn.sproName;
+ const inParams = [];
+ const inMap = btn.inMap;
+ const inlist = inMap ? inMap.split(',') : [];
+ const masterArr = [];
+ const slaveArr = [];
+ const slaveInfoArr = [];
+ const controlArr = [];
+ const materialsArr = [];
+ const processArr = [];
+
+ if (!sTableName && !inMap) { // 都为undefined时直接退出
+ return;
+ }
+
+ if (inlist.length > 0) {
+ inlist.forEach((item) => {
+ const itemArr = item.split('.');
+ if (itemArr.length > 0) {
+ const sname = itemArr[0];
+ const stype = itemArr[1];
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'master') {
+ masterArr.push(stype);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'slave') {
+ slaveArr.push(stype);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'slaveInfo') {
+ slaveInfoArr.push(stype);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'control') {
+ controlArr.push(stype);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'materials') {
+ materialsArr.push(stype);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'process') {
+ processArr.push(stype);
+ }
+ }
+ });
+
+ if (commonUtils.isNotEmptyArr(masterArr) && commonUtils.isNotEmptyObject(masterData)) {
+ const addState = {};
+ addState.key = 'master';
+ const val = [];
+ const currVal = {};
+ masterArr.forEach((filed) => {
+ currVal[`${filed}`] = masterData[`${filed}`];
+ });
+ val.push(currVal);
+ addState.value = val;
+ inParams.push({ ...addState });
+ }
+ if (commonUtils.isNotEmptyArr(slaveArr)) {
+ const addState = this.handleProParams('slave', slaveArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(slaveInfoArr)) {
+ const addState = this.handleProParams('slaveInfo', slaveInfoArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(controlArr)) {
+ const addState = this.handleProParams('control', controlArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(materialsArr)) {
+ const addState = this.handleProParams('materials', materialsArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(processArr)) {
+ const addState = this.handleProParams('process', processArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ }
+
+ const value = { sProName, sProInParam: JSON.stringify({ params: inParams }) };
+ if (other?.iFlag === 1) {
+ value.iFlag = 1;
+ }
+ const url = `${commonConfig.server_host}procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`;
+ const dataReturn = (await commonServices.postValueService(app.token, value, url)).data;
+ // const url = `${commonConfig.server_host}eleMaterialsStock/getEleMaterialsStock?sModelsId=${sModelsId}&sWareHouseId=${masterData.sWareHouseId}&num=${num}`;
+ // const dataReturn = (await commonServices.getService(this.props.app.token, url)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ const slaveDelData = commonUtils.isEmptyArr(slaveDelDataOld) ? [] : slaveDelDataOld;
+ slaveData.forEach((item) => {
+ item.handleType = 'del';
+ slaveDelData.push({ ...item });
+ });
+ returnData.forEach((item, index) => {
+ item.handleType = 'add';
+ item.sParentId = masterData.sId;
+ item.iOrder = index + 1;
+ returnData[index] = { ...item };
+ });
+ this.props.onSaveState({ slaveData: returnData, slaveDelData });
+ } else {
+ this.props.getServiceError({ ...dataReturn, fn: () => this.handleImport(proName, proInParam, { iFlag: 1 }) });
+ }
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+
+ handleSBusinessType = (key, sBusinessType) => {
+ const result = ({
+ 'BtnCopyTo.saldelivergoods': (v) => ({ isTrue: ['ZS05'].includes(v), message: '送货单只能选择非免费订单' }),
+ 'BtnCopyTo.saldeliverfree': (v) => ({ isTrue: !['ZS05'].includes(v), message: '免费送货只能选择免费订单' })
+ })[key];
+ return result?.(sBusinessType);
+ }
+ /**
+ * 区分是否免费送货
+ * @param {*} key
+ * @returns
+ */
+ handleFreeDeliver = (key) => {
+ if (['BtnCopyTo.saldelivergoods', 'BtnCopyTo.saldeliverfree'].includes(key)
+ && Array.isArray(this.props.slaveSelectedData) && this.props.slaveSelectedData.length) {
+ const selectSBusinessType = this.props.slaveSelectedData.map(i => i?.sBusinessType);
+ if (selectSBusinessType.includes('ZS05') && selectSBusinessType.find(i => i !== 'ZS05')) {
+ message.error('送货单只能选择非免费订单, 免费送货只能选择免费订单');
+ return true;
+ } else {
+ const result = this.handleSBusinessType(key, selectSBusinessType[0])
+ if (result?.isTrue) {
+ message.error(result?.message || '送货类型需保持一致');
+ return true;
+ }
+ }
+ }
+ }
+
+ // 按钮指令集
+ handleClick = (e) => {
+ // 如果没找到调用指令集方法,执行原始方法
+ if (!this.props.onExecInstructSet) {
+ this.handleClick1(e);
+ return;
+ }
+ let { key } = e;
+ const { menuData } = this.state;
+ if (key.includes('BtnCopyTo')) {
+ key = 'BtnCopyTo';
+ }
+ const iIndex = menuData.findIndex(item => item.sName === key || item.sControlName === key);
+ const { sInstruct: sInstructStr, sChangeType } = (iIndex > -1) ? menuData[iIndex] : {};
+ const sInstruct = commonUtils.convertStrToObj(sInstructStr, {});
+ // const { data = [] } = sInstruct;
+ // console.log('btnConfig', iIndex, sInstruct, data);
+ // const btnConfig = data.find(item => item.name && item.name.split(',').includes(key) && item.click);
+ if (commonUtils.isEmptyObject(sInstruct)) {
+ this.handleClick1(e);
+ return;
+ }
+
+ if (sChangeType === 'clickOnly') {
+ // 只执行指令集
+ this.props.onExecInstructSet({
+ sInstruct: sInstruct,
+ showName: "按钮only"
+ });
+ } else if (sChangeType === 'afterClick') {
+ // 先按钮再指令集
+ this.handleClick1(e);
+ setTimeout(() => {
+ this.props.onExecInstructSet({
+ sInstruct: sInstruct,
+ showName: "按钮-指令集"
+ });
+ }, 1000);
+ } else {
+ // 先指令集再按钮
+ this.props.onExecInstructSet({
+ sInstruct: sInstruct,
+ showName: "指令集-按钮",
+ callback: (ex) => {
+ console.log('=====xxx', '指令集-按钮', ex);
+ this.handleClick1(e);
+ }
+ });
+ }
+ }
+
+ /** 菜单的点击事件 */
+ handleClick1 = async (e) => {
+ if (this.props.onToolBarClick && this.props.onToolBarClick(e)) {
+ return;
+ }
+
+ let checkedBoolean = false;
+ let obj = { enabled: false };
+ const { checked, checkedId, menuData, printData } = this.state;
+ const { key, keyPath } = e;
+ // if (checked && checkedId === key) {
+ // checkedBoolean = true;
+ // }
+ const checkIndex = printData.findIndex(item => item.checkedId === key);
+ if(checkIndex > -1) {
+ checkedBoolean = printData[checkIndex].checked;
+ }
+ // console.log('toolbar-checked', checked, checkedId, key);
+
+ const iIndex = menuData.findIndex(item => item.sName === key || item.sControlName === key);
+ let interfaceArr = [] ;
+ if (iIndex > -1) {
+ interfaceArr = menuData[iIndex].interface;
+ }
+
+ const sErrorInfo = this.handleCheckButton(key); /* 验证按钮是否可以点击 */
+ if(commonUtils.isNotEmptyObject(sErrorInfo)) {
+ message.error(sErrorInfo);
+ return ;
+ }
+
+ /* 新增 */
+ if (key === 'BtnAdd') { /* 增加 */
+ this.handleAdd(obj);
+ } else if (key === 'BtnAddChild') { /* 分类增加子级 */
+ this.handleAddChild(obj);
+ } else if (key.indexOf('BtnAddTo') > -1) { /* 新增下拉 */
+ this.props.onAddTo(e.key);
+ } else if (key === 'BtnUpd') { /* 修改 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ this.props.onEdit(obj);
+ } else if (key === 'BtnSave') { /* 保存 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ /* 生产主计划重置数据变化状态 */
+ this.props.onSaveState({
+ dataChanged: false,
+ });
+ setTimeout(async() => {
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ let flag = 0;
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i]);
+ if (!data) {
+ flag += 1;
+ return;
+ }
+ }
+ }
+ await asyncFunc();
+ // beforeInterfaceArr.forEach((item) => {
+ // this.handleInterfaceCall(item);
+ // });
+ if (flag == 0) {
+ this.handleSubmit();
+ } else {
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ this.handleSubmit();
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i ++) {
+ await this.handleInterfaceCall(afterInterfaceArr[i]);
+ }
+ }
+ await asyncFunc();
+ // afterInterfaceArr.forEach((item) => {
+ // this.handleInterfaceCall(item);
+ // });
+ }
+ } else {
+ this.handleSubmit();
+ }
+ }, 500);
+ } else if (key === 'BtnExamine') { /* 审核 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ /* 根据接口返回是之前调用还是之后调用 */
+ let flag = 0;
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ // beforeInterfaceArr.forEach((item) => {
+ // this.handleInterfaceCall(item);
+ // });
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i]);
+ if (!data) {
+ flag += 1;
+ return;
+ }
+ }
+ }
+ await asyncFunc();
+
+ }
+ let result;
+ if (flag == 0) {
+ result = await this.props.onBtnExamine();
+ } else {
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ // const result = await this.props.onBtnExamine();
+ if(result) { /* 只有审核成功 才能调用接口 -5代表审核失败 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i++) {
+ await this.handleInterfaceCall(afterInterfaceArr[i],true);
+ }
+ }
+ await asyncFunc();
+ // afterInterfaceArr.forEach((item) => {
+ // this.handleInterfaceCall(item);
+ // });
+ }
+ }
+ } else{
+ this.props.onBtnExamine();
+ }
+ } else if (key === 'BtnBatchExamine') { /* 批量审核 接口循环调用 选中行1 调用接口+审核 选中行2 调用接口+审核 选中行3 调用接口+审核, 1错了,2、3继续 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ this.props.onBtnBatchExamine(interfaceArr);
+ } else{
+ this.props.onBtnBatchExamine();
+ }
+ this.props.onSaveState({
+ loading: false,
+ });
+ } else if (key === 'BtnBatchCancelExamine') { /* 批量审核 接口循环调用 选中行1 调用接口+审核 选中行2 调用接口+审核 选中行3 调用接口+审核, 1错了,2、3继续 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ this.props.onBtnBatchCancelExamine(interfaceArr);
+ } else{
+ this.props.onBtnBatchCancelExamine(interfaceArr);
+ }
+ this.props.onSaveState({
+ loading: false,
+ });
+ } else if (key === 'BtnBatchExamine' && false) { /* 批量审核 统一接口调用, 三条勾选行 合并为sIdArr */
+ this.props.onSaveState({
+ loading: true,
+ });
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ // beforeInterfaceArr.forEach((item) => {
+ // this.handleInterfaceCall(item);
+ // });
+ let flag = 0
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i]);
+ if (!data) {
+ flag += 1;
+ return;
+ }
+ }
+ }
+ await asyncFunc();
+ if (flag == 0) {
+ this.props.onBtnBatchExamine();
+ } else {
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ const result = await this.props.onBtnBatchExamine();
+ if(result!== -5) { /* 只有审核成功 才能调用接口 -5代表审核失败 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i++) {
+ await this.handleInterfaceCall(afterInterfaceArr[i],true);
+ }
+ }
+ await asyncFunc();
+ this.props.onSaveState({
+ loading: false,
+ });
+ // afterInterfaceArr.forEach((item) => {
+ // this.handleInterfaceCall(item);
+ // });
+ }
+ }
+ } else{
+ this.props.onBtnBatchExamine();
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+ } else if (key.indexOf('BtnSend') > -1 && key.includes('BtnSendDialog')) { /* 推送接口 */
+ /* 将当前界面所有数据集作为入参传到接口中 */
+ const { masterConfig, sModelsId, } = this.props;
+ let { masterData} = this.props;
+ const addState ={};
+ let allTableMap = {};
+ const allReturnMap = {};
+ let masterDataList = []; /* 弹窗数据集合 */
+ let allDataList = {}; /* 接口返回所有数据对象集合 */
+ const btnConfig = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))) ?
+ masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))[0] : {};// sButtonEnabled sButtonParam
+ const slaveNameList = [];
+ if(commonUtils.isNotEmptyObject(btnConfig)) {
+ /* 组装allTableData */
+ /* 从props找到 所有的Config */
+ if (commonUtils.isNotEmptyArr(this.props)) {
+ for (const key of Object.keys(this.props)) {
+ if (key.includes('Config') && !key.includes('onGet') && !key.includes('report')) {
+ const tablename = key.replace('Config', '').trim();
+ slaveNameList.push(tablename);
+ }
+ }
+ }
+ addState.slaveNameList = slaveNameList;
+
+ if (commonUtils.isNotEmptyArr(slaveNameList)) {
+ slaveNameList.forEach((name, index) => {
+ const tableConfig = this.props[name + 'Config']; /* 动态配置 */
+ if(commonUtils.isNotEmptyObject(tableConfig)) {
+ const tableData = this.props[name + 'Data']; /* 动态配置 */
+ const tableSelectedRowKeys = this.props[name + 'SelectedRowKeys']; /* 选中Key */
+ if (commonUtils.isNotEmptyObject(tableConfig)) {
+ allTableMap[name + '.' + tableConfig.sTbName] = tableData
+ }
+ }
+
+ })
+ const masterTbName = masterConfig.sTbName;
+ allTableMap['master.' + masterTbName] = masterData;
+ }
+
+ const { sActiveKey } = btnConfig;
+ if (commonUtils.isNotEmptyStr(sActiveKey)) {
+ sActiveKey.split(',').forEach(item => {
+ const [tableName, fieldName] = item.split('.');
+ if (commonUtils.isNotEmptyStr(tableName) && commonUtils.isNotEmptyStr(fieldName)) {
+ let tableData = this.props[`${tableName}Data`];
+ if (commonUtils.isNotEmptyObject(tableData)) {
+ tableData = tableName === 'master' ? tableData : tableData[0];
+ if (commonUtils.isNotEmptyObject(tableData)) {
+ allTableMap[fieldName] = tableData[fieldName];
+ }
+ }
+ }
+ });
+
+ if (commonUtils.isNotEmptyObject(this.tempCondition)) {
+ allTableMap = {
+ ...allTableMap,
+ ...this.tempCondition
+ };
+ }
+ }
+ }
+ /* 根据接口返回是之前调用还是之后调用 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ let addStateReturn = {};
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ addStateReturn = await this.handleInterfaceCallDialog(beforeInterfaceArr[i], true, key, allTableMap);
+ }
+ }
+ await asyncFunc();
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i ++) {
+ addStateReturn = await this.handleInterfaceCallDialog(afterInterfaceArr[i], true , key, allTableMap);
+ }
+ }
+ await asyncFunc();
+ }
+ }
+ if(addStateReturn && addStateReturn.bResult) {
+ addState.interfaceDialogData = addStateReturn.returnData;
+ addState.interfaceDialogAllData = addStateReturn.returnData;
+ } else {
+ addState.interfaceDialogData = [];
+ }
+ addState.masterData = { ...masterData, bIsSAP: 1 };
+
+ if(commonUtils.isNotEmptyArr(addState.interfaceDialogAllData)) {
+ /* 循环interfaceDialogData */
+ addState.interfaceDialogAllData.forEach((item, index) => {
+ /* 先把master数据 放到interfaceDialogData中 */
+ let sMasterId = '';
+ const dataMap = {};
+ for (const key of Object.keys(item)) {
+ /* 把主表数据塞到masterDataList中 */
+ if(key && key.includes('master')) {
+ const data = commonUtils.isNotEmptyObject(item[key]) && commonUtils.isJSON(item[key]) ? JSON.parse(item[key]) :[];
+ if(commonUtils.isNotEmptyObject(data)) {
+ sMasterId = commonUtils.isNotEmptyObject(data.sSlaveId) ? data.sSlaveId : data.sId;
+ masterDataList.push(data);
+ }
+ }
+ const data = commonUtils.isNotEmptyObject(item[key]) && commonUtils.isJSON(item[key]) ? JSON.parse(item[key]) :[];
+ dataMap[key] = data;
+ }
+ /* 将全部返回数据都铺到allDataList中 */
+ const allKey = 'master-' + sMasterId;
+ allDataList[allKey] = dataMap; /* 根据返回的下标 封装key-value */
+ });
+ addState.allDataList = allDataList;
+ }
+ /* 弹窗的条件是 数据集数量>1 或者有this.tempCondition 切配置弹窗,否则直接将返回数据集铺到界面上 */
+ if((commonUtils.isNotEmptyObject(btnConfig) && commonUtils.isNotEmptyObject(btnConfig.sActiveId) && masterDataList.length > 0) || commonUtils.isNotEmptyObject(this.tempCondition)) {
+ addState.interfaceDialogData = masterDataList;
+ addState.visibleInterfaceDialog = true;
+ addState.masterData = { ...masterData, bIsSAP: 1 };
+ } else{
+ addState.visibleInterfaceDialog = false; /* 没有弹窗 且主表只有1条 则不弹窗 直接带值 */
+ const dataMap = commonUtils.isNotEmptyArr(addState.interfaceDialogData) ? addState.interfaceDialogData[0] : {};
+ console.log('接口返回值:', dataMap);
+ if (commonUtils.isNotEmptyArr(slaveNameList) && commonUtils.isNotEmptyArr(dataMap)) {
+ slaveNameList.forEach((name) => {
+ const tableConfig = this.props[name +'Config']; /* 动态配置 */
+ let tableData = [];
+ if(commonUtils.isNotEmptyObject(tableConfig)) {
+ tableData = dataMap[name +'-'+ tableConfig.sTbName]; /* 动态配置 */
+ if(commonUtils.isNotEmptyObject(tableData) && commonUtils.isJSON(tableData)) {
+ const newCopyTo = {};
+ newCopyTo.master = masterData;
+ let tableNewData = JSON.parse(tableData);
+ if(name === 'master') {
+ tableNewData = Array.isArray(tableNewData) ? tableNewData[0] : tableNewData;
+ masterData = { ...masterData, ...commonFunc.getAssignFieldValue(btnConfig.sAssignField, tableNewData, newCopyTo, true), bIsSAP: 1 }; // 取赋值字段
+ addState.masterData = masterData;
+ } else {
+ const btnTableName = btnConfig.sControlName +'.'+ name;
+ const btnTableConfig = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnTableName))) ?
+ masterConfig.gdsconfigformslave.filter(item => (item.sControlName === btnTableName))[0] : {};// sButtonEnabled sButtonParam
+
+ const newData = [];
+ tableNewData.forEach((child) => {
+ let newRow ={};
+ if(commonUtils.isNotEmptyObject(btnTableConfig) && btnTableConfig.sAssignField){
+ newRow = { ...child, ...commonFunc.getAssignFieldValue(btnTableConfig.sAssignField, child, newCopyTo) }; // 取赋值字段
+ }else {
+ newRow = child;
+ }
+ newRow = {
+ ...newRow,
+ handleType: 'add',
+ sId: commonUtils.createSid(),
+ sParentId: masterData.sId
+ };
+ newData.push(newRow);
+ });
+ addState[name +'Data'] = newData;
+ }
+
+ }
+ }
+
+ });
+ } else {
+ addState.masterData = { ...masterData, bIsSAP: 1 };
+ }
+ }
+ this.tempCondition = null;
+ addState.loading = false;
+ console.log('弹窗接口数据:', addState);
+ this.props.onSaveState({
+ ...addState,
+ });
+ }else if ( key.includes('BtnGetApiDialog')) { /* 从第三方拿数据 */
+ /* 将当前界面所有数据集作为入参传到接口中 */
+ const { masterConfig, sModelsId, } = this.props;
+ let { masterData} = this.props;
+ const addState ={};
+ let allTableMap = {};
+ const allReturnMap = {};
+ let masterDataList = []; /* 弹窗数据集合 */
+ let allDataList = {}; /* 接口返回所有数据对象集合 */
+ const btnConfig = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))) ?
+ masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))[0] : {};// sButtonEnabled sButtonParam
+ /* 根据接口返回是之前调用还是之后调用 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ let addStateReturn = {};
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ addStateReturn = await this.handleInterfaceCallDialog(beforeInterfaceArr[i], true, key, allTableMap);
+ }
+ }
+ await asyncFunc();
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i ++) {
+ addStateReturn = await this.handleInterfaceCallDialog(afterInterfaceArr[i], true , key, allTableMap);
+ }
+ }
+ await asyncFunc();
+ }
+ }
+ if(addStateReturn) {
+ addState.getApiDialogData = addStateReturn.returnData;
+ } else {
+ addState.getApiDialogData = [];
+ }
+ /* 弹窗的条件是 数据集数量>1 或者有this.tempCondition 切配置弹窗,否则直接将返回数据集铺到界面上 */
+ if((commonUtils.isNotEmptyObject(btnConfig) && commonUtils.isNotEmptyObject(btnConfig.sActiveId)) || commonUtils.isNotEmptyObject(this.tempCondition)) {
+ addState.visibleApiDialog = true;
+ }
+ this.tempCondition = null;
+ addState.loading = false;
+ console.log('发票获取第三方接口:', addState);
+ this.props.onSaveState({
+ ...addState,
+ });
+ } else if (key === 'BtnCancelExamine') { /* 消审 */
+ this.props.onSaveState({
+ loading: true,
+ });
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ let flag = 0;
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i]);
+ if (!data) {
+ flag += 1;
+ return;
+ }
+ }
+ }
+ await asyncFunc();
+ if (flag == 0) {
+ this.props.onBtnCancelExamine();
+ } else {
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ const result = await this.props.onBtnCancelExamine();
+ if(result) { /* 只有审核成功 才能调用接口 -5代表审核失败 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i++) {
+ await this.handleInterfaceCall(afterInterfaceArr[i],true);
+ }
+ }
+ await asyncFunc();
+ }
+ }
+ } else{
+ this.props.onBtnCancelExamine();
+ }
+ } else if (key.indexOf('BtnBsOperation') > -1) { /* 作废、取消作废 */
+ if (key === 'BtnBsOperation.BtnInvalid') {
+ obj = {
+ title: '确定要作废',
+ handleType: 'toVoid',
+ };
+ this.props.onChangeInvalid(obj);
+ } else if (key === 'BtnBsOperation.BtnCancelInvalid') {
+ obj = {
+ title: '确定取消作废',
+ handleType: 'cancel',
+ };
+ this.props.onChangeInvalid(obj);
+ } else {
+ const name = key.split('.');
+ this.props.onButtonClick(name[1]);
+ }
+ } else if (key === 'BtnInvalid') {
+ obj = {
+ title: '确定要作废',
+ handleType: 'toVoid',
+ };
+ this.props.onChangeInvalid(obj);
+ } else if (key === 'BtnCancelInvalid') {
+ obj = {
+ title: '确定取消作废',
+ handleType: 'cancel',
+ };
+ this.props.onChangeInvalid(obj);
+ } else if (key === 'BtnGetWeight') { // 获取重量
+ this.props.onGetWeight();
+ } else if (key.indexOf('BtnCopyTo') > -1) { /* 复制到 */ // && commonUtils.isNotEmptyStr(e.item.props.sActiveId)
+
+ // if (this.handleFreeDeliver(key)) return;
+ this.props.onCopyTo(e.key, e.item.props['data-sactiveid']);
+ } else if (key.indexOf('BtnCopyFrom') > -1 && commonUtils.isNotEmptyStr(e.item.props['data-sactiveid'])) { /* 复制从 */
+ obj = {
+ name: e.key,
+ copyFromKey: key,
+ copyFromSActiveId: e.item.props['data-sactiveid'],
+ };
+ this.props.onCopyFrom(obj);
+ } else if (key.indexOf('BtnEject') > -1) { /* 自定义接口弹出 */
+ const { masterConfig, masterData } = this.props;
+ const buttonConfig = masterConfig.gdsconfigformslave.filter(item => item.sName === '' && item.showName !== '' && item.sControlName === key);
+ if (commonUtils.isNotEmptyStr(buttonConfig)) {
+ const sActiveKey = buttonConfig[0].sActiveKey;
+ /* 拿到表名 */
+ if (commonUtils.isNotEmptyObject(sActiveKey)) {
+ let tbName = 'slave'; /* 表名 */
+ const btnName = key; /* 按钮名 */
+ let record = {}; /* 选中行 */
+ let iIndex = -1;
+ const splitData = sActiveKey.split('.');
+ if (commonUtils.isNotEmptyStr(splitData) && splitData.length > 1) {
+ tbName = splitData[0]; /* 表名 */
+ if (tbName === 'master') {
+ record = masterData;
+ } else {
+ const { [`${tbName}SelectedRowKeys`]: tableSelectedRowKeys, [`${tbName}Data`]: tableData } = this.props;
+ if (commonUtils.isNotEmptyStr(tableData)) {
+ iIndex = tableData.findIndex(item => tableSelectedRowKeys.includes(item.sSlaveId));
+ if (iIndex > -1) {
+ record = tableData[iIndex];
+ }
+ }
+ }
+ }
+ this.props.onViewClick(tbName, btnName, record, iIndex);
+ }
+ }
+ } else if (keyPath.indexOf('BtnBsOperation.BtnUpCheck') > -1 && commonUtils.isNotEmptyStr(e.item.props['data-sactiveid']) && key.indexOf('BtnBsOperation.BtnUpCheck') < 0) { /* 上查 */ /* key.indexOf('BtnUpCheck') < 0 用于防止用户点击二级菜单时的跳转 */
+ this.props.onSearchUpDown(key, e.item.props['data-sactiveid']);
+ } else if (keyPath.indexOf('BtnBsOperation.BtnDownCheck') > -1 && commonUtils.isNotEmptyStr(e.item.props['data-sactiveid']) && key.indexOf('BtnBsOperation.BtnDownCheck') < 0) { /* 下查 */ /* key.indexOf('BtnDownCheck') < 0 用于防止用户点击二级菜单时的跳转 */
+ this.props.onSearchUpDown(key, e.item.props['data-sactiveid']);
+ } else if (key === 'BtnNext') { /* 下一条 */
+ this.props.onNext();
+ } else if (key === 'BtnPrior') { /* 上一条 */
+ this.props.onBtnPrior();
+ } else if (key === 'BtnFirst') { /* 首条 */
+ this.props.onBtnFirst();
+ } else if (key === 'BtnLast') { /* 末条 */
+ this.props.onBtnLast();
+ } else if (key === 'BtnCancel') { /* 取消 */
+ obj = {
+ title: '确定要取消',
+ };
+ this.props.onCancel(obj);
+ } else if (key.indexOf('BtnPrint') > -1 && commonUtils.isNotEmptyStr(e.item.props['data-sactiveid'])) { /* 打印 */
+ const { billnosetting, masterData } = this.props;
+ let sActiveId = e.item.props['data-sActiveId'];
+ if (commonUtils.isEmptyObject(sActiveId)) {
+ sActiveId = e.item.props['data-sactiveid'];
+ }
+ if (billnosetting.sStatusType === '1') { /* 1:审核后打印 0:制单后打印 */
+ if (!masterData.bCheck) { /* 未审核只能预览pdf */
+ this.props.onBtnPreview(sActiveId, checkedBoolean, e.key);
+ } else { /* 已审核:打印 */
+ this.props.onBtnPrint(sActiveId, checkedBoolean, e.key);
+ }
+ } else { /* 制单后可以直接打印 */
+ this.props.onBtnPrint(sActiveId, checkedBoolean, e.key);
+ }
+ } else if (key === 'BtnDel') { /* 删除 */
+ obj = {
+ title: '确定要删除',
+ };
+ this.props.onDel(obj);
+ } else if (key === 'BtnGetGoods') {
+ this.props.onGetGoods();
+ } else if (key.indexOf('BtnUploadOther') > -1) { /* 上传 */
+ const { slaveSelectedRowKeys } = this.props;
+ if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
+ message.warning('请先选择一条数据');
+ return;
+ }
+ this.props.onSaveState({
+ visibleOtherFilfile: true,
+ });
+ } else if (key.indexOf('BtnUpload') > -1) { /* 上传 */
+ const { slaveSelectedRowKeys } = this.props;
+ if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
+ message.warning('请先选择一条数据');
+ return;
+ }
+ this.props.onSaveState({
+ visibleFilfile: true,
+ });
+ } else if (key.indexOf('BtnEvent')> -1 || key.indexOf('BtnBatchSubmit')> -1 || key.indexOf('BtnSubmit')> -1) {
+ const { slaveSelectedRowKeys, slaveData, formRoute, slave0Child1Data: controlData, materialsData: materialsData, slave0Data: processData, } = this.props;
+ let { slaveSelectedData } = this.props;
+
+ if (key == 'BtnEventSAP' && ['/indexPage/processCardPackTableTree'].includes(this.props.formRoute)) {
+ if (!commonBusiness.validatePramsNotEmpty(this.props)) return;
+ }
+ // if (formRoute === '/indexPage/commonList' && commonUtils.isEmptyArr(slaveSelectedData)) {
+ // message.warning('请先选择一条数据');
+ // return;
+ // }
+ /* 如果主体数据为空 则提示 */
+ // if(location.pathname ==='/indexPage/commonCostomTabBill') {
+ // if(commonUtils.isEmptyArr(controlData) && commonUtils.isEmptyArr(processData) && commonUtils.isEmptyArr(materialsData)){
+ // message.error('主体数据不能为空!');
+ // return;
+ // }
+ // }
+
+ if(commonUtils.isEmptyArr(slaveSelectedData) && commonUtils.isNotEmptyArr(slaveData)) {
+ slaveSelectedData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sId) || slaveSelectedRowKeys.includes(item.sSlaveId));
+ }
+ this.props.onSaveState({
+ loading: true,
+ });
+ // const slaveSelectedDataNew = this.deteleObject(slaveSelectedData); // 删除sid重复的数据
+ const btnConfig = this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))[0];// sButtonEnabled sButtonParam
+ if (commonUtils.isNotEmptyObject(btnConfig) && commonUtils.isNotEmptyStr(btnConfig.sButtonParam)) {
+
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(commonUtils.isNotEmptyArr(interfaceArr)) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ const bProgressBar = btnConfig.sRelation === "progressBar";
+
+ let bContinue = true;
+ if (commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ let flag = 0;
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i++) {
+ if (bProgressBar) {
+ this.xlyProcessPercent = 0;
+ clearInterval(this.xlyProcessTimer);
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ for (let j = 0; j < slaveSelectedRowKeys.length; j++) {
+ const slaveSelectedRowOneKey = slaveSelectedRowKeys[j];
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i], false, key, slaveSelectedRowOneKey, slaveSelectedRowOneKey);
+ if (!data) {
+ message.destroy("xlyProcess");
+ flag += 1;
+ break;
+ }
+ this.xlyProcessPercent = ((i + 1) * (j + 1) / (beforeInterfaceArr.length * slaveSelectedRowKeys.length) * 100).toFixed(2);
+ message.loading({ content: , key: "xlyProcess", duration: this.xlyProcessPercent >=100 ? 3 : 0, className: styles.xlyProcess});
+ }
+ } else {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i], false, key, slaveSelectedRowKeys);
+ if (!data) {
+ flag += 1;
+ return;
+ }
+ }
+ }
+ }
+ await asyncFunc();
+ if (flag == 0) {
+ await this.handleBtnEent(btnConfig);
+ }else {
+ bContinue = false;
+ }
+ }
+ if (commonUtils.isNotEmptyArr(afterInterfaceArr) && bContinue) { /* 之后调用 */
+ const result = await this.handleBtnEent(btnConfig);
+ if (result === 1) { /* 只有按钮成功 才能调用接口 -5代表审核失败 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i++) {
+ if (bProgressBar) {
+ this.xlyProcessPercent = 0;
+ clearInterval(this.xlyProcessTimer);
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ for (let j = 0; j < slaveSelectedRowKeys.length; j++) {
+ const slaveSelectedRowOneKey = slaveSelectedRowKeys[j];
+ const data = await this.handleInterfaceCall(afterInterfaceArr[i], false, key, slaveSelectedRowOneKey, slaveSelectedRowOneKey);
+ if (!data) {
+ message.destroy("xlyProcess");
+ break;
+ }
+ this.xlyProcessPercent = ((i + 1) * (j + 1) / (afterInterfaceArr.length * slaveSelectedRowKeys.length) * 100).toFixed(2);
+ message.loading({ content: , key: "xlyProcess", duration: this.xlyProcessPercent >=100 ? 3 : 0, className: styles.xlyProcess});
+ }
+ } else {
+ await this.handleInterfaceCall(afterInterfaceArr[i], false, key, slaveSelectedRowKeys);
+ }
+ }
+ }
+ await asyncFunc();
+ }
+ }
+
+ // for (const child of slaveSelectedDataNew) {
+ //
+ // }
+ } else if (btnConfig.sButtonParam?.includes('Sp_BtnEven_CalcJsHs') && btnConfig.showName?.includes('工资核算')) {
+ // 工资核算特殊处理
+ const { slave3Data = [], slave3SelectedRowKeys = [] } = this.props;
+ const slave3SelectedData = slave3Data.filter(item => slave3SelectedRowKeys.includes(item.sId));
+ if (slave3SelectedData.length) {
+ for (let i = 0; i < slave3SelectedData.length; i++) {
+ const slave3DataOne = slave3SelectedData[i];
+ const { sCalcProName: sCalcProDetail, sId, sCalcDepart } = slave3DataOne;
+ const inParams = [
+ {
+ key: "slave3",
+ value: [{ sId, sCalcProDetail }]
+ }
+ ];
+ const percent = (i / slave3SelectedData.length * 100).toFixed(2);
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ await this.handleBtnEent(btnConfig, undefined, undefined, inParams);
+ // message.success(`【${sCalcDepart}】核算完成。`);
+ }
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ message.success(`全部方案计算成功。`);
+ setTimeout(() => {
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ }, 1000);
+ setTimeout(() => {
+ message.destroy("xlyProcess");
+ }, 2000);
+ } else {
+ message.warning('请先选择计算方案!');
+ }
+ } else {
+ this.handleBtnEent(btnConfig);
+ }
+ this.props.onSaveState({
+ loading: false,
+ });
+
+ } else {
+ message.error('请配置按钮的存储过程');
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+ } else if (key.indexOf('BtnRepair') > -1) {
+ if (key.toLowerCase().endsWith('choosedate')) {
+ this.handleForceComplete(key, 'chooseDate');
+ } else if (key.includes('BtnRepairGroup') || key.includes('BtnRepairUser')) { /* 复制组权限单独处理 */
+ this.props.onButtonClick(key);
+ } else {
+
+ /* 根据接口返回是之前调用还是之后调用 */
+ if(false) {
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1" );
+ const afterInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "2" );
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+
+ let flag = 0;
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i]);
+ if (!data) {
+ flag += 1;
+ return;
+ }
+ }
+ }
+ await asyncFunc();
+ if (flag == 0) {
+ this.handleForceComplete(key);
+ }
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ const result = await this.handleForceComplete(key);;
+ if(result!== -5) { /* 只有审核成功 才能调用接口 -5代表审核失败 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i++) {
+ await this.handleInterfaceCall(afterInterfaceArr[i],true);
+ }
+ }
+ await asyncFunc();
+ }
+ }
+ } else{
+ this.handleForceComplete(key);
+ }
+
+ }
+ } else if (key.indexOf('BtnApiLog') > -1) { /* 操作日志 */
+ const { slaveSelectedRowKeys, slaveData, formRoute } = this.props;
+ let { slaveSelectedData } = this.props;
+ /* 根据接口返回是之前调用还是之后调用 */
+ const btnConfig = commonUtils.isNotEmptyArr(this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))) ?
+ this.props.masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))[0] : {};// sButtonEnabled sButtonParam
+ const msgInfo = commonUtils.isNotEmptyObject(btnConfig)? btnConfig.sAssignField : '';
+ if(commonUtils.isEmptyArr(slaveSelectedData) && commonUtils.isNotEmptyArr(slaveData)) {
+ slaveSelectedData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sId) || slaveSelectedRowKeys.includes(item.sSlaveId));
+ }
+ let slaveSelectedDataNew = [];
+ if(commonUtils.isNotEmptyArr(slaveSelectedData)){
+ slaveSelectedDataNew = this.deteleObject(slaveSelectedData); // 删除sid重复的数据
+ if(slaveSelectedData[0].iStatus !==0) {
+ message.error(msgInfo);
+ return ;
+ }
+ }
+ let ids = '';
+ if(commonUtils.isNotEmptyArr(slaveSelectedDataNew)) {
+ slaveSelectedDataNew.forEach((item) => {
+ if(commonUtils.isNotEmptyObject(item)) {
+ ids += `${item.sId},`;
+ }
+ });
+ ids = commonUtils.isNotEmptyObject(ids) ? ids.substr(0, ids.length - 1) : '';
+ }
+ this.handleInterfaceCallLog(ids);
+ } else if (key === 'BtnForceComplete' || key === 'BtnNoPurchase' || key === 'BtnForceComplete2' || key === 'BtnForceComplete3') {
+ this.handleForceComplete(key);
+ } else if (key === 'BtnUpPbOrder') {
+ this.props.onSaveState({
+ upPbOrderVisible: true,
+ });
+ } else if (key === 'BtnDlPbOrder') {
+ this.props.onSaveState({
+ dlPbOrderVisible: true,
+ });
+ } else if (key === 'BtnCommonImport') {
+ this.handleImport();
+ } else if (key === 'BtnInit') {
+ this.props.handleSlaveInit('slave');
+ } else if (key === 'BtnExportSql.salve') {
+ this.props.handleMenuClick({ key: 'formSlave' });
+ } else if (key === 'BtnExportSql.master') {
+ this.props.handleMenuClick({ key: 'formMaster' });
+ } else if (key === 'BtnExportSql.full') {
+ this.props.handleMenuClick({ key: 'fromMasterSlave' });
+ } else if (key === 'BtnExportSql.full') {
+ this.props.handleMenuClick({ key: 'fromMasterSlave' });
+ } else if (key === 'BtnCopy2Custom') {
+ this.props.handleCopy2Custom();
+ } else if (key === 'BtnModuleSql.sModuleSql') {
+ this.props.handleSqlDownload('single');
+ } else if (key === 'BtnModuleSql.sModule2Sql') {
+ this.props.handleSqlDownload('all');
+ } else if (key === "BtnFileImposition") {
+ this.setState({
+ fileImpositionData: {
+ visible: true,
+ onCancel: () => {
+ this.setState({ fileImpositionData: null });
+ },
+ onOk: () => {
+ this.setState({ fileImpositionData: null });
+ },
+ onSaveState: (obj) => {
+ this.setState({
+ fileImpositionData: { ...this.state.fileImpositionData, ...obj }
+ });
+ },
+ onSaveState1: this.props.onSaveState
+ }
+ });
+ } else if (this.props.onButtonClick !== undefined) {
+ this.props.onButtonClick(key);
+ }
+ };
+
+ // 删除当前pane
+ handleClosePane = (btnConfig, callback) => {
+ const { showName, sButtonParam } = btnConfig;
+ /* 若sButtonParam含有 bClose": true 则关闭当前页签*/
+ let bClose = false; /* 是否关闭当前页签 */
+ let bRefreshBefore = false; /* 是否刷新之前列表 */
+ if(sButtonParam && commonUtils.isJSON(sButtonParam)) {
+ const jsonObj = JSON.parse(sButtonParam);
+ if(jsonObj.bClose) {
+ bClose = true;
+ }
+ if(jsonObj.bRefreshBefore) {
+ bRefreshBefore = true;
+ }
+
+ }
+ if (bClose) {
+ const { panes, currentPane } = this.props.app;
+ const currentPaneIndex = panes.findIndex(item => item.key === currentPane.key);
+ if (currentPaneIndex > 0) {
+ const newPanes = panes.filter(item => item.key !== currentPane.key);
+ this.props.dispatch({ type: 'app/removePane', payload: { changePanes: newPanes, currentPane: panes[currentPaneIndex - 1] } });/* 关闭当前页签 */
+ }
+ if(bRefreshBefore) {
+ if (currentPane.refresh !== undefined) {
+ currentPane.refresh();
+ }
+ }
+
+ } else {
+ callback();
+ }
+ }
+
+ handleSubmit = () => {
+ // 保存前手机号、邮箱校验
+ let checkResult = true;
+ const { masterData = {}, masterConfig = {} } = this.props;
+ const { gdsconfigformslave = [] } = masterConfig;
+
+ const sDateFormatTypeList = ['phone', 'mobile', 'mail', 'postcode'];
+ const fieldsList = gdsconfigformslave.filter(
+ item =>
+ item.bVisible && item.sDateFormat && sDateFormatTypeList.includes(item.sDateFormat)
+ );
+
+ for (let i = 0; i < fieldsList.length; i++) {
+ const config = fieldsList[i];
+ const { sName, showName, sDateFormat } = config;
+ const value = masterData[sName];
+
+ if (value === undefined || value === '') {
+ continue;
+ }
+
+ if (sDateFormat === "phone") {
+ const reg = /^0\d{2,3}-\d{7,8}$/;
+ const reg1 = /^1[0-9]{10}$/;
+ const reg2 = /^0\d{2,3}-\d{7,8}-\d{1,8}$/;
+ if (!reg.test(value) && !reg1.test(value) && !reg2.test(value)) {
+ message.warning(`【${showName}】【${sName}】格式不正确!`);
+ checkResult = false;
+ break;
+ }
+ } else if (sDateFormat === "mobile") {
+ const reg = /^0\d{2,3}-\d{7,8}$/;
+ const reg1 = /^1[0-9]{10}$/;
+ const reg2 = /^0\d{2,3}-\d{7,8}-\d{1,8}$/;
+ if (!reg.test(value) && !reg1.test(value) && !reg2.test(value)) {
+ message.warning(`【${showName}】【${sName}】格式不正确!`);
+ checkResult = false;
+ break;
+ }
+ } else if (sDateFormat === "mail") {
+ const reg = /^[a-zA-Z0-9]{1,20}@[a-zA-Z0-9]{1,5}\.[a-zA-Z0-9]{1,5}$/;
+ if (!reg.test(value)) {
+ message.warning(`【${showName}】【${sName}】格式不正确!`);
+ checkResult = false;
+ break;
+ }
+ } else if (sDateFormat === "postcode") {
+ const reg = /^[1-9][0-9]{5}$/;
+ if (!reg.test(value)) {
+ message.warning(`【${showName}】【${sName}】格式不正确!`);
+ checkResult = false;
+ break;
+ }
+ }
+ }
+
+ // 客户简码校验
+ // if (masterData.sBuSort2) {
+ // const reg = /^(?:[A-Z]{4}|[A-Z]{2}\d{2}|[A-Z]{3}\d)$/;
+ // if (!reg.test(masterData.sBuSort2)) {
+ // message.warning(`【客户简码】格式不正确【正确格式:大写字母+数字(共四位)】!`);
+ // checkResult = false;
+ // }
+ // }
+
+ if (checkResult) {
+ // 验证各种工序参数的必填项
+ if (!commonBusiness.validatePramsNotEmpty(this.props)) return;
+ this.props.onSubmit();
+ } else {
+ this.props.onSaveState({
+ loading: false,
+ });
+ }
+ }
+
+ deteleObject = (obj = []) => {
+ // eslint-disable-next-line camelcase
+ const replace_data = obj;
+ const result = []; // 去重后的数组对象集合
+ const hash = {};
+ // eslint-disable-next-line no-plusplus
+ for (let i = 0; i < replace_data.length; i++) {
+ const elem = replace_data[i].sId;
+ if (!hash[elem]) {
+ result.push(replace_data[i]);
+ hash[elem] = true;
+ }
+ }
+ return result;
+ }
+
+ handleCheckButton = (key) => {
+ let sErrorInfo = '';
+ const sCheckName = 's'+key +'ErroMsg';
+ /* sControlName + ErrorMsg 看数据集是否包含,包含则提示出来 */
+ let tableName = '';
+ if(location.pathname && location.pathname.includes('List')) {
+ tableName ='slave';
+ }else {
+ tableName = 'master';
+ }
+ if(commonUtils.isNotEmptyObject(tableName)) {
+ const {[`${tableName}Data`]: tableData, [`${tableName}SelectedRowKeys`]: tableSelectedRowKeys} = this.props;
+ if(tableName === 'master' && commonUtils.isNotEmptyObject(tableData)) {
+ sErrorInfo = tableData[sCheckName];
+ } else if(commonUtils.isNotEmptyArr(tableData)) {
+ const iIndex = tableData.findIndex(item => tableSelectedRowKeys.includes(item.sSlaveId));
+ if(iIndex > -1) {
+ const tableRow = tableData[iIndex];
+ if(commonUtils.isNotEmptyObject(tableRow[sCheckName])) {
+ sErrorInfo = tableRow[sCheckName];
+ }
+ }
+ }
+
+ }
+ return sErrorInfo;
+
+ }
+
+ handleToolBarKeyDown =(e) => {
+ /* 前端CTRL+ALT+G后,如果没有数据默认跳转第一个配置的数据 */
+ if (e.ctrlKey && (e.altKey || e.metaKey) && e.keyCode === 71) { /* CTRL+ALT+G F7 设置界面 */
+ const { sType } = this.props?.app?.userinfo || {};
+ if (!['sysadmin'].includes(sType)) {
+ return;
+ }
+ if (commonUtils.isNotEmptyObject(this.props)) {
+ let name = 'master';
+ if(location.pathname.includes('commonList')) {
+ name = 'slave';
+ }
+ console.log('name', name);
+ const { [`${name}Config`]: tableConfig } = this.props;
+ if(commonUtils.isNotEmptyArr(tableConfig)) {
+ const myTableConfig = JSON.parse(JSON.stringify(tableConfig));
+ myTableConfig.sActiveId = '16411004790004762980820285096000';
+ /* 找到配置的第一个字段 */
+ const columnArr = tableConfig.gdsconfigformslave.filter(child => child.sName !== '' && child.bVisible && child.showName !== '');
+ const sName = commonUtils.isNotEmptyArr(columnArr) ? columnArr[0].sName : '';
+ myTableConfig.sName = sName;
+ const myTableConfigArr = [];
+ myTableConfigArr.push(myTableConfig);
+ if (name === 'master') { /* 主表 */
+ this.props.onViewClick(name, 'myTableConfig', {}, 0, myTableConfigArr, '');
+ } else { /* 从表 */
+ this.props.onViewClick(name, 'myTableConfig', {}, 0, myTableConfigArr, '');
+ }
+ }
+
+ }
+ }
+
+ };
+
+ /* 解析消息 */
+ handleGetMsg = (str) => {
+ const msgArr = commonUtils.isNotEmptyObject(str) ? str.split('xpm'): '';
+ const divStr = [];
+ if(commonUtils.isNotEmptyArr(msgArr)) {
+ for (let i = 0; i < msgArr.length; i ++) {
+ divStr.push({msgArr[i]}
);
+ }
+ }
+ return divStr;
+ }
+
+ /* 调用后台配置的接口 */
+ handleInterfaceCall = async (obj, showTip, key, ids, slaveSelectedRowKeysOld) => {
+ let bResult = false;
+ const { app, sModelsId, masterData, slaveData, masterConfig, slaveFilterCondition } = this.props;
+ const slaveSelectedRowKeys = slaveSelectedRowKeysOld || this.props.slaveSelectedRowKeys;
+ const sInterfaceName = obj.sInterfaceName;
+ /* 如果key是BtnSendList 传从表的主键集合 */
+ let idArr = '';
+ /* 如果有对应字段 则取对应字段 ,否则 取默认值 */
+ const btnConfig = commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))) ?
+ masterConfig.gdsconfigformslave.filter(item => (item.sControlName === key))[0] : {};
+
+ let sActiveKey = '';
+ if(commonUtils.isNotEmptyObject(btnConfig)) {
+ sActiveKey = btnConfig.sActiveKey;
+ }
+ if(sActiveKey) {
+ if( sActiveKey.includes('master.sId')) {
+ idArr = masterData.sId;
+ }
+ } else if(key && (key.includes('BtnSendList') || key.includes('BtnBatchExamine'))) {
+ if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ slaveSelectedRowKeys.forEach((item) => {
+ if(commonUtils.isNotEmptyObject(item)) {
+ idArr += `${item},`;
+ }
+ });
+ idArr = commonUtils.isNotEmptyObject(idArr) ? idArr.substr(0, idArr.length - 1) : '';
+ }
+ }else if(location.pathname.includes('commonList')){
+ const { slaveSelectedRowKeys, slaveData } = this.props;
+ let { slaveSelectedData } = this.props;
+ if(commonUtils.isEmptyArr(slaveSelectedData) && commonUtils.isNotEmptyArr(slaveData)) {
+ slaveSelectedData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sId) || slaveSelectedRowKeys.includes(item.sSlaveId));
+ }
+ const slaveSelectedDataNew = this.deteleObject(slaveSelectedData); // 删除sid重复的数据
+
+ if(commonUtils.isNotEmptyArr(slaveSelectedDataNew)) {
+ slaveSelectedDataNew.forEach((item) => {
+ if(commonUtils.isNotEmptyObject(item)) {
+ idArr += `${item.sId},`;
+ }
+ });
+ idArr = commonUtils.isNotEmptyObject(idArr) ? idArr.substr(0, idArr.length - 1) : '';
+ }
+ if(commonUtils.isNotEmptyObject(ids)) { /* 如果是勾选多行 则sId为循环的每一条 */
+ idArr = ids;
+ }
+ } else {
+ idArr = masterData.sId;
+ }
+ const value = { sId: commonUtils.isNotEmptyObject(idArr) ? idArr : commonUtils.isNotEmptyObject(ids) ? ids : masterData.sId, sSlaveId: slaveSelectedRowKeys?.toString(), masterData, userInfo: app.userinfo };
+ if(location.pathname.includes('commonList') && commonUtils.isNotEmptyArr(slaveFilterCondition)){
+ value.bFilter = JSON.stringify(slaveFilterCondition) ;
+ }
+ const url = `${commonConfig.interface_host}interfaceDefine/callthirdparty/${sInterfaceName}?sModelsId=${sModelsId}`;
+ const returnData = (await commonServices.postValueService(app.token, value, url, app)).data;
+ if (showTip) {
+ if ((!returnData || returnData.code < 0)) {
+ if (commonUtils.isNotEmptyObject(returnData) && returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ } else {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ return;
+ }
+ // message.error('同步INFOR失败!');
+ return;
+ } else {
+ // message.success('同步INFOR成功!');
+ }
+ }
+ if(!returnData) {
+ message.error('接口调用失败!');
+ return false;
+ }
+ if (returnData.code === 1) {
+ bResult = true;
+ // message.success(returnData.msg);
+ }else if (returnData.code === 2) {
+ // Modal.info({
+ // title: '温馨提示:',
+ // content: (
+ //
+ // {this.handleGetMsg(returnData.msg)}
+ //
+ // ),
+ // okText: '确认',
+ // onOk() {},
+ // });
+ bResult = true;
+ }else if (returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ bResult = false;
+ } else {
+ bResult = false;
+ this.props.getServiceError(returnData);
+ }
+ /* 若配置的是按钮后调用第三方, 则调用成功后 需要重新回刷一次数据 */
+ if(commonUtils.isNotEmptyObject(obj) && obj.sInterfaceCallMethod === "2"){
+ if(bResult){
+ this.props.onButtonClick('BtnRefresh');
+ }
+ }
+ return bResult;
+ }
+
+
+ /* 调用后台配置的接口 */
+ handleInterfaceCallDialog = async (obj, showTip, key, map) => {
+ const addState ={};
+ let bResult = false;
+ const { app, sModelsId, masterData, slaveSelectedRowKeys} = this.props;
+ const sInterfaceName = obj.sInterfaceName;
+ /* 如果key是BtnSendList 传从表的主键集合 */
+ let idArr = '';
+ if(key && key.includes('BtnSendList')) {
+ if(commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ slaveSelectedRowKeys.forEach((item) => {
+ if(commonUtils.isNotEmptyObject(item)) {
+ idArr += `${item},`;
+ }
+ });
+ idArr = commonUtils.isNotEmptyObject(idArr) ? idArr.substr(0, idArr.length - 1) : '';
+ }
+ }
+ const value = { sId: key === 'BtnSendList' ? idArr : masterData.sId, masterData, userInfo: app.userinfo, data: map };
+ const url = `${commonConfig.interface_host}interfaceDefine/callthirdparty/${sInterfaceName}?sModelsId=${sModelsId}`;
+ const returnData = (await commonServices.postValueService(app.token, value, url, app)).data;
+
+ /*
+ -1: 提示returnData.msg的信息(message.error)
+ -8: 提示提示returnData.msg的信息(Modal温馨提示)
+ 1: 提示returnData.msg的信息(message.sucess)
+ 2: 提示提示returnData.msg的信息(Modal温馨提示)
+ **/
+
+ if (showTip) {
+ if ((!returnData || returnData.code < 1)) {
+ if (commonUtils.isNotEmptyObject(returnData) && returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ } else if (commonUtils.isNotEmptyObject(returnData) && returnData.code === -1) {
+ message.error(returnData.msg);
+ }
+ return;
+ } else if (returnData.code === 2) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ } else {
+ // message.success('同步INFOR成功!');
+ }
+ }
+ let inforEvent = ['itemiss', 'jobmatliss', 'jobmatliss-bz', 'jobmatliss-tl', 'jobmatliss-cx'];
+ if (obj && inforEvent.indexOf(obj.sInterfaceName) !== -1) {
+ if ((!returnData || returnData.code < 1)) {
+ if (returnData) {
+ if (returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ } else {
+ message.error(returnData.erroMsg || returnData.msg);
+ }
+ } else {
+ message.error('审核失败!');
+ }
+ return false;
+ }
+ }
+ if(commonUtils.isNotEmptyObject(returnData)) {
+ if (returnData.code > 0) {
+ bResult = true;
+ if(commonUtils.isNotEmptyObject(returnData.data) && commonUtils.isNotEmptyObject(returnData.data.dataList)) {
+ addState.returnData = returnData.data.dataList;
+ }
+ }else if (returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ } else {
+ message.error(returnData.erroMsg || returnData.msg);
+ }
+ } else {
+ bResult = false;
+ this.props.getServiceError(returnData);
+ }
+ addState.bResult = bResult;
+ // addState.returnData = datalist;
+ return addState;
+ }
+
+
+ /* 调用后台配置的日志接口 */
+ handleInterfaceCallLog = async (ids) => {
+ let bResult = false;
+ const { app, sModelsId } = this.props;
+ const value = { userInfo: app.userinfo };
+ const url = `${commonConfig.interface_host}interfaceDefine/callthirdpartyByLogId/${ids}?sModelsId=${sModelsId}`;
+ const returnData = (await commonServices.postValueService(app.token, value, url, app)).data;
+ if(!returnData) {
+ message.error('接口调用失败!');
+ return false;
+ }
+ if (returnData.code === 1) {
+ bResult = true;
+ // message.success(returnData.msg);
+ }else if (returnData.code === 2) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ bResult = true;
+ }else if (returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ bResult = false;
+ } else {
+ bResult = false;
+ this.props.getServiceError(returnData);
+ }
+ return bResult;
+ }
+
+
+ /* 新增 */
+ handleAdd = () => {
+ this.props.onAdd();
+ };
+
+ /* 新增子级 */
+ handleAddChild= (obj) => {
+ this.props.onAddChild(obj);
+ };
+
+
+ handleRefresh = () => {
+ this.props.onButtonClick('BtnRefresh');
+}
+ handleFilfileManageCancel = (modelVisible) => {
+ const { slaveConfig, sModelsId } = this.props;
+ if (['12710101117013204247130'].includes(sModelsId)) {
+ this.props.onGetData(slaveConfig);
+ }
+ this.props.onSaveState({ [modelVisible]: false });
+ }
+ handleFilfileManageOk = (modelVisible, selectConfig, filfileSelectedData, sSrcSlaveId, filfileDelData) => {
+ if (commonUtils.isNotEmptyObject(sSrcSlaveId) && !location.pathname.includes('commonList')) { /* 工单、工艺卡、报价单控制表数据带回 */
+ let controlFilfileData = [];
+ let controlFilfileDelData = [];
+ if (commonUtils.isNotEmptyArr(filfileSelectedData)) {
+ controlFilfileData = filfileSelectedData.filter(item => item.sSrcSlaveId === sSrcSlaveId);/* 控制表选中行上传的图片数组 */
+ }
+ if (commonUtils.isNotEmptyArr(filfileDelData)) {
+ controlFilfileDelData = filfileDelData.filter(item => item.sSrcSlaveId === sSrcSlaveId);
+ }
+ const { sActiveId } = selectConfig;
+ if (sActiveId && location.pathname.includes('processCardPackTableTree')) {
+ // 印品PBOM专用附件回调
+ this.props.onFilfileManageOk1 && this.props.onFilfileManageOk1({
+ controlFilfileData,
+ controlFilfileDelData,
+ sSrcSlaveId
+ });
+ } else {
+ // 通用附件回调
+ this.props.onFilfileManageOk(controlFilfileData, controlFilfileDelData, sSrcSlaveId);
+ }
+ }
+ this.props.onSaveState({ [modelVisible]: false, visibleOtherFilfile: false }, () => {
+ const { sAfterClickInstruct, showName } = selectConfig;
+ if (sAfterClickInstruct) {
+ instructSet({
+ ...this.props,
+ slavepupData: filfileSelectedData,
+ btnConfig: { sInstruct: sAfterClickInstruct, showName }
+ })
+ }
+ });
+ }
+
+ handleSelectDialog = (name, selectConfig, selectData) => {
+ this.props.onSelectDialog(name, selectConfig, selectData, 'master');
+ }
+ handleDialogCancel= () => {
+ this.props.onSaveState({ visibleInterfaceDialog: false });
+ }
+ // 获取订单中的取消
+ handleCancel = () => {
+ this.setState({
+ inputChange: '',
+ });
+ this.props.onGetGoodsCancle();
+ };
+ // 获取订单中的确定
+ handleOk = () => {
+ this.props.onGetGoodsValue(this.state.inputChange);
+ };
+ // 获取订单中的值变化
+ handleInputChange = (e) => {
+ this.setState({
+ inputChange: e.target.value,
+ });
+ }
+ radioClick = (Child, e) => {
+ e.stopPropagation();
+ const { printData } = this.state;
+ const iIndex = printData.findIndex(item => item.checkedId === Child.sControlName);
+ if(iIndex === -1) {
+ const printObj ={};
+ printObj.checked = e.target.checked;
+ printObj.checkedId = Child.sControlName;
+ printData.push(printObj);
+ } else {
+ printData[iIndex] ={...printData[iIndex], checked : e.target.checked}
+ }
+
+ this.setState({
+ // eslint-disable-next-line react/no-unused-state
+ // checked: e.target.checked, checkedId: Child.sControlName,
+ printData
+ });
+ }
+ // 进行存储过程按钮存储过程参数解析拼接 根据存储过程按钮参数配置进行解析,配置是json格式 {"sproName":"cal_sss","inMap":"master.sSlaveId,slave.sId"}
+ handleBtnEent = async (btnConfig, name, sValue, nextInParams) => {
+ this.xlyProcessPercent = 0;
+ clearInterval(this.xlyProcessTimer);
+ if (this.props.app?.currentPane?.title === "工单损耗及无形损跟踪" && btnConfig?.sControlName === "BtnEventAllWork") {
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ this.xlyProcessTimer = setInterval(() => {
+ if (this.xlyProcessPercent >= 50) {
+ this.xlyProcessPercent += 0.2;
+ } else if (this.xlyProcessPercent >= 90) {
+ return;
+ } else {
+ this.xlyProcessPercent += 0.5;
+ }
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ }, 500);
+ }
+ this.props.onSaveState({
+ pageLoading: true,
+ });
+ const { menuData } = this.state;
+ let iResult = 0;
+ let bFirst = false;
+ if (commonUtils.isNotEmptyObject(btnConfig) && (btnConfig.sControlName === 'BtnEventReceiveReturn' || btnConfig.sControlName === 'BtnEventReceive')) { // 刀模归还, 刀模领用判断是否选择数据
+ const { slaveSelectedRowKeys, app } = this.props;
+ if (slaveSelectedRowKeys && commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择记录
+ this.props.onSaveState({
+ pageLoading: false,
+ });
+ return;
+ }
+ }
+
+ if (commonUtils.isNotEmptyObject(btnConfig) && (btnConfig.sControlName.includes('BtnEventAutoOrder'))) { // 刀模归还, 刀模领用判断是否选择数据
+ bFirst = true; /* 沒有选中行时 默认第一条 */
+ }
+ const { masterData, sCurrMemoProps, masterConditionData } = this.props;
+ if (commonUtils.isNotEmptyObject(name) && name.indexOf('BtnRepair') > -1 && commonUtils.isNotEmptyObject(sCurrMemoProps)) {
+ sCurrMemoProps.bVisibleMemo = false;
+ this.props.onSaveState({ sCurrMemoProps });
+ }
+ const sButtonParam = btnConfig.sButtonParam;
+ console.log('11', btnConfig);
+ const btn = commonUtils.convertStrToObj(sButtonParam);
+ const sProName = btn.sproName;
+ const inParams = [];
+ const inMap = btn.inMap;
+ const inlist = inMap ? inMap.split(',') : [];
+ const masterArr = [];
+ const masterConditionArr = [];
+ const slaveArr = [];
+ const slaveInfoArr = [];
+ const controlArr = [];
+ const materialsArr = [];
+ const processArr = [];
+ const sTableName = btn.sTableName;
+
+ if (!sTableName && !inMap) { // 都为undefined时直接退出
+ this.props.onSaveState({
+ pageLoading: false,
+ });
+ return;
+ }
+
+ if (inlist.length > 0) {
+ inlist.forEach((item) => {
+ const itemArr = item.split('.');
+ if (itemArr.length > 0) {
+ const sname = itemArr[0];
+ const stype = itemArr[1];
+ const stypeNew = itemArr.length > 2 ? itemArr[2] : stype;
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'master') {
+ masterArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'masterCondition') { /* 参数数据集 */
+ masterConditionArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'slave') {
+ slaveArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'slaveInfo') {
+ slaveInfoArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'control') {
+ controlArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'materials') {
+ materialsArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && sname === 'process') {
+ processArr.push([stype, stypeNew]);
+ }
+ if (commonUtils.isNotEmptyStr(sname) && !['master', 'masterCondition', 'slave', 'slaveInfo', 'control', 'materials', 'process'].includes(sname)) {
+ const addState = this.handleProParams(sname, [[stype, stypeNew]]);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ }
+ });
+
+ if (commonUtils.isNotEmptyArr(masterArr) && commonUtils.isNotEmptyObject(masterData)) {
+ const addState = {};
+ addState.key = 'master';
+ const val = [];
+ const currVal = {};
+ masterArr.forEach(([stype, stypeNew]) => {
+ currVal[`${stypeNew}`] = masterData[`${stype}`];
+ });
+ val.push(currVal);
+ addState.value = val;
+ inParams.push({ ...addState });
+ }
+ if (commonUtils.isNotEmptyArr(masterConditionArr) && commonUtils.isNotEmptyObject(masterConditionData)) {
+ const addState = {};
+ addState.key = 'masterCondition';
+ const val = [];
+ const currVal = {};
+ masterConditionArr.forEach((filed) => {
+ currVal[`${filed}`] = masterConditionData[`${filed}`];
+ });
+ val.push(currVal);
+ addState.value = val;
+ inParams.push({ ...addState });
+ }
+ if (commonUtils.isNotEmptyArr(slaveArr)) {
+ const addState = this.handleProParams('slave', slaveArr, bFirst);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(slaveInfoArr)) {
+ const addState = this.handleProParams('slaveInfo', slaveInfoArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(controlArr)) {
+ const addState = this.handleProParams('control', controlArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(materialsArr)) {
+ const addState = this.handleProParams('materials', materialsArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ if (commonUtils.isNotEmptyArr(processArr)) {
+ const addState = this.handleProParams('process', processArr);
+ if (commonUtils.isNotEmptyObject(addState)) {
+ inParams.push({ ...addState });
+ }
+ }
+ }
+
+ if (commonUtils.isNotEmptyStr(sTableName) && commonUtils.isNotEmptyArr(inParams)) {
+ inParams.forEach(item => {
+ if (commonUtils.isNotEmptyArr(item.value)) {
+ item.value.forEach(item1 => {
+ item1.sTableName = sTableName;
+ })
+ }
+ });
+ }
+
+ /* 列表增加查询条件的传参 */
+ if(location.pathname?.includes('indexPage/commonList') && (btnConfig?.sControlName === "BtnEventOneWork"
+ || btnConfig?.sControlName === "BtnEventAllWork")) {
+ const { slaveFilterCondition = []} = this.props;
+ if (commonUtils.isNotEmptyArr(slaveFilterCondition) && commonUtils.isNotEmptyArr(inParams)) {
+ inParams.forEach(item => {
+ item.bFilter = slaveFilterCondition;
+ });
+ }
+ console.log('inParams', inParams);
+ }
+
+ const iIndex = commonUtils.isNotEmptyObject(btnConfig) ? menuData.findIndex(item => item.sControlName === btnConfig.sControlName) : -1;
+ let interfaceArr = [];
+ if (iIndex > -1) {
+ interfaceArr = menuData[iIndex].interface;
+ }
+ if (commonUtils.isNotEmptyArr(interfaceArr) && commonUtils.isNotEmptyObject(btnConfig) && btnConfig.sControlName.includes('BtnRepair')) {
+ if(true) {
+ const { slaveSelectedRowKeys, app, slaveData, } = this.props;
+ if (inMap && inMap.includes('slave.') && slaveSelectedRowKeys && commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择记录
+ this.props.onSaveState({
+ pageLoading: false,
+ });
+ return;
+ }
+ let slaveRow = {};
+ const iSlaveDataIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ if(iSlaveDataIndex > -1) {
+ slaveRow = slaveData[iSlaveDataIndex];
+ }
+ let ids = '';
+ if(location.pathname.includes('commonList')){
+ let { slaveSelectedData } = this.props;
+ if(commonUtils.isEmptyArr(slaveSelectedData) && commonUtils.isNotEmptyArr(slaveData)) {
+ slaveSelectedData = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sId) || slaveSelectedRowKeys.includes(item.sSlaveId));
+ }
+ const slaveSelectedDataNew = this.deteleObject(slaveSelectedData); // 删除sid重复的数据
+ if(commonUtils.isNotEmptyArr(slaveSelectedDataNew)) {
+ slaveSelectedDataNew.forEach((item) => {
+ if(commonUtils.isNotEmptyObject(item)) {
+ ids += `${item.sId},`;
+ }
+ });
+ ids = commonUtils.isNotEmptyObject(ids) ? ids.substr(0, ids.length - 1) : '';
+ }
+ } else {
+ ids = slaveRow.sId
+ }
+ const beforeInterfaceArr = interfaceArr.filter(item => item.sInterfaceCallMethod === "1");
+ const afterInterfaceArr = commonUtils.isNotEmptyArr(interfaceArr) ? interfaceArr.filter(item => item.sInterfaceCallMethod === "2" ) : [];
+ if(commonUtils.isNotEmptyArr(beforeInterfaceArr)) { /* 之前调用 */
+ let flag = 0;
+ const asyncFunc = async () => {
+ for (let i = 0; i < beforeInterfaceArr.length; i ++) {
+ const data = await this.handleInterfaceCall(beforeInterfaceArr[i], true, btnConfig.sControlName, ids);
+ if (!data) {
+ flag += 1;
+ this.props.onSaveState({
+ pageLoading: false,
+ });
+ return;
+ }
+ }
+ }
+ await asyncFunc();
+ if (flag == 0) {
+ await this.handleProcedureCall(btnConfig, sProName, JSON.stringify({ params: inParams, changeValue: sValue, sButtonParam: btn }));
+ }
+ }
+ if(commonUtils.isNotEmptyArr(afterInterfaceArr)) { /* 之后调用 */
+ const result = await this.handleProcedureCall(btnConfig, sProName, JSON.stringify({ params: inParams, changeValue: sValue, sButtonParam: btn }));
+ console.log('result', result);
+ if(result > 0) { /* 只有成功 才能调用接口 -5代表失败 */
+ const asyncFunc = async () => {
+ for (let i = 0; i < afterInterfaceArr.length; i++) {
+ await this.handleInterfaceCall(afterInterfaceArr[i],true, btnConfig.sControlName, ids);
+ }
+ }
+ await asyncFunc();
+ }
+ }
+ }
+ } else {
+ const inParamsNew = nextInParams || inParams;
+ iResult = await this.handleProcedureCall(btnConfig, sProName, JSON.stringify({ params: inParamsNew, changeValue: sValue, sButtonParam: btn }));
+ }
+
+ if (this.props.app?.currentPane?.title === "工单损耗及无形损跟踪" && btnConfig?.sControlName === "BtnEventAllWork") {
+ clearInterval(this.xlyProcessTimer);
+ this.xlyProcessPercent = 91;
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ this.xlyProcessTimer = setInterval(() => {
+ this.xlyProcessPercent += 1;
+ message.loading({ content: , key: "xlyProcess", duration: 0, className: styles.xlyProcess});
+ if (this.xlyProcessPercent === 100) {
+ clearInterval(this.xlyProcessTimer);
+ setTimeout(() => {
+ message.destroy();
+ }, 1000);
+ }
+ }, 100);
+ }
+
+ this.props.onSaveState({
+ pageLoading: false,
+ });
+ return iResult;
+
+ };
+ // 存储过程按钮调用存储过程
+ handleProcedureCall = async (btnConfig, proName, proInParam, other) => {
+ const { app, sModelsId } = this.props;
+ let iResult = 0;
+ const sBtnName = btnConfig.sControlName;
+ const value = { sProName: proName, sProInParam: proInParam, sBtnName };
+ if (other?.iFlag === 1) {
+ value.iFlag = 1;
+ }
+ const url = `${commonConfig.server_host}procedureCall/doGenericProcedureCall?sModelsId=${sModelsId}`;
+ // const url = '';
+ const returnData = (await commonServices.postValueService(app.token, value, url)).data;
+ if (proName === 'Sp_BtnEven_CalcJsHs') {
+ if (returnData.code === 1) {
+ message.success(returnData.msg);
+ } else {
+ message.warning(returnData.msg);
+ }
+ const proInParamJson = commonUtils.convertStrToObj(proInParam);
+ const sId = proInParamJson.params?.[0]?.value?.[0]?.sId;
+ const { slave3Data = [] } = this.props;
+ const iIndex = slave3Data.findIndex(item => item.sId === sId);
+ if (iIndex !== -1) {
+ slave3Data[iIndex].sCalcProDetail = returnData.msg;
+ this.props.onSaveState({ slave3Data });
+ }
+ } else if (returnData.code === 1) {
+ message.success(returnData.msg);
+ this.handleClosePane(btnConfig, () => {
+ this.props.onButtonClick('BtnRefresh');
+ });
+ } else if (returnData.code === -8) {
+ Modal.info({
+ title: '温馨提示:',
+ content: (
+
+ {this.handleGetMsg(returnData.msg)}
+
+ ),
+ okText: '确认',
+ onOk() {},
+ });
+ } else {
+ this.props.getServiceError({ ...returnData, fn: () => this.handleProcedureCall(btnConfig, proName, proInParam, { iFlag: 1 }) });
+ }
+ iResult = returnData.code;
+ this.props.onSaveState({ loading: false });
+ // 点击返回重排的时候刷新树
+ if (btnConfig.sControlName === 'BtnEventReturn') {
+ if (this.props.refreshTreeData) {
+ this.props.refreshTreeData();
+ }
+ }
+ return iResult
+ }
+ // 根据配置解析拼接具体参数
+ handleProParams = (sKey, arr, bFirst) => {
+ const { [`${sKey}Data`]: tableData, [`${sKey}SelectedRowKeys`]: selectedRowKeys } = this.props;
+ let keyData = commonUtils.isNotEmptyArr(tableData) && commonUtils.isNotEmptyArr(selectedRowKeys) ? tableData.filter(item => commonUtils.isEmptyObject(item.sDivRowNew) && (selectedRowKeys.includes(item.sId) || selectedRowKeys.includes(item.sSlaveId))) : [];
+ if (bFirst) { /* 没有选中行时默认第一条 */
+ if (commonUtils.isNotEmptyArr(tableData)) {
+ keyData = [tableData[0]];
+ }
+ }
+ if (commonUtils.isNotEmptyArr(keyData)) {
+ const addState = {};
+ addState.key = sKey;
+ const val = [];
+ keyData.forEach((currData) => {
+ const currVal = {};
+ arr.forEach(([stype, stypeNew]) => {
+ currVal[`${stypeNew}`] = currData[`${stype}`];
+ });
+ val.push(currVal);
+ });
+ addState.value = val;
+ return addState;
+ } else {
+ return undefined;
+ }
+ };
+ /* 双击弹出Memo */
+ handleGetMemo = (name, sValue, sMemoFiled, sRecord, bVisibleMemo, btnConfig, sCurrMemoPropsType) => {
+ const sCurrMemoProps = sCurrMemoPropsType === '1' ? this.props.sCurrMemoProps1 : this.props.sCurrMemoProps;
+ sCurrMemoProps.bVisibleMemo = false;
+ if (btnConfig.length > 0) {
+ sRecord[sMemoFiled] = sValue;
+ if (sCurrMemoPropsType === '1') {
+ this.props.onSaveState({ sCurrMemoProps1: sCurrMemoProps });
+ } else {
+ this.props.onSaveState({ sCurrMemoProps });
+ }
+ this.handleToForceComplete(sValue);
+ } else {
+ let { [`${name}Data`]: tableData } = this.props;
+ let addStata = { [`${sMemoFiled}`]: sValue };
+ if (name !== 'master') {
+ const iIndex = tableData.findIndex(item => item.sId === sRecord.sId);
+ let handleType = tableData[iIndex].handleType;/* 获取操作类型 */
+ handleType = commonUtils.isEmpty(handleType) ? 'update' : handleType;
+ addStata.handleType = handleType;
+ tableData[iIndex] = { ...tableData[iIndex], ...addStata };
+ } else {
+ if (sMemoFiled === 'sFormulaMemo') {
+ addStata.sFormula = sValue;
+ }
+ let handleType = tableData.handleType;/* 获取操作类型 */
+ handleType = commonUtils.isEmpty(handleType) ? 'update' : handleType;
+ addStata.handleType = handleType;
+ tableData = { ...tableData, ...addStata };
+ }
+ this.props.onSaveState({ ...sCurrMemoProps, [`${name}Data`]: tableData});
+ }
+ };
+ handleGetMemo1 = (name, sValue, sMemoFiled, sRecord, bVisibleMemo, btnConfig) => {
+ this.handleGetMemo(name, sValue, sMemoFiled, sRecord, bVisibleMemo, btnConfig, '1');
+ }
+ /* 点击隐藏Memo 弹窗 */
+ handleGetMemoCancel = () => {
+ const { sCurrMemoProps } = this.props;
+ sCurrMemoProps.bVisibleMemo = false;
+ this.props.onSaveState({ sCurrMemoProps });
+ };
+ handleGetMemoCancel1 = () => {
+ const { sCurrMemoProps1 } = this.props;
+ sCurrMemoProps1.bVisibleMemo = false;
+ this.props.onSaveState({ sCurrMemoProps1 });
+ }
+ handleForceComplete = (name, createDate) => {
+ let sysLogData = {};
+ const slaveMemoConfigOld = [];
+ const {
+ slaveSelectedRowKeys, slaveInfoSelectedRowKeys, app, masterConfig, slaveInfoData, masterData, slaveData, gdsformconst,
+ } = this.props;
+ const btnConfig = commonUtils.isNotEmptyObject(masterConfig) && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === name)) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === name)[0] :{};// sButtonEnabled sButtonParam
+ const bNoMemo = btnConfig.sDefault === 'noMemo';
+ if (createDate !== 'chooseDate') {
+ let target = '';
+ if (btnConfig.sActiveKey) {
+ target = btnConfig.sActiveKey.split(',')[0].split('.')[0];
+ }
+ if (target === 'slave' && commonUtils.isEmptyArrNew(slaveSelectedRowKeys)) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择记录
+ } else if (target === 'slaveInfo' && commonUtils.isEmptyArrNew(slaveInfoSelectedRowKeys)) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'pleaseChooseData')); // 请选择记录
+ } else if (target === 'slaveInfo' && !Array.isArray(slaveInfoData)) {
+ message.warn('请展开详情并选择数据。'); // 请选择记录
+ } else {
+ let btnConfigNameArr = [];
+ let singleConfig = {};
+ let singleRow = {}; /* 选中行的数据 */
+ if (name.indexOf('BtnRepair') > -1) {
+ if (!commonUtils.isEmpty(btnConfig.sActiveKey)) {
+ btnConfigNameArr = btnConfig.sActiveKey.split(',');
+ }
+ if (commonUtils.isNotEmptyArr(btnConfigNameArr)) {
+ // eslint-disable-next-line array-callback-return
+ btnConfigNameArr.map((i) => {
+ let sIndex = -1;
+ if (target === 'slaveInfo') {
+ sIndex = this.props.slaveInfoConfig.gdsconfigformslave.findIndex(item => (item.sName === i.split('.')[1]));
+ const iSlaveIndex = slaveInfoData.findIndex(item => slaveInfoSelectedRowKeys.includes(item.sSlaveId));
+ if(iSlaveIndex > -1) {
+ singleRow = slaveInfoData[iSlaveIndex];
+ }
+ } else if (target === 'master') {
+ sIndex = this.props.masterConfig.gdsconfigformslave.findIndex(item => (item.sName === i.split('.')[1]));
+ singleRow = masterData;
+ } else {
+ if(commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.slaveConfig)) {
+ sIndex = this.props.slaveConfig.gdsconfigformslave.findIndex(item => (item.sName === i));
+ const iSlaveIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ if (iSlaveIndex > -1) {
+ singleRow = slaveData[iSlaveIndex];
+ }
+ }
+ }
+ console.log('singleRow:', singleRow);
+ if (sIndex > -1) {
+ if (target === 'slaveInfo') {
+ singleConfig = this.props.slaveInfoConfig.gdsconfigformslave[sIndex];
+ } else if (target === 'master') {
+ singleConfig = this.props.masterConfig.gdsconfigformslave[sIndex];
+ }else {
+ singleConfig = this.props.slaveConfig.gdsconfigformslave[sIndex];
+ }
+ if (masterData && commonUtils.isNotEmptyObject(singleRow)) {
+ masterData[singleConfig.sName] = singleRow[singleConfig.sName];
+ }
+ // if (masterData && commonUtils.isNotEmptyObject(singleConfig)) {
+ // masterData[singleConfig.sName] = undefined;
+ // }
+ slaveMemoConfigOld.push(singleConfig);
+ }
+ });
+ }
+ }
+ /* 时间格式的字段 若默认值为空 则取当前时间 */
+ const activeKeyData = commonUtils.isNotEmptyObject(btnConfig.sActiveKey) ? btnConfig.sActiveKey.split(',') : [];
+ if (activeKeyData.length > 1) { /* 当多字段时候 若时间格式的字段 若默认值为空 则取当前时间 */
+ const filterData = activeKeyData.filter(item => item.substring(0, 1) === 't');
+ if (commonUtils.isNotEmptyArr(filterData)) {
+ filterData.forEach((item) => {
+ let currentDate = moment().format('YYYY-MM-DD HH:mm:ss');
+
+ // 如果默认值为0 则不设置默认时间
+ const itemConfigIndex = masterConfig.gdsconfigformslave.findIndex(config => config.sName ===item);
+ if (itemConfigIndex !== -1 && masterConfig.gdsconfigformslave[itemConfigIndex].sDefault === '0') {
+ currentDate = null;
+ }
+ if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isEmpty(masterData[item])) {
+ masterData[item] = currentDate;
+ }
+ });
+ }
+ } else {
+ if (commonUtils.isNotEmptyObject(btnConfig.sActiveKey) && btnConfig.sActiveKey.substring(0, 1) === 't') {
+ if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isEmpty(masterData[btnConfig.sActiveKey])) {
+ masterData[btnConfig.sActiveKey] = moment().format('YYYY-MM-DD HH:mm:ss');
+ }
+ }
+ }
+ // if (slaveSelectedRowKeys === undefined || slaveSelectedRowKeys === null) {
+ // message.warn('请选择数据!');
+ // return;
+ // }
+ sysLogData =commonUtils.isNotEmptyArr(slaveSelectedRowKeys) ? { sId: slaveSelectedRowKeys.toString() } : {};
+ this.props.onSaveState({
+ slaveMemoConfig: slaveMemoConfigOld,
+ masterData: commonUtils.isNotEmptyObject(masterData) ? lodash.cloneDeep(masterData) : {}, /* 将选中行数据深拷贝 变成两个互不相扰的独立数据源 */
+ sCurrMemoProps: {
+ bVisibleMemo: true,
+ sMemoField: 'sReason',
+ sRecord: sysLogData,
+ dataSource: sysLogData,
+ btnName: name,
+ bNoMemo,
+ },
+ });
+ }
+ } else {
+ /* 从系统常量中找到pChooseDate的sName */
+ let pChooseDateName = '生成凭证';
+ if(commonUtils.isNotEmptyArr(gdsformconst)) {
+ const iIndex = gdsformconst.findIndex(item => item.sName === 'pChooseDate');
+ if (iIndex > -1) {
+ pChooseDateName = gdsformconst[iIndex].showName;
+ }
+ }
+ const chooseDateConfig = {
+ sId: commonUtils.createSid(),
+ sName: 'pChooseDate',
+ sDropDownType: 'sql',
+ bNotEmpty: false,
+ iVisCount: 1,
+ dropDownData: [],
+ showName: pChooseDateName,
+ sDateFormat:btnConfig && btnConfig.sDateFormat ? btnConfig.sDateFormat : 'YYYY-MM-DD'
+ };
+ slaveMemoConfigOld.push(chooseDateConfig);
+ this.props.onSaveState({
+ slaveMemoConfig: slaveMemoConfigOld,
+ sCurrMemoProps: {
+ bVisibleMemo: true,
+ sMemoField: 'sReason',
+ sRecord: sysLogData,
+ dataSource: sysLogData,
+ btnName: name,
+ bNoMemo,
+ },
+ });
+ }
+ }
+ handleToForceComplete = async (sValue) => {
+ const {
+ app, slaveSelectedRowKeys, slaveConfig, sModelsId, slaveInfoSelectedRowKeys, formRoute,
+ masterConfig,
+ } = this.props;
+
+ const { token } = app;
+ let iIndex = -1;
+ if (masterConfig && Array.isArray(masterConfig.gdsconfigformslave)) {
+ iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnForceComplete' || item.sControlName === 'BtnNoPurchase');
+ }
+ if (iIndex < 0 && slaveConfig && Array.isArray(slaveConfig.gdsconfigformslave)) {
+ iIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnForceComplete' || item.sControlName === 'BtnNoPurchase');
+ }
+ if (iIndex < 0) return;
+ const btnConfig = slaveConfig.gdsconfigformslave[iIndex];
+ // debugger
+ const sRelation = btnConfig.sRelation;
+
+ let selectedRowKeys = '';
+ if (formRoute === '/indexPage/materialRequirementsPlanning') {
+ selectedRowKeys = slaveInfoSelectedRowKeys.toString();
+ } else {
+ selectedRowKeys = slaveSelectedRowKeys.toString();
+ }
+
+ const url = `${commonConfig.server_host}bill/billForceComplete?sModelsId=${sModelsId}&sName=${formRoute}`;
+ const values = { sqlParam: sRelation, sId: selectedRowKeys, sReason: sValue };
+
+ const masterReturn = (await commonServices.postValueService(token, values, url)).data;
+ if (masterReturn.code === 1) {
+ message.success(masterReturn.msg);
+ this.props.onButtonClick('BtnRefresh');
+ } else {
+ this.props.getServiceError(masterReturn);
+ }
+ }
+ /** 上传文件改变时的状态 */
+ handleUploadChange = async (info) => {
+ const {
+ slaveSelectedRowKeys, app, slaveSelectedData, sModelsId, token,
+ } = this.props;
+ if (slaveSelectedRowKeys === undefined || slaveSelectedRowKeys.length !== 1) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo')); /* 请先选择一条数据! */
+ return;
+ }
+ const { file } = info;
+ if (file.response) {
+ if (file.response.code === 1) {
+ /* 成功 */
+ message.success(file.response.msg);
+ const savePathStr = file.response.dataset.rows[0].savePathStr;
+ const sId = commonUtils.isNotEmptyArr(slaveSelectedData) ? slaveSelectedData[0].sId : '';
+ const bFile = commonUtils.isNotEmptyArr(slaveSelectedData) ? slaveSelectedData[0].bCorrespondFile : '';
+ if (commonUtils.isNotEmptyObject(sId) && !bFile) {
+ const url = `${commonConfig.server_host}salesorder/updateOrderCorrespondFile?sModelsId=${sModelsId}`;
+ const values = { sOrderId: sId, savePathStr };
+ const sReturn = (await commonServices.postValueService(token, values, url)).data;
+ if (sReturn.code === 1) {
+ this.props.onButtonClick('BtnRefresh');
+ } else {
+ this.props.getServiceError(sReturn);
+ }
+ }
+ } else { /* 失败 */
+ this.props.getServiceError({ msg: commonFunc.showMessage(app.commonConst, 'reportDesign') + file.response }); /* 报表设计 */
+ }
+ }
+ };
+
+ /** 上传发票文件改变时的状态 */
+ handleUploadInvoiceChange = async (info) => {
+ const {
+ slaveSelectedRowKeys, app, slaveSelectedData, sModelsId, token,
+ } = this.props;
+ if (slaveSelectedRowKeys === undefined || slaveSelectedRowKeys.length !== 1) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo')); /* 请先选择一条数据! */
+ return;
+ }
+ const { file } = info;
+ if (file.response) {
+ if (file.response.code === 1) {
+ /* 成功 */
+ message.success(file.response.msg);
+ } else { /* 失败 */
+ this.props.getServiceError({ msg:'发票上传失败!' }); /* 报表设计 */
+ }
+ }
+ };
+
+ /* 订单文件下载 */
+ handleBtnDownload = () => {
+ const {
+ slaveSelectedRowKeys, slaveData, app,
+ } = this.props;
+ if (commonUtils.isEmptyArr(slaveSelectedRowKeys)) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo'));/* 请先选择一条数据 */
+ return;
+ }
+ const dataSelect = slaveData.filter(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ const sBillNoArr = [];
+ let sBillNoStr = '';
+ if (commonUtils.isNotEmptyArr(dataSelect)) {
+ dataSelect.forEach((item) => {
+ sBillNoArr.push(item.sBillNo);
+ });
+ sBillNoStr = JSON.stringify(sBillNoArr);
+ }
+ if (commonUtils.isNotEmptyArr(sBillNoArr)) {
+ const urlPrint = `${commonConfig.file_host}file/downloadPbOrder`;
+ this.handleOpenPost(urlPrint, sBillNoStr);
+ }
+ };
+ handleOpenPost= (url, params) => {
+ const newWin = window.open();
+ let formStr = '';
+ formStr = `';
+ newWin.document.body.innerHTML = formStr;
+ newWin.document.forms[0].submit();
+ return newWin;
+ }
+ handleUploadImgChange = (info) => {
+ const { file } = info;
+ if (file.response && file.response.code === 1) {
+ const { treeSelectedKeys } = this.props;
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const uploadInfo = {
+ sPicturePath,
+ sFileName: file.name,
+ };
+ let { masterData } = this.props;
+ const addState = {};
+ if (file.response && file.response.code === 1) {
+ addState.sTitleLogoPath = uploadInfo.sPicturePath;
+ /* 当前设备状态上传多张图 */
+ if (commonUtils.isNotEmptyArr(treeSelectedKeys) && treeSelectedKeys[0].indexOf('101251240115016043081412740') > -1) {
+ addState.sTitleLogoPath = masterData.sTitleLogoPath;
+ if (commonUtils.isNotEmptyObject(addState.sTitleLogoPath)) {
+ addState.sTitleLogoPath += `,${uploadInfo.sPicturePath}`;
+ } else {
+ addState.sTitleLogoPath = uploadInfo.sPicturePath;
+ }
+ }
+ addState.handleType = 'update';
+ }
+ masterData = { ...masterData, ...addState };
+ this.props.onSaveState({ masterData });
+ } else if (file.response && file.response.code === -1) {
+ message.error(file.response.msg);
+ }
+ };
+
+ /* 通用上传员工图片 */
+ handleUploadPicChange = (info) => {
+ const { file } = info;
+ if (file.response && file.response.code === 1) {
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const spicture = sPicturePath;
+ const uploadInfo = {
+ sPicturePath,
+ sFileName: file.name,
+ };
+ let { masterData } = this.props;
+ const addState = {};
+ if (file.response && file.response.code === 1) {
+ addState.sPicturePath = uploadInfo.sPicturePath;
+ addState.spicture = spicture;
+ addState.handleType = 'update';
+ }
+ masterData = { ...masterData, ...addState };
+ this.props.onSaveState({ masterData });
+ } else if (file.response && file.response.code === -1) {
+ message.error(file.response.msg);
+ }
+ };
+
+ customRequest = (option) =>{
+ const { onSuccess, onError, file, action, data = {} } = option;
+ // 添加额外的参数
+ const formData = new FormData();
+ formData.append('file', file);
+ Object.keys(data).forEach((key) => {
+ formData.append(key, data[key]);
+ });
+
+ fetch(action, {
+ method: 'POST',
+ body: formData,
+ })
+ .then(response => response.json())
+ .then(data => {
+ onSuccess(data, file);
+ })
+ .catch(error => {
+ onError(error);
+ });
+ }
+
+ // 获取img元素
+ getImageDom = (sIcon) => {
+ if (!sIcon) {
+ return false;
+ }
+ const imageUrl = `${commonConfig.file_host}file/download?savePathStr=${sIcon}&sModelsId=100&token=${this.props.token}`;
+ return
;
+ };
+
+ /** 渲染 */
+ render() {
+ const { menuData, searchUpDownData, fileImpositionData = {} } = this.state;
+ const {
+ loading, sModelsId, masterConfig, masterData, visibleGetGoods, visibleFilfile, visibleOtherFilfile, copyFromChooseVisible, app, sTabId, controlSelectedRowKeys, sModelsType, slaveSelectedData, slaveSelectedRowKeys, formRoute, slaveData, visibleInterfaceDialog, interfaceDialogData, visibleApiDialog, getApiDialogData, bTabModal,
+ } = this.props;
+ const { userinfo } = app;
+ const pane = app.panes.filter(paneTmp => paneTmp.key === sTabId)[0];
+ const filfileManageTitle = commonFunc.showMessage(app.commonConst, 'filfileManageTitle');/* 通用文件上传 */
+ const getGoodsTitle = commonFunc.showMessage(app.commonConst, 'getGoodsTitle');/* 获取订单表头 */
+ const getGoodsPlaceholder = commonFunc.showMessage(app.commonConst, 'handleNoWebOrderIds');/* 获取订单输入框字样 */
+ let btnUploadConfig = {};
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnUpload');
+ if (iIndex > -1) {
+ btnUploadConfig = this.props.masterConfig.gdsconfigformslave[iIndex];
+ }
+ }
+
+ /* 第二个上传按钮 */
+ let btnUploadOtherConfig = {};
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ const iOtherIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName && item.sControlName.includes('BtnUploadOther'));
+ if (iOtherIndex > -1) {
+ btnUploadOtherConfig = this.props.masterConfig.gdsconfigformslave[iOtherIndex];
+ }
+ }
+
+ let btnUploadIconConfig = {};
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnUploadicon');
+ if (iIndex > -1) {
+ btnUploadIconConfig = this.props.masterConfig.gdsconfigformslave[iIndex];
+ }
+ }
+ let sSlaveId = '';
+ let selectedsId = ''; /* 列表选中行或窗体sFormId */
+ let selectedRow = {};
+ const bList = ['/indexPage/commonList', '/indexPage/commonClassify'].includes(formRoute);
+ if ((sModelsType === 'manufacture/workOrder' || sModelsType === 'manufacture/workOrder3' || sModelsType === 'quotation/quotation') && commonUtils.isNotEmptyArr(controlSelectedRowKeys)) {
+ sSlaveId = controlSelectedRowKeys[0];/* 控制表选中行ID */
+ } else if (bList) { /* HM订单准印资质列表 sSrcId为列表选中行sId */
+ if (sModelsType === 'HMOrderList') {
+ if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ selectedsId = slaveSelectedRowKeys[0];
+ }
+ } else if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ const iIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ if (iIndex > -1) {
+ selectedRow = slaveData[iIndex];
+ selectedsId = commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyObject(selectedRow) ? (commonUtils.isNotEmptyObject(selectedRow.sFormId) ? selectedRow.sFormId : '') : ''; /* 列表从表的sFormId */
+ sSlaveId = commonUtils.isNotEmptyArr(slaveData) && commonUtils.isNotEmptyObject(selectedRow) ? (commonUtils.isNotEmptyObject(selectedRow.sSlaveId) ? selectedRow.sSlaveId : '') : ''; /* 列表从表的sSlaveId */
+ }
+ }
+ }
+
+ /* 如果配置按钮有sqlConditon条件 则根据SQLCondition条件 否则走正常 */
+ let conditonValues ={ sSrcId: bList ? selectedsId : commonUtils.isNotEmptyObject(masterData) ? masterData.sId : '' };
+ if(commonUtils.isNotEmptyObject(btnUploadConfig) && btnUploadConfig.sSqlCondition) {
+ /* 选中行 */
+ if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ const iIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ if(iIndex > -1) {
+ if(commonUtils.isNotEmptyObject(selectedRow)) {
+ conditonValues = this.props.getSqlCondition(btnUploadConfig,'slave', selectedRow);
+ }
+ }
+ }
+ }
+
+ let conditonOtherValues ={ sSrcId: bList ? selectedsId : commonUtils.isNotEmptyObject(masterData) ? masterData.sId : '' };
+ if(commonUtils.isNotEmptyObject(btnUploadOtherConfig) && btnUploadOtherConfig.sSqlCondition) {
+ /* 选中行 */
+ if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ const iIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ if(iIndex > -1) {
+ if(commonUtils.isNotEmptyObject(selectedRow)) {
+ conditonOtherValues = this.props.getSqlCondition(btnUploadOtherConfig,'slave', selectedRow);
+ }
+ }
+ }
+ }
+
+ const filfilemanageType = {
+ app: {
+ ...this.props.app,
+ currentPane: {
+ name: 'elefilfilemanage',
+ config: btnUploadConfig,
+ conditonValues,
+ title: filfileManageTitle,
+ route: '/elefilfilemanage',
+ formId: btnUploadConfig && btnUploadConfig.sActiveId ? btnUploadConfig.sActiveId : '15864832090002447752315825731600',
+ key: `${sModelsId}15864832090002447752315825731600`,
+ sModelsType: 'element/filfilemanage',
+ sSrcNo: bList ? (commonUtils.isNotEmptyArr(selectedRow) ? selectedRow.sBillNo : '') : (commonUtils.isNotEmptyObject(masterData) ? masterData.sBillNo : ''), /* 源单号 */
+ sSrcFormId: bList ? (commonUtils.isNotEmptyArr(selectedRow) ? sModelsId : '') : (commonUtils.isNotEmptyObject(masterData) ? masterData.sFormId : ''), /* 源单窗体Id */
+ sSrcId: bList ? (commonUtils.isNotEmptyObject(selectedRow) ? selectedRow.sId : '') : commonUtils.isNotEmptyObject(masterData) ? masterData.sId : '', /* 源单Id */
+ sSrcSlaveId: commonUtils.isNotEmptyObject(sSlaveId) ? sSlaveId : '', /* 工单控制表选中行或列表的是sSlaveId */
+ onFilfileOk: this.handleFilfileManageOk,
+ onFilfileCancel: this.handleFilfileManageCancel,
+ refresh: this.handleRefresh,
+ },
+ },
+ config: btnUploadConfig,
+ enabled: true, /*this.props.enabled */
+ dispatch: this.props.dispatch,
+ content: this.props.content,
+ id: new Date().getTime().toString(),
+ };
+
+ /* 第二个上传按钮配置 */
+ const filfilemanageOtherType = {
+ app: {
+ ...this.props.app,
+ currentPane: {
+ name: 'elefilfilemanage',
+ config: btnUploadOtherConfig,
+ conditonValues: conditonOtherValues,
+ title: filfileManageTitle,
+ route: '/elefilfilemanage',
+ formId: btnUploadOtherConfig && btnUploadOtherConfig.sActiveId ? btnUploadOtherConfig.sActiveId : '15864832090002447752315825731600',
+ key: `${sModelsId}15864832090002447752315825731600`,
+ sModelsType: 'element/filfilemanage',
+ sSrcNo: bList ? (commonUtils.isNotEmptyArr(selectedRow) ? selectedRow.sBillNo : '') : (commonUtils.isNotEmptyObject(masterData) ? masterData.sBillNo : ''), /* 源单号 */
+ sSrcFormId: bList ? (commonUtils.isNotEmptyArr(selectedRow) ? sModelsId : '') : (commonUtils.isNotEmptyObject(masterData) ? masterData.sFormId : ''), /* 源单窗体Id */
+ sSrcId: bList ? (commonUtils.isNotEmptyObject(selectedRow) ? selectedRow.sId : '') : commonUtils.isNotEmptyObject(masterData) ? masterData.sId : '', /* 源单Id */
+ sSrcSlaveId: commonUtils.isNotEmptyObject(sSlaveId) ? sSlaveId : '', /* 工单控制表选中行或列表的是sSlaveId */
+ onFilfileOk: this.handleFilfileManageOk,
+ onFilfileCancel: this.handleFilfileManageCancel.bind(this, 'visibleOtherFilfile'),
+ },
+ },
+ config: btnUploadOtherConfig,
+ enabled: true, /*this.props.enabled */
+ dispatch: this.props.dispatch,
+ content: this.props.content,
+ id: new Date().getTime().toString(),
+ };
+
+ /* 通用复制从调用 */
+ let copyFromType = {};
+ let copyFromConfig = {};
+ let copyFromTitle = '自定义复制从窗体';/* 复制从工艺卡查询结果 */
+ if (commonUtils.isNotEmptyObject(this.props.copyFromChooseData)) {
+ const copyFromKey = this.props.copyFromKey;
+ const iIndex = this.props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === copyFromKey);
+ if (iIndex > -1) {
+ copyFromConfig = this.props.masterConfig.gdsconfigformslave[iIndex];
+ copyFromTitle = commonUtils.isNotEmptyObject(copyFromConfig) ? copyFromConfig.sActiveName : copyFromTitle;
+ }
+ copyFromType = {
+ app: {
+ ...this.props.app,
+ currentPane: {
+ name: 'commonCopyFrom',
+ config: copyFromConfig,
+ conditonValues: this.props.getSqlCondition(copyFromConfig),
+ title: this.props.copyFromChooseData.sMenuName,
+ route: this.props.copyFromChooseData.sName,
+ formId: this.props.copyFromChooseData.sId,
+ key: sModelsId + this.props.copyFromChooseData.sId,
+ sModelsType: this.props.copyFromChooseData.sModelType,
+ select: this.props.onCopyFromSelect, /* 自定义复制从窗体时间 */
+ selectCancel: this.handleFilfileManageCancel.bind(this, 'copyFromChooseVisible'),
+ },
+ },
+ dispatch: this.props.dispatch,
+ content: this.props.content,
+ id: new Date().getTime().toString(),
+ };
+ }
+
+ /* 接口对话框弹出推送接口返回数据功能 */
+ let btnDialogConfig = {};
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnSendDialog');
+ if (iIndex > -1) {
+ btnDialogConfig = this.props.masterConfig.gdsconfigformslave[iIndex];
+ }
+ }
+
+ const intefaceDialogType = {
+ app: {
+ ...this.props.app,
+ currentPane: {
+ name: 'interfaceDialog',
+ config: btnDialogConfig,
+ conditonValues,
+ title: filfileManageTitle,
+ route: '/eleintefaceDialog',
+ formId: btnDialogConfig && btnDialogConfig.sActiveId ? btnDialogConfig.sActiveId : '15864832090002447752315825731600',
+ key: `${sModelsId}15864832090002447752315825731600`,
+ sModelsType: 'element/intefaceDialog',
+ select:this.handleSelectDialog,
+ selectCancel:this.handleDialogCancel,
+ },
+ },
+ config: btnDialogConfig,
+ slaveData: interfaceDialogData,
+ enabled: true, /*this.props.enabled */
+ dispatch: this.props.dispatch,
+ content: this.props.content,
+ id: new Date().getTime().toString(),
+ onGetIntefaceDialogData: (slaveFilterCondition = [], callback) => {
+ const tempCondition = {};
+ slaveFilterCondition.forEach(item => {
+ const { bFilterName, bFilterValue } = item;
+ tempCondition[bFilterName] = bFilterValue;
+ });
+ this.tempCondition = tempCondition;
+ this.handleClick({ key: 'BtnSendDialog' });
+ setTimeout(() => {
+ callback && callback();
+ }, 1000);
+ }
+ };
+
+
+ let upPbOrderProps = {};
+ let sBillNo = '';
+ if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
+ sBillNo = slaveSelectedData[0].sBillNo;
+ }
+ const uploadIconProps = {
+ action: `${commonConfig.file_host}file/upload?sModelsId=${sModelsId}&token=${app.token}&sUploadType=model`,
+ onChange: this.handleUploadImgChange,
+ accept: 'image/*',
+ showUploadList: false,
+ listType: 'text',
+ disabled: !this.props.enabled,
+ // beforeUpload: this.handleBeforeUpload,
+ };
+ upPbOrderProps = {
+ action: `${commonConfig.file_host_ebc}file/uploadPbOrder?sModelsId=${sModelsId}&&sOrderNo=${sBillNo}`,
+ onChange: this.handleUploadChange,
+ accept: '.pdf',
+ showUploadList: false,
+ beforeUpload: () => {
+ if (commonUtils.isEmptyObject(sBillNo)) {
+ const noUpload = commonFunc.showMessage(app.commonConst, 'NoUpload');/* 禁止上传 */
+ message.error(noUpload);
+ return false;
+ }
+ },
+ };
+ /* 职工信息上传员工图片 */
+ const uploadPicProps = {
+ action: `${commonConfig.file_host}file/upload?sModelsId=${sModelsId}&token=${app.token}`,
+ onChange: this.handleUploadPicChange,
+ accept: 'image/*',
+ showUploadList: false,
+ disabled: !this.props.enabled,
+ // beforeUpload: this.handleBeforeUpload,
+ };
+
+
+ /* 发票上传 */
+ let invoiceBody ={};
+ if (commonUtils.isNotEmptyArr(slaveSelectedData)) {
+ const slaveRow = slaveSelectedData[0];
+ invoiceBody ={
+ invTaxNum: slaveRow.sBillNo, /* 发票号码 */
+ invType: "8000", /* 增值税发票类型代码 */
+ invSellerName: slaveRow.sSupplyName, /* 发票销方名称 */
+ statusQuery: 0, /* 查询条件 */
+ relaBizNos: { /* 业务单号集合 */
+ // "relaBizNo1": "",
+ // "relaBizNo2": "",
+ // "relaOaNo": "",
+ // "relaVoucherNo": ""
+ },
+ operatorId: userinfo.sUserNo, /* 操作人账号 */
+ operatorName: userinfo.sUserName, /* 操作人名字 */
+ InfoSysSource: "EBC", /* 信息系统来源 */
+ beginDate: slaveRow.tCreateDate, /* 查询起始时间 */
+ endDate: slaveRow.tEndDate, /* 查询结束时间 */
+ // size:3, /* 查询行 */
+ // page:1, /* 查询页 */
+ // invOrder: "desc", /* 排序方式 */
+ companyCode: userinfo.sSubsidiaryId /* 公司代码 */
+ }
+ }
+ const upInvoiceProps = {
+ action: `${commonConfig.server_host}open/api/tax/input/invlock`,
+ onChange: this.handleUploadInvoiceChange,
+ accept: '*/*',
+ customRequest: this.customRequest,
+ // 添加额外的参数
+ data: invoiceBody,
+ showUploadList: false,
+ beforeUpload: () => {
+ },
+ };
+
+ /* 第三方接口拉取数据源 */
+ let btnGetApiDialogConfig = {};
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ const iIndex = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'BtnGetApiDialog');
+ if (iIndex > -1) {
+ btnGetApiDialogConfig = this.props.masterConfig.gdsconfigformslave[iIndex];
+ /* 根据配置条件 */
+ if(bList && commonUtils.isNotEmptyObject(btnGetApiDialogConfig) && btnGetApiDialogConfig.sSqlCondition) {
+ /* 选中行 */
+ if (commonUtils.isNotEmptyArr(slaveSelectedRowKeys)) {
+ const iIndex = slaveData.findIndex(item => slaveSelectedRowKeys.includes(item.sSlaveId));
+ if(iIndex > -1) {
+ if(commonUtils.isNotEmptyObject(selectedRow)) {
+ conditonValues = this.props.getSqlCondition(btnGetApiDialogConfig,'slave', selectedRow);
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ const getApiDialogType = {
+ app: {
+ ...this.props.app,
+ currentPane: {
+ name: 'getApiDialog',
+ config: btnGetApiDialogConfig,
+ conditonValues,
+ title: filfileManageTitle,
+ route: '/eleintefaceDialog',
+ formId: btnGetApiDialogConfig && btnGetApiDialogConfig.sActiveId ? btnGetApiDialogConfig.sActiveId : '15864832090002447752315825731600',
+ key: `${sModelsId}15864832090002447752315825731600`,
+ sModelsType: 'element/getApiDialog',
+ select: this.props.onSelect,
+ selectCancel:this.handleFilfileManageCancel.bind(this, 'visibleApiDialog'),
+ },
+ },
+ config: btnGetApiDialogConfig,
+ // slaveData: getApiDialogData,
+ enabled: true, /*this.props.enabled */
+ dispatch: this.props.dispatch,
+ content: this.props.content,
+ id: new Date().getTime().toString(),
+ // onGetApiDialogData: (slaveFilterCondition = [], callback) => {
+ // const tempCondition = {};
+ // slaveFilterCondition.forEach(item => {
+ // const { bFilterName, bFilterValue } = item;
+ // tempCondition[bFilterName] = bFilterValue;
+ // });
+ // this.tempCondition = tempCondition;
+ // this.handleClick({ key: 'BtnGetApiDialog' });
+ // setTimeout(() => {
+ // callback && callback();
+ // }, 1000);
+ // }
+ };
+
+ let menuDataCopy = JSON.parse(JSON.stringify(menuData));
+ // let btnOutData = menuDataCopy.find(item => item.sName === 'BtnOut');
+ // if (commonUtils.isNotEmptyObject(btnOutData)) {
+ // btnOutData.child = [];
+ // for (let i = -1; i < 100; i++) {
+ // const slaveConfigName = i === -1 ? `slaveConfig` : `slave${i}Config`;
+ // const slaveConfig = this.props[slaveConfigName];
+ // if (slaveConfig && commonUtils.isNotEmptyObject(slaveConfig) && slaveConfig.bGrd) {
+ // const child = {
+ // child: [],
+ // iconName: 'menu-unfold',
+ // sControlName: `BtnOut.slave${i === -1 ? '' : i}`,
+ // sName: `BtnOut.slave${i === -1 ? '' : i}`,
+ // showName: slaveConfig.showName
+ // };
+ // btnOutData.child.push(child);
+ // }
+ // }
+ // if (btnOutData.child.length === 1) {
+ // // 如果只有一张表,还是用原来的配置
+ // menuDataCopy = JSON.parse(JSON.stringify(menuData));
+ // }
+
+ // }
+
+ // 如果复制到的child为空,则隐藏掉复制到按钮
+ let btnCopyToIndex = menuDataCopy.findIndex(item => item.sName === 'BtnCopyTo');
+ if (btnCopyToIndex !== -1) {
+ const btnCopyTo = menuDataCopy[btnCopyToIndex];
+ if (commonUtils.isEmptyArr(btnCopyTo.child)) {
+ menuDataCopy.splice(btnCopyToIndex, 1);
+ }
+ }
+
+ const { tabModalConfig, tabModalRecord } = this.props;
+ const sActiveId = tabModalConfig?.sActiveId;
+ let sActiveKey = tabModalConfig?.sActiveKey;
+ let tabModalTitle = tabModalConfig?.showName ? tabModalConfig.showName : '数据展示';
+ const sFormId = sActiveId === '1' ? commonUtils.isEmpty(tabModalRecord?.sFormId) ? tabModalRecord?.sSrcFormId : tabModalRecord?.sFormId : sActiveId;
+ if (commonUtils.isNotEmptyObject(sActiveKey) && sActiveKey.includes('.')) {
+ const index = sActiveKey.lastIndexOf('.');
+ sActiveKey = sActiveKey.substring(index + 1, sActiveKey.length);
+ }
+
+ const tabModalProps = {
+ app: {
+ ...this.props.app,
+ currentPane: {
+ ...this.props.app.currentPane,
+ formId: sFormId,
+ route: '/indexPage/commonList',
+ name: 'CommonList',
+ sModelsType: 'sales/autoView',
+ selectCancel: this.handleFilfileManageCancel.bind(this, 'bTabModal'),
+ checkedId: tabModalRecord?.[sActiveKey],
+ },
+ },
+ bTabModal: bTabModal,
+ token: this.props.app.token,
+ dispatch: this.props.dispatch,
+ content: this.props.content,
+ id: new Date().getTime().toString(),
+ pageLoading: false,
+ };
+
+
+ return (
+
+
+
+
+
+
+
+
+
+ {commonUtils.isNotEmptyObject(btnUploadConfig) && (pane?.notCurrentPane ? false : visibleFilfile) ?
+
+
+
+ : ''
+ }
+ {commonUtils.isNotEmptyObject(btnUploadOtherConfig) && (pane?.notCurrentPane ? false : visibleOtherFilfile) ?
+
+
+
+ : ''
+ }
+
+ {commonUtils.isNotEmptyObject(btnDialogConfig) && (pane?.notCurrentPane ? false : visibleInterfaceDialog) ?
+
+
+
+ : ''
+ }
+
+ {commonUtils.isNotEmptyObject(btnGetApiDialogConfig) && (pane?.notCurrentPane ? false : visibleApiDialog) ?
+
+
+
+ : ''
+ }
+
+ {pane?.notCurrentPane ? false : copyFromChooseVisible ?
+
+
+ : ''
+ }
+ {
+ visibleGetGoods ?
+
+
+
+ : ''
+ }
+ { bTabModal ?
+
+
+ 查看
+ {/**/}
+
+ : ''}
+ {!commonUtils.isEmpty(this.props.routing) ? '' :
}
+ {!commonUtils.isEmpty(this.props.routing) ? '' :
}
+ {!commonUtils.isEmpty(this.props.routing) ? '' :
}
+
+
+ );
+ }
+}
+
+export default ToolBarComponent;
diff --git a/src/components/Common/ToolBar/index.less b/src/components/Common/ToolBar/index.less
new file mode 100644
index 0000000..75bde6e
--- /dev/null
+++ b/src/components/Common/ToolBar/index.less
@@ -0,0 +1,60 @@
+@import "~@/variable.less";
+.toolBar {
+ margin: 0 10px;
+ background-color: #434343;
+ color: rgb(255,255,255);
+ height: 30px;
+ line-height: 30px;
+ .toolMenu{
+ background: #434343;
+ color: #fff;
+ li{
+ div, span{
+ transition: unset;
+ font-size: 13px!important;
+ }
+ &:after{
+ display: none;
+ }
+ &:hover{
+ color: @active_color;
+ }
+ div[aria-disabled=true]{
+ color: @disable_color!important;
+ svg{
+ fill: @disable_color!important;
+ stroke: @disable_color!important;
+ }
+ }
+ &[aria-disabled=true]{
+ div, span{
+ color: @disable_color!important;
+ }
+ svg{
+ fill: @disable_color!important;
+ stroke: @disable_color!important;
+ }
+ }
+ }
+ }
+ .toolMenu li:hover svg{
+ fill: @active_color!important;
+ stroke: @active_color!important;
+ }
+ .toolMenu li[aria-disabled=true]:hover svg{
+ fill: @disable_color!important;
+ stroke: @disable_color!important;
+ }
+}
+
+.xlyProcess {
+ :global {
+ .ant-message-loading {
+ display: flex;
+ }
+ .ant-progress {
+ width: 200px;
+ padding: 0 10px 0 10px;
+ }
+ }
+}
diff --git a/src/components/Common/Tree/StaticTree.js b/src/components/Common/Tree/StaticTree.js
new file mode 100644
index 0000000..97b9537
--- /dev/null
+++ b/src/components/Common/Tree/StaticTree.js
@@ -0,0 +1,388 @@
+/* eslint-disable */
+/* eslint-disable no-param-reassign */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import file from '@/assets/file.svg';
+import file_single from '@/assets/file_single.svg';
+import process from '@/assets/treeprocess.svg';
+import material from '@/assets/treematerial.svg';
+import '@ant-design/compatible/assets/index.css';
+import { Tree, Button, Input, Checkbox } from 'antd';
+import StaticEditTable from '../CommonTable';/* 可编辑表格 */
+import * as commonUtils from '../../../utils/utils';
+import styles from './Tree.css';
+import AntdDraggableModal from '../AntdDraggableModal';
+
+
+const SearchModule = Input.Search;
+const { TreeNode } = Tree;
+const FormItem = Form.Item;
+
+class TreeComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ name: props.name,
+ treeData: props.treeData || [],
+ sFieldName: 'showName',
+ sKeyName: 'key',
+ autoExpandParent: true,
+ showLine: true,
+ checkable: true,
+ searchValue: '',
+ disabled: false,
+ isSearch: false, // 是否可以t搜索 ,默认不可以进行搜索
+ selectedKeys: props.selectedKeys,
+ allCheckKeys: props.allCheckKeys,
+ checkedKeys: props.checkedKeys,
+ expandedKeys: props.expandedKeys,
+ disabledCheckedKeys: props.disabledCheckedKeys,
+ treeHeight: 0,
+ };
+ this.tableCollapsed = true;
+ }
+
+ componentDidMount() {
+ if (location.pathname === '/indexPage/systemPermission') {
+ if (this.treeRef) {
+ const { isSearch } = this.state;
+ const { height } = this.treeRef.getBoundingClientRect();
+ this.setState({ treeHeight: height - (isSearch ? 75 : 0) });
+ }
+ }
+ }
+
+ componentWillMount() {
+ this.assignmentWillProps(this.props);
+ }
+
+ componentWillReceiveProps(nextProps) {
+ this.assignmentWillProps(nextProps);
+ }
+
+ shouldComponentUpdate(nextProps, nextState) {
+ const {
+ name, selectedKeys, checkedKeys, sFieldName, sKeyName, treeData, expandedKeys, disabled, disabledCheckedKeys, searchVisible, searchValue, searchData,
+ } = this.props;
+
+ const bUpdate = disabled !== nextState.disabled || name !== nextState.name || sFieldName !== nextState.sFieldName || sKeyName !== nextState.sKeyName ||
+ JSON.stringify(disabledCheckedKeys) !== JSON.stringify(nextState.disabledCheckedKeys) ||
+ (commonUtils.isNotEmptyObject(searchValue) ? searchValue : '') !== (commonUtils.isNotEmptyObject(nextState.searchValue) ? nextState.searchValue : '') ||
+ searchVisible !== nextState.searchVisible ||
+ JSON.stringify(treeData) !== JSON.stringify(nextState.treeData) ||
+ JSON.stringify(checkedKeys) !== JSON.stringify(nextState.checkedKeys) ||
+ JSON.stringify(expandedKeys) !== JSON.stringify(nextState.expandedKeys) ||
+ JSON.stringify(selectedKeys) !== JSON.stringify(nextState.selectedKeys) ||
+ JSON.stringify(searchData) !== JSON.stringify(nextState.searchData);
+ return bUpdate;
+ }
+
+ onExpand = (expandedKeys) => {
+ this.setState({
+ expandedKeys,
+ autoExpandParent: false,
+ });
+ if (this.props.onExpandTree) {
+ this.props.onExpandTree(expandedKeys.map(item => item.split('-')[0]), expandedKeys);
+ this.props.onSaveState({
+ expandedKeys
+ })
+ }
+ };
+
+ onSelect = (selectedKeys, e) => {
+ if (this.props.onSelect !== undefined) {
+ this.props.onSelect(this.props.name, selectedKeys, e);
+ }
+ }
+
+ /** 获取tree 对象的props */
+ getTreeProps = () => {
+ const {
+ checkable, disabled, checkedKeys, isSearch, showLine, selectedKeys, disabledCheckedKeys, expandedKeys, autoExpandParent, draggable, treeHeight,
+ } = this.state;
+ return {
+ autoExpandParent,
+ checkable,
+ disabled,
+ showLine,
+ className: 'hide-file-icon',
+ checkedKeys,
+ selectedKeys,
+ isSearch,
+ disabledCheckedKeys,
+ expandedKeys,
+ draggable,
+ onCheck: this.checkBoxCheck,
+ onExpand: this.onExpand,
+ onSelect: this.onSelect,
+ onDrop: this.props.onDrop,
+ multiple: this.props.multiple,
+ // switcherIcon:
,
+ showIcon: true,
+ height: treeHeight,
+ };
+ };
+
+ /** 获取tree 对象的props */
+ getTableProps = (name, props) => {
+ const returnTypes = {
+ name,
+ app: props.app,
+ formId: props.sModelsId,
+ getSqlDropDownData: props.getSqlDropDownData,
+ getSqlCondition: props.getSqlCondition,
+ handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord,
+ getFloatNum: props.getFloatNum,
+ getDateFormat: props.getDateFormat,
+ onDataChange: props.onDataChange,
+ onUploadChange: props.onUploadChange,
+ onModalCancel: props.onModalCancel,
+ onLookRow: props.onDataRowLook,
+ onAddRow: props.onDataRowAdd,
+ onDelRow: props.onDataRowDel,
+ onSelectRowChange: this.handleSelectRowChange,
+ onDoubleClick: this.handleDoubleClick,
+ selectedRowKeys: this.state.selectedRowKeys,
+ headerColumn: props[`${name}Column`],
+ config: props[`${name}Config`],
+ data: props[`${name}Data`],
+ enabled: false,
+ rowSelectionType: 'radio', // 表格选择是单选还是多选择
+ tableProps: {
+ rowSelection: null,
+ rowKey: props.sFieldName,
+ AutoTableHeight: 450,
+ }, // 表格属性
+ previewImage: props.previewImage, /* 预览图片地址 */
+ previewVisible: props.previewVisible, /* 图片预览弹窗 */
+ };
+ return returnTypes;
+ };
+
+ /** 处理选择行发生改变 */
+ handleSelectRowChange = (name, selectedRowKeys) => {
+ /* 外置处理业务 */
+ this.setState({ selectedRowKeys });
+ };
+
+ assignmentWillProps = (props) => {
+ const addState = {
+ name: props.name,
+ checkable: props.checkable,
+ disabled: props.disabled,
+ checkedKeys: props.checkedKeys,
+ selectedKeys: props.selectedKeys,
+ treeData: props.treeData,
+ allCheckKeys: props.allCheckKeys,
+ sFieldName: props.sFieldName,
+ sKeyName: props.sKeyName,
+ showLine: props.showLine,
+ isSearch: props.isSearch,
+ searchData: props.searchData,
+ draggable: props.draggable,
+ };
+ if (props.expandedKeys !== undefined) {
+ addState.expandedKeys = props.expandedKeys;
+ }
+ this.setState({ ...addState });
+ };
+
+ handleButtonClick = (e, child) => {
+ const { allCheckKeys } = this.state;
+ const stateValue = {};
+ if (child === 'expandAll') {
+ stateValue.expandedKeys = allCheckKeys;
+ } else if (child === 'unExpand') {
+ stateValue.expandedKeys = [];
+ } else if (child === 'checkedAll') {
+ stateValue.checkedKeys = allCheckKeys;
+ } else if (child === 'unChecked') {
+ stateValue.checkedKeys = [];
+ }
+ this.props.onSetTreeOptionKeys('Checked', stateValue.checkedKeys);
+ this.setState(stateValue);
+ }
+
+ handleExpandClick = (e, child) => {
+ const { allCheckKeys } = this.state;
+ const stateValue = {};
+ if (child === 'expandAll') {
+ this.tableCollapsed = false;
+ this.expRef.classList.remove('ant-table-row-expand-icon-collapsed');
+ stateValue.expandedKeys = allCheckKeys;
+ } else if (child === 'unExpand') {
+ this.tableCollapsed = true;
+ this.expRef.classList.add('ant-table-row-expand-icon-collapsed');
+ stateValue.expandedKeys = [];
+ }
+ this.setState(stateValue);
+ }
+
+ checkBoxCheck = (checked, e) => {
+ this.props.onCheck(checked, e);
+ }
+
+ handleSearch = (value) => {
+ if (value !== '') {
+ this.props.onSearch(value);
+ this.setState({
+ searchVisible: true,
+ });
+ }
+ }
+
+ handleChange = (event) => {
+ this.setState({
+ searchValue: event.target.value,
+ });
+ }
+
+ hideModal = () => {
+ this.setState({
+ searchVisible: false,
+ });
+ }
+
+ handleDoubleClick = (record) => {
+ if (!commonUtils.isEmpty(record.sAllId)) {
+ const expandedKeys = [];
+ let expandedKey = '';
+ const selectedKeys = [];
+ record.sAllId.split('-').forEach((item) => {
+ if (!commonUtils.isEmpty(item)) {
+ expandedKey += `-${item}`;
+ expandedKeys.push(expandedKey);
+ }
+ });
+ if (commonUtils.isNotEmptyArr(this.state.expandedKeys)) {
+ this.state.expandedKeys.forEach((item) => {
+ expandedKeys.push(item);
+ });
+ }
+ const e = { node: { props: { treeNode: record } } };
+ this.props.onSelect(this.props.name, [record.sAllId], e);
+ selectedKeys.push(record.sAllId);
+ this.setState({ expandedKeys, searchVisible: false, selectedKeys });
+ }
+ };
+
+ treeNodesProps = (item) => {
+ const { checkedKeys, disabledCheckedKeys } = this.props;
+ const showType = {};
+ for (const ckey of checkedKeys) {
+ if (ckey === item.key) {
+ showType.checked = true;
+ break;
+ }
+ }
+ for (const dkey of disabledCheckedKeys) {
+ if (dkey === item.key) {
+ showType.disabled = true;
+ break;
+ }
+ }
+ return showType;
+ };
+
+ renderTreeNodesType = (item) => {
+ const { checkedKeys, disabledCheckedKeys } = this.props;
+ const iIndex = checkedKeys.findIndex(itemCheck => itemCheck === item.key);
+ if (iIndex > -1) {
+ checkedKeys[iIndex].checked = true;
+ }
+
+ const subscript = disabledCheckedKeys.findIndex(itemCheck => itemCheck === item.key);
+ if (subscript > -1) {
+ disabledCheckedKeys[subscript].checked = true;
+ }
+ }
+
+ renderTreeNodes = (data) => {
+ const { sFieldName, sKeyName } = this.props;
+ return data.map((item) => {
+ if (item.children && item.children.length > 0) {
+ return (
+
+ {this.renderTreeNodes(item.children)}
+
+ );
+ }
+ return ( :(item.sIconType === '13' || item.sIconType === '03' ?
:
) }
+ />);
+ });
+ };
+ render() {
+ const treeProps = this.getTreeProps();
+ return (
+
+
+
{ this.treeRef = ref; }}>
+ {this.props.isSearch ?
+
: ''}
+ {/*
*/}
+ {/* {!this.props.checkedAll ? '' : this.handleButtonClick(e, 'checkedAll')}>全选}*/}
+ {/* {!this.props.unChecked ? '' : this.handleButtonClick(e, 'unChecked')}>全部不选}*/}
+ {/*
*/}
+ {
+ this.props.isSearch ?
+
+
this.handleButtonClick(e,e.target.checked ? 'checkedAll' : 'unChecked')} /> 权限内容
+
+ {
+ this.expRef = ref
+ }}
+ onClick={e => this.handleExpandClick(e, this.tableCollapsed ? 'expandAll' : 'unExpand')}
+ >
+
+
: ''
+
+ }
+
+ {this.renderTreeNodes(this.props.treeData)}
+
+
+ {/*
*/}
+ {/* {!this.props.checkedAll ? '' : this.handleButtonClick(e, 'checkedAll')}>全选}*/}
+ {/* {!this.props.unChecked ? '' : this.handleButtonClick(e, 'unChecked')}>全部不选}*/}
+ {/*
*/}
+ {
+ this.state.searchVisible ?
+
+
+
+ : ''
+ }
+
+
+ );
+ }
+}
+
+export default TreeComponent;
diff --git a/src/components/Common/Tree/Tree.css b/src/components/Common/Tree/Tree.css
new file mode 100644
index 0000000..9cbd962
--- /dev/null
+++ b/src/components/Common/Tree/Tree.css
@@ -0,0 +1,50 @@
+.tree {
+ background: #fff;
+ border: 1px solid #e9e9e9;
+ margin-right: 15px;
+ width: 200px;
+ min-height: 315px;
+}
+
+.treeNode {
+ background: #f7f7f7;
+ transition: background .3s ease;
+ padding: 4px 0!important;
+ margin-bottom: 3px!important;
+}
+
+.treeNode:before {
+ width: 0!important;
+ border-left: 0!important;
+}
+
+.treeNode ul {
+ background: #fbfbfb;
+}
+
+.treeNode ul .treeNode {
+ background: #fbfbfb;
+}
+.advCol{
+ padding-left: 10px;
+}
+.advCol button{margin-left: 10px}
+.advColTitle{
+ background-color: #f0f0f0;
+ width: 100%;
+ height: 30px;
+ line-height: 30px;
+ display: flex;
+}
+.advColExpand{
+ margin-top: 11px;
+ padding-left: 15px;
+ font-size: 12px;
+ font-weight: 600;
+}
+.advColCt{
+ margin-top: 4px;
+ padding-left: 21px;
+ font-size: 12px;
+ font-weight: 600;
+}
diff --git a/src/components/Common/WorkOrderSystem/WorkOrderSystemAdd.js b/src/components/Common/WorkOrderSystem/WorkOrderSystemAdd.js
new file mode 100644
index 0000000..02abf0d
--- /dev/null
+++ b/src/components/Common/WorkOrderSystem/WorkOrderSystemAdd.js
@@ -0,0 +1,499 @@
+/* eslint-disable */
+import React, { useEffect, useState, useReducer } from "react";
+import {
+ Button,
+ Form,
+ Input,
+ Space,
+ Upload,
+ Select,
+ Switch,
+ message,
+ DatePicker,
+ Spin
+} from "antd";
+import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
+import BraftEditor from "braft-editor";
+import "braft-editor/dist/index.css";
+import styles from "./index.less";
+import * as commonServices from "@/services/services";
+import commonConfig from "@/utils/config";
+import * as commonUtils from "@/utils/utils";
+import moment from "moment";
+import WorkOrderSystemService from "./WorkOrderSystemService";
+
+let _dispatch, _props;
+const reducer = (state, action) => {
+ const [type, payload] = action;
+ switch (type) {
+ case "set":
+ return {
+ ...state,
+ ...payload
+ };
+ default:
+ return {
+ ...state,
+ ...payload
+ };
+ }
+};
+
+// 主入口
+const WorkOrderSystemAdd = props => {
+ const [state, dispatch] = useReducer(reducer, {
+ sType: 4,
+ bBug: false,
+ bVsersion: false
+ });
+ const { customerData, moduleData, userData, loading = false } = state;
+ const [form] = Form.useForm();
+ const [formState] = useState(state); // 表单数据
+ const [files, setFiles] = useState([]); // 附件数据
+ const [customerOption, setCustomerOption] = useState([]); // 【所属客户】下拉选项
+ const [moduleOption, setModuleOption] = useState([]); // 【所属模块】下拉选项
+ const [userOption, setUserOption] = useState([]); // 【处理人、抄送人】下拉选项
+ const priorityOption = [
+ {
+ label: "严重",
+ value: 1
+ },
+ {
+ label: "紧急",
+ value: 2
+ },
+ {
+ label: "一般",
+ value: 3
+ },
+ {
+ label: "优化",
+ value: 4
+ }
+ ];
+
+ // 初始化加载数据
+ useEffect(() => {
+ _dispatch = dispatch;
+ _props = props;
+ handleGetsCustomerData();
+ handleGetsModuleData();
+ handleGetUserData();
+ }, []);
+
+ // 设置【所属客户】下拉值
+ useEffect(
+ () => {
+ commonUtils.isNotEmptyArr(customerData) &&
+ setCustomerOption(
+ customerData.map(item => ({
+ label: item.sCustomerName,
+ value: item.sCustomerId || item.sId
+ }))
+ );
+ },
+ [customerData]
+ );
+
+ // 设置【处理人、抄送人】下拉值
+ useEffect(
+ () => {
+ commonUtils.isNotEmptyArr(userData) &&
+ setUserOption(
+ userData.map(item => ({
+ label: item.sHanldeName,
+ value: item.sHanldeId
+ }))
+ );
+ },
+ [userData]
+ );
+
+ // 设置【所属模块】下拉值
+ useEffect(
+ () => {
+ commonUtils.isNotEmptyArr(moduleData) &&
+ setModuleOption(
+ moduleData.map(item => ({
+ label: item.sModuleName,
+ value: item.sModuleId
+ }))
+ );
+ },
+ [moduleData]
+ );
+
+ // 提交
+ const onFinish = values => {
+ const { app } = props;
+ const { userinfo, currentPane } = app;
+ const { companyName, sUserName: sMakePerson, sId: sLoginId } = userinfo;
+ // const { title: sModuleName, formId: sModuleId } = currentPane;
+ const commonData = {
+ sCustomerName: companyName,
+ sBrandName: companyName,
+ sMakePerson,
+ sLoginId
+ // sModuleName,
+ // sModuleId
+ };
+
+ let addState = {};
+ if (values.sCopyHanldeId) {
+ addState.sCopyHanldeId = values.sCopyHanldeId.toString();
+ addState.sCopyHanldeName = userData
+ .filter(item => values.sCopyHanldeId.includes(item.sHanldeId))
+ .map(item => item.sHanldeName)
+ .toString();
+ }
+
+ if (values.sModuleId) {
+ const iIndex = moduleData.findIndex(
+ item => item.sModuleId === values.sModuleId
+ );
+ if (iIndex !== -1) {
+ // 下拉选中的数据
+ addState = { ...addState, ...moduleData[iIndex] };
+ } else {
+ // 手输的数据
+ addState = {
+ ...addState,
+ sModuleName: values.sModuleId,
+ sModuleId: commonUtils.createSid()
+ };
+ }
+ }
+
+ if (values.tDevHandleDate) {
+ addState.tDevHandleDate = moment(values.tDevHandleDate).format(
+ "YYYY-MM-DD"
+ );
+ }
+
+ if (values.tHandleDate) {
+ addState.tHandleDate = moment(values.tHandleDate).format("YYYY-MM-DD");
+ }
+
+ const submitData = {
+ ...commonData,
+ ...values,
+ ...customerData.find(
+ item => (item.sCustomerId || item.sId) === values.sCustomerId
+ ),
+ // ...moduleData.find(item => item.sModuleId === values.sModuleId),
+ ...userData.find(item => item.sHanldeId === values.sHanldeId),
+ ...addState,
+ sContentMemo: values.sContentMemo.toHTML(),
+ fileData: []
+ };
+
+ dispatch(["set", { loading: true }]);
+
+ // 如果有附件,先上传附件再提交保存
+ if (files.length) {
+ handleUpload(files, fileData => {
+ handleSubmit({ ...submitData, fileData });
+ });
+ } else {
+ handleSubmit(submitData);
+ }
+ };
+
+ // 附件props
+ const uploadProps = {
+ accept: "*/*",
+ multiple: true,
+ beforeUpload: file => {
+ files.push(file);
+ setFiles(files);
+ return false;
+ },
+ onRemove: file => {
+ const filesNew = files.filter(item => item.uid !== file.uid);
+ setFiles(filesNew);
+ }
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ const tHandleDate = form.getFieldValue().tHandleDate;
+ if (
+ chooseDate &&
+ tHandleDate &&
+ chooseDate.isAfter(tHandleDate)
+ ) {
+ return Promise.reject(
+ new Error("【开发截止日期】不能晚于【截止日期】")
+ );
+ } else {
+ return Promise.resolve();
+ }
+ }
+ }
+ ]}
+ >
+
+
+ {
+ const tDevHandleDate = form.getFieldValue().tDevHandleDate;
+ if (
+ chooseDate &&
+ tDevHandleDate &&
+ chooseDate.isBefore(tDevHandleDate)
+ ) {
+ return Promise.reject(
+ new Error("【截止日期】不能早于【开发截止日期】")
+ );
+ } else {
+ return Promise.resolve();
+ }
+ }
+ }
+ ]}
+ >
+
+
+ {
+ if (sContentMemo.toHTML() === "") {
+ return Promise.reject(new Error("请输入内容"));
+ } else {
+ return Promise.resolve();
+ }
+ }
+ }
+ ]}
+ >
+
+
+
+
+ 添加附件
+
+
+
+
+
+ }
+ onClick={() => {
+ props.onSaveState({ workOrderSystemAddModalVisible: false });
+ }}
+ >
+ 取消
+
+
+ }>
+ 提交
+
+
+
+
+
+ );
+};
+
+// 【接口】获取所属客户
+const handleGetsCustomerData = () => {
+ const url = `${commonConfig.feedback_host}sysworkorder/getCustomerData`;
+ commonServices.postValueService("", {}, url).then(({ data: result = {} }) => {
+ const { code = -1, data, msg = "接口出错" } = result;
+ if (code > -1) {
+ _dispatch && _dispatch(["set", { customerData: data }]);
+ } else {
+ message.error(msg);
+ }
+ });
+};
+
+// 【接口】获取所属模块
+const handleGetsModuleData = () => {
+ const url = `${commonConfig.feedback_host}sysworkorder/getModuleData`;
+ commonServices.postValueService("", {}, url).then(({ data: result = {} }) => {
+ const { code = -1, data, msg = "接口出错" } = result;
+ if (code > -1) {
+ _dispatch && _dispatch(["set", { moduleData: data }]);
+ } else {
+ message.error(msg);
+ }
+ });
+};
+
+// 【接口】获取人员
+const handleGetUserData = () => {
+ const url = `${commonConfig.feedback_host}sysworkorder/getUserData`;
+ commonServices.postValueService("", {}, url).then(({ data: result = {} }) => {
+ const { code = -1, data, msg = "接口出错" } = result;
+ if (code > -1) {
+ _dispatch && _dispatch(["set", { userData: data }]);
+ } else {
+ message.error(msg);
+ }
+ });
+};
+
+// 【接口】上传附件
+const handleUpload = (files, cb) => {
+ if (files.length === 0) {
+ cb("[]");
+ return;
+ }
+ let formData = new FormData();
+ for (let item of files) {
+ formData.append("file", item);
+ }
+ const url = `${commonConfig.feedback_host}file/uploadMulti`;
+ fetch(url, {
+ method: "POST",
+ body: formData
+ })
+ .then(res => res.json())
+ .then(result => {
+ const { code = -1, dataset, msg = "接口出错" } = result;
+ if (code > -1) {
+ const { rows } = dataset;
+ const savePathStr = rows[0].savePathStr;
+ const fileData = savePathStr.split(",").map(item => ({
+ sPicturePath: item,
+ sPictureName: item.substring(item.indexOf("_") + 1)
+ }));
+ if (cb) {
+ cb(JSON.stringify(fileData));
+ }
+ } else {
+ message.error(msg);
+ }
+ });
+};
+
+// 【接口】提交数据
+const handleSubmit = submitData => {
+ const url = `${commonConfig.feedback_host}sysworkorder/add`;
+ commonServices
+ .postValueService("", submitData, url)
+ .then(({ data: result = {} }) => {
+ _dispatch(["set", { loading: false }]);
+ const { code = -1, msg = "接口出错" } = result;
+ if (code > -1) {
+ message.success(msg);
+ _props &&
+ _props.onAddWorkOrderSuccess &&
+ _props.onAddWorkOrderSuccess();
+ } else {
+ message.error(msg);
+ }
+ });
+};
+
+export default WorkOrderSystemAdd;
diff --git a/src/components/Common/WorkOrderSystem/WorkOrderSystemConfig/index.js b/src/components/Common/WorkOrderSystem/WorkOrderSystemConfig/index.js
new file mode 100644
index 0000000..361b3c2
--- /dev/null
+++ b/src/components/Common/WorkOrderSystem/WorkOrderSystemConfig/index.js
@@ -0,0 +1,25 @@
+/* eslint-disable */
+
+// 优先级下拉数据
+const priorityOption = [
+ {
+ label: "严重",
+ value: 1
+ },
+ {
+ label: "紧急",
+ value: 2
+ },
+ {
+ label: "一般",
+ value: 3
+ },
+ {
+ label: "优化",
+ value: 4
+ }
+];
+
+export default {
+ priorityOption
+};
diff --git a/src/components/Common/WorkOrderSystem/WorkOrderSystemDetail.js b/src/components/Common/WorkOrderSystem/WorkOrderSystemDetail.js
new file mode 100644
index 0000000..dbf73a9
--- /dev/null
+++ b/src/components/Common/WorkOrderSystem/WorkOrderSystemDetail.js
@@ -0,0 +1,1117 @@
+/* eslint-disable */
+import React, { useEffect, useState, useRef } from "react";
+import {
+ Button,
+ Form,
+ Space,
+ Upload,
+ Select,
+ Switch,
+ message,
+ DatePicker,
+ Modal,
+ Spin,
+ Input,
+ Image
+} from "antd";
+import {
+ CheckOutlined,
+ CloseCircleOutlined,
+ EditOutlined,
+ SendOutlined,
+ SaveOutlined,
+ MinusOutlined
+} from "@ant-design/icons";
+import BackIcon from "@/assets/back.svg";
+import CopyAllIcon from "@/assets/copyallWhite.svg";
+import moment from "moment";
+import BraftEditor from "braft-editor";
+import "braft-editor/dist/index.css";
+import gStyles from "@/index.less";
+import styles from "./index.less";
+import commonConfig from "@/utils/config";
+import * as commonUtils from "@/utils/utils";
+import AntdDraggableModal from "@/components/Common/AntdDraggableModal";
+import WorkOrderSystemService from "./WorkOrderSystemService";
+import WorkOrderSystemConfig from "./WorkOrderSystemConfig";
+
+// 主入口
+const WorkOrderSystemDetail = props => {
+ const [loading, setLoading] = useState(false);
+ // 详情弹窗id
+ const { current: detailModalId } = useRef(
+ "detailModalId_" +
+ Math.random()
+ .toString(36)
+ .substring(2)
+ );
+
+ // 最小化状态
+ const [bMin, setBMin] = useState(false);
+ window.setBMin = setBMin;
+ // 强制更新视图
+ const [updater, setUpdater] = useState(0);
+ const forceUpdate = () => {
+ setUpdater(updater + 1);
+ };
+ // 刷新页面
+ const [refresher, setRefresher] = useState(0);
+ const refresh = () => {
+ setRefresher(refresher + 1);
+ };
+ const [form] = Form.useForm();
+ const [formEnabled, setFormEnabled] = useState(false);
+ const { sId, app, refreshSlaveTable, gdsjurisdiction } = props;
+ const { userinfo } = app;
+ const { sUserName: sMakePerson } = userinfo;
+ const [detailData, setDetailData] = useState({});
+ const {
+ sTitle,
+ fileData = [],
+ replyData = [],
+ sContentMemo,
+ sCustomerId,
+ sCustomerName,
+ sModuleId,
+ sModuleName,
+ sHanldeId,
+ sCopyHanldeId,
+ bVsersion,
+ bBug,
+ sType,
+ tDevHandleDate,
+ tHandleDate,
+ sStatus
+ } = detailData;
+
+ const [customerOption, setCustomerOption] = useState([]); // 【所属客户】下拉选项
+ const [moduleOption, setModuleOption] = useState([]); // 【所属模块】下拉选项
+ const [userOption, setUserOption] = useState([]); // 【处理人、抄送人】下拉选项
+ const { priorityOption } = WorkOrderSystemConfig; // 【优先级】下拉选项
+ const [replyModalVisible, setReplyModalVisible] = useState(false); // 回复弹窗状态
+ const [assignmentModalVisible, setAssignmentModalVisible] = useState(false); // 指派弹窗状态
+ const [resolutionModalVisible, setResolutionModalVisible] = useState(false); // 解决弹窗状态
+ const enabled = !["已关闭"].includes(sStatus); // 是否可操作
+
+ // 富文本看点击图片事件
+ const [imageVisible, setImageVisible] = useState(false);
+ const [imageSrc, setImageSrc] = useState(null);
+ useEffect(() => {
+ const showImage = e => {
+ if (e.target && e.target.nodeName === "IMG") {
+ const { src } = e.target;
+ if (src) {
+ setImageSrc(src);
+ setImageVisible(true);
+ }
+ }
+ };
+
+ document.addEventListener("dblclick", showImage);
+ return () => {
+ document.removeEventListener("dblclick", showImage);
+ };
+ }, []);
+
+ // 显示的按钮
+ const [btnShowData, setBtnShowData] = useState([]);
+ // 过滤掉没有权限的按钮
+ useEffect(
+ () => {
+ if (!enabled) {
+ setBtnShowData([]);
+ return;
+ }
+ const defaultBtnData = [
+ "BtnReplyd",
+ "BtnEdit",
+ "BtnAssign",
+ "BtnSolve",
+ "BtnClose"
+ ];
+ if (gdsjurisdiction) {
+ gdsjurisdiction.forEach(child => {
+ const index = defaultBtnData.findIndex(
+ item => item === child.sAction
+ );
+ if (index > -1) {
+ defaultBtnData.splice(index, 1);
+ }
+ });
+ }
+ setBtnShowData(defaultBtnData);
+ },
+ [gdsjurisdiction, enabled]
+ );
+
+ // 指派/解决
+ const addReplyHanle = async values => {
+ const response = await WorkOrderSystemService.addReplyHanle({
+ ...values,
+ sId,
+ sMakePerson
+ });
+ setLoading(false);
+ if (commonUtils.isNotEmptyObject(response)) {
+ refreshSlaveTable();
+ props.onSaveState({
+ workOrderSystemDetailModalVisible: false
+ });
+ }
+ };
+
+ // 初始化加载数据
+ useEffect(
+ async () => {
+ setDetailData(await WorkOrderSystemService.getDetailData({ sId }));
+ setCustomerOption(
+ (await WorkOrderSystemService.getsCustomerData()).map(item => ({
+ label: item.sCustomerName,
+ value: item.sCustomerId || item.sId,
+ item
+ }))
+ );
+ setModuleOption(
+ (await WorkOrderSystemService.getsModuleData()).map(item => ({
+ label: item.sModuleName,
+ value: item.sModuleId,
+ item
+ }))
+ );
+ setUserOption(
+ (await WorkOrderSystemService.getUserData()).map(item => ({
+ label: item.sHanldeName,
+ value: item.sHanldeId,
+ item
+ }))
+ );
+ },
+ [refresher]
+ );
+
+ // detailData变化时,给表单赋值
+ useEffect(
+ () => {
+ if (
+ commonUtils.isNotEmptyArr(detailData) &&
+ commonUtils.isNotEmptyArr(customerOption) &&
+ commonUtils.isNotEmptyArr(moduleOption)
+ ) {
+ const temp = {};
+ replyData.forEach((item, index) => {
+ const {
+ tCreateDate,
+ sMakePerson: sMakePersonTemp,
+ sResult,
+ sContentMemo: sContentMemoTemp,
+ sAssignedBy
+ } = item;
+ temp[`reply${index}`] = (
+
+ {index + 1}.{tCreateDate} 由{" "}
+ {sMakePersonTemp} {sResult.replace("已", "")}
+ {sAssignedBy ? (
+ <>
+ 给
+ {sAssignedBy}
+ >
+ ) : (
+ ""
+ )}
+
+ );
+ if (sContentMemoTemp) {
+ temp[`replyContentMemo${index}`] = BraftEditor.createEditorState(
+ sContentMemoTemp
+ );
+ }
+ });
+
+ const addState = {};
+ if (sCustomerId) {
+ if (customerOption.find(item => item.value === sCustomerId)) {
+ addState.sCustomerId = sCustomerId;
+ } else {
+ setCustomerOption(prevState => [
+ ...prevState,
+ {
+ value: sCustomerId,
+ label: sCustomerName,
+ item: {
+ sCustomerId,
+ sCustomerName
+ }
+ }
+ ]);
+ }
+ }
+
+ if (sModuleId) {
+ if (moduleOption.find(item => item.value === sModuleId)) {
+ addState.sModuleId = sModuleId;
+ } else {
+ setModuleOption(prevState => [
+ ...prevState,
+ {
+ value: sModuleId,
+ label: sModuleName,
+ item: {
+ sModuleId,
+ sModuleName
+ }
+ }
+ ]);
+ }
+ }
+
+ form.setFieldsValue({
+ sTitle,
+ sContentMemo: BraftEditor.createEditorState(sContentMemo),
+ ...addState,
+ sHanldeId,
+ sCopyHanldeId: sCopyHanldeId ? sCopyHanldeId.split(",") : [],
+ bVsersion,
+ bBug,
+ sType: sType !== undefined ? parseInt(sType) : "",
+ tDevHandleDate: tDevHandleDate ? moment(tDevHandleDate) : "",
+ tHandleDate: tHandleDate ? moment(tHandleDate) : "",
+ ...temp
+ });
+ forceUpdate();
+ }
+ },
+ [detailData, customerOption, moduleOption]
+ );
+
+ const [fileList, setFileList] = useState([]); // 附件列表
+ const [fileAdd, setFileAdd] = useState([]); // 新增附件
+
+ // fileData变化时,给附件列表赋值
+ useEffect(
+ () => {
+ setFileList(
+ [...fileData].map(item => {
+ const { sId: uid, sPictureName: name, sPicturePath } = item;
+ return {
+ uid,
+ name,
+ url: `${
+ commonConfig.feedback_host
+ }file/download?savePathStr=${sPicturePath}&sModelsId=100`,
+ status: "done",
+ item
+ };
+ })
+ );
+ },
+ [fileData]
+ );
+
+ // fileAdd变化时,调用新增附件接口
+ useEffect(
+ async () => {
+ if (fileAdd.length) {
+ setFileAdd([]);
+ const _fileData = await WorkOrderSystemService.uploadAdd(fileAdd, {
+ sId,
+ sMakePerson
+ });
+ setFileList([
+ ...fileList,
+ ..._fileData.map(item => {
+ const { sId: uid, sPictureName: name, sPicturePath } = item;
+ return {
+ uid,
+ name,
+ url: `${
+ commonConfig.feedback_host
+ }file/download?savePathStr=${sPicturePath}&sModelsId=100`,
+ status: "done",
+ item
+ };
+ })
+ ]);
+ }
+ },
+ [fileAdd]
+ );
+
+ // 附件props
+ const uploadProps = {
+ accept: "*/*",
+ multiple: true,
+ fileList,
+ disabled: !btnShowData.includes("BtnEdit"),
+ beforeUpload: file => {
+ setFileAdd(prevState => [...prevState, file]);
+ return false;
+ },
+ onRemove: file => {
+ Modal.confirm({
+ title: "确认删除",
+ onOk() {
+ WorkOrderSystemService.deleteFile(file.item, sId, () => {
+ setFileList(fileList.filter(item => item.uid !== file.uid));
+ message.success("附件删除成功");
+ });
+ }
+ });
+ }
+ };
+
+ // 回复props
+ const replyProps = {
+ ...props,
+ replyModalVisible,
+ detailData,
+ detailModalId,
+ setReplyModalVisible,
+ refresh,
+ bMin,
+ setBMin
+ };
+
+ // 指派props
+ const assignmentProps = {
+ ...props,
+ bMin,
+ setBMin,
+ userOption,
+ visible: assignmentModalVisible,
+ setVisible: setAssignmentModalVisible,
+ detailData,
+ onFinish: values => {
+ setLoading(true);
+ setAssignmentModalVisible(false);
+ const { value, label } = userOption.find(
+ item => item.value === values.sHanldeId
+ );
+
+ const copyDataAdd = {};
+ const copyData = userOption.filter(item =>
+ values.sCopyHanldeId.includes(item.value)
+ );
+
+ if (commonUtils.isNotEmptyArr(copyData)) {
+ copyDataAdd.sCopyFor = copyData.map(item => item.label).toString();
+ copyDataAdd.sCopyForId = copyData.map(item => item.value).toString();
+ }
+
+ addReplyHanle({
+ sAssignedBy: label,
+ sAssignedById: value,
+ ...copyDataAdd,
+ sContentMemo: values.sContentMemo
+ ? values.sContentMemo.toHTML()
+ : "",
+ sResult: "已指派"
+ });
+ }
+ };
+
+ // 解决props
+ const resolutionModalProps = {
+ ...props,
+ bResolution: true,
+ userOption,
+ visible: resolutionModalVisible,
+ setVisible: setResolutionModalVisible,
+ detailData,
+ bMin,
+ setBMin,
+ onFinish: values => {
+ setResolutionModalVisible(false);
+ addReplyHanle({
+ sContentMemo: values.sContentMemo
+ ? values.sContentMemo.toHTML()
+ : "",
+ sResult: "已解决"
+ });
+ }
+ };
+
+ // 图片弹窗props
+ const imageModalProps = {
+ imageSrc,
+ imageVisible,
+ setImageVisible
+ };
+
+ // 修改后保存
+ const onFinish = async values => {
+ setLoading(true);
+ const {
+ sContentMemo,
+ sCustomerId,
+ sModuleId,
+ sHanldeId,
+ sCopyHanldeId,
+ bVsersion,
+ bBug,
+ sType,
+ tDevHandleDate,
+ tHandleDate
+ } = values;
+
+ const response = await WorkOrderSystemService.detailUpdate({
+ sId,
+ sMakePerson,
+ sTitle,
+ sContentMemo: sContentMemo.toHTML(),
+ ...customerOption.find(item => item.value === sCustomerId).item,
+ ...moduleOption.find(item => item.value === sModuleId).item,
+ ...userOption.find(item => item.value === sHanldeId).item,
+ sCopyHanldeId: sCopyHanldeId.toString(),
+ sCopyHanldeName: userOption
+ .filter(item => sCopyHanldeId.includes(item.value))
+ .map(item => item.label)
+ .toString(),
+ bVsersion,
+ bBug,
+ sType,
+ tDevHandleDate: tDevHandleDate
+ ? moment(tDevHandleDate).format("YYYY-MM-DD")
+ : undefined,
+ tHandleDate: tDevHandleDate
+ ? moment(tHandleDate).format("YYYY-MM-DD")
+ : undefined,
+ sStatus: "已修改"
+ });
+
+ setLoading(false);
+ if (commonUtils.isNotEmptyObject(response)) {
+ setFormEnabled(false);
+ refresh();
+ refreshSlaveTable();
+ }
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ const tHandleDate = form.getFieldValue().tHandleDate;
+ if (
+ chooseDate &&
+ tHandleDate &&
+ chooseDate.isAfter(tHandleDate)
+ ) {
+ return Promise.reject(
+ new Error("【开发截止日期】不能晚于【截止日期】")
+ );
+ } else {
+ return Promise.resolve();
+ }
+ }
+ }
+ ]}
+ >
+
+
+ {
+ const tDevHandleDate = form.getFieldValue().tDevHandleDate;
+ if (
+ chooseDate &&
+ tDevHandleDate &&
+ chooseDate.isBefore(tDevHandleDate)
+ ) {
+ return Promise.reject(
+ new Error("【截止日期】不能早于【开发截止日期】")
+ );
+ } else {
+ return Promise.resolve();
+ }
+ }
+ }
+ ]}
+ >
+
+
+
+
历史记录
+ {replyData.map((item, index) => {
+ const { sContentMemo: sContentMemoTemp } = item;
+ const itemName = `reply${index}`;
+ const itemName1 = `replyContentMemo${index}`;
+ const itemDom = form.getFieldValue()[itemName];
+ return (
+ itemDom && (
+ <>
+
+ {itemDom}
+
+ {sContentMemoTemp ? (
+
+
+
+ ) : (
+ ""
+ )}
+ >
+ )
+ );
+ })}
+
+
+
+ {btnShowData.includes("BtnEdit") && 添加附件}
+
+
+
+
+
+
+ {!formEnabled && (
+ }
+ className={styles.iconBtn}
+ style={{ background: "#838A9D", borderColor: "#838A9D" }}
+ onClick={() => {
+ props.onSaveState({
+ workOrderSystemDetailModalVisible: false
+ });
+ }}
+ >
+ 返回
+
+ )}
+ {!formEnabled &&
+ btnShowData.includes("BtnReplyd") && (
+ }
+ className={styles.iconBtn}
+ style={{ background: "#ff822d", borderColor: "#ff822d" }}
+ onClick={() => {
+ setReplyModalVisible(true);
+ }}
+ >
+ 回复
+
+ )}
+ {!formEnabled &&
+ btnShowData.includes("BtnEdit") && (
+ }
+ className={styles.iconBtn}
+ onClick={() => {
+ setFormEnabled(true);
+ document.querySelector(`.${detailModalId}`).scrollTop = 0;
+ }}
+ >
+ 修改
+
+ )}
+ {formEnabled && (
+ }
+ style={{ background: "#ff822d", borderColor: "#ff822d" }}
+ className={styles.iconBtn}
+ >
+ 保存
+
+ )}
+ {formEnabled && (
+ }
+ className={styles.iconBtn}
+ onClick={() => {
+ setFormEnabled(false);
+ refresh();
+ }}
+ >
+ 取消
+
+ )}
+ {!formEnabled &&
+ btnShowData.includes("BtnAssign") && (
+ }
+ className={styles.iconBtn}
+ onClick={() => {
+ setAssignmentModalVisible(true);
+ }}
+ >
+ 指派
+
+ )}
+ {!formEnabled &&
+ btnShowData.includes("BtnSolve") && (
+ }
+ className={styles.iconBtn}
+ onClick={() => {
+ setResolutionModalVisible(true);
+ }}
+ >
+ 解决
+
+ )}
+ {!formEnabled &&
+ btnShowData.includes("BtnClose") && (
+ }
+ className={styles.iconBtn}
+ onClick={() => {
+ Modal.confirm({
+ title: "确认关闭工单",
+ onOk() {
+ const evaluate = async () => {
+ const result = await WorkOrderSystemService.evaluate({
+ dEvaluate: 5,
+ sId,
+ sMakePerson
+ });
+
+ if (result) {
+ refreshSlaveTable();
+ props.onSaveState({
+ workOrderSystemDetailModalVisible: false
+ });
+ }
+ };
+ evaluate();
+ }
+ });
+ }}
+ >
+ 关闭工单
+
+ )}
+
+
+
+ {replyModalVisible && }
+ {assignmentModalVisible && }
+ {resolutionModalVisible && }
+ {imageVisible && }
+
+ );
+};
+
+// 回复弹窗
+const ReplyModal = props => {
+ const {
+ replyModalVisible,
+ detailData,
+ detailModalId,
+ setReplyModalVisible,
+ refresh,
+ bMin,
+ setBMin
+ } = props;
+ const { sId, sTitle } = detailData;
+ const [loading, setLoading] = useState(false);
+
+ const closeModal = () => {
+ setReplyModalVisible(false);
+ };
+
+ const onFinish = async values => {
+ setLoading(true);
+ const { app } = props;
+ const { userinfo } = app;
+ const { sUserName: sMakePerson, sId: sLoginId } = userinfo;
+
+ const returnData = await WorkOrderSystemService.addReply({
+ sContentMemo: values.sContentMemo.toHTML(),
+ sMakePerson,
+ sLoginId,
+ sId,
+ status: "回复"
+ });
+ setLoading(false);
+ if (commonUtils.isNotEmptyArr(returnData)) {
+ message.success("成功");
+ refresh();
+ setTimeout(() => {
+ document.querySelector(`.${detailModalId}`).scrollTop = 9999;
+ }, 500);
+ closeModal();
+ }
+ };
+
+ return (
+ replyModalVisible && (
+
+
+ {sTitle}
+ -回复内容
+
+ {
+ props.onSaveState({ bMin: true }, () => {
+ setBMin(true);
+ });
+ }}
+ >
+
+
+ >
+ }
+ open={replyModalVisible && !bMin}
+ className={`${gStyles.workOrderSystemModal} ${styles.replyModal}`}
+ style={{ top: "10vh" }}
+ width="80vw"
+ footer={null}
+ onCancel={closeModal}
+ >
+
+ {
+ if (sContentMemo.toHTML() === "") {
+ return Promise.reject(new Error("请输入内容"));
+ } else {
+ return Promise.resolve();
+ }
+ }
+ }
+ ]}
+ >
+
+
+
+
+ 取消
+
+ 确认
+
+
+
+
+
+
+ )
+ );
+};
+
+// 指派弹窗
+const AssignmentModal = props => {
+ const {
+ visible,
+ userOption,
+ detailData,
+ onFinish,
+ setVisible,
+ bResolution,
+ setBMin,
+ bMin
+ } = props;
+ const { sTitle, sCopyHanldeId } = detailData;
+ const initialValues = {
+ sCopyHanldeId: sCopyHanldeId ? sCopyHanldeId.split(",") : []
+ };
+
+ const closeModal = () => {
+ setVisible(false);
+ };
+
+ return (
+ visible && (
+
+ {bResolution ? "已解决确认" : `${sTitle}-指派人选择`}
+ {
+ props.onSaveState({ bMin: true }, () => {
+ setBMin(true);
+ });
+ }}
+ >
+
+
+ >
+ }
+ open={visible && !bMin}
+ className={`${gStyles.workOrderSystemModal} ${styles.assignmentModal}`}
+ style={{ top: "10vh" }}
+ width="80vw"
+ footer={null}
+ onCancel={closeModal}
+ >
+
+
+
+
+
+
+ >
+ )}
+
+
+
+
+
+
+ 取消
+
+ 确认
+
+
+
+
+
+ )
+ );
+};
+
+// 图片弹窗
+const ImageModal = ({ imageSrc, imageVisible, setImageVisible }) => {
+ return (
+ {
+ setImageVisible(false);
+ }
+ }}
+ />
+ );
+};
+
+export default WorkOrderSystemDetail;
diff --git a/src/components/Common/WorkOrderSystem/WorkOrderSystemService/index.js b/src/components/Common/WorkOrderSystem/WorkOrderSystemService/index.js
new file mode 100644
index 0000000..f6f140b
--- /dev/null
+++ b/src/components/Common/WorkOrderSystem/WorkOrderSystemService/index.js
@@ -0,0 +1,290 @@
+/* eslint-disable */
+import * as commonServices from "@/services/services";
+import commonConfig from "@/utils/config";
+import { message } from "antd";
+
+//获取所属客户
+const getsCustomerData = async () => {
+ const errorMessage = "获取所属客户接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/getCustomerData`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ {},
+ url
+ );
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+// 获取所属模块
+const getsModuleData = async () => {
+ const errorMessage = "获取所属模块接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/getModuleData`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ {},
+ url
+ );
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+// 获取人员
+const getUserData = async () => {
+ const errorMessage = "获取人员接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/getUserData`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ {},
+ url
+ );
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+// 上传附件
+const upload = async files => {
+ let formData = new FormData();
+ for (let item of files) {
+ formData.append("file", item);
+ }
+ const url = `${commonConfig.feedback_host}file/uploadMulti`;
+ const response = await fetch(url, {
+ method: "POST",
+ body: formData
+ });
+
+ const result = await response.json();
+ const { code = -1, dataset, msg = "接口出错" } = result;
+ if (code > -1) {
+ const { rows } = dataset;
+ const savePathStr = rows[0].savePathStr;
+ const fileData = savePathStr.split(",").map(item => ({
+ sPicturePath: item,
+ sPictureName: item.substring(item.indexOf("_") + 1)
+ }));
+ return JSON.stringify(fileData);
+ } else {
+ message.error(msg);
+ return "[]";
+ }
+};
+
+// 删除附件
+const deleteFile = async (file, sId) => {
+ const errorMessage = "删除接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/delFile/${sId}`;
+ const dataReturn = (await commonServices.postValueService(
+ "",
+ { fileData: JSON.stringify(file) },
+ url
+ )).data;
+ if (!dataReturn) {
+ message.error(errorMessage);
+ return false;
+ } else {
+ return true;
+ }
+};
+
+// 额外添加附件
+const uploadAdd = async (files, { sId, sMakePerson }) => {
+ const fileData = await upload(files);
+ if (fileData === "[]") {
+ return;
+ }
+
+ const errorMessage = "额外添加附件接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/addFile/${sId}`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ { fileData, sMakePerson },
+ url
+ );
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ return data;
+ } else {
+ message.error(msg);
+ return [];
+ }
+};
+
+// 提交数据
+const handleSubmit = submitData => {
+ const url = `${commonConfig.feedback_host}sysworkorder/add`;
+ commonServices
+ .postValueService("", submitData, url)
+ .then(({ data: result = {} }) => {
+ const { code = -1, msg = "接口出错" } = result;
+ if (code > -1) {
+ message.success(msg);
+ _props &&
+ _props.onAddWorkOrderSuccess &&
+ _props.onAddWorkOrderSuccess();
+ } else {
+ message.error(msg);
+ }
+ });
+};
+
+// 获取详情数据
+const getDetailData = async ({ sId }) => {
+ const errorMessage = "获取详情接口出错";
+ const url = `${
+ commonConfig.feedback_host
+ }sysworkorder/getDetail/${sId}/project`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ {},
+ url
+ );
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+//回复 参数{ sContentMemo, sMakePerson, sLoginId, sId , status: '回复'}
+const addReply = async ({ sId, ...condition }) => {
+ const errorMessage = "回复出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/addReply/${sId}`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ condition,
+ url
+ );
+
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+// 详情更新
+const detailUpdate = async ({ sId, ...condition }) => {
+ const errorMessage = "详情更新出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/update/${sId}`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ condition,
+ url
+ );
+
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ message.success(msg);
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+const addReplyHanle = async ({ sId, ...condition }) => {
+ const errorMessage = "addReplyHanle接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/addReplyHanle/${sId}`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ condition,
+ url
+ );
+
+ const { code = -1, data, msg = errorMessage } = result;
+ if (code > -1) {
+ message.success(msg);
+ return data;
+ } else {
+ message.error(msg);
+ return {};
+ }
+};
+
+// 评分(关闭工单)
+const evaluate = async ({ sId, ...condition }) => {
+ const errorMessage = "关闭工单接口出错";
+ const url = `${commonConfig.feedback_host}sysworkorder/evaluate/${sId}`;
+ const { data: result = {} } = await commonServices.postValueService(
+ "",
+ condition,
+ url
+ );
+
+ const { code = -1, msg = errorMessage } = result;
+ if (code > -1) {
+ message.success(msg);
+ return true;
+ } else {
+ message.error(msg);
+ return false;
+ }
+};
+
+// 富文本媒体上传
+const uploadFn = async ({ file, success, error }) => {
+ let formData = new FormData();
+ formData.append("file", file);
+ message.open({
+ key: "xlyUploadFn",
+ type: "loading",
+ content: "文件上传中...",
+ duration: 0
+ });
+ const url = `${commonConfig.feedback_host}file/uploadMulti`;
+ const response = await fetch(url, {
+ method: "POST",
+ body: formData
+ });
+ message.destroy("xlyUploadFn");
+ const result = await response.json();
+ const { code = -1, dataset, msg = "上传失败" } = result;
+ if (code > -1) {
+ const { rows } = dataset;
+ const savePathStr = rows[0].savePathStr;
+ success({
+ url: `${
+ commonConfig.feedback_host
+ }file/download?savePathStr=${savePathStr}&sModelsId=100`
+ });
+ } else {
+ message.error(msg);
+ error();
+ }
+};
+
+export default {
+ getsCustomerData,
+ getsModuleData,
+ getUserData,
+ upload,
+ handleSubmit,
+ getDetailData,
+ addReply,
+ deleteFile,
+ uploadAdd,
+ detailUpdate,
+ addReplyHanle,
+ evaluate,
+ uploadFn
+};
diff --git a/src/components/Common/WorkOrderSystem/index.less b/src/components/Common/WorkOrderSystem/index.less
new file mode 100644
index 0000000..2da5031
--- /dev/null
+++ b/src/components/Common/WorkOrderSystem/index.less
@@ -0,0 +1,467 @@
+@modal-content-height: calc(100vh - 100px); // 弹窗内容高度
+@braft-height: 400px; // 富文本框高度
+@level-color-1: #d50000; // 严重
+@level-color-2: #ff9800; // 紧急
+@level-color-3: #2098ee; // 一般
+@level-color-4: #009688; // 优化
+
+// 通用样式
+.workOrderSystem,
+.workOrderSystemDetail,
+.replyModal,
+.assignmentModal {
+ padding: 20px;
+ overflow-x: hidden;
+ overflow-y: auto;
+
+ :global {
+
+ // form表单样式
+ .ant-form-item {
+ margin-bottom: 15px;
+ width: 100%;
+
+ .ant-form-item-label {
+ display: flex;
+ justify-content: center;
+
+ label {
+ color: #4a495f !important;
+ font-size: 14px !important;
+ }
+ }
+
+ .ant-select {
+ .ant-select-selector {
+ min-height: 35px;
+
+ .ant-select-selection-item {
+ font-size: 14px;
+ line-height: 32px;
+ }
+
+ .ant-select-selection-overflow-item {
+ max-width: calc(100% - 4px);
+ .ant-select-selection-item {
+ height: 25px;
+ line-height: 25px;
+ }
+ }
+
+ .ant-select-selection-search {
+ input {
+ height: 35px;
+ font-size: 14px;
+ }
+ span {
+ font-size: 14px;
+ }
+ }
+
+ .ant-select-selection-placeholder {
+ font-size: 14px;
+ line-height: 35px;
+ }
+ }
+ }
+
+ .ant-select-disabled {
+ .ant-select-selector {
+ .ant-select-selection-search {
+ input {
+ height: 33px;
+ font-size: 14px;
+ }
+ }
+ }
+ }
+
+
+ .ant-upload-list {
+ max-height: 50px;
+ max-width: 100%;
+ overflow-x: auto;
+ overflow-y: hidden;
+ display: flex;
+
+ .ant-upload-list-item-card-actions Button {
+ opacity: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ .anticon-delete {
+ width: 12px;
+ }
+ }
+ }
+
+ .ant-btn {
+ height: 32px;
+ padding: 3px 15px;
+ font-size: 14px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ span[role='img'] {
+ height: 16px;
+
+ svg {
+ width: 16px;
+ height: 16px;
+ }
+ }
+ }
+
+ .ant-input-affix-wrapper {
+ padding-top: 0;
+ padding-bottom: 0;
+ }
+
+ .ant-picker {
+ width: 100%;
+
+ .ant-picker-input {
+ height: 28px;
+
+ input {
+ font-size: 14px;
+ }
+ }
+ }
+
+ .ant-switch {
+ scale: 1.2;
+ }
+
+ input[class*='ant-input'] {
+ height: 33px;
+ font-size: 14px;
+ }
+
+ }
+ }
+
+ // 富文本框样式
+ .braftEditor {
+ height: @braft-height;
+ background-color: #f6f6f6;
+ border: 1px solid #d9d9d9;
+
+ :global {
+ .bf-content {
+ height: @braft-height - 94px;
+ background-color: #fff;
+ }
+ }
+ }
+
+ .braftEditorReadOnly {
+ height: auto;
+ background-color: #f6f6f6;
+ border: 1px solid #d9d9d9;
+
+ :global {
+ .bf-content {
+ height: auto;
+ background-color: #fff;
+ }
+ }
+ }
+
+ .detailBraftEditorReply {
+ height: auto;
+ width: calc(100% - 50px);
+ margin-left: 50px;
+
+ :global {
+ .bf-content {
+ height: auto;
+ padding: 0;
+
+ .public-DraftEditor-content,
+ .public-DraftEditor-content>div {
+ padding: 0;
+ }
+ }
+ }
+ }
+
+ .formItemHalf {
+ width: 50%;
+
+ :global {
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+ }
+ }
+
+ .formItemAQuarter {
+ width: 20%;
+
+ :global {
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ }
+ }
+
+ .formItemAQuarter1 {
+ width: 25%;
+
+ :global {
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ }
+ }
+
+ .formItemBug {
+ width: 10%;
+
+ :global {
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 0;
+ max-width: 0;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 100%;
+ max-width: 100%;
+ }
+
+ .ant-switch {
+ background: @level-color-3;
+ }
+
+ .ant-switch-checked {
+ background: @level-color-1;
+ }
+ }
+ }
+}
+
+
+// 居中布局
+.flexCener {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+// 悬浮按钮
+.fixedBtns {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: absolute;
+ width: calc(100% - 20px);
+ bottom: 10px;
+ z-index: 999;
+}
+
+// 自定义图标按钮
+.iconBtn {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ :global {
+ img {
+ width: 16px;
+ margin-right: 5px;
+ }
+
+ span[role='img'] {
+ height: 16px;
+
+ svg {
+ width: 16px;
+ height: 16px;
+ }
+ }
+ }
+}
+
+// 附件图标
+.annex {
+ :global {
+ .ant-form-item-label {
+ background: url(../../../assets/annex.svg) no-repeat;
+ background-position-x: 15%;
+ background-position-y: 5px;
+ background-size: 20px 20px;
+ }
+ }
+}
+
+// 工单新增弹窗
+.workOrderSystem {
+ height: @modal-content-height;
+ display: flex;
+ flex-wrap: wrap;
+
+ :global {
+
+ .ant-form-item:nth-child(1) {
+ .ant-form-item-label {
+ align-items: center;
+ }
+ }
+
+ .ant-form-item:nth-child(n+2):nth-child(-n+5) {
+ width: 50%;
+
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 25%;
+ max-width: 25%;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 75%;
+ max-width: 75%;
+ }
+ }
+
+ .ant-form-item:nth-child(6),
+ .ant-form-item:nth-child(8) {
+ width: 20%;
+
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+
+ }
+
+ .ant-form-item:nth-child(9),
+ .ant-form-item:nth-child(10) {
+ width: 25%;
+
+ .ant-form-item-label {
+ align-items: center;
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+
+ .ant-form-item-control {
+ flex: 0 0 50%;
+ max-width: 50%;
+ }
+ }
+
+ }
+}
+
+// 优先级下拉
+.sTypeSelect {
+ :global {
+ .ant-select-selection-item[title='严重'] {
+ color: @level-color-1;
+ }
+
+ .ant-select-selection-item[title='紧急'] {
+ color: @level-color-2;
+ }
+
+ .ant-select-selection-item[title='一般'] {
+ color: @level-color-3;
+ }
+
+ .ant-select-selection-item[title='优化'] {
+ color: @level-color-4;
+ }
+ }
+}
+
+.sTypedDropdown {
+ :global {
+ .ant-select-item-option:nth-child(1) {
+ color: @level-color-1;
+ }
+
+ .ant-select-item-option:nth-child(2) {
+ color: @level-color-2;
+ }
+
+ .ant-select-item-option:nth-child(3) {
+ color: @level-color-3;
+ }
+
+ .ant-select-item-option:nth-child(4) {
+ color: @level-color-4;
+ }
+ }
+}
+
+// 工单详情弹窗
+.workOrderSystemDetail {
+ height: @modal-content-height;
+ display: flex;
+ flex-wrap: wrap;
+
+ .replyDiv {
+ width: 100%;
+ background: #f6f6f6;
+ padding: 10px 0 0 10px;
+
+ .replyTitle {
+ font-size: 14px;
+ }
+ }
+}
+
+// 回复弹窗, 指派人弹窗
+.replyModal,
+.assignmentModal {
+ :global {
+ .ant-modal-body {
+ padding: 20px !important;
+ overflow: hidden;
+ }
+ }
+
+ .replyBraftEditor {
+ height: calc(70vh - 110px);
+ background-color: #f6f6f6;
+ border: 1px solid #d9d9d9;
+
+ :global {
+ .bf-content {
+ height: calc(70vh - 204px);
+ background-color: #fff;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/Common/commonFunc.js b/src/components/Common/commonFunc.js
index 096c005..fac124f 100644
--- a/src/components/Common/commonFunc.js
+++ b/src/components/Common/commonFunc.js
@@ -890,3 +890,6 @@ export function getEvalResult(params) {
return result;
}
+export function getReturnMsg() {
+ return '';
+}
diff --git a/src/components/CommonElementEvent/BatchNPriceUpdate.js b/src/components/CommonElementEvent/BatchNPriceUpdate.js
new file mode 100644
index 0000000..34bded5
--- /dev/null
+++ b/src/components/CommonElementEvent/BatchNPriceUpdate.js
@@ -0,0 +1,339 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Input, message } from 'antd';
+import styles from '../../index.less';
+import * as commonBusiness from '../Common/commonBusiness';
+import * as commonServices from '../../services/services'; /* 服务类 */
+import commonConfig from '../../utils/config';
+import * as commonUtils from '../../utils/utils';
+import * as commonFunc from '../Common/commonFunc';
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+
+const { TextArea } = Input;
+export default class BatchPriceUpdate extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.state = {};
+ this.formatOk = -1;
+ }
+
+ handleBtnSave = () => {
+ const {
+ reportData, reportDelData, reportConfig,
+ } = this.props;
+ const data = [];
+ if (!commonBusiness.validateTable(reportConfig, reportData)) {
+ return;
+ }
+ data.push(commonBusiness.mergeData('report', 'sysreport', reportData, reportDelData));
+ this.handleSaveData({ data, sClientType: '1', optName: commonFunc.showMessage(app.commonConst, 'priceSaveSucess') });
+ };
+ handleSaveData = async (params) => {
+ const {
+ token, sModelsId, masterData,
+ } = this.props;
+ const returnData = await commonBusiness.saveData({ token, value: params, sModelsId });
+ if (returnData.code === 1) {
+ this.props.onSaveState({
+ enabled: false, currentId: masterData.sId,
+ });
+ this.getReportData();
+ } else {
+ this.props.getServiceError(returnData);
+ }
+ };
+
+ handleOk = async () => {
+ const {
+ sModelsId, app, masterConfig, slaveConfig, checkConfig, slaveSelectedRowKeys, batchNPriceUpdateData, sModelsType,
+ } = this.props;
+ const dProductPrice = document.getElementById('dProductPriceNew').value; /* 产品单价 */
+ const dProductQty = document.getElementById('dProductQtyNew').value;
+ const OldProductQty = document.getElementById('dProductQty').value;
+ const dProductMoney = document.getElementById('dProductMoneyNew').value; /* 产品金额 */
+ const sChangePriceMemo = document.getElementById('sChangePriceMemo').value; /* 价格批量更新备注 */
+ const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
+ let dMaterialsQtyOld = 0;
+ let dMaterialsQtyNew = 0;
+ if (models !== 'Product') {
+ dMaterialsQtyOld = document.getElementById('dMaterialsQty').value;
+ dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value;
+ }
+
+ if (this.formatOk > -1) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'DecimalOut'));
+ return;
+ }
+ /* 数据参数 */
+ const value = {
+ sProName: 'Sp_System_BatchNPriceMoney',
+ paramsMap: {
+ sFormGuid: sModelsId, sSrcGuid: slaveSelectedRowKeys[0], dPrice: dProductPrice, dMoney: dProductMoney, dQty: dProductQty, oldQty: OldProductQty, oldMaterialsQty: dMaterialsQtyOld, dMaterialsQty: dMaterialsQtyNew, tDeliverDate: batchNPriceUpdateData[0].tDeliverDate, sChangePriceMemo,
+ },
+ };
+ const url = `${commonConfig.server_host}business/updatePriceBatch?sModelsId=${sModelsId}`;
+ const returnData = (await commonServices.postValueService(app.token, value, url)).data;
+ if (returnData.code === 1) { /* 成功 */
+ message.success(commonFunc.showMessage(app.commonConst, 'priceSaveSucess') + returnData.msg);
+ document.getElementById('dProductPriceNew').value = '';
+ document.getElementById('dProductMoneyNew').value = '';
+ document.getElementById('dProductQtyNew').value = '';
+ if (models !== 'Product') {
+ document.getElementById('dMaterialsQtyNew').value = '';
+ }
+ this.props.onGetData(masterConfig, slaveConfig, checkConfig);
+ } else { /* 失败 */
+ this.props.getServiceError({ msg: commonFunc.showMessage(app.commonConst, 'priceSaveSucess') + returnData.msg });
+ }
+ this.props.onSaveState({
+ visibleBatchNPriceUpdate: false,
+ enabled: false,
+ });
+ };
+
+ handleCancel = () => {
+ this.props.onSaveState({
+ visibleBatchNPriceUpdate: false,
+ enabled: false,
+ });
+ };
+ handleChange = (name, tableDataRow) => {
+ const {
+ slaveConfig, app, masterData, sModelsType,
+ } = this.props;
+ const dPprice = this.props.getFloatNum('dProductPrice'); /* 获取系统设定小数位 */
+ const dPmoney = this.props.getFloatNum('dProductMoney');
+ const priceValue = document.getElementById('dProductPriceNew').value;
+ const dProductQty = document.getElementById('dProductQty').value;
+ const dProductQtyNew = document.getElementById('dProductQtyNew').value;
+ const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
+ const iNewIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === 'dProductPrice');
+ if (iNewIndex > -1 && (commonUtils.isNotEmptyObject(slaveConfig.gdsconfigformslave[iNewIndex].sMaxValue) || commonUtils.isNotEmptyObject(slaveConfig.gdsconfigformslave[iNewIndex].sMinValue))) {
+ const product = slaveConfig.gdsconfigformslave[iNewIndex];
+ document.getElementById('dProductMoneyNew').value = 0;
+ if (commonUtils.isNotEmptyObject(product.sMaxValue) && parseFloat(product.sMaxValue, dPprice) < parseFloat(priceValue, dPprice)) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxValue') + product.sMaxValue);
+ }
+ if (commonUtils.isNotEmptyObject(product.sMinValue) && parseFloat(product.sMinValue, dPprice) < parseFloat(priceValue, dPprice)) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'minValue') + product.sMinValue);
+ }
+ } else {
+ const rep = /\d+\.(\d*)/;
+ if (name === 'dProductPriceNew') { /* 改变产品单价 */
+ const pointRep = priceValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = priceValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(priceValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > dPprice) {
+ this.formatOk = 1;
+ document.getElementById('dProductMoneyNew').value = 0;
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxPointLength') + dPprice);
+ } else if (pointRep === null && priceValue.length > 9) { /* 整数超9位 */
+ message.warning(`${commonFunc.showMessage(app.commonConst, 'maxIntegerLength')}9`);
+ this.formatOk = 1;
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (models === 'Product') {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dNProductPrice = priceValue;
+ tableDataRowNew.dProductQty = dProductQtyNew;
+ const batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dNProductPrice', masterData, tableDataRowNew);
+ const productMoney = batchPriceUpdateObj.dNProductMoney;
+ document.getElementById('dProductPriceNew').value = priceValue;
+ document.getElementById('dProductMoneyNew').value = productMoney.toFixed(dPmoney);
+ } else {
+ const dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value; /* 换算数量 */
+ const productMoney = priceValue * dMaterialsQtyNew;
+ document.getElementById('dProductPriceNew').value = priceValue;
+ document.getElementById('dProductMoneyNew').value = productMoney.toFixed(dPmoney);
+ }
+ }
+ }
+ if (name === 'dProductMoneyNew') { /* 改变产品金额 */
+ const moneyValue = document.getElementById('dProductMoneyNew').value;
+ const pointRep = moneyValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = moneyValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(moneyValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > dPmoney) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxPointLength') + dPmoney);
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (dProductQty !== 0) {
+ if (models === 'Product') {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dNProductMoney = moneyValue; /* 外币金额 */
+ tableDataRowNew.dProductQty = dProductQty;
+ const batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dNProductMoney', masterData, tableDataRowNew);
+ const priceValue = batchPriceUpdateObj.dNProductPrice;
+ document.getElementById('dProductPriceNew').value = commonUtils.convertFixNum(priceValue, dPprice);
+ document.getElementById('dProductMoneyNew').value = moneyValue;
+ } else {
+ const dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value; /* 换算数量 */
+ const priceValue = moneyValue / dMaterialsQtyNew; /* 采购单价改变时,金额=单价*换算数量 */
+ document.getElementById('dProductPriceNew').value = commonUtils.convertFixNum(priceValue, dPprice);
+ document.getElementById('dProductMoneyNew').value = moneyValue;
+ }
+ }
+ }
+ }
+ if (name === 'dProductQtyNew') { /* 改变订单数量 */
+ const qtyValue = document.getElementById('dProductQtyNew').value;
+ const pointRep = qtyValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = qtyValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(qtyValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > 6) {
+ this.formatOk = 1;
+ message.warning('最多6位小数!');
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (dProductQty !== 0 && commonUtils.isNotEmptyObject(tableDataRow)) {
+ if (models === 'Product') { /* 调用通用价格计算 */
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dNProductPrice = priceValue;
+ tableDataRowNew.dProductQty = qtyValue;
+ const batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dProductQty', masterData, tableDataRowNew);
+ const moneyValue = batchPriceUpdateObj.dNProductMoney;
+ document.getElementById('dProductMoneyNew').value = commonUtils.convertFixNum(moneyValue, dPprice);
+ document.getElementById('dProductQtyNew').value = qtyValue;
+ } else {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dAuxiliaryQty = qtyValue;
+ /* 输入数量 算换算数量 */
+ let batchPriceUpdateObj = commonBusiness.getMaterialsQty(app, tableDataRowNew, 'dAuxiliaryQty', 'dMaterialsQty');
+ document.getElementById('dMaterialsQtyNew').value = batchPriceUpdateObj.dMaterialsQty;
+ batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dMaterialsQty', masterData, batchPriceUpdateObj);
+ document.getElementById('dProductMoneyNew').value = batchPriceUpdateObj[`d${models}Money`];
+ }
+ }
+ }
+ }
+ if (name === 'dMaterialsQtyNew') {
+ const dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value;
+ const qtyValue = document.getElementById('dMaterialsQtyNew').value;
+ if (isNaN(qtyValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (dMaterialsQtyNew !== 0 && commonUtils.isNotEmptyObject(tableDataRow)) {
+ if (models !== 'Product') {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dMaterialsQty = qtyValue;
+ tableDataRowNew[`d${models}Price`] = priceValue;
+ /* 输入换算数量 算数量 */
+ let batchPriceUpdateObj = commonBusiness.getAuxiliaryQty(app, tableDataRowNew, 'dMaterialsQty', 'dAuxiliaryQty');
+ document.getElementById('dProductQtyNew').value = batchPriceUpdateObj.dAuxiliaryQty;
+ batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dMaterialsQty', masterData, batchPriceUpdateObj);
+ document.getElementById('dProductMoneyNew').value = batchPriceUpdateObj[`d${models}Money`];
+ }
+ }
+ }
+ }
+ };
+
+ /** 渲染 */
+ render() {
+ const {
+ batchNPriceUpdateData, visibleBatchNPriceUpdate, app, sModelsType,
+ } = this.props;
+ // const pane = app.panes.filter(paneTmp => paneTmp.key === sTabId)[0];
+ const disabled = true;
+ const priceBatchUpdate = `${commonFunc.showMessage(app.commonConst, 'priceBatchUpdate')}(产品单价)`;/* 价格批量更新 */
+ const OldQty = commonFunc.showMessage(app.commonConst, 'OldQty');/* 原数量 */
+ const OldMaterialsQty = commonFunc.showMessage(app.commonConst, 'OldMaterialsQty');/* 原换算数量 */
+ const OldPrice = commonFunc.showMessage(app.commonConst, 'OldPrice');/* 原单价 */
+ const OldTotalMoney = commonFunc.showMessage(app.commonConst, 'OldTotalMoney');/* 原金额 */
+ const qty = commonFunc.showMessage(app.commonConst, 'qty');/* 数量 */
+ const materialsQty = commonFunc.showMessage(app.commonConst, 'materialsQty');/* 换算数量 */
+ const price = commonFunc.showMessage(app.commonConst, 'price');/* 单价 */
+ const money = commonFunc.showMessage(app.commonConst, 'money');/* 金额 */
+ /* 通用价格批量更新 */
+ let dQty = 0;
+ let dPrice = 0;
+ let dMoney = 0;
+ let dMaterialsQty = 0;
+ let models = '';
+ let batchPriceUpdateObj = {};
+ if (commonUtils.isNotEmptyObject(sModelsType)) {
+ models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
+ const sFieldName = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'dProductQty' : 'dAuxiliaryQty';
+ batchPriceUpdateObj = commonUtils.isNotEmptyArr(batchNPriceUpdateData) ? batchNPriceUpdateData[0] : {};
+ if (commonUtils.isNotEmptyObject(batchPriceUpdateObj)) {
+ dQty = batchPriceUpdateObj[sFieldName];
+ if (models === 'Product') {
+ dPrice = batchPriceUpdateObj[`dN${models}Price`]; /* 取产品单价 */
+ if (commonUtils.isEmptyNumber(dPrice) || dPrice === 0) { /* 产品单价为0时,取外币单价,外币单价也为0时取本位币单价 */
+ dPrice = commonUtils.isNotEmptyNumber(batchPriceUpdateObj[`d${models}ForeignPrice`]) && batchPriceUpdateObj[`d${models}ForeignPrice`] !== 0 ?
+ batchPriceUpdateObj[`d${models}ForeignPrice`] : batchPriceUpdateObj[`d${models}Price`];
+ }
+
+ dMoney = batchPriceUpdateObj[`dN${models}Money`]; /* 取产品金额 */
+ if (commonUtils.isEmptyNumber(dMoney) || dMoney === 0) { /* 产品金额为0时,取外币金额,外币金额也为0时取本位币金额 */
+ dMoney = commonUtils.isNotEmptyNumber(batchPriceUpdateObj[`d${models}ForeignMoney`]) && batchPriceUpdateObj[`d${models}ForeignMoney`] !== 0 ?
+ batchPriceUpdateObj[`d${models}ForeignMoney`] : batchPriceUpdateObj[`d${models}Money`];
+ }
+ } else {
+ dPrice = batchPriceUpdateObj[`d${models}Price`];
+ dMoney = batchPriceUpdateObj[`d${models}Money`];
+ }
+
+ dMaterialsQty = batchPriceUpdateObj.dMaterialsQty;
+ }
+ }
+
+ return (
+
+ { visibleBatchNPriceUpdate ?
+
+
+
+ : '' }
+
+ );
+ }
+}
diff --git a/src/components/CommonElementEvent/BatchPriceUpdate.js b/src/components/CommonElementEvent/BatchPriceUpdate.js
new file mode 100644
index 0000000..4fc653b
--- /dev/null
+++ b/src/components/CommonElementEvent/BatchPriceUpdate.js
@@ -0,0 +1,350 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Input, message } from 'antd';
+import styles from '../../index.less';
+import * as commonBusiness from '../Common/commonBusiness';
+import * as commonServices from '../../services/services'; /* 服务类 */
+import commonConfig from '../../utils/config';
+import * as commonUtils from '../../utils/utils';
+import * as commonFunc from '../Common/commonFunc';
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+
+const { TextArea } = Input;
+export default class BatchPriceUpdate extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.state = {};
+ this.formatOk = -1;
+ }
+
+ handleBtnSave = () => {
+ const {
+ reportData, reportDelData, reportConfig,
+ } = this.props;
+ const data = [];
+ if (!commonBusiness.validateTable(reportConfig, reportData)) {
+ return;
+ }
+ data.push(commonBusiness.mergeData('report', 'sysreport', reportData, reportDelData));
+ this.handleSaveData({ data, sClientType: '1', optName: commonFunc.showMessage(app.commonConst, 'priceSaveSucess') });
+ };
+ handleSaveData = async (params) => {
+ const {
+ token, sModelsId, masterData,
+ } = this.props;
+ const returnData = await commonBusiness.saveData({ token, value: params, sModelsId });
+ if (returnData.code === 1) {
+ this.props.onSaveState({
+ enabled: false, currentId: masterData.sId,
+ });
+ this.getReportData();
+ } else {
+ this.props.getServiceError(returnData);
+ }
+ };
+
+ handleOk = async () => {
+ const {
+ sModelsId, app, masterConfig, slaveConfig, checkConfig, slaveSelectedRowKeys, batchPriceUpdateData, sModelsType,
+ } = this.props;
+ const dProductPrice = document.getElementById('dProductPriceNew').value; /* 外币单价 */
+ const dProductQty = document.getElementById('dProductQtyNew').value;
+ const OldProductQty = document.getElementById('dProductQty').value;
+ const dProductMoney = document.getElementById('dProductMoneyNew').value; /* 外币金额 */
+ const sChangePriceMemo = document.getElementById('sChangePriceMemo').value; /* 价格批量更新备注 */
+ const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
+ let dMaterialsQtyOld = 0;
+ let dMaterialsQtyNew = 0;
+ if (models !== 'Product') {
+ dMaterialsQtyOld = document.getElementById('dMaterialsQty').value;
+ dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value;
+ }
+
+ if (this.formatOk > -1) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'DecimalOut'));
+ return;
+ }
+ /* 数据参数 */
+ const value = {
+ sProName: 'Sp_System_BatchPriceMoney',
+ paramsMap: {
+ sFormGuid: sModelsId,
+ sSrcGuid: slaveSelectedRowKeys[0],
+ dPrice: dProductPrice,
+ dMoney: dProductMoney,
+ dQty: dProductQty,
+ oldQty: OldProductQty,
+ oldMaterialsQty: dMaterialsQtyOld,
+ dMaterialsQty: dMaterialsQtyNew,
+ tDeliverDate: batchPriceUpdateData[0].tDeliverDate,
+ sChangePriceMemo,
+ },
+ };
+ const url = `${commonConfig.server_host}business/updatePriceBatch?sModelsId=${sModelsId}`;
+ const returnData = (await commonServices.postValueService(app.token, value, url)).data;
+ if (returnData.code === 1) { /* 成功 */
+ message.success(commonFunc.showMessage(app.commonConst, 'priceSaveSucess') + returnData.msg);
+ document.getElementById('dProductPriceNew').value = '';
+ document.getElementById('dProductMoneyNew').value = '';
+ document.getElementById('dProductQtyNew').value = '';
+ if (models !== 'Product') {
+ document.getElementById('dMaterialsQtyNew').value = '';
+ }
+ this.props.onGetData(masterConfig, slaveConfig, checkConfig);
+ } else { /* 失败 */
+ this.props.getServiceError({ msg: commonFunc.showMessage(app.commonConst, 'priceSaveSucess') + returnData.msg });
+ }
+ this.props.onSaveState({
+ visibleBatchPriceUpdate: false,
+ enabled: false,
+ });
+ };
+
+ handleCancel = () => {
+ this.props.onSaveState({
+ visibleBatchPriceUpdate: false,
+ enabled: false,
+ });
+ };
+ handleChange = (name, tableDataRow) => {
+ const {
+ slaveConfig, app, masterData, sModelsType,
+ } = this.props;
+ const dPprice = this.props.getFloatNum('dProductPrice'); /* 获取系统设定小数位 */
+ const dPmoney = this.props.getFloatNum('dProductMoney');
+ const priceValue = document.getElementById('dProductPriceNew').value;
+ const dProductQty = document.getElementById('dProductQty').value;
+ const dProductQtyNew = document.getElementById('dProductQtyNew').value;
+ const models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
+ const iNewIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === 'dProductPrice');
+ if (iNewIndex > -1 && (commonUtils.isNotEmptyObject(slaveConfig.gdsconfigformslave[iNewIndex].sMaxValue) || commonUtils.isNotEmptyObject(slaveConfig.gdsconfigformslave[iNewIndex].sMinValue))) {
+ const product = slaveConfig.gdsconfigformslave[iNewIndex];
+ document.getElementById('dProductMoneyNew').value = 0;
+ if (commonUtils.isNotEmptyObject(product.sMaxValue) && parseFloat(product.sMaxValue, dPprice) < parseFloat(priceValue, dPprice)) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxValue') + product.sMaxValue);
+ }
+ if (commonUtils.isNotEmptyObject(product.sMinValue) && parseFloat(product.sMinValue, dPprice) < parseFloat(priceValue, dPprice)) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'minValue') + product.sMinValue);
+ }
+ } else {
+ const rep = /\d+\.(\d*)/;
+ if (name === 'dProductPriceNew') { /* 改变外币单价 */
+ const pointRep = priceValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = priceValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(priceValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > dPprice) {
+ this.formatOk = 1;
+ document.getElementById('dProductMoneyNew').value = 0;
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxPointLength') + dPprice);
+ } else if (pointRep === null && priceValue.length > 9) { /* 整数超9位 */
+ message.warning(`${commonFunc.showMessage(app.commonConst, 'maxIntegerLength')}9`);
+ this.formatOk = 1;
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (models === 'Product') {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dProductForeignPrice = priceValue;
+ tableDataRowNew.dProductQty = dProductQtyNew;
+ const batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dProductForeignPrice', masterData, tableDataRowNew);
+ const productMoney = batchPriceUpdateObj.dProductForeignMoney;
+ // const productMoney = priceValue * dProductQtyNew;
+ document.getElementById('dProductPriceNew').value = priceValue;
+ document.getElementById('dProductMoneyNew').value = productMoney.toFixed(dPmoney);
+ } else {
+ const dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value; /* 换算数量 */
+ const productMoney = priceValue * dMaterialsQtyNew;
+ document.getElementById('dProductPriceNew').value = priceValue;
+ document.getElementById('dProductMoneyNew').value = productMoney.toFixed(dPmoney);
+ }
+ }
+ }
+ if (name === 'dProductMoneyNew') { /* 改变外币金额 */
+ const moneyValue = document.getElementById('dProductMoneyNew').value;
+ const pointRep = moneyValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = moneyValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(moneyValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > dPmoney) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxPointLength') + dPmoney);
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (dProductQty !== 0) {
+ if (models === 'Product') {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dProductForeignMoney = moneyValue; /* 外币金额 */
+ tableDataRowNew.dProductQty = dProductQty;
+ const batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dProductForeignMoney', masterData, tableDataRowNew);
+ const priceValue = batchPriceUpdateObj.dProductForeignPrice;
+ // const priceValue = moneyValue / dProductQty;
+ document.getElementById('dProductPriceNew').value = commonUtils.convertFixNum(priceValue, dPprice);
+ document.getElementById('dProductMoneyNew').value = moneyValue;
+ } else {
+ const dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value; /* 换算数量 */
+ const priceValue = moneyValue / dMaterialsQtyNew; /* 采购单价改变时,金额=单价*换算数量 */
+ document.getElementById('dProductPriceNew').value = commonUtils.convertFixNum(priceValue, dPprice);
+ document.getElementById('dProductMoneyNew').value = moneyValue;
+ }
+ }
+ }
+ }
+ if (name === 'dProductQtyNew') { /* 改变订单数量 */
+ const qtyValue = document.getElementById('dProductQtyNew').value;
+ const pointRep = qtyValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = qtyValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(qtyValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > 6) {
+ this.formatOk = 1;
+ message.warning('最多6位小数!');
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (dProductQty !== 0 && commonUtils.isNotEmptyObject(tableDataRow)) {
+ if (models === 'Product') { /* 调用通用价格计算 */
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dProductForeignPrice = priceValue;
+ tableDataRowNew.dProductQty = qtyValue;
+ const batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dProductQty', masterData, tableDataRowNew);
+ const moneyValue = batchPriceUpdateObj.dProductForeignMoney;
+ // const moneyValue = priceValue * qtyValue;
+ document.getElementById('dProductMoneyNew').value = commonUtils.convertFixNum(moneyValue, dPprice);
+ document.getElementById('dProductQtyNew').value = qtyValue;
+ } else {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dAuxiliaryQty = qtyValue;
+ /* 输入数量 算换算数量 */
+ let batchPriceUpdateObj = commonBusiness.getMaterialsQty(app, tableDataRowNew, 'dAuxiliaryQty', 'dMaterialsQty');
+ document.getElementById('dMaterialsQtyNew').value = batchPriceUpdateObj.dMaterialsQty;
+ batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dMaterialsQty', masterData, batchPriceUpdateObj);
+ document.getElementById('dProductMoneyNew').value = batchPriceUpdateObj[`d${models}Money`];
+ }
+ }
+ }
+ }
+ if (name === 'dMaterialsQtyNew') {
+ const dMaterialsQtyNew = document.getElementById('dMaterialsQtyNew').value;
+ const qtyValue = document.getElementById('dMaterialsQtyNew').value;
+ if (isNaN(qtyValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ if (dMaterialsQtyNew !== 0 && commonUtils.isNotEmptyObject(tableDataRow)) {
+ if (models !== 'Product') {
+ const tableDataRowNew = JSON.parse(JSON.stringify(tableDataRow));
+ tableDataRowNew.dMaterialsQty = qtyValue;
+ tableDataRowNew[`d${models}Price`] = priceValue;
+ /* 输入换算数量 算数量 */
+ let batchPriceUpdateObj = commonBusiness.getAuxiliaryQty(app, tableDataRowNew, 'dMaterialsQty', 'dAuxiliaryQty');
+ document.getElementById('dProductQtyNew').value = batchPriceUpdateObj.dAuxiliaryQty;
+ batchPriceUpdateObj = commonBusiness.getCalculateAllMoney(app, models, 'dMaterialsQty', masterData, batchPriceUpdateObj);
+ document.getElementById('dProductMoneyNew').value = batchPriceUpdateObj[`d${models}Money`];
+ }
+ }
+ }
+ }
+ };
+
+ /** 渲染 */
+ render() {
+ const {
+ batchPriceUpdateData, visibleBatchPriceUpdate, app, sModelsType,
+ } = this.props;
+ // const pane = app.panes.filter(paneTmp => paneTmp.key === sTabId)[0];
+ const disabled = true;
+ const priceBatchUpdate = commonFunc.showMessage(app.commonConst, 'priceBatchUpdate');/* 价格批量更新 */
+ const OldQty = commonFunc.showMessage(app.commonConst, 'OldQty');/* 原数量 */
+ const OldMaterialsQty = commonFunc.showMessage(app.commonConst, 'OldMaterialsQty');/* 原换算数量 */
+ const OldPrice = commonFunc.showMessage(app.commonConst, 'OldPrice');/* 原单价 */
+ const OldTotalMoney = commonFunc.showMessage(app.commonConst, 'OldTotalMoney');/* 原金额 */
+ const qty = commonFunc.showMessage(app.commonConst, 'qty');/* 数量 */
+ const materialsQty = commonFunc.showMessage(app.commonConst, 'materialsQty');/* 换算数量 */
+ const price = commonFunc.showMessage(app.commonConst, 'price');/* 单价 */
+ const money = commonFunc.showMessage(app.commonConst, 'money');/* 金额 */
+ // const sChangePriceMemoTitle = commonFunc.showMessage(app.commonConst, 'sChangePriceMemoTitle');/* 价格批量更新备注 */
+
+ /* 通用价格批量更新 */
+ let dQty = 0;
+ let dPrice = 0;
+ let dMoney = 0;
+ let dMaterialsQty = 0;
+ let models = '';
+ let batchPriceUpdateObj = {};
+ if (commonUtils.isNotEmptyObject(sModelsType)) {
+ models = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'Product' : 'Materials';
+ const sFieldName = sModelsType.includes('sales/') || sModelsType.includes('manufacture/') || sModelsType.includes('productStock/') ? 'dProductQty' : 'dAuxiliaryQty';
+ batchPriceUpdateObj = commonUtils.isNotEmptyArr(batchPriceUpdateData) ? batchPriceUpdateData[0] : {};
+ if (commonUtils.isNotEmptyObject(batchPriceUpdateObj)) {
+ dQty = batchPriceUpdateObj[sFieldName];
+ if (models === 'Product') { /* 产品 取外币单价、外币金额 */
+ dPrice = batchPriceUpdateObj[`d${models}ForeignPrice`];
+ if (commonUtils.isEmptyNumber(dPrice) || dPrice === 0) { /* 外币单价为0时,等于本位币单价 */
+ dPrice = batchPriceUpdateObj[`d${models}Price`];
+ }
+
+ dMoney = batchPriceUpdateObj[`d${models}ForeignMoney`];
+ if (commonUtils.isEmptyNumber(dMoney) || dMoney === 0) { /* 外币金额为0时,等于本位币金额 */
+ dMoney = batchPriceUpdateObj[`d${models}Money`];
+ }
+ } else {
+ dPrice = batchPriceUpdateObj[`d${models}Price`];
+ dMoney = batchPriceUpdateObj[`d${models}Money`];
+ }
+ dMaterialsQty = batchPriceUpdateObj.dMaterialsQty;
+ }
+ }
+
+ return (
+
+ { visibleBatchPriceUpdate ?
+
+
+
+ : '' }
+
+ );
+ }
+}
diff --git a/src/components/CommonElementEvent/BatchWorkListPriceUpdate.js b/src/components/CommonElementEvent/BatchWorkListPriceUpdate.js
new file mode 100644
index 0000000..daabaf5
--- /dev/null
+++ b/src/components/CommonElementEvent/BatchWorkListPriceUpdate.js
@@ -0,0 +1,198 @@
+/**
+ * 此组件用于生产工单列表批量更新价格 by pm 20210518
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Input, message, Radio } from 'antd';
+import styles from '../../index.less';
+import * as commonBusiness from '../Common/commonBusiness';
+import * as commonServices from '../../services/services'; /* 服务类 */
+import commonConfig from '../../utils/config';
+import * as commonUtils from '../../utils/utils';
+import * as commonFunc from '../Common/commonFunc';
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+
+export default class BatchWorkListPriceUpdate extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.state = {
+ radioValue: 1,
+
+ };
+ this.formatOk = -1;
+ }
+
+ handleBtnSave = () => {
+ const {
+ reportData, reportDelData, reportConfig,
+ } = this.props;
+ const data = [];
+ if (!commonBusiness.validateTable(reportConfig, reportData)) {
+ return;
+ }
+ data.push(commonBusiness.mergeData('report', 'sysreport', reportData, reportDelData));
+ this.handleSaveData({ data, sClientType: '1', optName: commonFunc.showMessage(app.commonConst, 'priceSaveSucess') });
+ };
+ handleSaveData = async (params) => {
+ const {
+ token, sModelsId, masterData,
+ } = this.props;
+ const returnData = await commonBusiness.saveData({ token, value: params, sModelsId });
+ if (returnData.code === 1) {
+ this.props.onSaveState({
+ enabled: false, currentId: masterData.sId,
+ });
+ this.getReportData();
+ } else {
+ this.props.getServiceError(returnData);
+ }
+ };
+
+ handleOk = async () => {
+ const {
+ sModelsId, app, slaveConfig, slaveSelectedRowKeys, slaveFilterCondition,
+ } = this.props;
+ const { radioValue } = this.state;
+ const dProductPrice = document.getElementById('dProductPriceNew').value;
+ const dFlowRate = document.getElementById('dFlowRate').value; /* 上浮比率 */
+
+ if (this.formatOk > -1) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'DecimalOut'));
+ return;
+ }
+ /* 勾选行文本框作为单价的参数 */
+ let dNProductPrice = 0;
+ let dFloatRate = 0;
+ /* 数据参数 */
+ const value = {
+ sProName: 'Sp_System_BatchWorkListPriceMoney',
+ paramsMap: {
+ sFormGuid: sModelsId, sSrcGuid: slaveSelectedRowKeys,
+ },
+ };
+ if (radioValue === 1) { /* 上浮比率 */
+ dFloatRate = dFlowRate;
+ value.paramsMap.dFloatRate = dFloatRate;
+ } else if (radioValue === 2) {
+ dNProductPrice = dProductPrice;
+ value.paramsMap.dNProductPrice = dNProductPrice;
+ }
+ const url = `${commonConfig.server_host}business/updatePriceBatch?sModelsId=${sModelsId}`;
+ const returnData = (await commonServices.postValueService(app.token, value, url)).data;
+ if (returnData.code === 1) { /* 成功 */
+ message.success(commonFunc.showMessage(app.commonConst, 'priceSaveSucess') + returnData.msg);
+ document.getElementById('dProductPriceNew').value = '';
+ document.getElementById('dFlowRate').value = '';
+ this.props.onGetData(slaveConfig, slaveFilterCondition);
+ } else { /* 失败 */
+ this.props.getServiceError({ msg: commonFunc.showMessage(app.commonConst, 'priceSaveSucess') + returnData.msg });
+ }
+ this.props.onSaveState({
+ visibleBatchWorkListPriceUpdate: false,
+ enabled: false,
+ });
+ };
+
+ handleCancel = () => {
+ this.props.onSaveState({
+ visibleBatchWorkListPriceUpdate: false,
+ enabled: false,
+ });
+ };
+ handleRadioChange = (e) => {
+ this.setState({
+ radioValue: e.target.value,
+ });
+ };
+
+ handleChange = (name) => {
+ const { slaveConfig, app } = this.props;
+ const dPprice = this.props.getFloatNum('dProductPrice'); /* 获取系统设定小数位 */
+ const priceValue = document.getElementById('dProductPriceNew').value;
+ const iNewIndex = slaveConfig.gdsconfigformslave.findIndex(item => item.sName === 'dProductPrice');
+ if (iNewIndex > -1 && (commonUtils.isNotEmptyObject(slaveConfig.gdsconfigformslave[iNewIndex].sMaxValue) || commonUtils.isNotEmptyObject(slaveConfig.gdsconfigformslave[iNewIndex].sMinValue))) {
+ const product = slaveConfig.gdsconfigformslave[iNewIndex];
+ document.getElementById('dProductMoneyNew').value = 0;
+ if (commonUtils.isNotEmptyObject(product.sMaxValue) && parseFloat(product.sMaxValue, dPprice) < parseFloat(priceValue, dPprice)) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxValue') + product.sMaxValue);
+ }
+ if (commonUtils.isNotEmptyObject(product.sMinValue) && parseFloat(product.sMinValue, dPprice) < parseFloat(priceValue, dPprice)) {
+ message.warning(commonFunc.showMessage(app.commonConst, 'minValue') + product.sMinValue);
+ }
+ } else {
+ const rep = /\d+\.(\d*)/;
+ if (name === 'dProductPriceNew') {
+ const pointRep = priceValue.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = priceValue.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(priceValue)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > dPprice) {
+ this.formatOk = 1;
+ document.getElementById('dProductMoneyNew').value = 0;
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxPointLength') + dPprice);
+ } else if (pointRep === null && priceValue.length > 9) { /* 整数超9位 */
+ message.warning(`${commonFunc.showMessage(app.commonConst, 'maxIntegerLength')}9`);
+ this.formatOk = 1;
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ }
+ }
+ if (name === 'dFlowRate') {
+ const dFlowRate = document.getElementById('dFlowRate').value; /* 上浮比率 */
+ const pointRep = dFlowRate.match(rep); /* 匹配小数,若为整数,则为空 */
+ const point = dFlowRate.replace(rep, '$1');/* 通过正则表达式获取小数位后长度 */
+ if (isNaN(dFlowRate)) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'formatCheck'));
+ return;
+ }
+ if (pointRep !== null && point.length > dPprice) {
+ this.formatOk = 1;
+ message.warning(commonFunc.showMessage(app.commonConst, 'maxPointLength') + dPprice);
+ } else {
+ this.formatOk = -1;/* 确定时,输入规则正常标志 */
+ }
+ }
+ }
+ };
+
+ /** 渲染 */
+ render() {
+ const {
+ batchPriceWorkListUpdateData, visibleBatchWorkListPriceUpdate, app,
+ } = this.props;
+ const priceBatchUpdate = commonFunc.showMessage(app.commonConst, 'workPriceBatchUpdate');/* 价格批量更新 */
+ const sOrderMoney = commonFunc.showMessage(app.commonConst, 'sOrderMoney');/* 订货单价标题 */
+ const sFlowRate = commonFunc.showMessage(app.commonConst, 'sFlowRate');/* 浮动比率%标题 */
+ return (
+
+ { visibleBatchWorkListPriceUpdate ?
+
+
+
+ : '' }
+
+ );
+ }
+}
diff --git a/src/components/CommonElementEvent/CheckModelInfo.js b/src/components/CommonElementEvent/CheckModelInfo.js
new file mode 100644
index 0000000..6991c7f
--- /dev/null
+++ b/src/components/CommonElementEvent/CheckModelInfo.js
@@ -0,0 +1,91 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class CheckModelInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const CheckModelComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const tabUser = commonFunc.showMessage(app.commonConst, 'tabUser');/* 主体内容 */
+ const tabPhase = commonFunc.showMessage(app.commonConst, 'tabPhase');/* 审批信息 */
+ const tabcheckCondition = commonFunc.showMessage(app.commonConst, 'checkCondition');/* 审批条件 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(CheckModelInfoComponent));
+
diff --git a/src/components/CommonElementEvent/CheckPhaseInfo.js b/src/components/CommonElementEvent/CheckPhaseInfo.js
new file mode 100644
index 0000000..7b16a9f
--- /dev/null
+++ b/src/components/CommonElementEvent/CheckPhaseInfo.js
@@ -0,0 +1,83 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class CheckModelInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const CheckModelComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const checkPerson = commonFunc.showMessage(app.commonConst, 'checkPerson');/* 审核人 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(CheckModelInfoComponent));
+
diff --git a/src/components/CommonElementEvent/CustomerInfo.js b/src/components/CommonElementEvent/CustomerInfo.js
new file mode 100644
index 0000000..c80ce82
--- /dev/null
+++ b/src/components/CommonElementEvent/CustomerInfo.js
@@ -0,0 +1,142 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';
+import * as commonUtils from '../../utils/utils';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+class CustomerInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const CustomerComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app, masterConfig,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const masterShowConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName !== '') : [];
+ const tableConfigTypeArr = [];
+ masterShowConfig.map((child) => {
+ if (child.sControlName.indexOf('_') > -1) {
+ const tableType = child.sControlName.split('_')[1];
+ const isIndex = tableConfigTypeArr.findIndex(item => item === tableType);
+ if (isIndex === -1) {
+ tableConfigTypeArr.push(child);
+ }
+ }
+ });
+ const firstTableConfigTypeIndex = commonUtils.isNotEmptyArr(tableConfigTypeArr) ? tableConfigTypeArr[0].sControlName.replace(/[^\d]/g, ' ') : '0';
+ const tabContact = commonFunc.showMessage(app.commonConst, 'tabContact');/* 联系人 */
+ const tabAddress = commonFunc.showMessage(app.commonConst, 'tabAddress');/* 地址 */
+ const tabEleCustomerFinance = commonFunc.showMessage(app.commonConst, 'tabEleCustomerFinance');/* 财务 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(CustomerInfoComponent));
+
diff --git a/src/components/CommonElementEvent/ElemachineInfo.js b/src/components/CommonElementEvent/ElemachineInfo.js
new file mode 100644
index 0000000..709b94d
--- /dev/null
+++ b/src/components/CommonElementEvent/ElemachineInfo.js
@@ -0,0 +1,236 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Spin, Tabs, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import CommonView from '../Common/CommonView';
+import * as commonUtils from '../../utils/utils';
+import StaticEditTable from '../Common/CommonTable';
+import * as commonBusiness from '../Common/commonBusiness';
+
+import commonConfig from '../../utils/config';/* 通用方法 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+let oThis;
+class ElemachineInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ oThis = this;
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const EleMachineInfoComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData, masterConfig } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig);
+ return obj;
+ },
+})((props) => {
+ const {
+ form,
+ app,
+ onReturnForm,
+ iPlcNoConfig,
+ slave0Config,
+ slave1Config,
+ slave2Config,
+ masterData,
+ AutoTableHeight,
+ masterConfig,
+ slaveData,
+ slavePagination,
+ isSmall,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+ const masterShowConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.bVisible && item.sName !== '') : [];
+ const tableConfigTypeArr = [];
+ masterShowConfig.map((child) => {
+ if (child.sControlName.indexOf('_') > -1) {
+ const tableType = child.sControlName.split('_')[1];
+ const isIndex = tableConfigTypeArr.findIndex(item => item === tableType);
+ if (isIndex === -1) {
+ tableConfigTypeArr.push(tableType);
+ }
+ }
+ });
+ const firstTableConfigTypeIndex = commonUtils.isNotEmptyArr(tableConfigTypeArr) ? tableConfigTypeArr[0].replace(/[^\d]/g, ' ') : '0';
+ const pagination = {
+ pageSize: commonConfig.pageSize,
+ total: commonUtils.isEmptyArr(slaveData) ? 0 : slaveData.length,
+ current: commonUtils.isEmptyObject(slavePagination) ? 1 : slavePagination.current,
+ hideOnSinglePage: false,
+ size: isSmall ? 'small' : 'large',
+ pageSizeOptions: commonConfig.pageSizeOptions,
+ showSizeChanger: !isSmall,
+ showQuickJumper: !isSmall,
+ };
+
+ let fixedHeight = oThis.cacheFixedHeight || '500px';
+ if (oThis.tabRef) {
+ const tabPositionY = oThis.tabRef.getBoundingClientRect().y;
+ if (tabPositionY > 0) {
+ fixedHeight = `calc(100vh - ${tabPositionY + 130}px)`;
+ oThis.cacheFixedHeight = fixedHeight;
+ }
+ }
+ // const autoHeight = `calc( ${AutoTableHeight} - 90px)`;
+ const slaveTableProps = {
+ ...commonBusiness.getTableTypes('slave', props),
+ tableProps: {
+ onChange: props.onTitleChange, pagination, AutoTableHeight: false,
+ },
+ fixedHeight,
+ // templateProps,
+ };
+ const slave0TableProps = {
+ ...commonBusiness.getTableTypes('slave0', props),
+ tableProps: {
+ onChange: props.onTitleChange, pagination, AutoTableHeight: false,
+ },
+ fixedHeight,
+ // templateProps,
+ };
+ const slave1TableProps = {
+ ...commonBusiness.getTableTypes('slave1', props),
+ tableProps: {
+ onChange: props.onTitleChange, pagination, AutoTableHeight: false,
+ },
+ fixedHeight,
+ // templateProps,
+ };
+ const slave2TableProps = {
+ ...commonBusiness.getTableTypes('slave2', props),
+ tableProps: {
+ onChange: props.onTitleChange, pagination, AutoTableHeight: false,
+ },
+ fixedHeight,
+ // templateProps,
+ };
+
+ const MainContent = masterConfig && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave) && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'MainContent')) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'MainContent')[0].showName : commonFunc.showMessage(app.commonConst, 'MainContent'); /* 从表 */
+ const materialsInfo = masterConfig && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave) && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'zMaterials')) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'zMaterials')[0].showName : commonFunc.showMessage(app.commonConst, 'zMaterials'); /* 表一 */
+ const checkInfo = masterConfig && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave) && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'zCheck')) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'zCheck')[0].showName : commonFunc.showMessage(app.commonConst, 'zCheck'); /* 表二 */
+ const slaveInfo0 = masterConfig && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave) && commonUtils.isNotEmptyArr(masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'zSlaveInfo0')) ? masterConfig.gdsconfigformslave.filter(item => item.sControlName === 'zSlaveInfo0')[0].showName : commonFunc.showMessage(app.commonConst, 'zSlaveInfo0'); /* 表三 */
+
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(ElemachineInfoComponent));
+
diff --git a/src/components/CommonElementEvent/EleteamInfo.js b/src/components/CommonElementEvent/EleteamInfo.js
new file mode 100644
index 0000000..7fa6158
--- /dev/null
+++ b/src/components/CommonElementEvent/EleteamInfo.js
@@ -0,0 +1,124 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class EleteamInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const EleteamComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData, masterConfig } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, masterData, AutoTableHeight, app, masterConfig,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+ let tabEleemployee = commonFunc.showMessage(app.commonConst, 'tabEleemployee');/* 员工 */
+ let bShowTabEleemployee = true;
+ let tabElemachine = commonFunc.showMessage(app.commonConst, 'tabElemachine');/* 机台 */
+ let bShowTabElemachine = true;
+
+ if (commonUtils.isNotEmptyObject(masterConfig)) {
+ const iIndex0 = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'zSlaveInfo0');
+ if (iIndex0 > -1) {
+ tabEleemployee = masterConfig.gdsconfigformslave[iIndex0].showName;
+ bShowTabEleemployee = masterConfig.gdsconfigformslave[iIndex0].bVisible;
+ }
+ const iIndex1 = masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'zSlaveInfo1');
+ if (iIndex1 > -1) {
+ tabElemachine = masterConfig.gdsconfigformslave[iIndex1].showName;
+ bShowTabElemachine = masterConfig.gdsconfigformslave[iIndex1].bVisible;
+ }
+ }
+
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(EleteamInfoComponent));
+
diff --git a/src/components/CommonElementEvent/EmployeeInfo.js b/src/components/CommonElementEvent/EmployeeInfo.js
new file mode 100644
index 0000000..3158bf1
--- /dev/null
+++ b/src/components/CommonElementEvent/EmployeeInfo.js
@@ -0,0 +1,76 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import CommonView from '../Common/CommonView';
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+
+class CustomerInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const CustomerComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData, masterConfig } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig);
+ return obj;
+ },
+})((props) => {
+ const { form, onReturnForm, masterData } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(CustomerInfoComponent));
+
diff --git a/src/components/CommonElementEvent/FilfileManageInfo.js b/src/components/CommonElementEvent/FilfileManageInfo.js
new file mode 100644
index 0000000..52db2dc
--- /dev/null
+++ b/src/components/CommonElementEvent/FilfileManageInfo.js
@@ -0,0 +1,216 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Button, Layout, message, Spin } from 'antd';
+import StaticEditTable from '../Common/CommonTable';
+import * as commonBusiness from '../Common/commonBusiness';
+import CommonBase from '../Common/CommonBase';
+import CommonClassifyEvent from '../Common/CommonClassifyEvent';
+import * as commonFunc from '../Common/commonFunc';
+import commonConfig from '../../utils/config';
+import * as commonUtils from '../../utils/utils';/* 通用单据方法 */ /* 通用单据方法 */
+// import CommonListEvent from '../Common/CommonListEvent';
+
+const { Content } = Layout;
+class FilfileManageInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ handleOk = async (name) => {
+ const { app, slaveData, slaveDelData } = this.props;
+ try {
+ await this.props.onSubmit();/* 通用保存 */
+ } catch (error) {
+ return;
+ }
+ /*
+ slaveData:文件上传数据
+ slaveDelData:文件已删除数据
+ app.currentPane.sSrcSlaveId:工单控制表选中行sId
+ */
+ this.props.app.currentPane.onFilfileOk(name, app.currentPane.config, slaveData, app.currentPane.sSrcSlaveId, slaveDelData);
+ };
+
+ handleCancel = (name) => {
+ this.props.app.currentPane.onFilfileCancel(name);
+ };
+ /** 上传后执行函数 */
+ handleBeforeUpload = (file) => {
+ const { type = '' } = file;
+ const { config = {} } = this.props;
+ const { sActiveKey = '' } = config;
+ if (sActiveKey === 'image') {
+ if (!type.startsWith('image')) {
+ message.warning('该模块只允许上传【图片】!');
+ return false;
+ }
+ } else if (sActiveKey === 'pdf') {
+ if (type !== 'application/pdf') {
+ message.warning('该模块只允许上传【PDF】!');
+ return false;
+ }
+ } else if (sActiveKey.includes('image') && sActiveKey.includes('pdf')) {
+ if (!type.startsWith('image') && type !== 'application/pdf') {
+ message.warning('该模块只允许上传【图片/PDF】!');
+ return false;
+ }
+ }
+ return true;
+ };
+ /** 上传后执行函数(单一上传) */
+ handleUploadChangeSingle = (info, name) => {
+ const { app } = this.props;
+ const { currentPane } = app;
+ const { file } = info;
+ if (file.response && file.response.code === 1) {
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const { masterData } = this.props;
+ let { [`${name}Data`]: tableData } = this.props;
+ if (commonUtils.isEmptyArr(tableData)) {
+ tableData = [];
+ }
+ const tableDataRow = this.props.onDataRowAdd(name, true);/* 选中行 */
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ tableDataRow.sProductNo = masterData.sProductNo !== undefined ? masterData.sProductNo : '';
+ tableDataRow.sProductName = masterData.sProductName !== undefined ? masterData.sProductName : '';
+ }
+ tableDataRow.iOrder = tableData.length + 1;
+ tableDataRow.sSrcNo = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcNo : '';
+ tableDataRow.sSrcFormId = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcFormId : '';
+ tableDataRow.sSrcId = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcId : '';
+ tableDataRow.sSrcSlaveId = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcSlaveId : '';
+ tableDataRow.sPicturePath = file.response && file.response.code === 1 ? sPicturePath : '';
+ tableDataRow.sFileName = file.response && file.response.code === 1 ? file.name : '';
+ tableData.push(tableDataRow);
+ this.props.onSaveState({ [`${name}Data`]: tableData });
+ } else if (file.response && file.response.code === -1) {
+ message.error(file.response.msg);
+ }
+ };
+
+ /* 多文件上传 */
+ handleUploadChange = (info, name) => {
+ const { app } = this.props;
+ const { currentPane } = app;
+ const { fileList: fileListOlld } = info;
+ const fileList = fileListOlld.filter(item => item.status);
+ let uploadDone = true;
+ fileList.forEach((item) => {
+ if (item.status !== 'done') {
+ uploadDone = false;
+ }
+ });
+ if (uploadDone) {
+ let { [`${name}Data`]: tableData } = this.props;
+ if (commonUtils.isEmptyArr(tableData)) {
+ tableData = [];
+ }
+ fileList.forEach((file) => {
+ if (file.response && file.response.code === 1) {
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const { masterData } = this.props;
+ const tableDataRow = this.props.onDataRowAdd(name, true);/* 选中行 */
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ tableDataRow.sProductNo = masterData.sProductNo !== undefined ? masterData.sProductNo : '';
+ tableDataRow.sProductName = masterData.sProductName !== undefined ? masterData.sProductName : '';
+ }
+ tableDataRow.iOrder = tableData.length + 1;
+ tableDataRow.sSrcNo = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcNo : '';
+ tableDataRow.sSrcFormId = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcFormId : '';
+ tableDataRow.sSrcId = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcId : '';
+ tableDataRow.sSrcSlaveId = commonUtils.isNotEmptyObject(currentPane) ? currentPane.sSrcSlaveId : '';
+ tableDataRow.sPicturePath = file.response && file.response.code === 1 ? sPicturePath : '';
+ tableDataRow.sFileName = file.response && file.response.code === 1 ? file.name : '';
+ tableData.push(tableDataRow);
+ console.log('12', tableData);
+ // this.props.onSaveState({ [`${name}Data`]: tableData, enabled: true });
+ } else if (file.response && file.response.code === -1) {
+ message.error(file.response.msg);
+ }
+ });
+ this.props.onSaveState({ [`${name}Data`]: tableData });
+ }
+ };
+
+ /** 通用下载 */
+ handleDownload = (name, flag, tableSelectedRowKeys) => {
+ const {
+ [`${name}Data`]: tableData, sModelsId, app,
+ } = this.props;
+ if (tableSelectedRowKeys === undefined || tableSelectedRowKeys.length !== 1) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo'));/* 请先选择一条数据 */
+ return;
+ }
+ const dataSelect = tableData.filter(item => item.sId === tableSelectedRowKeys[0]);
+ const { token } = this.props.app;
+ const { sPicturePath } = dataSelect[0];
+ const urlPrint = `${commonConfig.file_host}file/download?sModelsId=${sModelsId}&token=${token}&savePathStr=${sPicturePath}`;
+ window.open(urlPrint);
+ };
+ render() {
+ return (
+
+ );
+ }
+}
+
+const FilfileManageComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const filfilemanageProps = {
+ ...commonBusiness.getTableTypes('slave', props),
+ uploadFileTypeVerification: true,
+ tableProps: { setUpload: true, setDownload: true },
+ enabled: true,
+ };
+ return (
+
+ );
+});
+
+export default CommonBase(CommonClassifyEvent(FilfileManageInfoComponent));
+
diff --git a/src/components/CommonElementEvent/KnifeMouldInfo.js b/src/components/CommonElementEvent/KnifeMouldInfo.js
new file mode 100644
index 0000000..fdca747
--- /dev/null
+++ b/src/components/CommonElementEvent/KnifeMouldInfo.js
@@ -0,0 +1,137 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar, message } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+class KnifeMouldInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ /** 上传后执行函数 */
+ handleBeforeUpload = () => {
+ // const isLt10M = file.size / 1024 / 1024 < 10;
+ // if (!isLt10M) {
+ // message.error(commonFunc.showMessage(this.props.app.commonConst, 'picMax'));/* 图片大小需小于10MB! */
+ // }
+ };
+ /** 上传后执行函数 */
+ handleUploadChange = (info, name) => {
+ const { file } = info;
+ if (file.response && file.response.code === 1) {
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const uploadInfo = {
+ sPicturePath,
+ sFileName: file.name,
+ };
+ const tableDataRow = this.props.onDataRowAdd(name, true);
+ const { [`${name}Column`]: tableColumn, masterData, [`${name}Data`]: tableData } = this.props;
+ tableColumn.forEach((slaveChild) => {
+ const ckey = slaveChild.dataIndex;
+ if (ckey === 'sProductNo' || ckey === 'sProductName') {
+ tableDataRow[ckey] = masterData[ckey] !== undefined ? masterData[ckey] : '';
+ } else if (ckey === 'iOrder') {
+ tableDataRow[ckey] = '';
+ } else if (file.response && file.response.code === 1) {
+ if (uploadInfo[ckey] !== undefined) {
+ tableDataRow[ckey] = uploadInfo[ckey];
+ }
+ }
+ });
+ tableData.push(tableDataRow);
+ this.props.onSaveState({ [`${name}Data`]: tableData });
+ } else if (file.response && file.response.code === -1) {
+ message.error(file.response.msg);
+ }
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const KnifeMouldComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const tabKnifemouldproduct = commonFunc.showMessage(app.commonConst, 'tabKnifemouldproduct');/* 刀模信息 */
+ const tabPicFile = commonFunc.showMessage(app.commonConst, 'tabPicFile');/* 图片上传 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(KnifeMouldInfoComponent));
+
diff --git a/src/components/CommonElementEvent/MaterialsInfo.js b/src/components/CommonElementEvent/MaterialsInfo.js
new file mode 100644
index 0000000..3238af7
--- /dev/null
+++ b/src/components/CommonElementEvent/MaterialsInfo.js
@@ -0,0 +1,100 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class MaterialsInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const MaterialsComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const tabSupply = commonFunc.showMessage(app.commonConst, 'tabSupply');/* 询价信息 */
+ const tabStock = commonFunc.showMessage(app.commonConst, 'tabStock');/* 仓库 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(MaterialsInfoComponent));
+
diff --git a/src/components/CommonElementEvent/MonthEndingClosing.js b/src/components/CommonElementEvent/MonthEndingClosing.js
new file mode 100644
index 0000000..0d13bb7
--- /dev/null
+++ b/src/components/CommonElementEvent/MonthEndingClosing.js
@@ -0,0 +1,71 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Spin } from 'antd';
+import styles from '../../index.less';
+// import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+import CommonView from '../Common/CommonViewNew';
+
+const { Content } = Layout;
+
+class MonthEndingClosingInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const MonthEndingClosingComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, masterData,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(MonthEndingClosingInfoComponent));
+
diff --git a/src/components/CommonElementEvent/PaymentTermsInfo.js b/src/components/CommonElementEvent/PaymentTermsInfo.js
new file mode 100644
index 0000000..3e96ae2
--- /dev/null
+++ b/src/components/CommonElementEvent/PaymentTermsInfo.js
@@ -0,0 +1,70 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Spin } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonView from '../Common/CommonViewNew';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+
+class PaymentTermsInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const PaymentTermsComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const { form, onReturnForm, masterData } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = false;
+ }
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(PaymentTermsInfoComponent));
+
diff --git a/src/components/CommonElementEvent/PrintInfo.js b/src/components/CommonElementEvent/PrintInfo.js
new file mode 100644
index 0000000..a29897c
--- /dev/null
+++ b/src/components/CommonElementEvent/PrintInfo.js
@@ -0,0 +1,193 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar, message } from 'antd';
+import styles from '@/index.less';
+import Toolbar from '@/components/Common/ToolBar/ToolBarNew';
+import * as commonFunc from '@/components/Common/commonFunc';
+import CommonBase from '@/components/Common/CommonBase';
+import CommonElementEvent from '@/components/Common/CommonElementEvent';
+import StaticEditTable from '@/components/Common/CommonTable';/* 可编辑表格 */
+import CommonView from '@/components/Common/CommonView';
+import * as commonBusiness from '@/components/Common/commonBusiness';/* 单据业务功能 */
+import commonConfig from '@/utils/config';
+import * as commonUtils from '@/utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class PrintInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ /** 上传后执行函数 */
+ handleBeforeUpload = () => {
+ // if (!file.type.includes('image/')) {
+ // message.error('请上传正确的图片类型!');
+ // return false;
+ // }
+ // const isLt10M = file.size / 1024 / 1024 < 10;
+ // if (!isLt10M) {
+ // message.error(commonFunc.showMessage(this.props.app.commonConst, 'picMax'));/* 图片大小需小于10MB! */
+ // }
+ };
+ /** 上传后执行函数 */
+ handleUploadChange = (info, name) => {
+ const { file } = info;
+ if (file.response && file.response.code === 1) {
+ /* 图片类型验证 */
+ // if (!file.type.includes('image/')) {
+ // return false;
+ // }
+ const sPicturePath = file.response.dataset.rows[0].savePathStr;
+ const spicture = sPicturePath;
+ const uploadInfo = {
+ sPicturePath,
+ sFileName: file.name,
+ spicture,
+ };
+ const { [`${name}Column`]: tableColumn, masterData, [`${name}Data`]: tableData } = this.props;
+ if (commonUtils.isNotEmptyArr(tableData) && commonUtils.isEmpty(tableData[tableData.length - 1].sPicturePath)) {
+ tableData[tableData.length - 1].sPicturePath = uploadInfo.sPicturePath;
+ tableData[tableData.length - 1].spicture = spicture;
+ tableData[tableData.length - 1] = {
+ ...tableData[tableData.length - 1], sPicturePath: uploadInfo.sPicturePath, sFileName: uploadInfo.sFileName, spicture, handleType: commonUtils.isEmpty(tableData[tableData.length - 1].handleType) ? 'update' : tableData[tableData.length - 1].handleType,
+ };
+ } else {
+ const tableDataRow = this.props.onDataRowAdd(name, true);
+ tableColumn.forEach((slaveChild) => {
+ const ckey = slaveChild.dataIndex;
+ if (ckey === 'sProductNo' || ckey === 'sProductName') {
+ tableDataRow[ckey] = masterData[ckey] !== undefined ? masterData[ckey] : '';
+ } else if (ckey === 'iOrder') {
+ tableDataRow[ckey] = tableData.length + 1;
+ } else if (file.response && file.response.code === 1) {
+ if (uploadInfo[ckey] !== undefined) {
+ tableDataRow[ckey] = uploadInfo[ckey];
+ }
+ }
+ });
+ tableData.push(tableDataRow);
+ }
+ this.props.onSaveState({ [`${name}Data`]: tableData, enabled: true });
+ } else if (file.response && file.response.code === -1) {
+ message.error(file.response.msg);
+ }
+ };
+ /** 查看 */
+ handleTableLook = (name) => {
+ const { [`${name}SelectedRowKeys`]: selectedRowKeys, [`${name}Data`]: data, app } = this.props;
+ if (selectedRowKeys === undefined || selectedRowKeys.length !== 1) {
+ return message.warning(commonFunc.showMessage(app.commonConst, 'pleaseChooseDataLook'));/* 请选择一条数据进行查看 */
+ } else {
+ const dataSelect = data.filter(item => item.sId === selectedRowKeys[0]);
+ const { currentId } = this.state;
+ const { token } = this.props.app;
+ const { sPicturePath } = dataSelect[0];
+ const previewUrl = `${commonConfig.file_host}file/download?sModelsId=${currentId}&token=${token}&savePathStr=${sPicturePath}`;
+ this.props.onSaveState({ previewImage: previewUrl, previewVisible: true });
+ }
+ };
+ /** 删除 */
+ handleTableDel= (name, isWait, tableSelectedRowKeys) => {
+ this.props.onDataRowDel(name, isWait, tableSelectedRowKeys);
+ this.props.onSaveState({ enabled: true });
+ };
+ /** 关闭弹窗 */
+ handleModalCancel = () => {
+ this.props.onSaveState({ previewVisible: false, previewImage: '' });
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const PrintComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, masterData, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+ const tabPicFile = commonFunc.showMessage(app.commonConst, 'tabPicFile');/* 图片文件 */
+ const tabStock = commonFunc.showMessage(app.commonConst, 'tabStock');/* 仓库 */
+ const tabcustomerInfo = commonFunc.showMessage(app.commonConst, 'tabcustomerInfo');/* 客户信息功能 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(PrintInfoComponent));
+
diff --git a/src/components/CommonElementEvent/ProcessInfo.js b/src/components/CommonElementEvent/ProcessInfo.js
new file mode 100644
index 0000000..d50b610
--- /dev/null
+++ b/src/components/CommonElementEvent/ProcessInfo.js
@@ -0,0 +1,329 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class ProcessInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ handleAddRow = (name, sType) => {
+ const tableData = JSON.parse(JSON.stringify(this.props[`${name}Data`] || []));
+ const tableDataRow = { ...this.props.onDataRowAdd(name, true), sType };
+ tableData.push(tableDataRow);
+ this.props.onSaveState({
+ [`${name}Data`]: tableData,
+ });
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const ProcessComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData, masterConfig } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, masterData, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+ let tabMachine = commonFunc.showMessage(app.commonConst, 'tabMachine');/* 对应机台 */
+ let tabAssort = commonFunc.showMessage(app.commonConst, 'tabAssort');/* 配套工序 */
+ let tabOutside = commonFunc.showMessage(app.commonConst, 'tabOutside');/* 發外公式 */
+ let tabProcessstyle = commonFunc.showMessage(app.commonConst, 'tabProcesstyle');/* 工序规格 */
+ let tabProcessApsRule = commonFunc.showMessage(app.commonConst, 'tabProcessApsRule');/* APS规则定义 */
+ // const tabDynamicParam = commonFunc.showMessage(app.commonConst, 'tabDynamicParam'); /* 动态参数 */
+ let tabOrderParam = commonFunc.showMessage(app.commonConst, 'tabOrderParam'); /* 工单参数 */
+ let tabOfferParam = commonFunc.showMessage(app.commonConst, 'tabOfferParam'); /* 报价参数 */
+ let tabReportParam = commonFunc.showMessage(app.commonConst, 'tabReportParam'); /* 上报参数 */
+
+ let bMachine = true; /* 对应机台 */
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabMachine'); /* 对应机台 */
+ if (iIndexProcess > -1) {
+ bMachine = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabMachine = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+ let bAssort = true; /* 配套工序 */
+
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabAssort'); /* 配套工序 */
+ if (iIndexProcess > -1) {
+ bAssort = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabAssort = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+ let bOutside = true; /* 發外公式 */
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabOutSide'); /* 發外公式 */
+ if (iIndexProcess > -1) {
+ bOutside = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabOutside = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+ let bProcessstyle = true; /* 工序规格 */
+
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabProcessStyle'); /* 工序规格 */
+ if (iIndexProcess > -1) {
+ bProcessstyle = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabProcessstyle = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+ let bProcesssApsRule = true; /* APS规则定义 */
+
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabAPS'); /* APS规则定义 */
+ if (iIndexProcess > -1) {
+ bProcesssApsRule = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabProcessApsRule = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+ let bOrderParam = true; /* 工单参数 */
+
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabProcessParam'); /* 工单参数 */
+ if (iIndexProcess > -1) {
+ bOrderParam = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabOrderParam = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+ let bOfferParam = true; /* 报价参数 */
+
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabQuoParam'); /* 报价参数 */
+ if (iIndexProcess > -1) {
+ bOfferParam = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabOfferParam = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+
+ let bReportParam = true; /* 上报参数 */
+
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndexProcess = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabReportParam');
+ if (iIndexProcess > -1) {
+ bReportParam = props.masterConfig.gdsconfigformslave[iIndexProcess].bVisible;
+ tabReportParam = props.masterConfig.gdsconfigformslave[iIndexProcess].sChinese;
+ }
+ }
+
+ let bNormParam = true; /* 标准书参数 */
+ let tabNormParam = '标准书参数';
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndex = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabNormParam');
+ if (iIndex > -1) {
+ bNormParam = props.masterConfig.gdsconfigformslave[iIndex].bVisible;
+ tabNormParam = props.masterConfig.gdsconfigformslave[iIndex].sChinese;
+ }
+ }
+
+ let bTestParam = true; /* 测试参数 */
+ let tabTestParam = '测试参数';
+ if (commonUtils.isNotEmptyObject(props.masterConfig) && commonUtils.isNotEmptyArr(props.masterConfig.gdsconfigformslave)) {
+ const iIndex = props.masterConfig.gdsconfigformslave.findIndex(item => item.sControlName === 'tabTestParam');
+ if (iIndex > -1) {
+ bTestParam = props.masterConfig.gdsconfigformslave[iIndex].bVisible;
+ tabTestParam = props.masterConfig.gdsconfigformslave[iIndex].sChinese;
+ }
+ }
+
+
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(ProcessInfoComponent));
+
diff --git a/src/components/CommonElementEvent/ProductClassifyInfo.js b/src/components/CommonElementEvent/ProductClassifyInfo.js
new file mode 100644
index 0000000..978d0ff
--- /dev/null
+++ b/src/components/CommonElementEvent/ProductClassifyInfo.js
@@ -0,0 +1,89 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class ProductClassifyInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const ProductClassifyComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, masterData, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ masterData.bCheck = true;
+ }
+ const tabProcessClassify = commonFunc.showMessage(app.commonConst, 'tabProcessClassify');/* 印件分类产品 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(ProductClassifyInfoComponent));
+
diff --git a/src/components/CommonElementEvent/SftLoginInfo.js b/src/components/CommonElementEvent/SftLoginInfo.js
new file mode 100644
index 0000000..c844b71
--- /dev/null
+++ b/src/components/CommonElementEvent/SftLoginInfo.js
@@ -0,0 +1,133 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import * as commonUtils from '@/utils/utils';/* 通用方法 */
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class SftLoginInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const SftLoginComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app, departgroupConfig,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const tabJurgroup = commonFunc.showMessage(app.commonConst, 'tabJurgroup');/* 权限组 */
+ const tabCustomergroup = commonFunc.showMessage(app.commonConst, 'tabCustomergroup');/* 客户查看权限 */
+ const tabSupplygroup = commonFunc.showMessage(app.commonConst, 'tabSupplygroup');/* 供应商查看权限 */
+ const tabPersongroup = commonFunc.showMessage(app.commonConst, 'tabPersongroup');/* 人员查看权限 */
+ const tabProcessgroup = commonFunc.showMessage(app.commonConst, 'tabProcessgroup');/* 工序查看权限 */
+ const tabDrivergroup = commonFunc.showMessage(app.commonConst, 'tabDrivergroup');/* 司机查看权限 */
+ const tabDepartgroup = commonFunc.showMessage(app.commonConst, 'tabDepartgroup');/* 部门查看权限 */
+ const tabApproveGroup = commonFunc.showMessage(app.commonConst, 'sftlogininfoCheck');/* 审核组权限 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(SftLoginInfoComponent));
+
diff --git a/src/components/CommonElementEvent/SisCommonStyle.js b/src/components/CommonElementEvent/SisCommonStyle.js
new file mode 100644
index 0000000..7851d1f
--- /dev/null
+++ b/src/components/CommonElementEvent/SisCommonStyle.js
@@ -0,0 +1,85 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class SisCommonStyleComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const SupplyComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const tabProductclassify = commonFunc.showMessage(app.commonConst, 'tabProductclassify');/* 产品分类 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(SisCommonStyleComponent));
+
diff --git a/src/components/CommonElementEvent/SisformulaInfo.js b/src/components/CommonElementEvent/SisformulaInfo.js
new file mode 100644
index 0000000..5dafb50
--- /dev/null
+++ b/src/components/CommonElementEvent/SisformulaInfo.js
@@ -0,0 +1,306 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Spin, Tabs, Row, Col } from 'antd';
+import styles from '@/index.less';
+import * as commonUtils from '@/utils/utils';
+import Toolbar from '@/components/Common/ToolBar/ToolBarNew';
+import * as commonFunc from '@/components/Common/commonFunc';
+import CommonBase from '@/components/Common/CommonBase';
+import CommonElementEvent from '@/components/Common/CommonElementEvent';
+import CommonView from '@/components/Common/CommonView';
+import TabCounter from '@/components/Common/CommonCalculator';
+import TabParam from '@/components/Common/commonParam';
+import * as commonBusiness from '@/components/Common/commonBusiness';/* 单据业务功能 */
+import ShowTypeNew from '@/components/Common/CommonComponent';
+import StaticEditTable from '@/components/Common/CommonTable';/* 可编辑表格 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class SisformulaInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+
+ // onDoubleClick = (record) => { /* 双击行 将参数名 @参数名放到公式框里 */
+ // if (this.props.enabled && commonUtils.isNotEmptyObject(record)) {
+ // const { sParam } = record;
+ // if (commonUtils.isNotEmptyObject(sParam)) {
+ // const { masterData: masterDataOld } = this.props;
+ // const value = `@${sParam}`;
+ // const masterData = { ...masterDataOld };
+ // const sFormulaMemo = (Object.keys(masterData).length > 0 && masterData.sFormulaMemo !== undefined) ? masterData.sFormulaMemo : '';
+ // const changeFormula = `${sFormulaMemo}${value}`;
+ // masterData.sFormula = changeFormula;
+ // masterData.sFormulaMemo = changeFormula;
+ // masterData.handleType = masterData.handleType === 'add' ? 'add' : 'update';
+ // this.props.onSaveState({ masterData });
+ // }
+ // }
+ // };
+
+ handleFieldDoubleClick = (record, sValue, showConfig, tbName) => {
+ if (!this.props.bUserModel) {
+ return;
+ }
+ const lastChar = tbName.charAt(tbName.length - 1);
+ const firstChar = this.props.onGetFirstChar(lastChar);
+ const { [`${tbName}Data`]: tableData, enabled } = this.props;
+ if (enabled && commonUtils.isNotEmptyObject(showConfig) && commonUtils.isNotEmptyArr(tableData)) {
+ if (commonUtils.isNotEmptyObject(record)) {
+ const { masterData: masterDataOld } = this.props;
+ let sParam = '';
+ /* 找到该字段所在行 */
+ const iIndex = tableData.findIndex(item => item.sId === record.sId);
+ if (iIndex > -1) {
+ sParam = `${firstChar}${iIndex}_${showConfig.sName}`;
+ } else {
+ sParam = showConfig.sName;
+ }
+ const value = `@${sParam}`;
+ const masterData = { ...masterDataOld };
+ const sFormulaMemo = (Object.keys(masterData).length > 0 && masterData.sFormulaMemo !== undefined) ? masterData.sFormulaMemo : '';
+ const changeFormula = `${sFormulaMemo}${value}`;
+ masterData.sFormula = changeFormula;
+ masterData.sFormulaMemo = changeFormula;
+ masterData.handleType = masterData.handleType === 'add' ? 'add' : 'update';
+ this.props.onSaveState({ masterData });
+ }
+ }
+ };
+
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+
+const SisformulaComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, sModelsId, app, customizeParamConfig,
+ } = props;
+ onReturnForm(form);
+ const { masterConfig } = props;
+ let { masterData } = props;
+ masterData = masterData === undefined ? {} : masterData;
+ const masterShowConfig = commonUtils.isNotEmptyObject(masterConfig) ? masterConfig.gdsconfigformslave.filter(item => item.sName === 'sFormulaMemo') : {};
+ const masterShowConfigMemo = commonUtils.isNotEmptyObject(masterShowConfig) ? masterShowConfig[0] : {};
+ const tabFormulaDetails = commonFunc.showMessage(app.commonConst, 'tabFormulaDetails');/* 公式详情 */
+ // const tabCalculatorArea = commonFunc.showMessage(app.commonConst, 'tabCalculatorArea');/* 计算器区域 */
+ const tabCalculationParameter = commonFunc.showMessage(app.commonConst, 'tabCalculationParameter');/* 计算参数 */
+ const tabSystemFunction = commonFunc.showMessage(app.commonConst, 'tabSystemFunction');/* 系统函数 */
+ const tabBusinessFunction = commonFunc.showMessage(app.commonConst, 'tabBusinessFunction');/* 业务函数 */
+ const showTypeProps = {
+ record: masterData,
+ name: 'master',
+ form: props.form,
+ formId: sModelsId,
+ isDropDownLoadFinish: true,
+ getSqlDropDownData: props.getSqlDropDownData,
+ getSqlCondition: props.getSqlCondition,
+ handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord,
+ getFloatNum: props.getFloatNum,
+ getDateFormat: props.getDateFormat,
+ onChange: props.onChange,
+ showConfig: masterShowConfigMemo,
+ formItemLayout: true,
+ textArea: true,
+ enabled: props.enabled,
+ dataValue: masterData.sFormulaMemo,
+ bTable: true,
+ onFilterDropDownData: props.onFilterDropDownData,
+ onSaveState: props.onSaveState,
+ };
+
+ /* 开发者模式 */
+ const customizeParamPropsType = {
+ ...commonBusiness.getTableTypes('customizeParam', props),
+ tableProps: {
+ AutoTableHeight: 255,
+ },
+ // bNaturalWidth: true, /* 原始宽度 不进行最后一列计算 */
+ rowSelection: null,
+ };
+
+ const customizeParamPropsTypeArr = [];
+ if (commonUtils.isNotEmptyArr(props.customizeParamName)) {
+ props.customizeParamName.forEach((paramName) => {
+ customizeParamPropsTypeArr.push({
+ ...commonBusiness.getTableTypes(paramName, props),
+ tableProps: {
+ AutoTableHeight: 255,
+ },
+ // bNaturalWidth: true, /* 原始宽度 不进行最后一列计算 */
+ rowSelection: null,
+ bHideCopyAll: true,
+ });
+ });
+ }
+
+ /* 用户模式 */
+ const customizeParamUserPropsType = {
+ ...commonBusiness.getTableTypes('customizeParam', props),
+ data: props.customizeParamData,
+ config: props.userParamConfig,
+ headerColumn: props.userParamColumn,
+ tableProps: {
+ AutoTableHeight: 469,
+ },
+ // bNaturalWidth: true, /* 原始宽度 不进行最后一列计算 */
+ rowSelection: null,
+ };
+
+ const customizeParamUserPropsTypeArr = [];
+ if (commonUtils.isNotEmptyArr(props.userParamName)) {
+ props.userParamName.forEach((paramName) => {
+ const customizeParamName = paramName.replace('userParam', 'customizeParam');
+ customizeParamUserPropsTypeArr.push({
+ ...commonBusiness.getTableTypes(customizeParamName, props),
+ data: props[`${customizeParamName}Data`],
+ config: props[`${paramName}Config`],
+ headerColumn: props[`${paramName}Column`],
+ tableProps: {
+ AutoTableHeight: 469,
+ },
+ // bNaturalWidth: true, /* 原始宽度 不进行最后一列计算 */
+ rowSelection: null,
+ bHideCopyAll: true,
+ });
+ });
+ }
+
+ const editableClass = commonUtils.isNotEmptyObject(props) && props.enabled ? 'xly-bill-list editUser' : 'xly-bill-list viewUser';
+
+ return (
+
+ );
+});
+export default CommonBase(CommonElementEvent(SisformulaInfoComponent));
+
diff --git a/src/components/CommonElementEvent/StatementInfo.js b/src/components/CommonElementEvent/StatementInfo.js
new file mode 100644
index 0000000..65bec51
--- /dev/null
+++ b/src/components/CommonElementEvent/StatementInfo.js
@@ -0,0 +1,323 @@
+/**
+ * Created by mar105 on 2019-02-13.
+ */
+/* eslint-disable no-undef,import/first,prefer-destructuring,jsx-a11y/alt-text */
+import React, { Component } from 'react';
+
+import {
+ DeleteOutlined,
+ DownloadOutlined,
+ EditOutlined,
+ PlusOutlined,
+ SaveOutlined,
+ UploadOutlined,
+} from '@ant-design/icons';
+
+import { Modal, Upload, message } from 'antd';
+import * as commonUtils from '../../utils/utils';
+import * as commonServices from '../../services/services';
+import commonConfig from '../../utils/config';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+import StaticEditTable from '../Common/CommonTable';
+import * as commonFunc from '../Common/commonFunc';
+import AntdDraggableModal from '../Common/AntdDraggableModal';
+
+const { confirm } = Modal;
+export default class StatementInfo extends Component {
+ /** 构造函数 */
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ }
+
+ /** props改变的时候触发 */
+ componentWillReceiveProps(nextProps) {
+ let { reportColumn } = nextProps;
+ const { app } = nextProps;
+ const reportName = commonFunc.showMessage(app.commonConst, 'reportName');/* 设计功能 */
+ if (commonUtils.isEmptyArr(reportColumn)) {
+ const reportConfig = {};
+ reportConfig.gdsconfigformslave = [{
+ bVisible: true,
+ sName: 'sReportName',
+ bNotEmpty: true,
+ showName: '报表名称',
+ }, {
+ bVisible: true,
+ sName: 'sReportPath',
+ bReadOnly: true,
+ showName: '模板名称',
+ iTag: 1,
+ }];
+ reportColumn = [{
+ title: reportName,
+ dataIndex: 'sReportName',
+ width: 200,
+ }, {
+ title: '模板名称',
+ dataIndex: 'sReportPath',
+ width: 239,
+ }];
+ reportConfig.bisMutiSelect = true; // 处理选择框消失问题
+ this.getReportData();
+ this.props.onSaveState({
+ reportColumn, reportConfig,
+ });
+ }
+ }
+
+ /** 获取是否可用属性 */
+ getDisabledProps = (name) => {
+ const obj = {};
+ obj.disabled = this.getMenuStatus(name);
+ return obj;
+ };
+
+ /** 获取按钮属性 */
+ getMenuStatus = (name) => {
+ const { reportPropsEnabled } = this.props;
+ let disabledData = []; /* 置灰按钮集合 */
+ if (!reportPropsEnabled) {
+ /* 初始状态 */
+ disabledData = ['BtnSave', 'BtnUpload'];
+ } else {
+ /* 修改状态 */
+ disabledData = ['BtnAdd', 'BtnUpd', 'BtnDel', 'BtnDownload'];
+ }
+ return (disabledData.findIndex(item => item === name) > -1);
+ };
+ /** 获取打印数据 */
+ getReportData = async () => {
+ const { sModelsId, token, formSrcRoute } = this.props;
+ const dataUrl = `${commonConfig.file_host_ebc}printReport/getReport/${sModelsId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`;
+ const dataReturn = (await commonServices.getService(token, dataUrl)).data;
+ if (dataReturn.code === 1) {
+ const returnData = dataReturn.dataset.rows;
+ this.props.onSaveState({ reportData: returnData, initialReportData: returnData });
+ } else { /* 失败 */
+ this.props.getServiceError(dataReturn);
+ }
+ };
+ /** 上传文件改变时的状态 */
+ handleUploadChange = (info) => {
+ const { reportSelectedRowKeys, app } = this.props;
+ if (reportSelectedRowKeys === undefined || reportSelectedRowKeys.length !== 1) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo')); /* 请先选择一条数据! */
+ return;
+ }
+ const { reportData } = this.props;
+ const { file } = info;
+ if (file.response) {
+ if (file.response.code === 1) {
+ /* 成功 */
+ message.success(file.response.msg);
+ const sReportPath = file.response.dataset.rows[0].savePathStr;
+ const reportRow = reportData.filter(item => item.sId === reportSelectedRowKeys[0]);
+ reportRow[0].sReportPath = sReportPath;
+ reportRow[0].handleType = commonUtils.isEmpty(reportRow[0].handleType) ? 'update' : reportRow[0].handleType;
+ this.props.onSaveState({ reportData });
+ } else { /* 失败 */
+ this.props.getServiceError({ msg: commonFunc.showMessage(app.commonConst, 'reportDesign') + file.response }); /* 报表设计 */
+ }
+ }
+ };
+ handleBtnAdd = async (name) => {
+ const {
+ sModelsId, [`${name}Data`]: tableData,
+ } = this.props;
+ let tableDataRow = await this.props.onDataRowAdd(name, true);
+ if (commonUtils.isEmptyObject(tableDataRow)) {
+ tableDataRow = {};
+ tableDataRow.sId = commonUtils.createSid();
+ tableDataRow.handleType = 'add';
+ tableDataRow.key = tableDataRow.sId;
+ }
+ tableDataRow.sFormId = sModelsId;
+ tableData.push(tableDataRow);
+ this.props.onSaveState({ [`${name}Data`]: tableData, reportPropsEnabled: true });
+ };
+ handleBtnUpd = () => {
+ this.getReportData();
+ this.props.onSaveState({ reportPropsEnabled: true });
+ };
+ handleBtnSave = () => {
+ const {
+ reportData, reportDelData, reportConfig, app,
+ } = this.props;
+ const data = [];
+ if (!commonBusiness.validateTable(reportConfig, reportData, this.props)) {
+ return;
+ }
+ data.push(commonBusiness.mergeData('report', 'sysreport', reportData, reportDelData));
+ this.handleSaveData({ data, sClientType: '1', optName: commonFunc.showMessage(app.commonConst, 'reportDesign') });
+ };
+ handleSaveData = async (params) => {
+ const {
+ token, masterData, optName,
+ } = this.props;
+ const returnData = await commonBusiness.saveData({ token, value: params, sModelsId: 100 });
+ if (returnData.code === 1) {
+ this.props.onSaveState({
+ reportPropsEnabled: false, currentId: masterData.sId,
+ });
+ this.getReportData();
+ } else {
+ this.props.getServiceError(optName + returnData);
+ }
+ };
+ handleBtnDel = () => {
+ const { reportSelectedRowKeys } = this.props;
+ const props = { ...this.props };
+ const onSaveStateOk = this.props.onSaveState;
+ confirm({
+ title: '确定要删除?',
+ onOk() {
+ props.onDataRowDel('report', false, reportSelectedRowKeys);
+ onSaveStateOk({ reportPropsEnabled: true });
+ },
+ onCancel() {
+ },
+ });
+ };
+ handleBtnDownload = () => {
+ const {
+ reportSelectedRowKeys, reportData, sModelsId, app, formSrcRoute,
+ } = this.props;
+ if (reportSelectedRowKeys === undefined || reportSelectedRowKeys.length !== 1) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo'));/* 请先选择一条数据 */
+ return;
+ }
+ const { token } = this.props.app;
+ const dataSelect = reportData.filter(item => item.sId === reportSelectedRowKeys[0]);
+ const { sReportPath } = dataSelect[0];
+ const urlPrint = `${commonConfig.file_host_ebc}file/downloadReport?sModelsId=${sModelsId}&token=${token}&savePathStr=${sReportPath}&sName=${formSrcRoute}`;
+ window.open(urlPrint);
+ };
+ /* 置顶 */
+ handleBtnTop = (name) => {
+ const {
+ [`${name}SelectedRowKeys`]: reportSelectedRowKeys, [`${name}Data`]: tableData, app,
+ } = this.props;
+ if (reportSelectedRowKeys === undefined || reportSelectedRowKeys.length !== 1) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'selectedRowKeysNo'));/* 请先选择一条数据 */
+ return;
+ }
+ const iIndex = tableData.findIndex(item => item.sId === reportSelectedRowKeys[0]);/* 选中第一个节点的下标 */
+ if (iIndex === 0) {
+ message.warn(commonFunc.showMessage(app.commonConst, 'NoTop')); /* 无需置顶 */
+ return;
+ } else {
+ tableData[iIndex].iOrder = 1;/* 初始为1; */
+ }
+ let initNum = 2;
+ tableData.forEach((item, index) => {
+ item.handleType = commonUtils.isEmpty(item.handleType) ? 'update' : item.handleType;
+ if (index !== iIndex) {
+ tableData[index] = { ...item, iOrder: initNum };
+ initNum += 1;
+ }
+ });
+ this.props.onSaveState({ [`${name}Data`]: tableData });
+ this.handleBtnSave();
+ };
+ handleOk = () => {
+ this.handleBtnSave();
+ this.props.onSaveState({
+ visibleStatement: false,
+ });
+ };
+
+ handleCancel = () => {
+ this.getReportData();
+ this.props.onSaveState({
+ visibleStatement: false,
+ });
+ };
+
+ /** 渲染 */
+ render() {
+ const {
+ sModelsId, app, sTabId, formSrcRoute, reportPropsEnabled,
+ } = this.props;
+ const pane = app.panes.filter(paneTmp => paneTmp.key === sTabId)[0];
+ const { token } = this.props.app;
+ const outProps = {
+ action: `${commonConfig.file_host_ebc}file/uploadReport?sModelsId=${sModelsId}&token=${token}&sName=${formSrcRoute}`,
+ onChange: this.handleUploadChange,
+ accept: '.jasper',
+ showUploadList: false,
+ beforeUpload: () => {
+ if (!this.props.reportPropsEnabled) return false;
+ },
+ };
+ const reportProps = {
+ ...commonBusiness.getTableTypes('report', this.props),
+ onDoubleClick: undefined,
+ sUseInfo: '',
+ enabled: reportPropsEnabled,
+ };
+ const DesignFunc = commonFunc.showMessage(app.commonConst, 'DesignFunc');/* 设计功能 */
+ const BtnAdd = commonFunc.showMessage(app.commonConst, 'BtnAdd');/* 新增 */
+ const BtnUpd = commonFunc.showMessage(app.commonConst, 'BtnUpd');/* 修改 */
+ const BtnDel = commonFunc.showMessage(app.commonConst, 'BtnDel');/* 删除 */
+ const BtnDownload = commonFunc.showMessage(app.commonConst, 'BtnDownload');/* 下载 */
+ const BtnUpload = commonFunc.showMessage(app.commonConst, 'BtnUpload');/* 上传 */
+ const BtnSave = commonFunc.showMessage(app.commonConst, 'BtnSave');/* 保存 */
+ const btnTop = commonFunc.showMessage(app.commonConst, 'setTop');/* 置顶 */
+ return (
+
+ {(pane?.notCurrentPane ? false : this.props.visibleStatement) ?
+
+
+
+ : ''}
+
+ );
+ }
+}
diff --git a/src/components/CommonElementEvent/SupplyInfo.js b/src/components/CommonElementEvent/SupplyInfo.js
new file mode 100644
index 0000000..813ead5
--- /dev/null
+++ b/src/components/CommonElementEvent/SupplyInfo.js
@@ -0,0 +1,107 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+import * as commonUtils from '../../utils/utils';/* 通用方法 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+
+class SupplyInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const SupplyComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, masterData, AutoTableHeight, masterConfig, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ if (commonUtils.isNotEmptyObject(masterData)) {
+ const bCheck = masterConfig.gdsconfigformslave.filter(item => item.sName === 'bCheck');
+ if (commonUtils.isNotEmptyObject(bCheck)) {
+ masterData.bCheck = true;
+ }
+ }
+ const tabContact = commonFunc.showMessage(app.commonConst, 'tabContact');/* 联系人 */
+ const tabAddress = commonFunc.showMessage(app.commonConst, 'tabAddress');/* 地址 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(SupplyInfoComponent));
+
diff --git a/src/components/CommonElementEvent/SysMsgInfo.js b/src/components/CommonElementEvent/SysMsgInfo.js
new file mode 100644
index 0000000..a4d0a31
--- /dev/null
+++ b/src/components/CommonElementEvent/SysMsgInfo.js
@@ -0,0 +1,64 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Spin } from 'antd';// Tabs, Form,
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import CommonView from '../Common/CommonView';
+
+const { Header, Content } = Layout;
+
+class SysMsgInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const SysMsgComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData, masterConfig } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form, masterConfig);
+ return obj;
+ },
+})((props) => {
+ const { form, onReturnForm } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(SysMsgInfoComponent));
diff --git a/src/components/CommonElementEvent/TestStandInfo.js b/src/components/CommonElementEvent/TestStandInfo.js
new file mode 100644
index 0000000..c186cd6
--- /dev/null
+++ b/src/components/CommonElementEvent/TestStandInfo.js
@@ -0,0 +1,93 @@
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Form } from '@ant-design/compatible';
+import '@ant-design/compatible/assets/index.css';
+import { Layout, Tabs, Spin, Avatar } from 'antd';
+import styles from '../../index.less';
+import Toolbar from '../Common/ToolBar/ToolBarNew';
+import * as commonFunc from '../Common/commonFunc';
+import CommonBase from '../Common/CommonBase';
+import CommonElementEvent from '../Common/CommonElementEvent';
+import StaticEditTable from '../Common/CommonTable';/* 可编辑表格 */
+import CommonView from '../Common/CommonView';
+import * as commonBusiness from '../Common/commonBusiness';/* 单据业务功能 */
+
+const { Header, Content } = Layout;
+const { TabPane } = Tabs;
+class TestStandInfoComponent extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ };
+ this.form = {}; /* 表单对象 */
+ }
+ onTabChange = (key) => {
+ this.props.onSaveState({ activeKey: key });
+ };
+ render() {
+ const { pageLoading } = this.props;
+ return (
+
+ );
+ }
+}
+const TestStandComponent = Form.create({
+ mapPropsToFields(props) {
+ const { masterData } = props;
+ const obj = commonFunc.mapPropsToFields(masterData, Form);
+ return obj;
+ },
+})((props) => {
+ const {
+ form, onReturnForm, AutoTableHeight, app,
+ } = props;
+ /* 回带表单 */
+ onReturnForm(form);
+ const tabEleTestStand = commonFunc.showMessage(app.commonConst, 'tabEleTestStand');/* 刀模信息 */
+ return (
+
+ );
+});
+
+export default CommonBase(CommonElementEvent(TestStandInfoComponent));
+
diff --git a/src/components/PrintPdf/PreviewPdf.js b/src/components/PrintPdf/PreviewPdf.js
new file mode 100644
index 0000000..40d14ab
--- /dev/null
+++ b/src/components/PrintPdf/PreviewPdf.js
@@ -0,0 +1,92 @@
+/* eslint-disable prefer-destructuring */
+/* eslint no-dupe-keys: 0, no-mixed-operators: 0 */
+import React from 'react';
+import { InputItem, Icon } from 'antd-mobile';
+import { Document, Page, pdfjs } from 'react-pdf';
+import 'antd-mobile/dist/antd-mobile.css';
+import * as commonUtils from '@/utils/utils';
+import pdfstyles from './printpdf.less';
+
+pdfjs.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.min.js`;
+
+class CommonPrintPdf extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ pageNumber: 1,
+ numPages: 1,
+ };
+ }
+
+ onDocumentLoadSuccess = ({ numPages }) => {
+ this.setState({ numPages });
+ };
+
+ onPageNumberChange = (e) => {
+ let value = commonUtils.convertStrToNumber(e);
+ value = value <= 0 ? 1 : value;
+ value = value >= this.state.numPages ? this.state.numPages : value;
+ this.setState({ pageNumber: value });
+ };
+ lastPage = () => {
+ if (this.state.pageNumber === 1) {
+ return;
+ }
+ const page = this.state.pageNumber - 1;
+ this.setState({ pageNumber: page });
+ }
+ nextPage = () => {
+ if (this.state.pageNumber === this.state.numPages) {
+ return;
+ }
+ const page = this.state.pageNumber + 1;
+ this.setState({ pageNumber: page });
+ }
+ render() {
+ const {
+ pageNumber, numPages,
+ } = this.state;
+ const { urlPrint, bFitWidth } = this.props;
+ const pageWidth = commonUtils.isNotEmptyNumber(document.body.clientWidth) ? 1000 : 360;
+ const pageProps = {};
+ if (bFitWidth) {
+ // 适应宽度模式(当前屏幕宽度-边距47)
+ pageProps.width = document.body.clientWidth - 47;
+ } else {
+ /* 计算缩放比例(595为浏览器控制台获取到的原pdf的canvas属性的宽度,该属性导致pdf宽度无法适配页面宽度) */
+ pageProps.scale = (pageWidth / 595).toFixed(2);
+ }
+
+ return (
+
+
+
+
+
+
+
this.onPageNumberChange(e)}
+ type="number"
+ /> / {numPages}
+
+
+
+
+ {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
+ {/*
window.history.back(-1)} > */}
+
+ );
+ }
+}
+
+export default CommonPrintPdf;
diff --git a/src/components/PrintPdf/PrintPdf.js b/src/components/PrintPdf/PrintPdf.js
new file mode 100644
index 0000000..43a0d81
--- /dev/null
+++ b/src/components/PrintPdf/PrintPdf.js
@@ -0,0 +1,28 @@
+/* eslint-disable */
+/* eslint-disable array-callback-return,no-undef */
+import React, { Component } from 'react';
+import { Layout } from 'antd';// Tabs, Form,
+// import * as commonUtils from '@/utils/utils'; /* 通用方法 */
+import PreviewPdf from './PreviewPdf';
+
+
+class printPdf extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ urlPrint: props.previewUrl ? props.previewUrl : undefined,
+ bFitWidth: props.bFitWidth ? props.bFitWidth : undefined,
+ };
+ }
+ render() {
+ return (
+ this.state.urlPrint !==undefined?
+
+ :''
+ );
+ }
+}
+
+export default printPdf;
diff --git a/src/components/PrintPdf/printpdf.less b/src/components/PrintPdf/printpdf.less
new file mode 100644
index 0000000..2fc1611
--- /dev/null
+++ b/src/components/PrintPdf/printpdf.less
@@ -0,0 +1,108 @@
+.view {
+ //position: fixed;
+ //padding: 0;
+ //height: 100vh;
+ //overflow: auto;
+ position: relative;
+ display: flex;
+ justify-content: center;
+ width:100%;
+ z-index: 0;
+ background-color: #515558;
+ padding-top: 30px;
+}
+.pageContainer {
+ box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px 0px;
+ width:max-content;
+ max-width:100%;
+ //height: calc(100vh - 18px);
+ overflow-y: hidden;
+ overflow-x: hidden;
+}
+.pageTool{
+ width: 100%;
+ position: absolute;
+ top: 0px;
+ background: rgb(67, 67, 67);
+ color: white;
+ padding: 0px;
+ border-radius: 0px;
+ display: flex;
+ align-items: center;
+ i{
+ padding: 5px;
+ margin:0 5px;
+ &:hover{
+ background: #333;
+ }
+ }
+ input{
+ display: inline-block;
+ width: 25px;
+ text-align: center;
+ margin-right: 0px;
+ height: 12px;
+ font-size: 1rem!important;
+ }
+ input::-webkit-outer-spin-button,
+ input::-webkit-inner-spin-button {
+ -webkit-appearance: none;
+ }
+ input[type="number"]{
+ -moz-appearance: textfield;
+ }
+ .numPages{
+ text-align: center;
+ height: 100%;
+ align-items: center;
+ justify-content: center;
+ width: 4%;
+ font-size: 1rem;
+ }
+ .left{
+ display: flex;
+ text-align: center;
+ height: 100%;
+ align-items: center;
+ justify-content: center;
+ width: 25%;
+ }
+ .right{
+ display: flex;
+ text-align: center;
+ height: 100%;
+ align-items: center;
+ justify-content: center;
+ width: 25%;
+ }
+}
+
+:global{
+ .pdfClose{
+ position: absolute;
+ right: 2%;
+ top:3%;
+ z-index: 3001;
+ }
+ .demo-preview-item{
+ .am-list-item.am-input-item{
+ height: 36px!important;
+ min-height: 36px!important;
+ padding-left: 5px;
+ }
+ .am-list-item .am-list-line{
+ padding-right: 2px;
+ }
+ }
+ /* 前端控制打印预览inputItem */
+ .printStyle{
+ .am-list-item.am-input-item{
+ height: 30px!important;
+ min-height: 30px!important;
+ padding-left: 5px;
+ }
+ .am-list-item .am-list-line{
+ padding-right: 2px;
+ }
+ }
+}
diff --git a/src/components/SvgIcon/index.js b/src/components/SvgIcon/index.js
new file mode 100644
index 0000000..b69eaef
--- /dev/null
+++ b/src/components/SvgIcon/index.js
@@ -0,0 +1,23 @@
+import React from 'react';
+
+const SvgIcon = (props) => {
+ const {
+ iconClass, className, size, offsetX, fill, offsetY,
+ } = props;
+
+ return (
+
+ );
+};
+
+export default SvgIcon;
diff --git a/src/components/Vlist/index.js b/src/components/Vlist/index.js
new file mode 100644
index 0000000..9519746
--- /dev/null
+++ b/src/components/Vlist/index.js
@@ -0,0 +1,775 @@
+/* eslint-disable */
+import './index.less';
+var throttleTime = 1;
+
+function getAllChildren(data, expandedKeys, rowKey) {
+ var result = [];
+ var expandedKeysNew = [];
+ if (typeof data === 'object') {
+ data.forEach((item) => {
+ if (item && item.children && item.children.length) {
+ var children = item.children.map((child) => {
+ const temp = child;
+ temp.vlistParentRowKey = item[rowKey];
+ return temp;
+ });
+ if (expandedKeys.has(item[rowKey])) {
+ result = result.concat(children);
+ expandedKeysNew = expandedKeysNew.concat(item[rowKey]);
+ var nextData = getAllChildren(children, expandedKeys, rowKey);
+ result = result.concat(nextData[0]);
+ expandedKeysNew = expandedKeysNew.concat(nextData[1]);
+ }
+ }
+ });
+ }
+ return [result, expandedKeysNew];
+}
+
+function _interopDefault(e) {
+ return e && 'object' == typeof e && 'default' in e ? e.default : e;
+}
+function __rest(e, t) {
+ var r = {};
+ for (var o in e)
+ Object.prototype.hasOwnProperty.call(e, o) &&
+ t.indexOf(o) < 0 &&
+ (r[o] = e[o]);
+ if (null != e && 'function' == typeof Object.getOwnPropertySymbols)
+ for (var n = 0, o = Object.getOwnPropertySymbols(e); n < o.length; n++)
+ t.indexOf(o[n]) < 0 &&
+ Object.prototype.propertyIsEnumerable.call(e, o[n]) &&
+ (r[o[n]] = e[o[n]]);
+ return r;
+}
+function getRawTag(e) {
+ var t = hasOwnProperty.call(e, symToStringTag),
+ r = e[symToStringTag];
+ try {
+ e[symToStringTag] = void 0;
+ var o = !0;
+ } catch (e) {}
+ var n = nativeObjectToString.call(e);
+ return o && (t ? (e[symToStringTag] = r) : delete e[symToStringTag]), n;
+}
+function objectToString(e) {
+ return nativeObjectToString$1.call(e);
+}
+function baseGetTag(e) {
+ return null == e
+ ? void 0 === e
+ ? undefinedTag
+ : nullTag
+ : symToStringTag$1 && symToStringTag$1 in Object(e)
+ ? getRawTag(e)
+ : objectToString(e);
+}
+function isObjectLike(e) {
+ return null != e && 'object' == typeof e;
+}
+function isSymbol(e) {
+ return (
+ 'symbol' == typeof e || (isObjectLike(e) && baseGetTag(e) == symbolTag)
+ );
+}
+function trimmedEndIndex(e) {
+ for (var t = e.length; t-- && reWhitespace.test(e.charAt(t)); );
+ return t;
+}
+function baseTrim(e) {
+ return e ? e.slice(0, trimmedEndIndex(e) + 1).replace(reTrimStart, '') : e;
+}
+function isObject(e) {
+ var t = typeof e;
+ return null != e && ('object' == t || 'function' == t);
+}
+function toNumber(e) {
+ if ('number' == typeof e) return e;
+ if (isSymbol(e)) return NAN;
+ if (isObject(e)) {
+ var t = 'function' == typeof e.valueOf ? e.valueOf() : e;
+ e = isObject(t) ? t + '' : t;
+ }
+ if ('string' != typeof e) return 0 === e ? e : +e;
+ e = baseTrim(e);
+ var r = reIsBinary.test(e);
+ return r || reIsOctal.test(e)
+ ? freeParseInt(e.slice(2), r ? 2 : 8)
+ : reIsBadHex.test(e)
+ ? NAN
+ : +e;
+}
+function debounce(e, t, r) {
+ function o(t) {
+ var r = v,
+ o = f;
+ return (v = f = void 0), (T = t), (p = e.apply(o, r));
+ }
+ function n(e) {
+ return (T = e), (b = setTimeout(a, t)), _ ? o(e) : p;
+ }
+ function i(e) {
+ var r = e - T,
+ o = t - (e - h);
+ return y ? nativeMin(o, g - r) : o;
+ }
+ function l(e) {
+ var r = e - h,
+ o = e - T;
+ return void 0 === h || r >= t || r < 0 || (y && o >= g);
+ }
+ function a() {
+ var e = now();
+ if (l(e)) return c(e);
+ b = setTimeout(a, i(e));
+ }
+ function c(e) {
+ return (b = void 0), m && v ? o(e) : ((v = f = void 0), p);
+ }
+ function s() {
+ void 0 !== b && clearTimeout(b), (T = 0), (v = h = f = b = void 0);
+ }
+ function u() {
+ return void 0 === b ? p : c(now());
+ }
+ function d() {
+ var e = now(),
+ r = l(e);
+ if (((v = arguments), (f = this), (h = e), r)) {
+ if (void 0 === b) return n(h);
+ if (y) return clearTimeout(b), (b = setTimeout(a, t)), o(h);
+ }
+ return void 0 === b && (b = setTimeout(a, t)), p;
+ }
+ var v,
+ f,
+ g,
+ p,
+ b,
+ h,
+ T = 0,
+ _ = !1,
+ y = !1,
+ m = !0;
+ if ('function' != typeof e) throw new TypeError(FUNC_ERROR_TEXT);
+ return (
+ (t = toNumber(t) || 0),
+ isObject(r) &&
+ ((_ = !!r.leading),
+ (g = (y = 'maxWait' in r) ? nativeMax(toNumber(r.maxWait) || 0, t) : g),
+ (m = 'trailing' in r ? !!r.trailing : m)),
+ (d.cancel = s),
+ (d.flush = u),
+ d
+ );
+}
+function isNumber(e) {
+ return (
+ 'number' == typeof e || (isObjectLike(e) && baseGetTag(e) == numberTag)
+ );
+}
+function throttle(e, t, r) {
+ var o = !0,
+ n = !0;
+ if ('function' != typeof e) throw new TypeError(FUNC_ERROR_TEXT$1);
+ return (
+ isObject(r) &&
+ ((o = 'leading' in r ? !!r.leading : o),
+ (n = 'trailing' in r ? !!r.trailing : n)),
+ debounce(e, t, {
+ leading: o,
+ maxWait: t,
+ trailing: n,
+ })
+ );
+}
+function styleInject(e, t) {
+ void 0 === t && (t = {});
+ var r = t.insertAt;
+ if (e && 'undefined' != typeof document) {
+ var o = document.head || document.getElementsByTagName('head')[0],
+ n = document.createElement('style');
+ (n.type = 'text/css'),
+ 'top' === r && o.firstChild
+ ? o.insertBefore(n, o.firstChild)
+ : o.appendChild(n),
+ n.styleSheet
+ ? (n.styleSheet.cssText = e)
+ : n.appendChild(document.createTextNode(e));
+ }
+}
+function reducer(e, t) {
+ var r = t.scrollHeight,
+ o = t.curScrollTop,
+ n = t.tableScrollY,
+ i = t.rowHeight,
+ l = t.totalLen,
+ a = t.ifScrollTopClear,
+ c = e.curScrollTop;
+ switch (t.type) {
+ case 'changeTrs':
+ return __assign(__assign({}, e), {
+ curScrollTop: o,
+ scrollHeight: r,
+ tableScrollY: n,
+ });
+ case 'initHeight':
+ return __assign(__assign({}, e), {
+ rowHeight: i,
+ });
+ case 'changeTotalLen':
+ return (
+ 0 === l && (c = 0),
+ __assign(__assign({}, e), {
+ totalLen: l,
+ curScrollTop: c,
+ })
+ );
+ case 'reset':
+ return __assign(__assign({}, e), {
+ curScrollTop: a ? 0 : e.curScrollTop,
+ scrollHeight: 0,
+ });
+ default:
+ throw new Error();
+ }
+}
+function VCell(e) {
+ var t = e.children,
+ r = __rest(e, ['children']);
+ return React__default.createElement(
+ 'td',
+ __assign({}, r),
+ React__default.createElement('div', null, t),
+ );
+}
+function VRow(e, t) {
+ var r = React.useContext(ScrollContext),
+ o = r.dispatch,
+ n = r.rowHeight,
+ i = r.totalLen,
+ l = r.vid,
+ a = e.children,
+ c = e.style,
+ s = __rest(e, ['children', 'style']),
+ u = React.useRef(null);
+ return (
+ React.useEffect(
+ function () {
+ !(function (e) {
+ var t, r, a;
+ if (
+ (null === (t = null === e || void 0 === e ? void 0 : e.current) ||
+ void 0 === t
+ ? void 0
+ : t.offsetHeight) &&
+ !n &&
+ i
+ ) {
+ var c =
+ null !==
+ (a =
+ null ===
+ (r = null === e || void 0 === e ? void 0 : e.current) ||
+ void 0 === r
+ ? void 0
+ : r.offsetHeight) && void 0 !== a
+ ? a
+ : 0;
+ vidMap.set(
+ l,
+ __assign(__assign({}, vidMap.get(l)), {
+ rowItemHeight: c,
+ }),
+ ),
+ o({
+ type: 'initHeight',
+ rowHeight: c,
+ });
+ }
+ })(Object.prototype.hasOwnProperty.call(t, 'current') ? t : u);
+ },
+ [u, o, n, i, t, l],
+ ),
+ React__default.createElement(
+ 'tr',
+ __assign({}, s, {
+ ref: Object.prototype.hasOwnProperty.call(t, 'current') ? t : u,
+ style: __assign(__assign({}, c), {
+ height: n || 'auto',
+ boxSizing: 'border-box',
+ }),
+ }),
+ a,
+ )
+ );
+}
+function VWrapper(e) {
+ var t = e.children,
+ r = __rest(e, ['children']),
+ o = React.useContext(ScrollContext),
+ n = o.renderLen,
+ i = o.start,
+ l = o.dispatch,
+ a = o.totalLen,
+ c = o.vid,
+ s = React.useMemo(
+ function () {
+ return t[1];
+ },
+ [t],
+ );
+ React.useEffect(
+ function () {
+ var e;
+ a !== (null === s || void 0 === s ? void 0 : s.length) &&
+ a &&
+ (l({
+ type: 'changeTotalLen',
+ totalLen:
+ null !== (e = null === s || void 0 === s ? void 0 : s.length) &&
+ void 0 !== e
+ ? e
+ : 0,
+ }),
+ vidMap.has(c) &&
+ vidMap.set(
+ c,
+ __assign(__assign({}, vidMap.get(c)), {
+ notRefresh: !0,
+ }),
+ ));
+ },
+ [a, s, l, c],
+ );
+ var u = null;
+ // return u = Array.isArray(s) && s.length ? [t[0], s.slice(i, i + n).map(function(e) {
+ // return Array.isArray(e) ? e[0] : e
+ // })] : t,
+ let temp;
+ if (Array.isArray(s) && s.length) {
+ temp = [
+ ...s.slice(i, i + n).map(function (e) {
+ return Array.isArray(e) ? e[0] : e;
+ }),
+ ];
+ }
+ return (
+ (u = Array.isArray(s) && s.length ? [t[0], temp] : t),
+ React__default.createElement('tbody', __assign({}, r), u)
+ );
+}
+function VTable(e, t) {
+ var r,
+ o,
+ n,
+ i,
+ l,
+ a,
+ c = e.style,
+ s = e.children,
+ u = __rest(e, ['style', 'children']),
+ d = c.width,
+ v = __rest(c, ['width']),
+ f = null !== t && void 0 !== t ? t : {},
+ g = f.vid,
+ p = f.scrollY,
+ b = f.reachEnd,
+ h = f.onScroll,
+ T = React.useReducer(reducer, initialState),
+ _ = T[0],
+ y = T[1],
+ m = React.useRef(null),
+ S = React.useRef(null),
+ w = React.useState(
+ null !==
+ (i =
+ null ===
+ (n =
+ null ===
+ (o = null === (r = s[1]) || void 0 === r ? void 0 : r.props) ||
+ void 0 === o
+ ? void 0
+ : o.data) || void 0 === n
+ ? void 0
+ : n.length) && void 0 !== i
+ ? i
+ : 0,
+ ),
+ R = w[0],
+ O = w[1];
+
+ var newR = R;
+ if (vidMap && vidMap.get(t.vid) && vidMap.get(t.vid).rowKey) {
+ const rowKey = vidMap.get(t.vid).rowKey;
+ const getAllChildrenData = getAllChildren(o.data, o.expandedKeys, rowKey);
+ var childrenList = getAllChildrenData[0];
+ var childrenExpandedKeys = getAllChildrenData[1];
+ if (childrenList && childrenList.length) {
+ var expandedKeys = o.expandedKeys;
+ if (expandedKeys && expandedKeys.size) {
+ const expandedChildrenList = childrenList.filter((item) =>
+ expandedKeys.has(item.vlistParentRowKey),
+ );
+ const expandedChildrenKeysList = expandedChildrenList.map(
+ (item) => item[rowKey],
+ );
+ const allExpandedKeysList = childrenExpandedKeys
+ .concat(expandedChildrenKeysList)
+ .concat(o.data.map((item) => item[rowKey]));
+ const allExpandedKeysSet = new Set(allExpandedKeysList);
+ newR = allExpandedKeysSet.size;
+ }
+ }
+ }
+
+ if (_.curScrollTop === 0 && vidMap && vidMap.get(t.vid)) {
+ const scrollNode = vidMap.get(t.vid).scrollNode;
+ if (scrollNode && scrollNode.scrollTop) {
+ _.curScrollTop = scrollNode.scrollTop;
+ }
+ }
+
+ React.useEffect(
+ function () {
+ _.totalLen && O(_.totalLen);
+ },
+ [_.totalLen],
+ ),
+ React.useEffect(
+ function () {
+ return function () {
+ vidMap.delete(g);
+ };
+ },
+ [g],
+ ),
+ React.useEffect(
+ function () {
+ var e, t, r, o, n, i;
+ isNumber(
+ null ===
+ (r =
+ null ===
+ (t = null === (e = s[1]) || void 0 === e ? void 0 : e.props) ||
+ void 0 === t
+ ? void 0
+ : t.data) || void 0 === r
+ ? void 0
+ : r.length,
+ ) &&
+ O(
+ null ===
+ (i =
+ null ===
+ (n =
+ null === (o = s[1]) || void 0 === o ? void 0 : o.props) ||
+ void 0 === n
+ ? void 0
+ : n.data) || void 0 === i
+ ? void 0
+ : i.length,
+ );
+ },
+ [s[1].props.data],
+ );
+ var j = React.useMemo(
+ function () {
+ var e = 'auto';
+ return _.rowHeight && newR && (e = _.rowHeight * newR), e;
+ },
+ [_.rowHeight, newR, o.expandedKeys],
+ ),
+ E = 0;
+ let maxHeight = '';
+ if (
+ vidMap &&
+ vidMap.get(t.vid) &&
+ vidMap.get(t.vid).scrollNode &&
+ vidMap.get(t.vid).scrollNode.style.maxHeight
+ ) {
+ maxHeight = vidMap.get(t.vid).scrollNode.style.maxHeight;
+ }
+ (E =
+ 'string' == typeof p
+ ? null ===
+ (a =
+ null === (l = m.current) || void 0 === l ? void 0 : l.parentNode) ||
+ void 0 === a
+ ? void 0
+ : a.offsetHeight
+ : p),
+ isNumber(j) &&
+ (j < E || (E === 0 && newR) || maxHeight === '100%') &&
+ (E = j),
+ E <= 0 && (E = 0);
+ var x = React.useMemo(
+ function () {
+ var e = 1;
+ if (_.rowHeight && newR && E)
+ if (E <= 0) e = 0;
+ else {
+ var t = 1 + ((E / _.rowHeight) | 0) + 2;
+ e = t > newR ? newR : t;
+ }
+ return e;
+ },
+ [_.rowHeight, newR, E],
+ ),
+ H = _.rowHeight ? (_.curScrollTop / _.rowHeight) | 0 : 0,
+ L = _.rowHeight ? _.curScrollTop % _.rowHeight : 0;
+ return (
+ _.curScrollTop && _.rowHeight && _.curScrollTop > _.rowHeight
+ ? ((H -= 1), (L += _.rowHeight))
+ : (H = 0),
+ React.useEffect(
+ function () {
+ var e,
+ t,
+ r = null === (e = m.current) || void 0 === e ? void 0 : e.parentNode,
+ o = null !== (t = vidMap.get(g)) && void 0 !== t ? t : {};
+ (null === o || void 0 === o ? void 0 : o.notRefresh) ||
+ (b
+ ? y({
+ type: 'reset',
+ ifScrollTopClear: !1,
+ })
+ : (false && r && (r.scrollTop = 0),
+ y({
+ type: 'reset',
+ ifScrollTopClear: !0,
+ }))),
+ vidMap.has(g) &&
+ vidMap.set(
+ g,
+ __assign(__assign({}, o), {
+ scrollNode: r,
+ notRefresh: !1,
+ }),
+ );
+ },
+ [newR, b, g],
+ ),
+ React.useEffect(
+ function () {
+ var e,
+ t = throttle(function (e) {
+ var t,
+ r,
+ o,
+ n,
+ i,
+ l,
+ a =
+ null !==
+ (r =
+ null ===
+ (t = null === e || void 0 === e ? void 0 : e.target) ||
+ void 0 === t
+ ? void 0
+ : t.scrollTop) && void 0 !== r
+ ? r
+ : 0,
+ c =
+ null !==
+ (n =
+ null ===
+ (o = null === e || void 0 === e ? void 0 : e.target) ||
+ void 0 === o
+ ? void 0
+ : o.scrollHeight) && void 0 !== n
+ ? n
+ : 0,
+ s =
+ null !==
+ (l =
+ null ===
+ (i = null === e || void 0 === e ? void 0 : e.target) ||
+ void 0 === i
+ ? void 0
+ : i.clientHeight) && void 0 !== l
+ ? l
+ : 0;
+ a === c || (a + s >= c && b && b()),
+ h && h(),
+ y({
+ type: 'changeTrs',
+ curScrollTop: a,
+ scrollHeight: c,
+ tableScrollY: E,
+ });
+ }, throttleTime),
+ r =
+ null === (e = null === m || void 0 === m ? void 0 : m.current) ||
+ void 0 === e
+ ? void 0
+ : e.parentNode;
+ return (
+ r && r.addEventListener('scroll', t),
+ function () {
+ r.removeEventListener('scroll', t);
+ }
+ );
+ },
+ [m, E, h, b],
+ ),
+ React__default.createElement(
+ 'div',
+ {
+ className: 'virtuallist',
+ ref: m,
+ style: {
+ width: '100%',
+ position: 'relative',
+ height: j,
+ boxSizing: 'border-box',
+ paddingTop: _.curScrollTop,
+ },
+ },
+ React__default.createElement(
+ ScrollContext.Provider,
+ {
+ value: {
+ dispatch: y,
+ rowHeight: _.rowHeight,
+ start: H,
+ offsetStart: L,
+ renderLen: x,
+ totalLen: newR,
+ vid: g,
+ },
+ },
+ React__default.createElement(
+ 'table',
+ __assign({}, u, {
+ ref: S,
+ style: __assign(__assign({}, v), {
+ width: d,
+ position: 'relative',
+ transform: 'translateY(-' + L + 'px)',
+ }),
+ }),
+ s,
+ ),
+ ),
+ )
+ );
+}
+export function VList(e) {
+ var t,
+ r,
+ o,
+ n = null !== (t = e.vid) && void 0 !== t ? t : DEFAULT_VID;
+ return (
+ vidMap.has(n)
+ ? (o =
+ null === (r = vidMap.get(n)) || void 0 === r ? void 0 : r.components)
+ : ((o = transformTable({
+ vid: n,
+ scrollY: e.height,
+ reachEnd: e.onReachEnd,
+ onScroll: e.onScroll,
+ })),
+ vidMap.set(n, {
+ components: o,
+ rowKey: e.rowKey,
+ })),
+ {
+ table: o,
+ body: {
+ wrapper: VWrapper,
+ row: VRow,
+ cell: VCell,
+ },
+ }
+ );
+}
+export function scrollTo(e) {
+ var t = e.row,
+ r = e.y,
+ o = e.vid,
+ n = void 0 === o ? DEFAULT_VID : o,
+ i = vidMap.get(n),
+ l = i.scrollNode,
+ a = i.rowItemHeight;
+ l.scrollTop = t
+ ? t - 1 > 0
+ ? (t - 1) * (null !== a && void 0 !== a ? a : 0)
+ : 0
+ : null !== r && void 0 !== r
+ ? r
+ : 0;
+}
+Object.defineProperty(exports, '__esModule', {
+ value: !0,
+});
+var React = require('react'),
+ React__default = _interopDefault(React),
+ __assign = function () {
+ return (__assign =
+ Object.assign ||
+ function (e) {
+ for (var t, r = 1, o = arguments.length; r < o; r++) {
+ t = arguments[r];
+ for (var n in t)
+ Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
+ }
+ return e;
+ }).apply(this, arguments);
+ },
+ freeGlobal =
+ 'object' == typeof global && global && global.Object === Object && global,
+ freeSelf = 'object' == typeof self && self && self.Object === Object && self,
+ root = freeGlobal || freeSelf || Function('return this')(),
+ Symbol = root.Symbol,
+ objectProto = Object.prototype,
+ hasOwnProperty = objectProto.hasOwnProperty,
+ nativeObjectToString = objectProto.toString,
+ symToStringTag = Symbol ? Symbol.toStringTag : void 0,
+ objectProto$1 = Object.prototype,
+ nativeObjectToString$1 = objectProto$1.toString,
+ nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]',
+ symToStringTag$1 = Symbol ? Symbol.toStringTag : void 0,
+ symbolTag = '[object Symbol]',
+ reWhitespace = /\s/,
+ reTrimStart = /^\s+/,
+ NAN = NaN,
+ reIsBadHex = /^[-+]0x[0-9a-f]+$/i,
+ reIsBinary = /^0b[01]+$/i,
+ reIsOctal = /^0o[0-7]+$/i,
+ freeParseInt = parseInt,
+ now = function () {
+ return root.Date.now();
+ },
+ FUNC_ERROR_TEXT = 'Expected a function',
+ nativeMax = Math.max,
+ nativeMin = Math.min,
+ numberTag = '[object Number]',
+ FUNC_ERROR_TEXT$1 = 'Expected a function',
+ css_248z =
+ '.virtuallist .ant-table-tbody>tr>td>div{-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;width:100%}.virtuallist .ant-table-tbody>tr>td.ant-table-row-expand-icon-cell>div{overflow:inherit}.ant-table-bordered .virtuallist>table>.ant-table-tbody>tr>td{border-right:1px solid #f0f0f0}';
+styleInject(css_248z);
+var initialState = {
+ rowHeight: 0,
+ curScrollTop: 0,
+ scrollHeight: 0,
+ tableScrollY: 0,
+ totalLen: 0,
+ },
+ DEFAULT_VID = 'vtable',
+ vidMap = new Map(),
+ ScrollContext = React.createContext({
+ dispatch: void 0,
+ renderLen: 1,
+ start: 0,
+ offsetStart: 0,
+ rowHeight: initialState.rowHeight,
+ totalLen: 0,
+ vid: DEFAULT_VID,
+ }),
+ transformTable = function (e) {
+ return function (t) {
+ return VTable(t, e);
+ };
+ };
diff --git a/src/components/Vlist/index.less b/src/components/Vlist/index.less
new file mode 100644
index 0000000..1b6f27d
--- /dev/null
+++ b/src/components/Vlist/index.less
@@ -0,0 +1,16 @@
+.virtuallist .ant-table-tbody > tr > td > div {
+ box-sizing: border-box;
+ white-space: nowrap;
+ vertical-align: middle;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 100%;
+}
+
+.virtuallist .ant-table-tbody > tr > td.ant-table-row-expand-icon-cell > div {
+ overflow: inherit;
+}
+
+.ant-table-bordered .virtuallist > table > .ant-table-tbody > tr > td {
+ border-right: 1px solid #f0f0f0;
+}
diff --git a/src/components/Vlist/index_back.js b/src/components/Vlist/index_back.js
new file mode 100644
index 0000000..7e63df3
--- /dev/null
+++ b/src/components/Vlist/index_back.js
@@ -0,0 +1,458 @@
+/* eslint-disable */
+import './index.less';
+const throttleTime = 1;
+function _interopDefault(e) {
+ return e && "object" == typeof e && "default" in e ? e.
+ default:
+ e
+}
+function __rest(e, t) {
+ var r = {};
+ for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (r[o] = e[o]);
+ if (null != e && "function" == typeof Object.getOwnPropertySymbols) for (var n = 0,
+ o = Object.getOwnPropertySymbols(e); n < o.length; n++) t.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[n]) && (r[o[n]] = e[o[n]]);
+ return r
+}
+function getRawTag(e) {
+ var t = hasOwnProperty.call(e, symToStringTag),
+ r = e[symToStringTag];
+ try {
+ e[symToStringTag] = void 0;
+ var o = !0
+ } catch(e) {}
+ var n = nativeObjectToString.call(e);
+ return o && (t ? e[symToStringTag] = r: delete e[symToStringTag]),
+ n
+}
+function objectToString(e) {
+ return nativeObjectToString$1.call(e)
+}
+function baseGetTag(e) {
+ return null == e ? void 0 === e ? undefinedTag: nullTag: symToStringTag$1 && symToStringTag$1 in Object(e) ? getRawTag(e) : objectToString(e)
+}
+function isObjectLike(e) {
+ return null != e && "object" == typeof e
+}
+function isSymbol(e) {
+ return "symbol" == typeof e || isObjectLike(e) && baseGetTag(e) == symbolTag
+}
+function trimmedEndIndex(e) {
+ for (var t = e.length; t--&&reWhitespace.test(e.charAt(t)););
+ return t
+}
+function baseTrim(e) {
+ return e ? e.slice(0, trimmedEndIndex(e) + 1).replace(reTrimStart, "") : e
+}
+function isObject(e) {
+ var t = typeof e;
+ return null != e && ("object" == t || "function" == t)
+}
+function toNumber(e) {
+ if ("number" == typeof e) return e;
+ if (isSymbol(e)) return NAN;
+ if (isObject(e)) {
+ var t = "function" == typeof e.valueOf ? e.valueOf() : e;
+ e = isObject(t) ? t + "": t
+ }
+ if ("string" != typeof e) return 0 === e ? e: +e;
+ e = baseTrim(e);
+ var r = reIsBinary.test(e);
+ return r || reIsOctal.test(e) ? freeParseInt(e.slice(2), r ? 2 : 8) : reIsBadHex.test(e) ? NAN: +e
+}
+function debounce(e, t, r) {
+ function o(t) {
+ var r = f,
+ o = v;
+ return f = v = void 0,
+ T = t,
+ p = e.apply(o, r)
+ }
+ function n(e) {
+ return T = e,
+ b = setTimeout(a, t),
+ y ? o(e) : p
+ }
+ function i(e) {
+ var r = e - T,
+ o = t - (e - h);
+ return _ ? nativeMin(o, g - r) : o
+ }
+ function l(e) {
+ var r = e - h,
+ o = e - T;
+ return void 0 === h || r >= t || r < 0 || _ && o >= g
+ }
+ function a() {
+ var e = now();
+ if (l(e)) return c(e);
+ b = setTimeout(a, i(e))
+ }
+ function c(e) {
+ return b = void 0,
+ m && f ? o(e) : (f = v = void 0, p)
+ }
+ function s() {
+ void 0 !== b && clearTimeout(b),
+ T = 0,
+ f = h = v = b = void 0
+ }
+ function u() {
+ return void 0 === b ? p: c(now())
+ }
+ function d() {
+ var e = now(),
+ r = l(e);
+ if (f = arguments, v = this, h = e, r) {
+ if (void 0 === b) return n(h);
+ if (_) return clearTimeout(b),
+ b = setTimeout(a, t),
+ o(h)
+ }
+ return void 0 === b && (b = setTimeout(a, t)),
+ p
+ }
+ var f, v, g, p, b, h, T = 0,
+ y = !1,
+ _ = !1,
+ m = !0;
+ if ("function" != typeof e) throw new TypeError(FUNC_ERROR_TEXT);
+ return t = toNumber(t) || 0,
+ isObject(r) && (y = !!r.leading, g = (_ = "maxWait" in r) ? nativeMax(toNumber(r.maxWait) || 0, t) : g, m = "trailing" in r ? !!r.trailing: m),
+ d.cancel = s,
+ d.flush = u,
+ d
+}
+function isNumber(e) {
+ return "number" == typeof e || isObjectLike(e) && baseGetTag(e) == numberTag
+}
+function throttle(e, t, r) {
+ var o = !0,
+ n = !0;
+ if ("function" != typeof e) throw new TypeError(FUNC_ERROR_TEXT$1);
+ return isObject(r) && (o = "leading" in r ? !!r.leading: o, n = "trailing" in r ? !!r.trailing: n),
+ debounce(e, t, {
+ leading: o,
+ maxWait: t,
+ trailing: n
+ })
+}
+function styleInject(e, t) {
+ void 0 === t && (t = {});
+ var r = t.insertAt;
+ if (e && "undefined" != typeof document) {
+ var o = document.head || document.getElementsByTagName("head")[0],
+ n = document.createElement("style");
+ n.type = "text/css",
+ "top" === r && o.firstChild ? o.insertBefore(n, o.firstChild) : o.appendChild(n),
+ n.styleSheet ? n.styleSheet.cssText = e: n.appendChild(document.createTextNode(e))
+ }
+}
+function reducer(e, t) {
+ switch (t.type) {
+ case "changeTrs":
+ var r = t.curScrollTop,
+ o = t.scrollHeight,
+ n = t.tableScrollY;
+ return e.scrollHeight && r > e.scrollHeight && (r = e.scrollHeight),
+ __assign(__assign({},
+ e), {
+ curScrollTop: r,
+ scrollHeight: o,
+ tableScrollY: n
+ });
+ case "initHeight":
+ var i = t.rowHeight;
+ return __assign(__assign({},
+ e), {
+ rowHeight: i
+ });
+ case "reset":
+ return __assign(__assign({},
+ e), {
+ curScrollTop: (null === t || void 0 === t ? void 0 : t.ifScrollTopClear) ? 0 : e.curScrollTop,
+ scrollHeight: 0
+ });
+ default:
+ throw new Error
+ }
+}
+function VCell(e) {
+ var t = e.children,
+ r = __rest(e, ["children"]);
+ return React__default.createElement("td", __assign({},
+ r), React__default.createElement("div", null, t))
+}
+function VRow(e, t) {
+ var r = React.useContext(ScrollContext),
+ o = r.dispatch,
+ n = r.rowHeight,
+ i = r.totalLen,
+ l = r.vid,
+ a = e.children,
+ c = e.style,
+ s = __rest(e, ["children", "style"]),
+ u = React.useRef(null);
+ return React.useEffect(function() { !
+ function(e) {
+ var t, r, a;
+ if ((null === (t = null === e || void 0 === e ? void 0 : e.current) || void 0 === t ? void 0 : t.offsetHeight) && !n && i) {
+ var c = null !== (a = null === (r = null === e || void 0 === e ? void 0 : e.current) || void 0 === r ? void 0 : r.offsetHeight) && void 0 !== a ? a: 0;
+ vidMap.set(l, __assign(__assign({},
+ vidMap.get(l)), {
+ rowItemHeight: c
+ })),
+ o({
+ type: "initHeight",
+ rowHeight: c
+ })
+ }
+ } (t.hasOwnProperty("current") ? t: u)
+ },
+ [u, o, n, i]),
+ React__default.createElement("tr", __assign({},
+ s, {
+ ref: t.hasOwnProperty("current") ? t: u,
+ style: __assign(__assign({},
+ c), {
+ height: n || "auto",
+ boxSizing: "border-box"
+ })
+ }), a)
+}
+function VWrapper(e) {
+ var t = e.children,
+ r = __rest(e, ["children"]),
+ o = React.useContext(ScrollContext),
+ n = o.renderLen,
+ i = o.start,
+ l = (o.offsetStart, t[1]),
+ a = null;
+ return a = Array.isArray(l) && l.length ? [t[0], l.slice(i, i + n).map(function(e) {
+ return Array.isArray(e) ? e[0] : e
+ })] : t,
+ React__default.createElement("tbody", __assign({},
+ r), a)
+}
+function VTable(e, t) {
+ var r, o, n, i, l, a, c = e.style,
+ s = e.children,
+ u = __rest(e, ["style", "children"]),
+ d = c.width,
+ f = __rest(c, ["width"]),
+ v = null !== t && void 0 !== t ? t: {},
+ g = v.vid,
+ p = v.scrollY,
+ b = v.reachEnd,
+ h = v.onScroll,
+ T = React.useReducer(reducer, initialState),
+ y = T[0],
+ _ = T[1],
+ m = React.useRef(null),
+ S = React.useRef(null),
+ w = React.useState(null !== (i = null === (n = null === (o = null === (r = s[1]) || void 0 === r ? void 0 : r.props) || void 0 === o ? void 0 : o.data) || void 0 === n ? void 0 : n.length) && void 0 !== i ? i: 0),
+ R = w[0],
+ O = w[1];
+ React.useEffect(function() {
+ return function() {
+ vidMap.delete(g)
+ }
+ },
+ []),
+ React.useEffect(function() {
+ var e, t, r, o, n, i;
+ isNumber(null === (r = null === (t = null === (e = s[1]) || void 0 === e ? void 0 : e.props) || void 0 === t ? void 0 : t.data) || void 0 === r ? void 0 : r.length) && O(null === (i = null === (n = null === (o = s[1]) || void 0 === o ? void 0 : o.props) || void 0 === n ? void 0 : n.data) || void 0 === i ? void 0 : i.length)
+ },
+ [s]);
+ var j = React.useMemo(function() {
+ var e = "auto";
+ return y.rowHeight && R && (e = y.rowHeight * R),
+ e
+ },
+ [y.rowHeight, R]),
+ H = 0;
+ H = "string" == typeof p ? null === (a = null === (l = m.current) || void 0 === l ? void 0 : l.parentNode) || void 0 === a ? void 0 : a.offsetHeight: p,
+ isNumber(j) && j < H && (H = j),
+ H <= 0 && (H = 0);
+ var x = React.useMemo(function() {
+ var e = 1;
+ if (y.rowHeight && R && H) if (H <= 0) e = 0;
+ else {
+ var t = 1 + (H / y.rowHeight | 0) + 2;
+ e = t > R ? R: t
+ }
+ return e
+ },
+ [y.rowHeight, R, H]),
+ E = y.rowHeight ? y.curScrollTop / y.rowHeight | 0 : 0,
+ N = y.rowHeight ? y.curScrollTop % y.rowHeight: 0;
+ return y.curScrollTop && y.rowHeight && y.curScrollTop > y.rowHeight ? E > R - x || E > 1 && (E -= 1, N += y.rowHeight) : E = 0,
+ React.useEffect(function() {
+ var e, t = null === (e = m.current) || void 0 === e ? void 0 : e.parentNode;
+ vidMap.set(g, __assign(__assign({},
+ vidMap.get(g)), {
+ scrollNode: t
+ })),
+ b ? _({
+ type: "reset",
+ ifScrollTopClear: !1
+ }) : (t && (t.scrollTop = 0), _({
+ type: "reset",
+ ifScrollTopClear: !0
+ }))
+ },
+ [R]),
+ React.useEffect(function() {
+ var e, t = throttle(function(e) {
+ var t, r, o, n, i, l, a = null !== (r = null === (t = null === e || void 0 === e ? void 0 : e.target) || void 0 === t ? void 0 : t.scrollTop) && void 0 !== r ? r: 0,
+ c = null !== (n = null === (o = null === e || void 0 === e ? void 0 : e.target) || void 0 === o ? void 0 : o.scrollHeight) && void 0 !== n ? n: 0,
+ s = null !== (l = null === (i = null === e || void 0 === e ? void 0 : e.target) || void 0 === i ? void 0 : i.clientHeight) && void 0 !== l ? l: 0;
+ a === c || a + s >= c && b && b(),
+ h && h(),
+ _({
+ type: "changeTrs",
+ curScrollTop: a,
+ scrollHeight: c,
+ tableScrollY: H
+ })
+ },
+ throttleTime),
+ r = null === (e = null === m || void 0 === m ? void 0 : m.current) || void 0 === e ? void 0 : e.parentNode;
+ return r && r.addEventListener("scroll", t),
+ function() {
+ r.removeEventListener("scroll", t)
+ }
+ },
+ [m, H]),
+ React__default.createElement("div", {
+ className: "virtuallist",
+ ref: m,
+ style: {
+ width: "100%",
+ position: "relative",
+ height: j,
+ boxSizing: "border-box",
+ paddingTop: y.curScrollTop
+ }
+ },
+ React__default.createElement(ScrollContext.Provider, {
+ value: {
+ dispatch: _,
+ rowHeight: y.rowHeight,
+ start: E,
+ offsetStart: N,
+ renderLen: x,
+ totalLen: R,
+ vid: g
+ }
+ },
+ React__default.createElement("table", __assign({},
+ u, {
+ ref: S,
+ style: __assign(__assign({},
+ f), {
+ width: d,
+ position: "relative",
+ transform: "translateY(-" + N + "px)"
+ })
+ }), s)))
+}
+function VList(e) {
+ var t, r, o, n = null !== (t = e.vid) && void 0 !== t ? t: DEFAULT_VID;
+ return vidMap.has(n) ? o = null === (r = vidMap.get(n)) || void 0 === r ? void 0 : r.components: (o = transformTable({
+ vid: n,
+ scrollY: e.height,
+ reachEnd: e.onReachEnd,
+ onScroll: e.onScroll
+ }), vidMap.set(n, {
+ components: o
+ })),
+ {
+ table: o,
+ body: {
+ wrapper: VWrapper,
+ row: VRow,
+ cell: VCell
+ }
+ }
+}
+function scrollTo(e) {
+ var t = e.row,
+ r = e.y,
+ o = e.vid,
+ n = void 0 === o ? DEFAULT_VID: o,
+ i = vidMap.get(n),
+ l = i.scrollNode,
+ a = i.rowItemHeight;
+ l.scrollTop = t ? t - 1 > 0 ? (t - 1) * (null !== a && void 0 !== a ? a: 0) : 0 : null !== r && void 0 !== r ? r: 0
+}
+Object.defineProperty(exports, "__esModule", {
+ value: !0
+});
+var React = require("react"),
+ React__default = _interopDefault(React),
+ __assign = function() {
+ return (__assign = Object.assign ||
+ function(e) {
+ for (var t, r = 1,
+ o = arguments.length; r < o; r++) {
+ t = arguments[r];
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n])
+ }
+ return e
+ }).apply(this, arguments)
+ },
+ freeGlobal = "object" == typeof global && global && global.Object === Object && global,
+ freeSelf = "object" == typeof self && self && self.Object === Object && self,
+ root = freeGlobal || freeSelf || Function("return this")(),
+ Symbol = root.Symbol,
+ objectProto = Object.prototype,
+ hasOwnProperty = objectProto.hasOwnProperty,
+ nativeObjectToString = objectProto.toString,
+ symToStringTag = Symbol ? Symbol.toStringTag: void 0,
+ objectProto$1 = Object.prototype,
+ nativeObjectToString$1 = objectProto$1.toString,
+ nullTag = "[object Null]",
+ undefinedTag = "[object Undefined]",
+ symToStringTag$1 = Symbol ? Symbol.toStringTag: void 0,
+ symbolTag = "[object Symbol]",
+ reWhitespace = /\s/,
+ reTrimStart = /^\s+/,
+ NAN = NaN,
+ reIsBadHex = /^[-+]0x[0-9a-f]+$/i,
+ reIsBinary = /^0b[01]+$/i,
+ reIsOctal = /^0o[0-7]+$/i,
+ freeParseInt = parseInt,
+ now = function() {
+ return root.Date.now()
+ },
+ FUNC_ERROR_TEXT = "Expected a function",
+ nativeMax = Math.max,
+ nativeMin = Math.min,
+ numberTag = "[object Number]",
+ FUNC_ERROR_TEXT$1 = "Expected a function",
+ css_248z = ".virtuallist .ant-table-tbody>tr>td>div{-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;width:100%}.virtuallist .ant-table-tbody>tr>td.ant-table-row-expand-icon-cell>div{overflow:inherit}.ant-table-bordered .virtuallist>table>.ant-table-tbody>tr>td{border-right:1px solid #f0f0f0}";
+styleInject(css_248z);
+var initialState = {
+ rowHeight: 0,
+ curScrollTop: 0,
+ scrollHeight: 0,
+ tableScrollY: 0
+ },
+ DEFAULT_VID = "vtable",
+ vidMap = new Map,
+ ScrollContext = React.createContext({
+ dispatch: void 0,
+ renderLen: 1,
+ start: 0,
+ offsetStart: 0,
+ rowHeight: initialState.rowHeight,
+ totalLen: 0,
+ vid: DEFAULT_VID
+ }),
+ transformTable = function(e) {
+ return function(t) {
+ return VTable(t, e)
+ }
+ };
+exports.VList = VList,
+ exports.scrollTo = scrollTo;
diff --git a/src/components/VlistNew/index.js b/src/components/VlistNew/index.js
new file mode 100644
index 0000000..a04be92
--- /dev/null
+++ b/src/components/VlistNew/index.js
@@ -0,0 +1,1053 @@
+/* eslint-disable */
+var React = require('react');
+
+/******************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+
+var __assign = function() {
+ __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
+
+function __rest(s, e) {
+ var t = {};
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
+ t[p[i]] = s[p[i]];
+ }
+ return t;
+}
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+
+var freeGlobal$1 = freeGlobal;
+
+/** Detect free variable `self`. */
+var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+
+/** Used as a reference to the global object. */
+var root = freeGlobal$1 || freeSelf || Function('return this')();
+
+var root$1 = root;
+
+/** Built-in value references. */
+var Symbol = root$1.Symbol;
+
+var Symbol$1 = Symbol;
+
+/** Used for built-in method references. */
+var objectProto$1 = Object.prototype;
+
+/** Used to check objects for own properties. */
+var hasOwnProperty = objectProto$1.hasOwnProperty;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString$1 = objectProto$1.toString;
+
+/** Built-in value references. */
+var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
+
+/**
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the raw `toStringTag`.
+ */
+function getRawTag(value) {
+ var isOwn = hasOwnProperty.call(value, symToStringTag$1),
+ tag = value[symToStringTag$1];
+
+ try {
+ value[symToStringTag$1] = undefined;
+ var unmasked = true;
+ } catch (e) {}
+
+ var result = nativeObjectToString$1.call(value);
+ if (unmasked) {
+ if (isOwn) {
+ value[symToStringTag$1] = tag;
+ } else {
+ delete value[symToStringTag$1];
+ }
+ }
+ return result;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var nativeObjectToString = objectProto.toString;
+
+/**
+ * Converts `value` to a string using `Object.prototype.toString`.
+ *
+ * @private
+ * @param {*} value The value to convert.
+ * @returns {string} Returns the converted string.
+ */
+function objectToString(value) {
+ return nativeObjectToString.call(value);
+}
+
+/** `Object#toString` result references. */
+var nullTag = '[object Null]',
+ undefinedTag = '[object Undefined]';
+
+/** Built-in value references. */
+var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
+
+/**
+ * The base implementation of `getTag` without fallbacks for buggy environments.
+ *
+ * @private
+ * @param {*} value The value to query.
+ * @returns {string} Returns the `toStringTag`.
+ */
+function baseGetTag(value) {
+ if (value == null) {
+ return value === undefined ? undefinedTag : nullTag;
+ }
+ return (symToStringTag && symToStringTag in Object(value))
+ ? getRawTag(value)
+ : objectToString(value);
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+ return value != null && typeof value == 'object';
+}
+
+/** `Object#toString` result references. */
+var symbolTag = '[object Symbol]';
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+ return typeof value == 'symbol' ||
+ (isObjectLike(value) && baseGetTag(value) == symbolTag);
+}
+
+/** Used to match a single whitespace character. */
+var reWhitespace = /\s/;
+
+/**
+ * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
+ * character of `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the index of the last non-whitespace character.
+ */
+function trimmedEndIndex(string) {
+ var index = string.length;
+
+ while (index-- && reWhitespace.test(string.charAt(index))) {}
+ return index;
+}
+
+/** Used to match leading whitespace. */
+var reTrimStart = /^\s+/;
+
+/**
+ * The base implementation of `_.trim`.
+ *
+ * @private
+ * @param {string} string The string to trim.
+ * @returns {string} Returns the trimmed string.
+ */
+function baseTrim(string) {
+ return string
+ ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
+ : string;
+}
+
+/**
+ * Checks if `value` is the
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+ var type = typeof value;
+ return value != null && (type == 'object' || type == 'function');
+}
+
+/** Used as references for various `Number` constants. */
+var NAN = 0 / 0;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @since 4.0.0
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3.2);
+ * // => 3.2
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3.2');
+ * // => 3.2
+ */
+function toNumber(value) {
+ if (typeof value == 'number') {
+ return value;
+ }
+ if (isSymbol(value)) {
+ return NAN;
+ }
+ if (isObject(value)) {
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
+ value = isObject(other) ? (other + '') : other;
+ }
+ if (typeof value != 'string') {
+ return value === 0 ? value : +value;
+ }
+ value = baseTrim(value);
+ var isBinary = reIsBinary.test(value);
+ return (isBinary || reIsOctal.test(value))
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+ : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Gets the timestamp of the number of milliseconds that have elapsed since
+ * the Unix epoch (1 January 1970 00:00:00 UTC).
+ *
+ * @static
+ * @memberOf _
+ * @since 2.4.0
+ * @category Date
+ * @returns {number} Returns the timestamp.
+ * @example
+ *
+ * _.defer(function(stamp) {
+ * console.log(_.now() - stamp);
+ * }, _.now());
+ * // => Logs the number of milliseconds it took for the deferred invocation.
+ */
+var now = function() {
+ return root$1.Date.now();
+};
+
+var now$1 = now;
+
+/** Error message constants. */
+var FUNC_ERROR_TEXT$1 = 'Expected a function';
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeMax = Math.max,
+ nativeMin = Math.min;
+
+/**
+ * Creates a debounced function that delays invoking `func` until after `wait`
+ * milliseconds have elapsed since the last time the debounced function was
+ * invoked. The debounced function comes with a `cancel` method to cancel
+ * delayed `func` invocations and a `flush` method to immediately invoke them.
+ * Provide `options` to indicate whether `func` should be invoked on the
+ * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
+ * with the last arguments provided to the debounced function. Subsequent
+ * calls to the debounced function return the result of the last `func`
+ * invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
+ * invoked on the trailing edge of the timeout only if the debounced function
+ * is invoked more than once during the `wait` timeout.
+ *
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
+ *
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
+ * for details over the differences between `_.debounce` and `_.throttle`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to debounce.
+ * @param {number} [wait=0] The number of milliseconds to delay.
+ * @param {Object} [options={}] The options object.
+ * @param {boolean} [options.leading=false]
+ * Specify invoking on the leading edge of the timeout.
+ * @param {number} [options.maxWait]
+ * The maximum time `func` is allowed to be delayed before it's invoked.
+ * @param {boolean} [options.trailing=true]
+ * Specify invoking on the trailing edge of the timeout.
+ * @returns {Function} Returns the new debounced function.
+ * @example
+ *
+ * // Avoid costly calculations while the window size is in flux.
+ * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+ *
+ * // Invoke `sendMail` when clicked, debouncing subsequent calls.
+ * jQuery(element).on('click', _.debounce(sendMail, 300, {
+ * 'leading': true,
+ * 'trailing': false
+ * }));
+ *
+ * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
+ * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
+ * var source = new EventSource('/stream');
+ * jQuery(source).on('message', debounced);
+ *
+ * // Cancel the trailing debounced invocation.
+ * jQuery(window).on('popstate', debounced.cancel);
+ */
+function debounce(func, wait, options) {
+ var lastArgs,
+ lastThis,
+ maxWait,
+ result,
+ timerId,
+ lastCallTime,
+ lastInvokeTime = 0,
+ leading = false,
+ maxing = false,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT$1);
+ }
+ wait = toNumber(wait) || 0;
+ if (isObject(options)) {
+ leading = !!options.leading;
+ maxing = 'maxWait' in options;
+ maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+
+ function invokeFunc(time) {
+ var args = lastArgs,
+ thisArg = lastThis;
+
+ lastArgs = lastThis = undefined;
+ lastInvokeTime = time;
+ result = func.apply(thisArg, args);
+ return result;
+ }
+
+ function leadingEdge(time) {
+ // Reset any `maxWait` timer.
+ lastInvokeTime = time;
+ // Start the timer for the trailing edge.
+ timerId = setTimeout(timerExpired, wait);
+ // Invoke the leading edge.
+ return leading ? invokeFunc(time) : result;
+ }
+
+ function remainingWait(time) {
+ var timeSinceLastCall = time - lastCallTime,
+ timeSinceLastInvoke = time - lastInvokeTime,
+ timeWaiting = wait - timeSinceLastCall;
+
+ return maxing
+ ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
+ : timeWaiting;
+ }
+
+ function shouldInvoke(time) {
+ var timeSinceLastCall = time - lastCallTime,
+ timeSinceLastInvoke = time - lastInvokeTime;
+
+ // Either this is the first call, activity has stopped and we're at the
+ // trailing edge, the system time has gone backwards and we're treating
+ // it as the trailing edge, or we've hit the `maxWait` limit.
+ return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
+ (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
+ }
+
+ function timerExpired() {
+ var time = now$1();
+ if (shouldInvoke(time)) {
+ return trailingEdge(time);
+ }
+ // Restart the timer.
+ timerId = setTimeout(timerExpired, remainingWait(time));
+ }
+
+ function trailingEdge(time) {
+ timerId = undefined;
+
+ // Only invoke if we have `lastArgs` which means `func` has been
+ // debounced at least once.
+ if (trailing && lastArgs) {
+ return invokeFunc(time);
+ }
+ lastArgs = lastThis = undefined;
+ return result;
+ }
+
+ function cancel() {
+ if (timerId !== undefined) {
+ clearTimeout(timerId);
+ }
+ lastInvokeTime = 0;
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
+ }
+
+ function flush() {
+ return timerId === undefined ? result : trailingEdge(now$1());
+ }
+
+ function debounced() {
+ var time = now$1(),
+ isInvoking = shouldInvoke(time);
+
+ lastArgs = arguments;
+ lastThis = this;
+ lastCallTime = time;
+
+ if (isInvoking) {
+ if (timerId === undefined) {
+ return leadingEdge(lastCallTime);
+ }
+ if (maxing) {
+ // Handle invocations in a tight loop.
+ clearTimeout(timerId);
+ timerId = setTimeout(timerExpired, wait);
+ return invokeFunc(lastCallTime);
+ }
+ }
+ if (timerId === undefined) {
+ timerId = setTimeout(timerExpired, wait);
+ }
+ return result;
+ }
+ debounced.cancel = cancel;
+ debounced.flush = flush;
+ return debounced;
+}
+
+/** `Object#toString` result references. */
+var numberTag = '[object Number]';
+
+/**
+ * Checks if `value` is classified as a `Number` primitive or object.
+ *
+ * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
+ * classified as numbers, use the `_.isFinite` method.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is a number, else `false`.
+ * @example
+ *
+ * _.isNumber(3);
+ * // => true
+ *
+ * _.isNumber(Number.MIN_VALUE);
+ * // => true
+ *
+ * _.isNumber(Infinity);
+ * // => true
+ *
+ * _.isNumber('3');
+ * // => false
+ */
+function isNumber(value) {
+ return typeof value == 'number' ||
+ (isObjectLike(value) && baseGetTag(value) == numberTag);
+}
+
+/** Error message constants. */
+var FUNC_ERROR_TEXT = 'Expected a function';
+
+/**
+ * Creates a throttled function that only invokes `func` at most once per
+ * every `wait` milliseconds. The throttled function comes with a `cancel`
+ * method to cancel delayed `func` invocations and a `flush` method to
+ * immediately invoke them. Provide `options` to indicate whether `func`
+ * should be invoked on the leading and/or trailing edge of the `wait`
+ * timeout. The `func` is invoked with the last arguments provided to the
+ * throttled function. Subsequent calls to the throttled function return the
+ * result of the last `func` invocation.
+ *
+ * **Note:** If `leading` and `trailing` options are `true`, `func` is
+ * invoked on the trailing edge of the timeout only if the throttled function
+ * is invoked more than once during the `wait` timeout.
+ *
+ * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
+ * until to the next tick, similar to `setTimeout` with a timeout of `0`.
+ *
+ * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
+ * for details over the differences between `_.throttle` and `_.debounce`.
+ *
+ * @static
+ * @memberOf _
+ * @since 0.1.0
+ * @category Function
+ * @param {Function} func The function to throttle.
+ * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+ * @param {Object} [options={}] The options object.
+ * @param {boolean} [options.leading=true]
+ * Specify invoking on the leading edge of the timeout.
+ * @param {boolean} [options.trailing=true]
+ * Specify invoking on the trailing edge of the timeout.
+ * @returns {Function} Returns the new throttled function.
+ * @example
+ *
+ * // Avoid excessively updating the position while scrolling.
+ * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+ *
+ * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
+ * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
+ * jQuery(element).on('click', throttled);
+ *
+ * // Cancel the trailing throttled invocation.
+ * jQuery(window).on('popstate', throttled.cancel);
+ */
+function throttle(func, wait, options) {
+ var leading = true,
+ trailing = true;
+
+ if (typeof func != 'function') {
+ throw new TypeError(FUNC_ERROR_TEXT);
+ }
+ if (isObject(options)) {
+ leading = 'leading' in options ? !!options.leading : leading;
+ trailing = 'trailing' in options ? !!options.trailing : trailing;
+ }
+ return debounce(func, wait, {
+ 'leading': leading,
+ 'maxWait': wait,
+ 'trailing': trailing
+ });
+}
+
+function styleInject(css, ref) {
+ if ( ref === void 0 ) ref = {};
+ var insertAt = ref.insertAt;
+
+ if (!css || typeof document === 'undefined') { return; }
+
+ var head = document.head || document.getElementsByTagName('head')[0];
+ var style = document.createElement('style');
+ style.type = 'text/css';
+
+ if (insertAt === 'top') {
+ if (head.firstChild) {
+ head.insertBefore(style, head.firstChild);
+ } else {
+ head.appendChild(style);
+ }
+ } else {
+ head.appendChild(style);
+ }
+
+ if (style.styleSheet) {
+ style.styleSheet.cssText = css;
+ } else {
+ style.appendChild(document.createTextNode(css));
+ }
+}
+
+var css_248z = ".virtuallist .ant-table-tbody>tr>td>div{-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;width:100%}.virtuallist .ant-table-tbody>tr>td.ant-table-row-expand-icon-cell>div{overflow:inherit}.ant-table-bordered .virtuallist>table>.ant-table-tbody>tr>td{border-right:1px solid #f0f0f0}";
+styleInject(css_248z);
+
+// ===============reducer ============== //
+var initialState = {
+ // 行高度
+ rowHeight: 0,
+ // 当前的scrollTop
+ curScrollTop: 0,
+ // 总行数
+ totalLen: 0,
+ // 每行的高度list
+ trHeightList: [],
+};
+function reducer(state, action) {
+ var _a;
+ var curScrollTop = action.curScrollTop, rowHeight = action.rowHeight, totalLen = action.totalLen, ifScrollTopClear = action.ifScrollTopClear, trHeight = action.trHeight, trIndex = action.trIndex;
+ var stateScrollTop = state.curScrollTop;
+ var trHeightList = state.trHeightList;
+ switch (action.type) {
+ // 改变trs 即 改变渲染的列表trs
+ case 'changeTrs':
+ return __assign(__assign({}, state), { curScrollTop: curScrollTop });
+ // 初始化每行的高度, 表格总高度, 渲染的条数
+ case 'initHeight':
+ return __assign(__assign({}, state), { rowHeight: rowHeight });
+ // 更改totalLen
+ case 'changeTotalLen':
+ if (totalLen === 0) {
+ stateScrollTop = 0;
+ }
+ else if (totalLen) {
+ for (var i = 0; i < totalLen; i++) {
+ trHeightList[i] = (_a = trHeightList[i]) !== null && _a !== void 0 ? _a : 29;
+ }
+ }
+ return __assign(__assign({}, state), { totalLen: totalLen, curScrollTop: stateScrollTop, trHeightList: trHeightList });
+ case 'reset':
+ return __assign(__assign({}, state), { curScrollTop: ifScrollTopClear ? 0 : state.curScrollTop });
+ case 'setTrList':
+ trHeightList[trIndex] = trHeight;
+ if (trHeightList.length > state.totalLen) {
+ trHeightList = trHeightList.slice(0, state.totalLen);
+ }
+ return __assign(__assign({}, state), { trHeightList: trHeightList });
+ default:
+ throw new Error();
+ }
+}
+// ==============全局常量 ================== //
+var DEFAULT_VID = 'vtable';
+var vidMap = new Map();
+var debounceListRender;
+// ===============context ============== //
+var ScrollContext = React.createContext({
+ dispatch: undefined,
+ renderLen: 1,
+ start: 0,
+ offsetStart: 0,
+ // =============
+ rowHeight: initialState.rowHeight,
+ totalLen: 0,
+ vid: DEFAULT_VID,
+});
+// =============组件 =================== //
+function VCell(props) {
+ var children = props.children, restProps = __rest(props, ["children"]);
+ return (React.createElement("td", __assign({}, restProps),
+ React.createElement("div", null, children)));
+}
+function VRow(props, ref) {
+ var _a = React.useContext(ScrollContext), dispatch = _a.dispatch, rowHeight = _a.rowHeight, totalLen = _a.totalLen, vid = _a.vid;
+ var children = props.children, style = props.style, restProps = __rest(props, ["children", "style"]);
+ var trRef = React.useRef(null);
+ React.useEffect(function () {
+ var initHeight = function (tempRef) {
+ var _a, _b, _c;
+ if (((_a = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) && !rowHeight && totalLen) {
+ var tempRowHeight = (_c = (_b = tempRef === null || tempRef === void 0 ? void 0 : tempRef.current) === null || _b === void 0 ? void 0 : _b.offsetHeight) !== null && _c !== void 0 ? _c : 0;
+ vidMap.set(vid, __assign(__assign({}, vidMap.get(vid)), { rowItemHeight: tempRowHeight }));
+ dispatch({
+ type: 'initHeight',
+ rowHeight: tempRowHeight,
+ });
+ }
+ };
+ initHeight(Object.prototype.hasOwnProperty.call(ref, 'current') ? ref : trRef);
+ }, [trRef, dispatch, rowHeight, totalLen, ref, vid]);
+ // zhangzhen
+ React.useEffect(function () {
+ var _a, _b, _c;
+ if (restProps.index !== undefined) {
+ if ((_a = trRef === null || trRef === void 0 ? void 0 : trRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().height) {
+ var nextSibling = trRef.current.nextSibling;
+ if (nextSibling && Array.from(nextSibling.classList).includes('ant-table-expanded-row')) {
+ dispatch({
+ type: 'setTrList',
+ trIndex: restProps.index,
+ trHeight: (((_b = trRef === null || trRef === void 0 ? void 0 : trRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect().height) + nextSibling.getBoundingClientRect().height) || 0
+ });
+ }
+ else {
+ dispatch({
+ type: 'setTrList',
+ trIndex: restProps.index,
+ trHeight: ((_c = trRef === null || trRef === void 0 ? void 0 : trRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect().height) || 0
+ });
+ }
+ }
+ }
+ }, [children]);
+ return (React.createElement("tr", __assign({}, restProps, { ref: Object.prototype.hasOwnProperty.call(ref, 'current')
+ ? ref
+ : trRef, style: __assign(__assign({}, style), {
+ // height: rowHeight || 'auto',
+ height: 'auto',
+ boxSizing: 'border-box' }) }), children));
+}
+function VWrapper(props) {
+ var children = props.children, restProps = __rest(props, ["children"]);
+ var _a = React.useContext(ScrollContext), renderLen = _a.renderLen, start = _a.start, dispatch = _a.dispatch, vid = _a.vid, totalLen = _a.totalLen;
+ var contents = React.useMemo(function () {
+ return children[1];
+ }, [children]);
+ var contentsLen = React.useMemo(function () {
+ var _a;
+ return (_a = contents === null || contents === void 0 ? void 0 : contents.length) !== null && _a !== void 0 ? _a : 0;
+ }, [contents]);
+ React.useEffect(function () {
+ if (totalLen !== contentsLen) {
+ dispatch({
+ type: 'changeTotalLen',
+ totalLen: contentsLen !== null && contentsLen !== void 0 ? contentsLen : 0,
+ });
+ }
+ }, [contentsLen, dispatch, vid, totalLen]);
+ var tempNode = null;
+ if (Array.isArray(contents) && contents.length) {
+ tempNode = [
+ children[0],
+ contents.slice(start, start + (renderLen !== null && renderLen !== void 0 ? renderLen : 1)).map(function (item) {
+ if (Array.isArray(item)) {
+ // 兼容antd v4.3.5 --- rc-table 7.8.1及以下
+ return item[0];
+ }
+ // 处理antd ^v4.4.0 --- rc-table ^7.8.2
+ return item;
+ }),
+ ];
+ }
+ else {
+ tempNode = children;
+ }
+ return React.createElement("tbody", __assign({}, restProps), tempNode);
+}
+function VTable(props, otherParams) {
+ var _a, _b, _c, _d, _e, _f, _g, _h;
+ var style = props.style, children = props.children, rest = __rest(props, ["style", "children"]);
+ var width = style.width, rest_style = __rest(style, ["width"]);
+ var _j = otherParams !== null && otherParams !== void 0 ? otherParams : {}, vid = _j.vid, scrollY = _j.scrollY, reachEnd = _j.reachEnd, onScroll = _j.onScroll, resetScrollTopWhenDataChange = _j.resetScrollTopWhenDataChange;
+ var _k = React.useReducer(reducer, initialState), state = _k[0], dispatch = _k[1];
+ var wrap_tableRef = React.useRef(null);
+ var tableRef = React.useRef(null);
+ var ifChangeRef = React.useRef(false);
+ // 数据的总条数
+ var _l = React.useState((_d = (_c = (_b = (_a = children[1]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0), totalLen = _l[0], setTotalLen = _l[1];
+ React.useEffect(function () {
+ setTotalLen(state.totalLen);
+ }, [state.totalLen]);
+ // 组件卸载的清除操作
+ React.useEffect(function () {
+ return function () {
+ vidMap.delete(vid);
+ };
+ }, [vid]);
+ // 数据变更
+ React.useEffect(function () {
+ var _a, _b, _c, _d, _e, _f, _g;
+ ifChangeRef.current = true;
+ // console.log('数据变更')
+ if (isNumber((_c = (_b = (_a = children[1]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.length)) {
+ dispatch({
+ type: 'changeTotalLen',
+ totalLen: (_g = (_f = (_e = (_d = children[1]) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : 0,
+ });
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [children[1].props.data]);
+ // table总高度
+ var tableHeight = 'auto';
+ if (state.trHeightList.length && totalLen) {
+ tableHeight = 0;
+ // zhangzhen
+ for (var i = 1; i < state.trHeightList.length; i++) {
+ tableHeight += (_e = state.trHeightList[i]) !== null && _e !== void 0 ? _e : 0;
+ }
+ var parentTobdy = (_f = wrap_tableRef.current) === null || _f === void 0 ? void 0 : _f.parentNode;
+ if (parentTobdy) {
+ tableHeight = Math.max(tableHeight, parseFloat(parentTobdy.style.maxHeight));
+ }
+ }
+ // table的scrollY值
+ var _m = React.useState(0), tableScrollY = _m[0], setTableScrollY = _m[1];
+ // tableScrollY 随scrollY / tableHeight 进行变更
+ React.useEffect(function () {
+ var _a, _b, _c;
+ var temp = 0;
+ if (typeof scrollY === 'string') {
+ temp = (_c = (_b = (_a = wrap_tableRef.current) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.offsetHeight) !== null && _c !== void 0 ? _c : 0;
+ }
+ else {
+ temp = scrollY;
+ }
+ // if (isNumber(tableHeight) && tableHeight < temp) {
+ // temp = tableHeight;
+ // }
+ // 处理tableScrollY <= 0的情况
+ if (temp <= 0) {
+ temp = 0;
+ }
+ setTableScrollY(temp);
+ }, [scrollY, tableHeight]);
+ // 渲染的条数
+ var renderLen = React.useMemo(function () {
+ var temp = 1;
+ if (state.rowHeight && totalLen && tableScrollY) {
+ if (tableScrollY <= 0) {
+ temp = 0;
+ }
+ else {
+ var tempRenderLen = ((tableScrollY / state.rowHeight) | 0) + 1 + 2;
+ // console.log('tempRenderLen', tempRenderLen)
+ // temp = tempRenderLen > totalLen ? totalLen : tempRenderLen;
+ temp = tempRenderLen;
+ }
+ }
+ temp = Math.max(temp, 20);
+ return temp;
+ }, [state.rowHeight, totalLen, tableScrollY]);
+ // 渲染中的第一条
+ // zhangzhen
+ // let start = state.rowHeight ? (state.curScrollTop / state.rowHeight) | 0 : 0
+ var start = 0;
+ var totalLength = 0;
+ var currentHeight = 0;
+ if (state.trHeightList && state.curScrollTop) {
+ for (var i = 0; i < state.trHeightList.length; i++) {
+ totalLength += (_g = state.trHeightList[i]) !== null && _g !== void 0 ? _g : 0;
+ if (totalLength >= state.curScrollTop) {
+ currentHeight = state.trHeightList[i];
+ start = i;
+ break;
+ }
+ }
+ }
+ // 偏移量
+ // let offsetStart = state.rowHeight ? state.curScrollTop % state.rowHeight : 0
+ // let offsetStart = 0;
+ var offsetStart = (1 - (totalLength - state.curScrollTop) / currentHeight) * currentHeight;
+ if (!offsetStart || offsetStart !== offsetStart) {
+ offsetStart = 0;
+ }
+ // 用来优化向上滚动出现的空白
+ // if (
+ // state.curScrollTop &&
+ // state.rowHeight &&
+ // state.curScrollTop > state.rowHeight
+ // ) {
+ // start -= 1
+ // offsetStart += state.rowHeight
+ // } else {
+ // start = 0
+ // }
+ // 数据变更 操作scrollTop
+ React.useEffect(function () {
+ var _a;
+ var scrollNode = (_a = wrap_tableRef.current) === null || _a === void 0 ? void 0 : _a.parentNode;
+ if (ifChangeRef === null || ifChangeRef === void 0 ? void 0 : ifChangeRef.current) {
+ ifChangeRef.current = false;
+ if (resetScrollTopWhenDataChange) {
+ // 重置scrollTop
+ if (scrollNode) {
+ scrollNode.scrollTop = 0;
+ }
+ dispatch({ type: 'reset', ifScrollTopClear: true });
+ }
+ else {
+ // 不重置scrollTop 不清空curScrollTop
+ dispatch({ type: 'reset', ifScrollTopClear: false });
+ }
+ }
+ if (vidMap.has(vid)) {
+ vidMap.set(vid, __assign(__assign({}, vidMap.get(vid)), { scrollNode: scrollNode }));
+ }
+ }, [totalLen, resetScrollTopWhenDataChange, vid, children]);
+ React.useEffect(function () {
+ var _a;
+ var throttleScroll = throttle(function (e) {
+ var _a, _b, _c, _d, _e, _f;
+ var scrollTop = (_b = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0;
+ var scrollHeight = (_d = (_c = e === null || e === void 0 ? void 0 : e.target) === null || _c === void 0 ? void 0 : _c.scrollHeight) !== null && _d !== void 0 ? _d : 0;
+ var clientHeight = (_f = (_e = e === null || e === void 0 ? void 0 : e.target) === null || _e === void 0 ? void 0 : _e.clientHeight) !== null && _f !== void 0 ? _f : 0;
+ // 到底了 没有滚动条就不会触发reachEnd. 建议设置scrolly高度少点或者数据量多点.
+ if (scrollTop === scrollHeight) ;
+ else if (scrollTop + clientHeight >= scrollHeight) {
+ // 有滚动条的情况
+ // eslint-disable-next-line no-unused-expressions
+ reachEnd && reachEnd();
+ }
+ // eslint-disable-next-line no-unused-expressions
+ onScroll && onScroll();
+ // 若renderLen大于totalLen, 置空curScrollTop. => table paddingTop会置空.
+ dispatch({
+ type: 'changeTrs',
+ curScrollTop: renderLen <= totalLen ? scrollTop : 0,
+ });
+ }, 60);
+ var ref = (_a = wrap_tableRef === null || wrap_tableRef === void 0 ? void 0 : wrap_tableRef.current) === null || _a === void 0 ? void 0 : _a.parentNode;
+ if (ref) {
+ ref.addEventListener('scroll', throttleScroll);
+ }
+ return function () {
+ ref.removeEventListener('scroll', throttleScroll);
+ };
+ }, [onScroll, reachEnd, renderLen, totalLen]);
+ // console.log(start, renderLen)
+ debounceListRender(start, renderLen);
+ return (React.createElement("div", { className: "virtuallist", ref: wrap_tableRef, style: {
+ width: '100%',
+ position: 'relative',
+ height: tableHeight,
+ boxSizing: 'border-box',
+ paddingTop: state.curScrollTop,
+ } },
+ React.createElement(ScrollContext.Provider, { value: {
+ dispatch: dispatch,
+ rowHeight: (_h = vidMap === null || vidMap === void 0 ? void 0 : vidMap.get(vid)) === null || _h === void 0 ? void 0 : _h.rowItemHeight,
+ start: start,
+ offsetStart: offsetStart,
+ renderLen: renderLen,
+ totalLen: totalLen,
+ vid: vid,
+ } },
+ React.createElement("table", __assign({}, rest, { ref: tableRef, style: __assign(__assign({}, rest_style), { width: width, position: 'relative', transform: "translateY(-" + offsetStart + "px)" }) }), children))));
+}
+// ================导出===================
+function VList(props) {
+ var _a = props.vid, vid = _a === void 0 ? DEFAULT_VID : _a, height = props.height, onReachEnd = props.onReachEnd, onScroll = props.onScroll, onListRender = props.onListRender, debounceListRenderMS = props.debounceListRenderMS; props.resetTopWhenDataChange;
+ // const resetScrollTopWhenDataChange = onReachEnd
+ // ? false
+ // : resetTopWhenDataChange
+ var resetScrollTopWhenDataChange = false;
+ if (!vidMap.has(vid)) {
+ vidMap.set(vid, { _id: vid });
+ }
+ debounceListRender = onListRender
+ ? debounce(function (_start, _renderLen) {
+ onListRender({ start: _start, renderLen: _renderLen });
+ }, debounceListRenderMS !== null && debounceListRenderMS !== void 0 ? debounceListRenderMS : 300)
+ : function () { };
+ return {
+ table: function (p) {
+ return VTable(p, {
+ vid: vid,
+ scrollY: height,
+ reachEnd: onReachEnd,
+ onScroll: onScroll,
+ onListRender: onListRender,
+ resetScrollTopWhenDataChange: resetScrollTopWhenDataChange,
+ });
+ },
+ body: {
+ wrapper: VWrapper,
+ row: VRow,
+ cell: VCell,
+ },
+ };
+}
+function scrollTo(option) {
+ var row = option.row, y = option.y, _a = option.vid, vid = _a === void 0 ? DEFAULT_VID : _a;
+ var _b = vidMap.get(vid), scrollNode = _b.scrollNode, rowItemHeight = _b.rowItemHeight;
+ if (row) {
+ if (row - 1 > 0) {
+ scrollNode.scrollTop = (row - 1) * (rowItemHeight !== null && rowItemHeight !== void 0 ? rowItemHeight : 0);
+ }
+ else {
+ scrollNode.scrollTop = 0;
+ }
+ }
+ else {
+ scrollNode.scrollTop = y !== null && y !== void 0 ? y : 0;
+ }
+ return { vid: vid, rowItemHeight: rowItemHeight };
+}
+
+exports.VList = VList;
+exports.scrollTo = scrollTo;
diff --git a/src/default.less b/src/default.less
new file mode 100644
index 0000000..5ede6ae
--- /dev/null
+++ b/src/default.less
@@ -0,0 +1,1030 @@
+@import "~@/variable.less";
+:global{
+ body {
+ border: 1px solid red !important;
+ }
+ .sActiveIdStyle {
+ top: 0;
+ }
+ .select-table-option{
+ max-width: 100wh;
+ overflow: hidden;
+ .select-table{
+ td{
+ font-weight: normal!important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+ }
+ .select-search{
+ box-sizing: border-box;
+ padding: 5px;
+ background: #f1f1f1;
+ }
+ .select-pagination{
+ padding: 5px 0;
+ margin-bottom: -5px;
+ background: #f1f1f1;
+ display: flex;
+ justify-content: space-between;
+ }
+ .toolbarIcon{
+ width: 13px;
+ height: 13px;
+ display: inline-block;
+ fill: #fff;
+ stroke: #fff;
+ margin-right: 3px;
+ position: relative;
+ top: 2px;
+ }
+ .commonNewBillContainer{
+ .ant-form-item-control-input-content{
+ .ant-input-number{
+ width: 100%!important;
+ .ant-input-number-input {
+ height: 28px;
+ }
+ }
+ }
+ }
+ .homeTab {
+ width: 80px;
+ text-align: center;
+ font-size: 14px;
+ cursor: pointer;
+ span{
+ margin-left: 8px;
+ }
+ }
+ .homeTab__active{
+ color: var(--xly-skin-active-color, #1890FF);
+ }
+ .mainTabWrap{
+ & > .ant-tabs-nav {
+ .ant-tabs-tab{
+ &:first-child{
+ display: none;
+ }
+ }
+ }
+ }
+ .placeHidden {
+ opacity: 0;
+ visibility: hidden;
+ }
+ .ant-tabs-dropdown-menu {
+ padding: 0px!important;
+ }
+ // 空表单margin高度改为0
+ .ant-empty-normal{
+ margin: 0!important;
+ .ant-empty-image{
+ display: none;
+ }
+ }
+ .custom-collapse{
+ .ant-collapse-item {
+ border-bottom: 1.5px solid #f5f5f5;
+ }
+ .ant-collapse-content-box{
+ padding: 0;
+ }
+ .ant-collapse-header{
+ font-size: 14px;
+ font-weight: bold;
+ background: rgba(204, 204, 204, 1);
+ }
+ .ant-collapse-content{
+ border-top: none;
+ }
+ .ant-table-container{
+ border-left: none!important;
+ }
+ .ant-collapse-extra{
+ margin-left: 8px!important;
+ }
+ }
+ div, span, p, input, textarea{
+ font-family: @font_family!important;
+ }
+ #slaveTabs {
+ margin-top: 8px;
+ height: auto;
+ }
+ #slaveTabs::-webkit-scrollbar{
+ width: 1px;
+ background-color: rgb(230,230,230,1);
+ opacity: 5%;
+ }
+
+ tr.ant-table-measure-row{
+ td{
+ padding: 0;
+ }
+ }
+ tr:not(.ant-table-measure-row) {
+ td{
+ padding: 4px;
+ }
+ }
+ .xly-bill-list, .xly-workorder-list, .other-list, .productPlan{
+ td{
+ padding: 0!important;
+ .listDiv {
+ padding: 4px;
+ }
+ }
+ }
+ // 处理表单详情的样式问题开始
+ button.ant-table-row-expand-icon {
+ margin-left: ~'calc(50% - 9px)';
+ }
+ .ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{
+ margin: 0 0 0 47px;
+ }
+ .ant-table-bordered .virtuallist>table>.ant-table-tbody>tr>td{
+ border-right: 1px solid #d9d9d9!important;
+ }
+ // 处理表单详情的样式问题结束
+
+ .ant-input{
+ padding: 3px 4px;
+ }
+ .ant-input-number-input{
+ padding: 3px 4px;
+ font-size: 12px;
+ }
+ .ant-select-single:not(.ant-select-customize-input) .ant-select-selector{
+ //padding: 3px 4px;
+ }
+ td{
+ .ant-input:focus, .ant-input-focused{
+ border: none;
+ box-shadow: none;
+ }
+ .ant-picker-focused{
+ border: none;
+ box-shadow: none;
+ }
+ .ant-select-focused{
+ border: none;
+ box-shadow: none;
+ outline: none;
+ .ant-select-selector{
+ border: none;
+ box-shadow: none!important;
+ outline: none;
+ }
+ }
+ .ant-input-number-focused{
+ border: none;
+ box-shadow: none;
+ }
+ .ant-select:not(.ant-select-customize-input) .ant-select-selector{
+ padding: 0 4px;
+ border: none;
+ line-height: 26px;
+ height: 26px;
+ background-color: transparent;
+ }
+ .ant-select-single:not(.ant-select-customize-input) .ant-select-selector{
+ line-height: 26px;
+ height: 26px;
+ background-color: transparent;
+ }
+ .ant-input{
+ border: none;
+ background-color: transparent;
+ }
+ .ant-input-number{
+ border: none;
+ background-color: transparent;
+ }
+ .ant-picker{
+ border: none;
+ padding: 3px 4px 3px;
+ background-color: transparent;
+ }
+ }
+
+ .noInput{
+ max-width: 100%;
+ min-height: @cell-height;
+ line-height: @cell-height;
+ display: block; // inline-block会引发line-height问题
+ overflow:hidden;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+ & > span{
+ padding: @td_padding_sub;
+ }
+ }
+
+ input[disabled]{
+ color: #000!important;
+ background: #fff!important;
+ font: 12px @font_family;
+ line-height: 1.66667;
+ overflow: hidden;
+ text-overflow :ellipsis;
+ }
+
+ .ant-select-selector{
+ color: #000!important;
+ }
+
+ .ant-form-item-control-input-content{
+ //height: 100%;
+ min-height: @cell-height;
+ line-height: @cell-height;
+ }
+
+ tbody{
+ color: #000;
+ font-size: 12px;
+ tr:not(.selected-record-row):not(.ant-table-expanded-row-level-1){
+ &:hover{
+ background: #fff7e6!important;
+ td{
+ background: #fff7e6!important;
+ font-weight: bold;
+ }
+ .sActiveIdStyle{
+ background: #fff7e6!important;
+ }
+ }
+ }
+ .ant-input-number{
+ max-width: 100%;
+ }
+ input[disabled]{
+ border: none;
+ padding: @td_padding_sub;
+ background: transparent!important;
+ }
+ button[class*='ant-table-row-expand-icon']+.changeClassName{
+ display: inline;
+ }
+ .changeClassName{
+ .ant-checkbox {
+ padding: @td_padding_sub;
+ }
+ }
+ .ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{
+ background-color: transparent;
+ color: #000!important;
+ }
+ .ant-select-single .ant-select-selector .ant-select-selection-search{
+ left: 4px;
+ background-color: transparent;
+ line-height: @cell-height;
+ display: inline-block;
+ }
+ .sActiveIdStyle {
+ height: 100%;
+ max-width: 100%;
+ padding: @td_padding_sub;
+ font-size: 12px;
+ z-index: 9;
+ white-space: nowrap;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ background: #fff;
+ top: 0;
+ left: 0;
+ position: absolute!important;
+ & + .ant-select{
+ display: none;
+ }
+ & + input{
+ //display: none;
+ }
+ span {
+ font-size: 12px;
+ position: relative;
+ top: 50%;
+ transform: translateY(-50%);
+ display: inline-block;
+ cursor: pointer;
+ &:hover{
+ text-decoration: underline;
+ }
+ }
+ .viewChooseSpan{
+ display: block;
+ top: 14px;
+ white-space: nowrap;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ }
+ }
+ .sActiveIdStyle_viewChooseSpan{
+ width: 100%;
+ }
+ .sActiveIdStyleNone, .sActiveIdStyleBlock{
+ & + .ant-select{
+ display: block;
+ }
+ }
+ .ant-table-row-indent + button.ant-table-row-expand-icon{
+ margin-left: 6px;
+ margin-top: 6px;
+ }
+ }
+
+ .xlyCommonTable.tableEnabled tbody {
+ tr:not(.selected-record-row):not(.ant-table-expanded-row-level-1){
+ &:hover{
+ background: #FFF !important;
+ td{
+ background: #FFF !important;
+ font-weight: bold;
+ }
+ .sActiveIdStyle{
+ background: #FFF !important;
+ }
+ .readonlyStyle {
+ background: #f1f2f8 !important;
+ .sActiveIdStyle{
+ background: #f1f2f8 !important;
+ }
+ }
+ }
+ }
+ .readonlyStyle {
+ background: #f1f2f8 !important;
+ .sActiveIdStyle{
+ background: #f1f2f8 !important;
+ }
+ }
+ .ant-input-search {
+ height: 25px;
+ top: -2px;
+ .ant-input-group-addon {
+ left: 0;
+ .ant-input-search-button {
+ height: 26px;
+ }
+ }
+ }
+ }
+
+ .ant-modal{
+ max-width: unset;
+ }
+
+ .xlyCommonTable:not(.tableEnabled) .ant-table-tbody > tr.ant-table-row-selected > td{
+ background: #e6f7ff;
+ }
+
+ .xlyCommonTable.tableEnabled .ant-table-tbody > tr.ant-table-row:hover > td, .ant-table-tbody > tr > td.ant-table-cell-row-hover {
+ background: initial;
+ }
+
+ @selected-line-border-color: #1296db;
+ .xlyCommonTable.tableEnabled .ant-table-tbody > tr.ant-table-row-selected,
+ .xlyCommonTable.tableEnabled .ant-table-tbody > tr.selected-record-row {
+ // box-shadow: 0px 2px 0px 0px #2400ff inset, 0px -2px 0px 0px red inset;
+ >td {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ .sActiveIdStyle{
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ .readonlyStyle {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ .sActiveIdStyle{
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ // background-color: transparent !important;
+ // border: 1px solid @selected-line-border-color !important;
+ // border-left: 0 !important;
+ // border-right: 0 !important;
+ &:first-child {
+ // border-left: 1px solid @selected-line-border-color !important;
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ .sActiveIdStyle{
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ .readonlyStyle {
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ .sActiveIdStyle{
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ }
+ &:last-child {
+ // border-right: 1px solid @selected-line-border-color !important;
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ .sActiveIdStyle{
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ .readonlyStyle {
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ .sActiveIdStyle{
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ }
+ }
+ // &.dark-record-row {
+ // >td {
+ // background-color: #f5f5f5 !important;
+ // }
+ // }
+ }
+
+ .xlyCommonTable.tableEnabled .ant-table-tbody > tr.selected-record-row {
+ > td {
+ .readonlySpanStyle {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ &:first-child {
+ .readonlySpanStyle {
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ &:last-child {
+ .readonlySpanStyle {
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ }
+ }
+
+ // .ant-table-bordered .virtuallist>table>.ant-table-tbody>tr.ant-table-row-selected {
+ // >td {
+ // &:last-child {
+ // border-right: 1px solid @selected-line-border-color !important;
+ // }
+ // }
+ // }
+
+
+ .selected-record-row{
+ background-color: #e6f7ff!important;
+ font-weight: bold;
+ input{
+ font-weight: bold;
+ }
+ td{
+ background: #e6f7ff!important;
+ font-weight: bold;
+ }
+ .ant-input-number-disabled{
+ background: transparent;
+ transition: unset;
+ border: none;
+ width: unset;
+ }
+ .sActiveIdStyle{
+ background: #e6f7ff!important;
+ }
+ .ant-select-selector{
+ transition: unset;
+ }
+ }
+ .xlyCommonTable.tableEnabled .selected-record-row{
+ background-color: #FFF !important;
+ td{
+ background: #FFF !important;
+ }
+ .sActiveIdStyle{
+ background: #FFF !important;
+ }
+ }
+ .ant-form-item-label {
+ vertical-align: middle;
+ display: inline-block;
+ text-align: left!important;
+ }
+ .ant-form-item-label label {
+ //color: rgba(0, 0, 0, 0.65)!important;
+ color:inherit!important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ padding-right: 0!important;
+ text-align: left;
+ &:before{
+ content: '';
+ width: 10px;
+ }
+ }
+ .ant-form-item-label > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before{
+ width: auto;
+ }
+ .ant-form-item-label .ant-form-item-required {
+ font-size: 12px!important;
+ left: 0px;
+ }
+ .commonCheckBill{
+ .sActiveIdStyle{
+ left:1px;
+ top:1px;
+ width: ~'calc(100% - 2px)';
+ height: ~'calc(100% - 2px)';
+ }
+ .ant-input-number{
+ width: 100%!important;
+ }
+ }
+ .searchMainForm{
+ .sActiveIdStyle{
+ left:1px;
+ top:1px!important;
+ padding:0px!important;
+ max-width: 90%!important;
+ //width: ~'calc(100% - 2px)'!important;
+ height: ~'calc(100% - 2px)'!important;
+ background: #fff;
+ }
+ .sActiveIdStyle-sMemo{
+ max-width: 100%!important;
+ }
+ #sMemo{
+ margin-bottom: 0;
+ }
+ .ant-input-number{
+ width: 100%!important;
+ }
+ .masterMemo{
+ background-color: #f1f2f8!important;
+ color: #000!important;
+ top: 4px !important;
+ left: 1px!important;
+ height: ~'calc(100% - 9px)' !important;
+ line-height: 20px;
+ letter-spacing:-1px;
+ font-family: Monospaced Number, Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif !important
+ }
+ }
+ .suit .searchMainForm{
+ .sActiveIdStyle{
+ left:8px;
+ }
+ }
+ .insertTd{
+ z-index: 999!important;
+ }
+ .ant-form-item{
+ margin-bottom: 0;
+ }
+ .linksActiveIdStyle {
+ color: @active_color2!important;
+ cursor: pointer;
+ backgroundColor: transparent!important;
+ padding: 4px 0px;
+ }
+ .linksActiveIdStyle:hover{
+ text-decoration: underline!important;
+ }
+ .ant-checkbox-wrapper{
+ line-height: 14px;
+ }
+
+ .ant-tabs-tab.ant-tabs-tab-disabled{
+ &:hover{
+ color: rgba(0, 0, 0, 0.25)!important;
+ }
+ }
+ // 因紧凑型主题,修改部分过小的样式
+ .ant-tabs-tab{
+ font-size: 14px;
+ }
+ #allBtnNav{
+ font-size: 14px;
+ &[disabled] {
+ &:hover{
+ color: unset!important;
+ }
+ }
+ }
+ .ant-card-head{
+ font-size: 14px;
+ }
+ // end
+ // tab样式与老版本统一
+ .ant-tabs-content-holder{
+ .ant-tabs-nav-wrap{
+ background: #fff;
+ .ant-tabs-nav-list{
+ background: #fff;
+ .ant-tabs-tab{
+ border: 1px solid #d9d9d9;
+ border-right: 0;
+ padding: 0 18px;
+ height: 30px;
+ line-height: 30px;
+ margin-left: 0;
+ background: #fafafa;
+ &:nth-last-child(2){
+ border-right: 1px solid #d9d9d9;
+ }
+ }
+ .ant-tabs-tab-active{
+ border-bottom: 1px solid transparent;
+ background: #fff;
+ }
+ .ant-tabs-ink-bar{
+ top: 0;
+ bottom: unset;
+ }
+ }
+ }
+ }
+ // end
+ .input24 {
+ :global {
+ .ant-col-2.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 24 * 100%)';
+ }
+ .ant-col-22.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 87 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 87 / 24 * 100%)';
+ }
+ .ant-col-7.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 24 * 100%)';
+ }
+ .ant-col-15.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 87 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 87 / 24 * 100%)';
+ }
+ }
+ }
+ .input18 {
+ :global {
+ .ant-col-7.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 18 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 18 * 100%)';
+ }
+ .ant-col-15.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 42 / 12 * 100%)';
+ max-width: ~'calc(0.25 * 42 / 12 * 100%)';
+ }
+ }
+ }
+ .input12 {
+ :global {
+ .ant-col-7.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 12 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 12 * 100%)';
+ }
+ .ant-col-15.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 39 / 12 * 100%)';
+ max-width: ~'calc(0.25 * 39 / 12 * 100%)';
+ }
+ }
+ }
+ .ant-table-pagination.ant-pagination {
+ position: fixed;
+ bottom: 0;
+ right: 8px;
+ z-index: 999;
+ }
+ .ant-table-summary td {
+ padding: 4px!important;
+ text-align: center;
+ }
+ .ant-table-column-title {
+ moz-user-select: -moz-none;
+ -moz-user-select: none;
+ -o-user-select:none;
+ -khtml-user-select:none;
+ -webkit-user-select:none;
+ -ms-user-select:none;
+ user-select:none;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ }
+
+ #calTab {
+ .ant-tabs > .ant-tabs-nav {
+ margin-bottom: 0;
+ }
+ .formula{
+ textarea.ant-input {
+ height: 140px!important;
+ }
+ }
+ }
+ /* 调整系统权限界面 */
+ #SysPermissionList {
+ .ant-tree{
+ margin-top: 1px;
+ border:1px solid #d9d9d9;
+ overflow-y: auto;
+ height: 516px;
+ }
+ .ant-tabs-nav{
+ margin-bottom: 0;
+ //border-bottom: 1px solid #d9d9d9;
+ }
+ #staticEditTree .ant-input-search{
+ //width: 63%
+ width: 405px;
+ }
+ }
+
+ #modalChooseProcess, #modalChooseProductMaterial{
+ .ant-table-pagination.ant-pagination {
+ position: static;
+ }
+ }
+
+ .xly-eject{
+ z-index: 999;
+ }
+ .xly-normal-list{
+ padding-left: 10px;
+ padding-right: 10px;
+ }
+ .xly-normal-list1{
+ padding-left: 0;
+ padding-right: 0;
+ }
+ .react-resizable{
+ user-select: none;
+ }
+ .xly-workorder-list{
+ .ant-layout{
+ overflow: hidden;
+ }
+ }
+ .ant-table-sticky-holder{
+ z-index: 15;
+ }
+
+ thead{
+ .ant-table-cell-fix-left, .ant-table-cell-fix-right, .ant-table-cell-fix-left-last, .ant-table-cell-fix-left-first, .ant-table-cell-fix-right-first, .ant-table-cell-fix-right-last, .ant-table-cell-fix-sticky{
+ z-index: 15;
+ }
+ }
+ tbody{
+ .ant-table-cell-fix-left, .ant-table-cell-fix-right, .ant-table-cell-fix-left-last, .ant-table-cell-fix-left-first, .ant-table-cell-fix-right-first, .ant-table-cell-fix-right-last, .ant-table-cell-fix-sticky{
+ z-index: 10;
+ }
+ .ant-select-multiple.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{
+ background: none;
+ }
+ .ant-select-disabled.ant-select-multiple .ant-select-selection-item{
+ background: none;
+ border: none;
+ color: #000;
+ padding-left: 0px;
+ }
+ }
+
+ .modalChooseProcessContent, #modalChooseProcess, #modalChooseProcessContent, #modalChooseProductMaterial{
+ .ant-table-body, #staticEditTree{
+ height: @modal-table-height;
+ }
+ }
+ .dark-mode{
+
+ }
+ .ant-table-sticky-scroll{
+ display: none;
+ }
+
+ .ant-table-body::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ }
+ .ant-table-body::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+ }
+ /*鼠标悬浮在该类指向的控件上时滑块的样式*/
+ .ant-table-body:hover::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+ }
+ /*鼠标悬浮在滑块上时滑块的样式*/
+ .ant-table-body::-webkit-scrollbar-thumb:hover {
+ background-color: rgba(180, 180, 180, 1);
+ }
+ /*正常时候的主干部分*/
+ .ant-table-body::-webkit-scrollbar-track {
+ background: #f5f5f5;
+ }
+ /*鼠标悬浮在滚动条上的主干部分*/
+ .ant-table-body::-webkit-scrollbar-track:hover {
+ background: #f5f5f5;
+ }
+ .ant-table-body::-webkit-scrollbar-corner {
+ background: rgba(204, 204, 204, 1);
+ }
+
+ .custom-scroll::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ }
+ .custom-scroll::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+ }
+ /*鼠标悬浮在该类指向的控件上时滑块的样式*/
+ .custom-scroll:hover::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+ }
+ /*鼠标悬浮在滑块上时滑块的样式*/
+ .custom-scroll::-webkit-scrollbar-thumb:hover {
+ background-color: rgba(180, 180, 180, 1);
+ }
+ /*正常时候的主干部分*/
+ .custom-scroll::-webkit-scrollbar-track {
+ background: #f5f5f5;
+ }
+ /*鼠标悬浮在滚动条上的主干部分*/
+ .custom-scroll::-webkit-scrollbar-track:hover {
+ background: #f5f5f5;
+ }
+ .custom-scroll::-webkit-scrollbar-corner {
+ background: rgba(204, 204, 204, 1);
+ }
+ .row-dragging {
+ background: #fafafa;
+ border: 1px solid #ccc;
+ z-index: 99999;
+ height: 29px;
+ line-height: 29px;
+ overflow: hidden;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ //font-size: 12px!important;
+ //td, span, input, div{
+ // display: inline-block!important;
+ // padding: 0;
+ // margin: 0;
+ // height: 29px!important;
+ // line-height: 20px!important;
+ // font-size: 12px!important;
+ //}
+ }
+ .row-dragging .drag-visible {
+ visibility: visible!important;
+ opacity: 1!important;
+ }
+ .xly-workorder-list{
+ .ant-tabs-nav{
+ margin-bottom: 0;
+ }
+ }
+ .drag-visible{
+ text-align: center;
+ }
+ .insertTd{
+ z-index: 999!important;
+ }
+ .ant-table-small .ant-table-thead > tr > th{
+ background: #f5f5f5;
+ }
+ .ant-modal-mask{
+ z-index: 999;
+ }
+ .commonCheckBillContainer{
+ .ant-table-pagination.ant-pagination{
+ position: static;
+ }
+ }
+ .ant-tabs{
+ overflow: unset;
+ }
+ .operate-bar{
+ min-height: 28px;
+ a{
+ width: 40px;
+ margin: 0!important;
+ position: relative;
+ img{
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ }
+ svg{
+ display: block;
+ position: absolute!important;
+ top: 0!important;
+ bottom: 0;
+ left: 0!important;
+ right: 0;
+ margin: auto;
+ }
+ }
+ }
+ .ant-tree-switcher-leaf-line::before{
+ right: 10px;
+ }
+ .masterLinkSpan{
+ width: auto;
+ height: 26px;
+ line-height: 26px;
+ overflow: hidden;
+ color: #2f54eb;
+ //position: absolute;
+ padding-right: 2px;
+ z-index: 10;
+ cursor: pointer;
+ }
+ /* checkBill commonView区域 */
+ .checkbillStyle .masterLinkSpan{
+ width: 100%;
+ }
+ .checkbillStyle .sActiveIdStyleBlock{
+ width: 100%;
+ }
+ .commonNewBillContainer .changeClassName .sActiveIdStyleBlock,
+ .commonNewBillContainer .input12 .sActiveIdStyleBlock,
+ .commonNewBillContainer .input18 .sActiveIdStyleBlock,
+ .commonNewBillContainer .input24 .sActiveIdStyleBlock
+ {
+ top: 0;
+ left: 3px !important;
+ .masterLinkSpan {
+ left: 0 !important;
+ }
+ }
+ .bill-search-group{
+ .masterLinkSpan{
+ padding-left: 7px;
+ background: #fff;
+ }
+ .sActiveIdStyle {
+ height: calc(100% - 2px);
+ max-width: 100%;
+ padding: @td_padding_sub;
+ font-size: 12px;
+ z-index: 9;
+ white-space: nowrap;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ background: #fff;
+ top: 0;
+ left: 0;
+ position: absolute!important;
+ }
+ :global {
+ .searchMainFormArrow {
+ z-index: 1000 !important;
+ }
+ .searchMainFormArrowMaxHeight {
+ max-height: 91px !important;
+ overflow: hidden !important;
+ }
+ }
+ }
+ .bill-search-group1 {
+ :global {
+ .searchMainFormArrowMaxHeight {
+ max-height: none !important;
+ }
+ }
+ }
+ .ant-pagination-options-size-changer.ant-select{
+ width: auto!important;
+ }
+ // 富文本编辑器
+ .braft-output-content{
+ border: 1px solid #d9d9d9;
+ border-radius: 2px;
+ min-height: 28.5px;
+ }
+
+ // 英文版样式
+ .xlyerpEnglish {
+ .homeTab {
+ width: 100px;
+ }
+ }
+
+ .ant-select-multiple .ant-select-selection-search input {
+ width: auto !important;
+ }
+
+ .commonTitle {
+ padding-top: 0;
+ .ant-tooltip-arrow {
+ display: none;
+ }
+ }
+ .commonSpecialTitle {
+ padding-top: 0;
+ .ant-tooltip-arrow {
+ display: block;
+ }
+ }
+}
diff --git a/src/global.less b/src/global.less
new file mode 100644
index 0000000..5a04ba4
--- /dev/null
+++ b/src/global.less
@@ -0,0 +1,5486 @@
+@import "~@/variable.less";
+@table-bg-even: #f5f5f5;
+/* 表格偶数行背景色 */
+@table-bg-split: #CDCDCD;
+
+/* 表格分割行背景色 */
+html,
+body,
+:global(#root) {
+ background: #888;
+ height: 100%;
+ font-size: 13px;
+}
+
+html {
+ overflow: hidden;
+}
+
+// 公用更改样式
+.formItemMargin {
+ margin-bottom: 2px !important;
+}
+
+#sTemplateFullMemo {
+ max-height: 300px;
+}
+
+.clayout {
+ position: relative;
+ padding: 89px 0 0 0;
+ background: #f0f2f5;
+}
+
+.content {
+ max-height: 100%;
+ overflow-y: auto;
+}
+
+.filterContent {
+ max-height: 100%;
+ position: relative;
+ z-index: 20;
+}
+
+.bShow>div:first-child {
+ line-height: 0;
+ height: 0;
+}
+
+.bShow>div:first-child>span {
+ background-color: transparent;
+}
+
+.bShow>div:first-child>span>img {
+ position: fixed;
+ width: 93px;
+ height: 93px;
+ right: 0px;
+ z-index: 999;
+ top: 122px;
+ /* 解决审核图标挡住操作按钮 */
+ object-fit: contain;
+}
+
+.bShow1>div:first-child {
+ line-height: 0;
+ height: 0;
+ position: relative;
+}
+
+.bShow1>div:first-child>span {
+ background-color: transparent;
+}
+
+.bShow1>div:first-child>span>img {
+ position: fixed;
+ width: 93px;
+ height: 93px;
+ right: 28px;
+ z-index: 999;
+ top: 102px;
+ /* 解决审核图标挡住操作按钮 */
+ object-fit: contain;
+}
+
+.personChecked {
+ position: relative;
+}
+
+.personName {
+ color: #d81e06;
+ font-size: 17px;
+ font-weight: bold;
+ position: fixed;
+ top: 149px;
+ right: 32px;
+ z-index: 999;
+}
+
+
+#modalChooseProductMaterial {
+ .ant-pagination-total-text {
+ span {
+ display: none !important;
+ }
+ }
+}
+
+/* subBill单据页 分页组件根据表格定位 */
+.sub_table .ant-table-pagination.ant-pagination {
+ position: static;
+ margin-top: 10px;
+ margin-bottom: -6px;
+}
+
+.multilist .ant-table-pagination.ant-pagination {
+ position: static;
+ margin-top: 10px;
+ margin-bottom: -6px;
+}
+
+.clear {
+ *zoom: 1;
+
+ &:before,
+ &:after {
+ content: " ";
+ display: table;
+ }
+
+ &:after {
+ clear: both;
+ }
+}
+
+.overflow-ellipsis {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.ant-modal-body {
+ max-height: unset !important;
+}
+
+.topTable {
+ .ant-table-header {
+ table {
+ visibility: visible !important; // issue antd
+ }
+ }
+
+ .ant-table-body {
+ overflow: auto !important;
+ }
+}
+
+#modalChooseProcess {
+ .resize-container {
+ #staticEditTable {
+ .topTable .ant-table-body {
+ height: 100% !important;
+ }
+ }
+ }
+}
+
+#modalChooseProcess {
+ .resize-container-select {
+ #staticEditTable {
+ .ant-table-body {
+ height: 100% !important;
+ }
+ }
+ }
+}
+
+#modalChooseProcess {
+ .resize-container {
+ #staticEditTree {
+ height: 100% !important;
+ }
+ }
+}
+
+.resize-container-select {
+ #staticEditTable {
+ .topTable {
+ height: calc(~'100% - 55px');
+ }
+ }
+}
+
+.resize-container {
+ .xly-tree-box {
+ height: calc(~'100% - 13px');
+
+ .ant-form-item {
+ height: calc(~'100% - 30px');
+
+ .ant-form-item-control-wrapper {
+ height: 100%;
+
+ .ant-form-item-control {
+ height: 100%;
+
+ .ant-form-item-children {
+ height: 100%;
+
+ &>div {
+ height: 100%;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ #staticEditTable {
+ .topTable {
+ height: calc(~'100% - 13px');
+ }
+ }
+}
+
+body {
+ -webkit-font-smoothing: antialiased;
+}
+
+/* 排序 */
+.ant-col-order-25 {
+ -webkit-box-ordinal-group: 26;
+ -webkit-order: 25;
+ -ms-flex-order: 25;
+ order: 25;
+}
+
+.ant-col-order-26 {
+ -webkit-box-ordinal-group: 27;
+ -webkit-order: 26;
+ -ms-flex-order: 26;
+ order: 26;
+}
+
+.ant-col-order-27 {
+ -webkit-box-ordinal-group: 28;
+ -webkit-order: 27;
+ -ms-flex-order: 27;
+ order: 27;
+}
+
+.ant-col-order-28 {
+ -webkit-box-ordinal-group: 29;
+ -webkit-order: 28;
+ -ms-flex-order: 28;
+ order: 28;
+}
+
+.ant-col-order-29 {
+ -webkit-box-ordinal-group: 30;
+ -webkit-order: 29;
+ -ms-flex-order: 29;
+ order: 29;
+}
+
+.ant-col-order-30 {
+ -webkit-box-ordinal-group: 31;
+ -webkit-order: 30;
+ -ms-flex-order: 30;
+ order: 30;
+}
+
+.ant-col-order-31 {
+ -webkit-box-ordinal-group: 32;
+ -webkit-order: 31;
+ -ms-flex-order: 31;
+ order: 31;
+}
+
+.ant-col-order-32 {
+ -webkit-box-ordinal-group: 33;
+ -webkit-order: 32;
+ -ms-flex-order: 32;
+ order: 32;
+}
+
+.ant-col-order-33 {
+ -webkit-box-ordinal-group: 34;
+ -webkit-order: 33;
+ -ms-flex-order: 33;
+ order: 33;
+}
+
+.ant-col-order-34 {
+ -webkit-box-ordinal-group: 35;
+ -webkit-order: 34;
+ -ms-flex-order: 34;
+ order: 34;
+}
+
+.ant-col-order-35 {
+ -webkit-box-ordinal-group: 36;
+ -webkit-order: 35;
+ -ms-flex-order: 35;
+ order: 35;
+}
+
+.ant-col-order-36 {
+ -webkit-box-ordinal-group: 37;
+ -webkit-order: 36;
+ -ms-flex-order: 36;
+ order: 36;
+}
+
+.ant-col-order-37 {
+ -webkit-box-ordinal-group: 38;
+ -webkit-order: 37;
+ -ms-flex-order: 37;
+ order: 37;
+}
+
+.ant-col-order-38 {
+ -webkit-box-ordinal-group: 39;
+ -webkit-order: 38;
+ -ms-flex-order: 38;
+ order: 38;
+}
+
+.ant-col-order-39 {
+ -webkit-box-ordinal-group: 40;
+ -webkit-order: 39;
+ -ms-flex-order: 39;
+ order: 39;
+}
+
+.ant-col-order-40 {
+ -webkit-box-ordinal-group: 41;
+ -webkit-order: 40;
+ -ms-flex-order: 40;
+ order: 40;
+}
+
+.ant-col-order-41 {
+ -webkit-box-ordinal-group: 42;
+ -webkit-order: 41;
+ -ms-flex-order: 41;
+ order: 41;
+}
+
+.ant-col-order-42 {
+ -webkit-box-ordinal-group: 43;
+ -webkit-order: 42;
+ -ms-flex-order: 42;
+ order: 42;
+}
+
+.ant-col-order-43 {
+ -webkit-box-ordinal-group: 44;
+ -webkit-order: 43;
+ -ms-flex-order: 43;
+ order: 43;
+}
+
+.ant-col-order-44 {
+ -webkit-box-ordinal-group: 45;
+ -webkit-order: 44;
+ -ms-flex-order: 44;
+ order: 44;
+}
+
+.ant-col-order-45 {
+ -webkit-box-ordinal-group: 46;
+ -webkit-order: 45;
+ -ms-flex-order: 45;
+ order: 45;
+}
+
+.ant-col-order-46 {
+ -webkit-box-ordinal-group: 47;
+ -webkit-order: 46;
+ -ms-flex-order: 46;
+ order: 46;
+}
+
+.ant-col-order-47 {
+ -webkit-box-ordinal-group: 48;
+ -webkit-order: 47;
+ -ms-flex-order: 47;
+ order: 47;
+}
+
+.ant-col-order-48 {
+ -webkit-box-ordinal-group: 49;
+ -webkit-order: 48;
+ -ms-flex-order: 48;
+ order: 48;
+}
+
+.ant-col-order-49 {
+ -webkit-box-ordinal-group: 50;
+ -webkit-order: 49;
+ -ms-flex-order: 49;
+ order: 49;
+}
+
+.ant-col-order-50 {
+ -webkit-box-ordinal-group: 51;
+ -webkit-order: 50;
+ -ms-flex-order: 50;
+ order: 50;
+}
+
+.ant-col-order-51 {
+ -webkit-box-ordinal-group: 52;
+ -webkit-order: 51;
+ -ms-flex-order: 51;
+ order: 51;
+}
+
+.ant-col-order-52 {
+ -webkit-box-ordinal-group: 53;
+ -webkit-order: 52;
+ -ms-flex-order: 52;
+ order: 52;
+}
+
+.ant-col-order-53 {
+ -webkit-box-ordinal-group: 54;
+ -webkit-order: 53;
+ -ms-flex-order: 53;
+ order: 53;
+}
+
+.ant-col-order-54 {
+ -webkit-box-ordinal-group: 55;
+ -webkit-order: 54;
+ -ms-flex-order: 54;
+ order: 54;
+}
+
+.ant-col-order-55 {
+ -webkit-box-ordinal-group: 56;
+ -webkit-order: 55;
+ -ms-flex-order: 55;
+ order: 55;
+}
+
+.ant-col-order-56 {
+ -webkit-box-ordinal-group: 57;
+ -webkit-order: 56;
+ -ms-flex-order: 56;
+ order: 56;
+}
+
+.ant-col-order-57 {
+ -webkit-box-ordinal-group: 58;
+ -webkit-order: 57;
+ -ms-flex-order: 57;
+ order: 57;
+}
+
+.ant-col-order-58 {
+ -webkit-box-ordinal-group: 59;
+ -webkit-order: 58;
+ -ms-flex-order: 58;
+ order: 58;
+}
+
+.ant-col-order-59 {
+ -webkit-box-ordinal-group: 60;
+ -webkit-order: 59;
+ -ms-flex-order: 59;
+ order: 59;
+}
+
+.ant-col-order-60 {
+ -webkit-box-ordinal-group: 61;
+ -webkit-order: 60;
+ -ms-flex-order: 60;
+ order: 60;
+}
+
+.ant-col-order-61 {
+ -webkit-box-ordinal-group: 62;
+ -webkit-order: 61;
+ -ms-flex-order: 61;
+ order: 61;
+}
+
+.ant-col-order-62 {
+ -webkit-box-ordinal-group: 63;
+ -webkit-order: 62;
+ -ms-flex-order: 62;
+ order: 62;
+}
+
+.ant-col-order-63 {
+ -webkit-box-ordinal-group: 64;
+ -webkit-order: 63;
+ -ms-flex-order: 63;
+ order: 63;
+}
+
+.ant-col-order-64 {
+ -webkit-box-ordinal-group: 65;
+ -webkit-order: 64;
+ -ms-flex-order: 64;
+ order: 64;
+}
+
+.ant-col-order-65 {
+ -webkit-box-ordinal-group: 66;
+ -webkit-order: 65;
+ -ms-flex-order: 65;
+ order: 65;
+}
+
+.ant-col-order-66 {
+ -webkit-box-ordinal-group: 67;
+ -webkit-order: 66;
+ -ms-flex-order: 66;
+ order: 66;
+}
+
+.ant-col-order-67 {
+ -webkit-box-ordinal-group: 68;
+ -webkit-order: 67;
+ -ms-flex-order: 67;
+ order: 67;
+}
+
+.ant-col-order-68 {
+ -webkit-box-ordinal-group: 69;
+ -webkit-order: 68;
+ -ms-flex-order: 68;
+ order: 68;
+}
+
+.ant-col-order-69 {
+ -webkit-box-ordinal-group: 70;
+ -webkit-order: 69;
+ -ms-flex-order: 69;
+ order: 69;
+}
+
+.ant-col-order-70 {
+ -webkit-box-ordinal-group: 71;
+ -webkit-order: 70;
+ -ms-flex-order: 70;
+ order: 70;
+}
+
+.ant-col-order-71 {
+ -webkit-box-ordinal-group: 72;
+ -webkit-order: 71;
+ -ms-flex-order: 71;
+ order: 71;
+}
+
+.ant-col-order-72 {
+ -webkit-box-ordinal-group: 73;
+ -webkit-order: 72;
+ -ms-flex-order: 72;
+ order: 72;
+}
+
+.ant-col-order-73 {
+ -webkit-box-ordinal-group: 74;
+ -webkit-order: 73;
+ -ms-flex-order: 73;
+ order: 73;
+}
+
+.ant-col-order-74 {
+ -webkit-box-ordinal-group: 75;
+ -webkit-order: 74;
+ -ms-flex-order: 74;
+ order: 74;
+}
+
+.ant-col-order-75 {
+ -webkit-box-ordinal-group: 76;
+ -webkit-order: 75;
+ -ms-flex-order: 75;
+ order: 75;
+}
+
+.ant-col-order-76 {
+ -webkit-box-ordinal-group: 77;
+ -webkit-order: 76;
+ -ms-flex-order: 76;
+ order: 76;
+}
+
+.ant-col-order-77 {
+ -webkit-box-ordinal-group: 78;
+ -webkit-order: 77;
+ -ms-flex-order: 77;
+ order: 77;
+}
+
+.ant-col-order-78 {
+ -webkit-box-ordinal-group: 79;
+ -webkit-order: 78;
+ -ms-flex-order: 78;
+ order: 78;
+}
+
+.ant-col-order-79 {
+ -webkit-box-ordinal-group: 80;
+ -webkit-order: 79;
+ -ms-flex-order: 79;
+ order: 79;
+}
+
+.ant-col-order-80 {
+ -webkit-box-ordinal-group: 81;
+ -webkit-order: 80;
+ -ms-flex-order: 80;
+ order: 80;
+}
+
+.ant-col-order-81 {
+ -webkit-box-ordinal-group: 82;
+ -webkit-order: 81;
+ -ms-flex-order: 81;
+ order: 81;
+}
+
+.ant-col-order-82 {
+ -webkit-box-ordinal-group: 83;
+ -webkit-order: 82;
+ -ms-flex-order: 82;
+ order: 82;
+}
+
+.ant-col-order-83 {
+ -webkit-box-ordinal-group: 84;
+ -webkit-order: 83;
+ -ms-flex-order: 83;
+ order: 83;
+}
+
+.ant-col-order-84 {
+ -webkit-box-ordinal-group: 85;
+ -webkit-order: 84;
+ -ms-flex-order: 84;
+ order: 84;
+}
+
+.ant-col-order-85 {
+ -webkit-box-ordinal-group: 86;
+ -webkit-order: 85;
+ -ms-flex-order: 85;
+ order: 85;
+}
+
+.ant-col-order-86 {
+ -webkit-box-ordinal-group: 87;
+ -webkit-order: 86;
+ -ms-flex-order: 86;
+ order: 86;
+}
+
+.ant-col-order-87 {
+ -webkit-box-ordinal-group: 88;
+ -webkit-order: 87;
+ -ms-flex-order: 87;
+ order: 87;
+}
+
+.ant-col-order-88 {
+ -webkit-box-ordinal-group: 89;
+ -webkit-order: 88;
+ -ms-flex-order: 88;
+ order: 88;
+}
+
+.ant-col-order-89 {
+ -webkit-box-ordinal-group: 90;
+ -webkit-order: 89;
+ -ms-flex-order: 89;
+ order: 89;
+}
+
+.ant-col-order-90 {
+ -webkit-box-ordinal-group: 91;
+ -webkit-order: 90;
+ -ms-flex-order: 90;
+ order: 90;
+}
+
+.ant-col-order-91 {
+ -webkit-box-ordinal-group: 92;
+ -webkit-order: 91;
+ -ms-flex-order: 91;
+ order: 91;
+}
+
+.ant-col-order-92 {
+ -webkit-box-ordinal-group: 93;
+ -webkit-order: 92;
+ -ms-flex-order: 92;
+ order: 92;
+}
+
+.ant-col-order-93 {
+ -webkit-box-ordinal-group: 94;
+ -webkit-order: 93;
+ -ms-flex-order: 93;
+ order: 93;
+}
+
+.ant-col-order-94 {
+ -webkit-box-ordinal-group: 95;
+ -webkit-order: 94;
+ -ms-flex-order: 94;
+ order: 94;
+}
+
+.ant-col-order-95 {
+ -webkit-box-ordinal-group: 96;
+ -webkit-order: 95;
+ -ms-flex-order: 95;
+ order: 95;
+}
+
+.ant-col-order-96 {
+ -webkit-box-ordinal-group: 97;
+ -webkit-order: 96;
+ -ms-flex-order: 96;
+ order: 96;
+}
+
+.ant-col-order-97 {
+ -webkit-box-ordinal-group: 98;
+ -webkit-order: 97;
+ -ms-flex-order: 97;
+ order: 97;
+}
+
+.ant-col-order-98 {
+ -webkit-box-ordinal-group: 99;
+ -webkit-order: 98;
+ -ms-flex-order: 98;
+ order: 98;
+}
+
+.ant-col-order-99 {
+ -webkit-box-ordinal-group: 100;
+ -webkit-order: 99;
+ -ms-flex-order: 99;
+ order: 99;
+}
+
+.ant-col-order-100 {
+ -webkit-box-ordinal-group: 101;
+ -webkit-order: 100;
+ -ms-flex-order: 100;
+ order: 100;
+}
+
+.ant-tabs {
+ height: 100%;
+}
+
+
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-tab {
+ /* tabs 页签 */
+ line-height: 24px !important;
+ padding: 8px 10px !important;
+ margin-right: 18px !important;
+ font-size: 14px !important;
+ background: none !important;
+ border: 0 !important;
+}
+
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-tab span {
+ color: #fff;
+}
+
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-ink-bar {
+ /* tabs 页签 */
+ visibility: visible !important;
+ bottom: 0 !important;
+}
+
+.ant-tabs-nav .ant-tabs-tab-active {
+ /* tabs 页签 */
+ font-weight: 400 !important;
+}
+
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-tab .anticon-close {
+ /* 关闭按钮页签样式 */
+ color: #fff !important;
+ margin-left: 5px !important;
+}
+
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-tab-active .anticon-close {
+ color: #1890FF !important;
+}
+
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-tab-active span {
+ color: #1890FF !important;
+}
+
+.ant-layout {
+ background: transparent !important;
+ height: 100%;
+}
+
+.ant-form-item-required:before {}
+
+/* 表格必填项 */
+.table-title-required {
+ font-family: SimSun;
+ line-height: 1;
+ font-size: 14px;
+ color: #f5222d;
+}
+
+.ant-card-wider-padding .ant-card-head {
+ /* tabs */
+ padding: 0 !important;
+}
+
+.ant-tabs-bar {
+ margin-bottom: 0 !important;
+}
+
+.ant-tabs-small .ant-tabs-tab {
+ padding: 8px 12px !important;
+}
+
+.ant-tree.ant-tree-show-line li span.ant-tree-switcher {
+ /* 树 */
+ color: #000 !important;
+}
+
+.ant-input-affix-wrapper {
+ /* 搜索框 */
+ font-size: 16px !important;
+}
+
+.ant-menu-inline .ant-menu-item:not(:last-child) {
+ /* 菜单 */
+ margin: 0 !important;
+}
+
+.ant-menu-vertical .ant-menu-item {
+ /* 菜单 */
+ margin-bottom: 0 !important;
+}
+
+.ant-menu-vertical .ant-menu-item:not(:last-child) {
+ /* 菜单 */
+ margin-bottom: 0 !important;
+}
+
+.tabChild___3EqgA .ant-form-item-label {
+ text-align: right !important;
+ padding-right: 10px !important;
+}
+
+.tabChild___3EqgA .ant-form-item-control {
+ padding-left: 20px !important;
+}
+
+.tabChildDot___DZtMw .ant-form-item-label {
+ text-align: right !important;
+ padding-right: 10px !important;
+}
+
+.ant-select-selection--single {
+ border-radius: 0 !important;
+ height: 32px !important;
+}
+
+.white-bk {
+ font-size: 12px !important;
+}
+
+.white-bk .ant-select-selection--single {
+ background-color: #fff !important;
+ font-size: 12px;
+}
+
+.ant-checkbox-wrapper+span,
+.ant-checkbox+span {
+ /* checkbox */
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ padding-right: 0 !important;
+ display: inline-block;
+ vertical-align: middle;
+ margin-top: -3px;
+ margin-right: 5px;
+}
+
+.ant-tabs-small .ant-tabs-nav-container {
+ font-size: 14px !important;
+}
+
+.ant-table-scroll {
+ overflow-y: hidden !important;
+}
+
+.ant-table-header table {
+ border-radius: 0 !important;
+}
+
+.ant-calendar-picker-icon:after {
+ font-size: 14px !important;
+}
+
+.ant-calendar-picker-clear,
+.ant-calendar-picker-icon {
+ width: 16px !important;
+ height: 16px !important;
+ right: 8px !important;
+ margin-top: -8px !important;
+ line-height: 16px !important;
+ font-size: 14px !important;
+}
+
+.ant-calendar-picker-icon:after {
+ font-size: 16px !important;
+}
+
+.ant-btn-clicked:after {
+ border: 0 !important;
+}
+
+.ant-upload {
+ line-height: normal !important;
+}
+
+/*设置所有表格选中行背景色 */
+#staticEditTable .selected-record-row td {
+ background-color: #e6f7ff !important;
+
+ div {
+ background: #e6f7ff;
+ /* ffe7ba */
+ }
+}
+
+/*设置列表选中行背景色 */
+.xly-normal-list #staticEditTable .selected-record-row td {
+ background-color: #e6f7ff;
+
+ div {
+ background: none;
+ }
+}
+
+/* 通用大屏列表选中行 */
+.commonRollChar #staticEditTable .selected-record-row td {
+ background: none !important;
+
+ div {
+ background: none !important;
+ }
+}
+
+/* 可编辑列表 */
+.editable #staticEditTable .selected-record-row td {
+ background: none !important;
+
+ div {
+ //padding:1px 13px!important;
+ background-color: #fff;
+ }
+}
+
+.editable #staticEditTable .ant-form-item-control {
+ height: 28px !important;
+}
+
+/* 设置偶行背景色 */
+.xlyCommonTable:not(.tableEnabled) .dark-record-row td {
+ background-color: @table-bg-even !important;
+
+ .ant-table-selection-column {
+ background-color: @table-bg-even !important;
+ }
+}
+
+.xlyCommonTable.tableEnabled .ant-table-tbody>tr.ant-table-row-selected>td {
+ background: #FFF !important;
+ border-color: #d9d9d9 !important;
+}
+
+/* 设置分割行背景色 */
+.split-record-row td,
+.split-record-row-skip td {
+ background-color: @table-bg-split !important;
+ font-weight: bold;
+
+ .ant-table-selection-column {
+ font-weight: bold;
+ background-color: @table-bg-split !important;
+ }
+
+ .noInput {
+ overflow: unset;
+ }
+
+ //span{background-color:@table-bg-split!important;}
+ .linksActiveIdStyle {
+ word-break: keep-all !important;
+ word-space: nowrap !important;
+ }
+}
+
+.split-record-row td {
+ span {
+ background-color: @table-bg-split !important;
+ }
+}
+
+.split-record-row-skip td {
+ .noInput {
+ background-color: @table-bg-split !important;
+ }
+}
+
+.split-record-row-skip td span.ant-checkbox {
+ background-color: transparent !important;
+}
+
+/* 设置分割行边框 */
+.ant-table-bordered .virtuallist>table>.ant-table-tbody>tr.split-record-row>td {
+ border: none !important;
+}
+
+.ant-table-bordered .virtuallist>table>.ant-table-tbody>tr.split-record-row-skip>td {
+ border: none !important;
+}
+
+.virtuallist>table>.ant-table-tbody>tr.split-record-row>td>div {
+ overflow: unset;
+}
+
+.virtuallist>table>.ant-table-tbody>tr.split-record-row-skip>td>div {
+ overflow: unset;
+}
+
+/* 设置分割行悬浮背景 */
+tr.split-record-row:not(.selected-record-row):not(.ant-table-expanded-row-level-1) {
+ &:hover {
+ background: @table-bg-split !important;
+
+ td {
+ background: @table-bg-split !important;
+ font-weight: bold;
+ }
+
+ .sActiveIdStyle {
+ background: @table-bg-split !important;
+ }
+ }
+}
+
+tr.split-record-row-skip:not(.selected-record-row):not(.ant-table-expanded-row-level-1) {
+ &:hover {
+ background: @table-bg-split !important;
+
+ td {
+ background: @table-bg-split !important;
+ font-weight: bold;
+ }
+
+ .sActiveIdStyle {
+ background: @table-bg-split !important;
+ }
+ }
+}
+
+/* 根据条件 设置符合条件的行背景 */
+.SetRow_blue td {
+ background-color: blue !important;
+
+ .ant-table-selection-column {
+ background-color: blue !important;
+ }
+}
+
+.SetRow_orange td {
+ background-color: orange !important;
+
+ .ant-table-selection-column {
+ background-color: orange !important;
+ }
+}
+
+.SetRow_green td {
+ background-color: green !important;
+
+ .ant-table-selection-column {
+ background-color: green !important;
+ }
+}
+
+.SetRow_red td {
+ background-color: #ff9393 !important;
+
+ .ant-table-selection-column {
+ background-color: #ffdede !important;
+ }
+}
+
+.SetRow_yellow td {
+ background-color: yellow !important;
+
+ .ant-table-selection-column {
+ background-color: yellow !important;
+ }
+}
+
+.SetRow_pink td {
+ background-color: pink !important;
+
+ .ant-table-selection-column {
+ background-color: pink !important;
+ }
+}
+
+tr[class*="SetRow_"] {
+ .readonlyField {
+ background-color: transparent !important;
+ }
+}
+
+/* 根据条件 设置符合条件的单元格背景 */
+.SetCell_green div {
+ background-color: green !important;
+}
+
+.SetCell_red div {
+ background-color: red !important;
+}
+
+.SetCell_yellow div {
+ background-color: yellow !important;
+}
+
+.SetCell_blue div {
+ background-color: blue !important;
+}
+
+.SetCell_orange div {
+ background-color: orange !important;
+}
+
+.SetCell_pink div {
+ background-color: pink !important;
+}
+
+/* 未读消息 整行文字加粗 */
+.newsNoRead {
+ font-weight: bold !important;
+}
+
+.ant-pagination-item {
+ border-radius: 0 !important;
+}
+
+.ant-pagination-options-quick-jumper input {
+ border-radius: 0 !important;
+}
+
+.ant-pagination-prev .ant-pagination-item-link,
+.ant-pagination-next .ant-pagination-item-link {
+ border-radius: 0 !important;
+ height: 28px;
+}
+
+.ant-pagination-options-quick-jumper {
+ height: 28px !important;
+ line-height: 28px !important;
+}
+
+.ant-pagination-options-quick-jumper input {
+ height: 28px !important;
+}
+
+.ant-modal-content {
+ border-radius: 0 !important;
+}
+
+.ant-modal-header {
+ padding: 7px 24px !important;
+ background: var(--xly-skin-modal-bg-color, #646464) !important;
+ color: #fff !important;
+ font-size: 18px;
+ border-radius: 0 !important;
+}
+
+.ant-modal-close-x {
+ height: 33px !important;
+ line-height: 33px !important;
+}
+
+.ant-modal-title {
+ color: #fff !important;
+}
+
+.ant-modal-close {
+ color: #fff !important;
+
+}
+
+.ant-menu-item i.selected {
+ color: #f6c136;
+}
+
+.mergeTable .ant-table-header {
+ position: fixed;
+ top: 113px;
+ z-index: 20;
+ border-top: 1px solid #d9d9d9;
+}
+
+.ant-select-selection-selected-value {
+ padding-left: 11px;
+}
+
+#sMemo {
+ font-size: 12px !important;
+}
+
+.ant-form-item-children {
+ display: block;
+}
+
+.speacialNote {
+ font-size: 12px;
+ color: rgba(0, 0, 0, 0.65) !important;
+}
+
+/* 制单日期、制单人员、订单号设置保存时自动生成文字提醒 */
+.searchMainForm .speacialNote {
+ position: absolute;
+ left: 32%;
+ top: 0;
+ font-size: 12px;
+ color: #000 !important;
+}
+
+.searchMainForm {
+ border-top: 0;
+ padding: 8px 8px 8px 8px !important;
+ /* 间距收窄 */
+ margin: 0 10px !important;
+ background: #fff;
+}
+
+.viewStyle {
+ background: #fff;
+}
+
+.searchMainForm input[disabled],
+.searchMainForm textArea[disabled],
+.searchMainForm .ant-select-disabled .ant-select-selection-item,
+// .searchMainForm .sActiveIdStyle,
+.viewStyle input[disabled],
+.viewStyle textArea[disabled],
+.xlyMemoList textArea[disabled] // .viewStyle .sActiveIdStyle,
+
+ {
+ background-color: #f1f2f8 !important;
+ // color: #999!important;
+ color: #000 !important;
+
+ &+.sActiveIdStyle {
+ background-color: #f1f2f8 !important;
+
+ .masterLinkSpan {
+ background-color: #f1f2f8 !important;
+ }
+ }
+}
+
+.searchMainForm .ant-picker.ant-picker-disabled,
+.viewStyle .ant-picker.ant-picker-disabled {
+ background-color: #f1f2f8 !important;
+
+ &+.sActiveIdStyle {
+ background-color: #f1f2f8 !important;
+
+ .masterLinkSpan {
+ background-color: #f1f2f8 !important;
+ }
+ }
+}
+
+.searchMainForm .ant-select-disabled,
+.viewStyle .ant-select-disabled {
+ .ant-select-selector {
+ background-color: #f1f2f8 !important;
+ }
+
+ &+.sActiveIdStyle {
+ background-color: #f1f2f8 !important;
+
+ .masterLinkSpan {
+ background-color: #f1f2f8 !important;
+ }
+ }
+}
+
+/* 所有表格只读模式设置背景色 */
+.coustomStyle input {
+ background-color: #f1f2f8 !important;
+}
+
+/* 生产施工单 选择框异常 */
+.ant-select-selection__rendered {
+ margin-left: 0 !important;
+ margin-right: 0 !important;
+ background-color: #fff;
+ font-size: 12px;
+ height: 30px;
+ line-height: 31px !important;
+}
+
+/* 通用弹窗select样式 */
+
+.commonInputSearch input:hover {
+ background: #e6f7ff !important;
+ /* #e6e7ff */
+}
+
+.commonInputSearch input:focus {
+ background: #e6f7ff !important;
+}
+
+.react-grid-item {
+ .ant-row {
+ flex-wrap: nowrap !important;
+ }
+
+ .sActiveIdStyle_viewChooseSpan {
+ position: absolute !important;
+ background: #FFF;
+ width: calc(100% - 2px);
+ height: calc(100% - 2px) !important;
+ margin: 1px;
+ z-index: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+
+ .viewChooseSpan {
+ cursor: pointer;
+ }
+ }
+}
+
+.ant-row .commonInputSearch input:focus {
+ background: #e6f7ff !important;
+}
+
+/* 右击单击 弹窗 */
+.ContextMenuCol {
+ border: 1px solid #d3d3d3;
+
+ .ant-select-auto-complete.ant-select .ant-input {
+ border: 0 !important;
+ }
+
+}
+
+/** 这个样式控制表单页悬浮框样式,这个样式涵盖的范围太广,导致其他样式被覆盖 */
+.white-bk .ant-select-selection__rendered {
+ background-color: #fff;
+ font-size: 12px;
+}
+
+.ant-cascader-picker-disabled {
+ background: #fafafa !important;
+ color: rgba(0, 0, 0, 0.5) !important;
+}
+
+#mergeTableEdit .ant-input-number-input[disabled] {
+ background: transparent !important;
+}
+
+/* 设置CommonTable通用表格样式 */
+#staticEditTable {
+ background-color: #fff;
+ /* 设置通用表格背景色 */
+ position: relative;
+ margin-top: -1px;
+}
+
+#staticEditTable .ant-input[disabled] {
+ background: transparent !important;
+}
+
+#staticEditTable .ant-input-number-input[disabled] {
+ background: transparent !important;
+}
+
+/* 默认数字控件是90px,单层表格行设置数字控件不设置宽度 */
+.viewStyle .ant-input-number {
+ width: auto !important;
+}
+
+.viewStyle .ant-select-show-search {
+ border: 1px solid #d9d9d9 !important;
+}
+
+.viewStyle .react-grid-item .ant-select-show-search {
+ border: 0 !important;
+}
+
+.commonNewTabBilll {
+ .ant-form-item-control {
+ flex: 1;
+ max-width: 100%;
+ }
+
+ .ant-form-item-control-input {
+ .masterLinkSpan {
+ left: -3px;
+ top: 1px;
+ background: #FFF;
+ }
+ }
+}
+
+/* 控制所有表格 悬浮行背景颜色*/
+/* 通用表格 icon字体 */
+#staticEditTable a i {
+ font-size: 15px;
+}
+
+/*销售订单列表单元格元素控制*/
+.xly-normal-list #staticEditTable td {
+ font-size: 12px !important;
+ color: #000 !important;
+ /* 设置通用列表单元格文字颜色 */
+ padding: 0 5px !important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ /*超出变成省略号 */
+}
+
+/* 设置通用表格滚动条问题 */
+#staticEditTable .ant-select-selection {
+ height: 31px !important;
+ background-color: transparent !important;
+}
+
+#staticEditTable .ant-calendar-picker-icon:after {
+ content: '' !important;
+}
+
+/* 设置CommonTable通用树样式 */
+#staticEditTree {
+ height: 100%;
+ overflow: auto;
+}
+
+/* 系统权限Tree*/
+.xly-jurisdiction #staticEditTree {
+ //max-height: ~'calc(100vh - 160px)';
+ overflow: hidden;
+}
+
+/* 选择工序Tree*/
+#modalChooseProcess #staticEditTree {
+ height: 298px;
+ overflow: auto;
+}
+
+#modalChooseProcess #staticEditTable .sActiveIdStyle {
+ position: inherit !important;
+}
+
+/* Begin 数据导入页面 */
+#importDataInfo .topTable {
+ .ant-table-scroll {
+ height: calc(~'100vh - 225px');
+ overflow-x: auto !important;
+ }
+
+ .ant-table-header {
+ /* 解决无数据时没滚动条导致头部显示不全问题 */
+ width: max-content;
+ overflow-y: scroll !important;
+ }
+
+ .ant-table-body {
+ width: max-content;
+ height: calc(~'100vh - 276px');
+ overflow-x: auto !important;
+ overflow-y: auto !important;
+ }
+}
+
+/* END 数据导入页面 */
+
+/* Begin 设计功能弹出层界面样式调整 */
+#StatementInfo .ant-btn {
+ border: 0;
+ background-color: #1890FF;
+}
+
+#StatementInfo .billToolBar {
+ margin-bottom: 8px;
+}
+
+#StatementInfo .ant-table-fixed {
+ width: 100% !important;
+}
+
+#StatementInfo ul {
+ width: 100%;
+}
+
+#StatementInfo li {
+ float: left;
+ width: 60px;
+}
+
+#StatementInfo .toolBar___22SoH li {
+ padding: 0 !important;
+}
+
+#StatementInfo .toolBar___22SoH a:hover {
+ color: #1890FF !important
+}
+
+#StatementInfo li a {
+ color: #fff;
+}
+
+#StatementInfo li a[disabled] {
+ color: #a2a2a2;
+}
+
+#StatementInfo li i {
+ margin-right: 6px;
+}
+
+#StatementInfo .ant-table-body {
+ overflow-x: hidden !important;
+ overflow-y: auto !important;
+ height: 133px;
+}
+
+#StatementInfo .ant-table-footer {
+ display: none;
+}
+
+/* END 设计功能弹出层 */
+
+.ant-message span {
+ white-space: pre-wrap;
+}
+
+.ant-input-number-handler-wrap {
+ display: none !important;
+}
+
+.ant-card-extra {
+ padding: 0 !important;
+}
+
+.ant-card-body {
+ overflow: auto;
+}
+
+.ant-modal-body {
+ overflow: hidden;
+}
+
+/* 设置通用切换slaveTab */
+.ant-tabs.ant-tabs-card>.ant-tabs-bar .ant-tabs-tab-disabled span {
+ color: #6b6868;
+ cursor: not-allowed;
+ /*设置不可用tab样式 */
+}
+
+.importDataInfo {
+ .ant-legacy-form-item-control {
+ line-height: unset;
+ }
+}
+
+#popupPan .ant-table-body {
+ max-height: 350px !important;
+}
+
+#worker .ant-table-scroll>div:last-child {
+ min-height: 110px;
+}
+
+#worker .ant-input-number-input[disabled] {
+ background: transparent !important;
+}
+
+#workerOrder table {
+ width: auto;
+}
+
+#workerOrder td {
+ padding: 0 8px !important;
+ height: 32px;
+}
+
+#commonList {
+ background: #f0f2f5 !important;
+}
+
+#sPartsName .ant-form-item {
+ display: inline-block;
+ width: 100%;
+ margin-bottom: 0 !important;
+ height: 21px !important;
+}
+
+#sPartsName .ant-form-item-control {
+ line-height: 21px !important;
+}
+
+//.ant-select {
+// width: 100%!important;
+//}
+#staticEditTable {
+ .ant-pagination {
+ .ant-select {
+ width: 63px !important;
+ }
+ }
+
+ .ant-pagination-total-text {
+ position: absolute;
+ right: 10px;
+ }
+
+ .ant-pagination-options {
+ .ant-pagination-options-size-changer {
+ .ant-select-selection {
+ height: auto !important;
+ }
+ }
+ }
+}
+
+//设备信息中的从表样式
+.xly-bill-list .iPlcNoTable .topTable .ant-spin-nested-loading .ant-spin-container .ant-table {
+ height: 83% !important;
+
+ .ant-table-body {
+ overflow: auto !important;
+ }
+}
+
+
+.tableOption {
+ line-height: 0 !important;
+ position: absolute;
+ top: -27px;
+ right: 0;
+}
+
+.tableOption>span:first-child {
+ display: inline-block;
+}
+
+.tableOption>button {
+ border: 1px solid #1890FF;
+ background: #1890FF;
+ color: #fff;
+ margin-left: 8px;
+ min-width: 65px;
+ height: 28px;
+ line-height: 28px;
+}
+
+.tableOption>button:hover {
+ border: 1px solid #1890FF !important;
+ background: #1890FF !important;
+ color: #fff !important;
+}
+
+.tableOption>button[disabled],
+.tableOption>button[disabled]:hover {
+ color: rgba(0, 0, 0, 0.5) !important;
+ background: #f5f5f5 !important;
+ border: 1px solid #d9d9d9 !important;
+}
+
+
+
+.TextArea {
+ font-size: 20px;
+ margin: 0 10px 10px 10px;
+}
+
+.wrapRow {
+ width: 100%;
+ padding: 0 25px 0 25px;
+}
+
+.lef {
+ width: 48%;
+ float: left;
+}
+
+.rig {
+ width: 48%;
+ margin-left: 4%;
+ float: left;
+}
+
+.uploadPic i {
+ display: block;
+ font-size: 32px;
+ color: #999;
+}
+
+.uploadPic>div {
+ color: #666;
+ font-size: 14px;
+}
+
+.header {
+ position: fixed;
+ width: 100%;
+ z-index: 999;
+ top: 60px;
+ height: 30px !important;
+ padding: 0px !important;
+ line-height: inherit !important;
+ background: transparent !important;
+}
+
+
+
+.clayoutClassify {
+ margin: 70px 0 0 0;
+}
+
+.popupPan .clayoutClassify {
+ margin: 0 !important;
+}
+
+.clayoutBot {
+ padding: 0 10px;
+}
+
+.clayoutTop {
+ padding: 30px 32px 20px 32px;
+}
+
+.clayoutCalc {
+ margin: 0 10px;
+ background: #fff !important;
+}
+
+.slaveTabs .ant-tabs-bar {
+ margin: 0 10px !important;
+}
+
+.slaveTabs .ant-table-thead>tr>th {
+ //background-color: #d0d0d0!important;
+}
+
+.modal .clayoutTop {
+ padding: 0 !important;
+}
+
+.modal .mergeTableEdit {
+ width: auto !important;
+}
+
+.sider {
+ flex: none !important;
+ max-width: none !important;
+ min-width: 0 !important;
+ width: auto !important;
+ background: #fff !important;
+}
+
+.jsqSider {
+ background: #fff !important;
+}
+
+.jsqSider button {
+ width: 57px;
+ height: 30px;
+ padding: 0 !important;
+ line-height: 30px;
+ text-align: center;
+}
+
+.tabGroup {
+ padding-left: 0 !important;
+}
+
+.tabChild {
+ margin-bottom: 20px;
+}
+
+.tabChildTitle {
+ border-bottom: 1px dotted #354052;
+ margin-bottom: 10px;
+ color: #fff;
+ line-height: 22px;
+}
+
+.tabChildTitle span {
+ background: #354052;
+ display: inline-block;
+ padding: 5px 15px;
+ line-height: 22px;
+ border-top-left-radius: 5px;
+ border-bottom-right-radius: 5px;
+ font-size: 12px;
+}
+
+
+.labelNo {
+ height: auto;
+}
+
+.labelNo .formItemMargin {
+ height: auto !important;
+}
+
+.labelNo textarea {
+ border-top: 0 !important;
+}
+
+.white-bk>div>div>div>div>span>span input {
+ background-color: #fff !important;
+ font-size: 12px;
+}
+
+
+
+.searchSlaveForm {
+ border: 1px solid #d9d9d9;
+ border-top: 0;
+ padding: 15px !important;
+ padding-top: 25px !important;
+ background: #fff;
+}
+
+.formItemMargin0 {
+ margin-bottom: 0 !important;
+}
+
+.formItemMargin0>div>div>span>span {
+ background: transparent !important;
+}
+
+.formItemMargin0>div>div>span>span input {
+ border: 0 !important;
+}
+
+/* 设置整单外发 大小为12 */
+.formItemMag10 label {
+ font-size: 12px !important;
+}
+
+.searchForm {
+ background: #fff;
+}
+
+.searchForm .formItemMag10 label>span:last-child {
+ width: inherit !important;
+}
+
+.searchForm .formItemMag10>div>div {
+ line-height: 32px !important;
+}
+
+.searchForm .formItemMag0 label {
+ margin-top: 5px !important;
+ margin-bottom: 0 !important;
+}
+
+.searchForm .area {
+ height: auto;
+ min-height: 300px;
+}
+
+.tabChildDot {
+ padding-bottom: 10px;
+ margin-bottom: 10px;
+ border-bottom: 1px dotted #354052;
+}
+
+.tab240 {
+ height: 240px;
+}
+
+.searchForm .list {
+ border: 1px solid #d9d9d9;
+ border-radius: 4px;
+ padding: 4px 11px;
+ min-height: 280px;
+}
+
+.searchForm .list:hover {
+ border: 1px solid #1890FF;
+}
+
+.searchForm .list li {
+ height: 32px;
+ line-height: 32px;
+}
+
+.tableOption .formItemMargin {
+ margin-bottom: 0 !important;
+}
+
+/* 设定单据->销售对账 */
+.outStandFilter {
+ padding: 20px 32px 0 32px !important;
+ min-height: 72px;
+}
+
+.outStandRow {
+ z-index: 20;
+ padding: 10px 0 0 20px;
+ background: #f7f7f7;
+ transition: background .3s ease;
+ box-shadow: 0 0 5px #1890FF;
+ width: 70%;
+ min-height: 49px;
+ float: left;
+}
+
+.outStandFormItem {
+ margin-bottom: 0 !important;
+}
+
+.outStandFormItem label span+span {
+ width: auto !important;
+}
+
+.inputGroup {
+ position: relative;
+}
+
+.inputGroup>div {
+ width: 100% !important;
+}
+
+.inputGroup input {
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.inputGroup .iconAdd {
+ position: absolute;
+ right: 0;
+ top: 0;
+}
+
+.inputGroup .iconAdd>span {
+ width: 32px;
+ height: 32px;
+ position: absolute !important;
+ left: 0 !important;
+ top: 14px !important;
+ cursor: pointer;
+}
+
+.inputGroup .iconAdd i {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 32px;
+ height: 32px;
+}
+
+.inputGroup .iconAdd i:before {
+ color: rgba(0, 0, 0, 0.43);
+ transform: scale(0.75) rotate(0deg);
+ line-height: 32px;
+}
+
+.inputGroup .iconAdd i:hover:before {
+ line-height: 32px;
+ font-weight: 700;
+ color: rgba(0, 0, 0, 0.65);
+}
+
+.inputGroup .iconAdd input {
+ padding-left: 20px !important;
+ height: 32px !important;
+}
+
+.inputGroup>div>div {
+ background: #fafafa !important;
+ width: 100% !important;
+}
+
+.inputGroup>div>div>div {
+ width: 100% !important;
+}
+
+.tableInputGroup {
+ position: relative;
+}
+
+.tableInputGroup .iconAdd {
+ position: absolute;
+ right: 8px;
+ top: 6px;
+}
+
+.tableInputGroup input {
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 16px !important;
+ height: 16px !important;
+ padding: 0 !important;
+ border-radius: 0 !important;
+}
+
+.tableInputGroup .iconAdd>span {
+ width: 16px;
+ height: 16px;
+ position: absolute !important;
+ left: 0 !important;
+ top: 8px !important;
+ cursor: pointer;
+}
+
+.tableInputGroup .iconAdd i {
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 16px;
+ height: 16px;
+}
+
+.tableInputGroup .iconAdd i:before {
+ color: rgba(0, 0, 0, 0.43);
+ transform: scale(0.75) rotate(0deg);
+ line-height: 16px;
+}
+
+.tableInputGroup .iconAdd i:hover:before {
+ line-height: 16px;
+ font-weight: 700;
+ color: rgba(0, 0, 0, 0.65);
+}
+
+.tableInputGroup>div>div>span {
+ display: none !important;
+}
+
+.layout {
+ padding-top: 20px;
+}
+
+.editSelect>div {
+ height: 32px;
+ border-color: transparent !important;
+ border-radius: 0;
+ transition: none;
+ width: 100%;
+}
+
+.tableOperation {
+ padding: 0 6px;
+}
+
+.tableOperation>button {
+ border: 0 !important;
+ background: none !important;
+ color: #1890FF;
+ cursor: pointer;
+ outline: 0;
+}
+
+.tableOperation>button:focus {
+ outline: 0;
+}
+
+.rightSearch {
+ width: 220px;
+ position: absolute;
+ right: 80px;
+ top: -29px;
+}
+
+.rightSearch input {
+ height: 28px;
+}
+
+.rightSearch button {
+ height: 28px;
+}
+
+.searchBox {
+ width: 200px !important;
+ height: 26px;
+ background: hsla(0, 0%, 100%, .12);
+ transition: all .3s linear;
+}
+
+.show {
+ width: 300px !important;
+ border: 1px solid #1890FF;
+}
+
+.searchBox button {
+ border: 0;
+ background: none;
+}
+
+.searchBox button:hover {
+ background: none;
+}
+
+.tabButton {
+ //margin-top: 10px;
+ font-size: 12px;
+ text-indent: 1em;
+ height: 185px;
+ overflow: auto;
+ border-left: 1px solid #d9d9d9;
+ border-bottom: 1px solid #d9d9d9;
+}
+
+
+.tabButton button {
+ display: block !important;
+ border: 0 !important;
+ width: 100% !important;
+ text-indent: 0.6em !important;
+ text-align: left;
+}
+
+/* 上传 */
+.uploadListInline {
+ margin-right: 8px;
+}
+
+.uploadListInline>div:last-child>div {
+ height: 300px;
+}
+
+.uploadListInline>div:last-child>div a {
+ width: auto;
+ height: 280px;
+}
+
+.uploadListInline>div:last-child>div img {
+ width: auto;
+ height: 280px;
+}
+
+/* 图片列表上传 */
+.staticUpload {
+ display: inline-block;
+}
+
+.staticUpload button {
+ height: 28px !important;
+}
+
+.staticUpload>div:last-child {
+ display: none;
+}
+
+/* 销售订单自定义审核界面设置 */
+.checkTable {
+ margin-bottom: 20px;
+
+ table tr td {
+ padding-left: 4px !important;
+ padding: 4px 4px;
+ font-size: 12px;
+ height: 30px;
+ }
+}
+
+.checkInputGroup {
+ padding-left: 0 !important;
+ margin-top: 10px !important;
+}
+
+.clickRow {
+ background: #f0fcff !important;
+}
+
+.contentPop {
+ background: #fff !important;
+}
+
+.buttonOpt {
+ margin-top: 25px;
+}
+
+.buttonOpt button {
+ margin-right: 10px;
+ padding: 0 15px !important;
+}
+
+.tableShow td span {
+ padding: 0 8px !important;
+ line-height: 32px;
+}
+
+.collapseB {
+ margin-top: 20px;
+ text-align: center;
+ display: inline-block;
+ width: 98%;
+ font-size: 16px;
+ background: #fafafa;
+ color: rgba(0, 0, 0, 0.65) !important;
+ border: 0;
+ cursor: pointer;
+}
+
+.collapseA {
+ text-align: center;
+ display: inline-block;
+ width: 98%;
+ font-size: 16px;
+ background: #fafafa;
+ color: rgba(0, 0, 0, 0.65) !important;
+ border: 0;
+ cursor: pointer;
+ margin-top: 5px;
+}
+
+.collapseA span,
+.collapseB span {
+ font-size: 14px;
+ margin-right: 5px;
+}
+
+.collapseA i,
+.collapseB i {
+ vertical-align: middle;
+}
+
+.collapseA:focus,
+.collapseB:focus {
+ outline: 0;
+}
+
+/* 快捷过滤 */
+.advForm {
+ background: #eef1f6;
+ height: 52px;
+}
+
+.advFormItem {
+ margin-bottom: 4px !important;
+ margin-right: 7px !important;
+}
+
+.advFormItem>div {
+ width: 100%;
+}
+
+.advFormItem .advDelectIcon {
+ position: absolute;
+ right: -20px;
+ top: 0;
+}
+
+.advDelectIcon i {
+ position: absolute;
+ right: -5px;
+ top: 8px;
+ cursor: pointer;
+ color: rgba(0, 0, 0, 0.65) !important;
+}
+
+.advRow {
+ position: absolute !important;
+ z-index: 20;
+ padding: 10px 34px 0 10px;
+ transition: background .3s ease;
+ border: 1px solid transparent;
+ width: 46%;
+ float: left;
+}
+
+.advRowActive {
+ position: absolute !important;
+ z-index: 20;
+ padding: 10px 34px 0 10px;
+ background: #eef1f6;
+ transition: background .3s ease;
+ border: 1px solid #1890FF;
+ width: 46%;
+ float: left;
+}
+
+.advRow>button,
+.advRowActive>button {
+ position: absolute;
+ top: 10px;
+ width: 32px;
+ height: 32px;
+ background: #1890FF;
+ border: 0;
+ color: #fff;
+ cursor: pointer;
+}
+
+.advRow button>i,
+.advRowActive button>i {
+ display: block;
+ font-size: 14px;
+ color: #fff;
+ text-align: center;
+ line-height: 32px;
+}
+
+.advButton {
+ position: relative;
+ margin-right: 7px;
+ margin-bottom: 7px;
+}
+
+.advRow button:focus {
+ outline: 0;
+}
+
+.advButton button {
+ width: 100%;
+}
+
+.advCol {
+ left: 47%;
+ width: 30%;
+ z-index: 20;
+ float: left !important;
+ padding-top: 11px;
+ margin-left: 20px;
+}
+
+.popupPan .advRow,
+.popupPan .advRowActive {
+ width: 60% !important;
+}
+
+.popupPan .advCol {
+ left: 60% !important;
+ margin-left: 5px !important;
+}
+
+.advCol button {
+ height: 32px !important;
+ min-width: 80px;
+ padding: 0 16px;
+}
+
+.advCol button>span {
+ line-height: 32px !important;
+}
+
+.advInput {
+ width: 100%;
+ height: 32px;
+}
+
+.advInput input {
+ height: 32px !important;
+}
+
+/* 分页 */
+.pagination {
+ float: none !important;
+ text-align: center;
+ margin: 8px 0 !important;
+}
+
+.pagination li {
+ min-width: 28px;
+ height: 28px;
+ line-height: 28px;
+}
+
+.pagination li a:after {
+ height: 28px !important;
+}
+
+/* 可修改表格 */
+.mergeTableEdit {
+ position: relative;
+ width: 1000px;
+ margin: 0 auto;
+}
+
+.mergeTableEdit .tableCommon {
+ position: absolute;
+ bottom: 0;
+ margin-bottom: 8px;
+ line-height: 0 !important;
+}
+
+.mergeTableEdit .tableCommonSpace {
+ margin-top: 8px;
+}
+
+.mergeTableEdit .tableCommonRig {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ margin-bottom: 8px;
+ line-height: 0 !important;
+}
+
+.tableCommon>button,
+.tableCommonSpace>button {
+ min-width: 80px;
+ height: 28px;
+ background: #1890FF;
+ color: #fff;
+ border: 1px solid #1890FF !important;
+ margin-right: 8px;
+}
+
+.tableCommonRig>button {
+ min-width: 80px;
+ height: 28px;
+ background: #1890FF;
+ color: #fff;
+ border: 1px solid #1890FF !important;
+ margin-left: 8px;
+}
+
+.mergeTableEdit .tableCommonRig {
+ display: none;
+}
+
+.popupPan .tableCommonRig {
+ display: block !important;
+}
+
+.tableCommon>button:hover,
+.tableCommonRig>button:hover {
+ background: #26d7eb !important;
+ color: #fff !important;
+}
+
+.tableCommon>button[disabled]:hover {
+ border: 1px solid #b0b0b3 !important;
+ background: #b0b0b3 !important;
+ opacity: 0.6;
+ color: #fff !important;
+}
+
+.tableCommon>button[disabled] {
+ border: 1px solid #b0b0b3 !important;
+ background: #b0b0b3 !important;
+ opacity: 0.6;
+ color: #fff !important;
+}
+
+.btnLoad {
+ width: 100% !important;
+ padding: 0 !important;
+ text-align: center !important;
+}
+
+.workeOrderMainT {
+ float: left;
+ width: 90px;
+ font-size: 14px;
+ color: #1890FF;
+ font-weight: 700;
+ height: 32px;
+ line-height: 28px;
+ padding-bottom: 4px;
+ border-bottom: 2px solid #1890FF;
+ text-align: center;
+ margin-bottom: 10px;
+}
+
+.workOrderMain {
+ float: right;
+ margin-right: 2.1%;
+}
+
+.workOrderMain .formItemMargin {
+ height: 32px !important;
+}
+
+.workOrderMain button,
+.workOrderMain button:active {
+ float: right;
+ background: #fc785e;
+ border: 0;
+ color: #fff;
+}
+
+.workOrderMain button:hover {
+ background: #fe927d;
+ border: 0;
+ color: #fff;
+}
+
+.workOrderMain>div {
+ width: 106px;
+ float: right;
+}
+
+
+
+.collapseWorker {
+ margin-top: 10px;
+}
+
+.workerList {
+ height: auto;
+ margin-bottom: 8px;
+ font-size: 12px !important;
+}
+
+.workerListItem {
+ margin-right: 15px;
+ margin-bottom: 0px !important;
+ overflow: hidden;
+ height: 100%;
+ background-color: transparent;
+}
+
+.workerListItem label {
+ float: left;
+}
+
+.workerListItem>div>div {
+ border: 0px !important;
+ background-color: transparent;
+ font-size: 12px;
+}
+
+.workerListItem>div>div>div {
+ height: 40px;
+ line-height: 40px;
+ padding: 0px 5px !important;
+ overflow: hidden;
+ display: flex;
+ background-color: transparent;
+ font-size: 12px;
+ margin-top: 0px;
+}
+
+.workerListItem>div>div>div>label {
+ flex: 1;
+ font-size: 12px;
+}
+
+.workerListItem>div>div>div>label span {
+ font-size: 12px;
+}
+
+.workerForm {
+ margin: 10px !important;
+}
+
+.workerFormRow {
+ display: flex;
+}
+
+.workerFormRow>div:first-child {
+ background: #1890FF;
+ display: flex;
+ flex-flow: row wrap;
+ justify-content: center;
+ align-items: center;
+}
+
+.workerFormRow>div .item {
+ font-size: 18px;
+ font-weight: 700;
+ color: #fff;
+}
+
+.workerOpt {
+ position: absolute;
+ left: -3.5%;
+}
+
+.workerOpt i {
+ color: #fff;
+ cursor: pointer;
+}
+
+.workerFormPop {
+ margin: 10px 0 !important;
+}
+
+.workerFormPop .workerOpt {
+ position: absolute;
+ left: -6.5%;
+}
+
+.clayoutJur {
+ position: relative;
+ margin: 0 10px;
+ background: #fff !important;
+ padding: 10px 10px 0 2px;
+}
+
+.clayoutJur table {
+ width: 100% !important;
+}
+
+.tableOptionJur {
+ margin-bottom: 8px;
+}
+
+.tableOptionJur>button {
+ border: 1px solid #1890FF;
+ background: #1890FF;
+ color: #fff;
+ margin-left: 8px;
+ min-width: 65px;
+ height: 28px;
+ line-height: 28px;
+}
+
+.tableOptionJur>button:first-child {
+ margin-left: 0;
+}
+
+.tableOptionJur>button:hover {
+ border: 1px solid #1890FF;
+ background: #1890FF;
+ opacity: 0.6;
+ color: #fff;
+}
+
+/* 菜单项 */
+.affixMenu {
+ cursor: pointer;
+ position: fixed;
+ font-size: 22px;
+ right: 35px;
+ top: 60px;
+}
+
+affixMenuhasProps {
+ cursor: pointer;
+ position: fixed;
+ font-size: 22px;
+ right: 35px;
+ top: 60px;
+ color: rgba(255, 255, 255, 0.6) !important;
+}
+
+.affixMenuTable table {
+ width: 100% !important;
+}
+
+.affixMenuTable table td {
+ padding: 0 !important;
+}
+
+.affixMenuTable table td input {
+ border: 0 !important;
+ background: transparent;
+}
+
+.affixMenuTable table td label {
+ padding: 0 11px;
+}
+
+.affixMenuShow>span {
+ margin-right: 10px;
+}
+
+.affixMenuTableAll span {
+ font-size: 12px;
+}
+
+.affixMenuTableAll h3 {
+ margin-bottom: 15px;
+}
+
+.modalsContent .affixMenuTableAll:not(first-child) {
+ margin-top: 0px;
+}
+
+.modalsContent {
+ //max-height: 395px;
+ margin-right: -39px;
+ padding-right: 24px;
+ overflow-y: scroll;
+}
+
+.modalsContent {
+ margin-top: -15px;
+}
+
+.modalsContent>div:first-child {
+ padding: 8px 15px 8px 45px !important;
+ margin-bottom: 10px;
+}
+
+.modalsContent>div:first-child>i {
+ font-size: 16px;
+ top: 15.5px !important;
+}
+
+.modalsContent .slaveTabs {
+ margin: auto !important;
+}
+
+
+
+.iconGroup {
+ i {
+ position: absolute;
+ right: 20px;
+ bottom: 20px;
+ transition: color 0.32s;
+ color: @text-color-secondary;
+ cursor: pointer;
+ margin-left: 16px;
+
+ &:hover {
+ color: @text-color;
+ }
+ }
+}
+
+.popupButton {
+ border: 0;
+ background: 0;
+ color: #1890FF;
+ border-bottom: 1px solid #1890FF;
+ cursor: pointer;
+}
+
+ton:focus {
+ box-shadow: none !important;
+ outline: none;
+}
+
+
+.xly-bill-list {
+ padding: 0 10px;
+}
+
+th.column-money {
+ color: #1890FF !important;
+ box-shadow: 2px 0 3px -1px #999999 !important;
+}
+
+.ant-calendar-picker-input {
+ outLine: none;
+ font-size: 12px !important;
+}
+
+.processListTable {
+ .ant-table-content {
+ .ant-table-body {
+ max-height: 90% !important;
+ }
+ }
+}
+
+/* 所有CommonList列表样式控制*/
+.xly-normal-list .topTable {
+ .ant-table-content {
+ height: 100%;
+
+ .ant-table-scroll {
+ height: 100%;
+ padding-bottom: 61px;
+ /* 兼容多表头 */
+ }
+
+ .ant-table-body {
+ overflow-x: hidden !important;
+ overflow-y: auto !important;
+ }
+ }
+
+ .ant-spin-nested-loading {
+ height: 100%;
+
+ .ant-spin-container {
+ height: 100%;
+
+ .ant-table {
+ height: 100%;
+ }
+ }
+ }
+
+ .ant-table-pagination.ant-pagination {
+ margin: 6px 0;
+ float: none;
+ text-align: center;
+ }
+
+ .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: scroll !important;
+ }
+}
+
+/* 通用分类自适应 */
+.xly-normal-list.other-list {
+ .topTable {
+ height: calc(~'100% - 170px');
+ }
+
+ .ant-table-header {
+ width: 100%;
+ }
+
+ .ant-table-body {
+ width: 100%;
+ }
+}
+
+/* 通用分类 表头不设置滚动条*/
+.xly-normal-list.other-list .topTable .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: auto !important;
+}
+
+.sider-table-box .topTable {
+ height: 100%;
+
+ .ant-table {
+ height: 100%;
+
+ .ant-table-scroll {
+ height: 100%;
+ }
+
+ .ant-table-body {
+ margin-bottom: -15px;
+ height: calc(~'100% + 50px');
+ padding-bottom: 30px;
+ }
+
+ .ant-table-content {
+ height: 100%;
+
+ .ant-table-scroll {
+ height: 100%;
+ }
+ }
+ }
+}
+
+/* 所有单据通用设置 */
+.xly-bill-list .topTable {
+ height: calc(~'100%');
+
+ /* 分页按钮 67*/
+ .ant-table-scroll {
+ height: 100%;
+ padding-bottom: 76px;
+ /* 多表头设置 */
+ overflow-x: auto !important;
+ }
+
+ .ant-table-body {
+ margin-bottom: -15px;
+ // width: max-content;
+ }
+
+ .ant-table-content {
+ height: 100%;
+
+ .ant-table-scroll {
+ height: 100%;
+ }
+
+ .ant-table-fixed-right {
+ /* 单据固定列滚动条设置 */
+ /*
+ 修改日期:2021-03-17
+ 修改人:吕杰
+ 区域:以下一行
+ 需求变更:fix 2104 解决table操作列下拉错位问题
+ */
+ // height: 87%!important;
+ height: calc(~"100% - 48px") !important;
+ }
+
+ /*
+ 修改日期:2021-03-17
+ 修改人:吕杰
+ 区域:以下三行
+ 需求变更:fix 2104 解决table操作列下拉错位问题
+ */
+ .ant-table-fixed-right .ant-table-body-outer {
+ height: calc(~'100% - 28px');
+ }
+
+ .ant-table-fixed-right .ant-table-body-inner {
+ overflow-x: hidden !important;
+ overflow-y: auto !important;
+ /*
+ 修改日期:2021-03-17
+ 修改人:吕杰
+ 区域:以下一行
+ 需求变更:fix 2104 解决table操作列下拉错位问题
+ */
+ // padding-bottom: 80px;
+ }
+ }
+
+ .ant-spin-nested-loading {
+ height: 100%;
+
+ .ant-spin-container {
+ height: 100%;
+
+ .ant-table {
+ height: 88%;
+ /* 单据分页控件可见 */
+ }
+ }
+ }
+
+ //.ant-table-placeholder {
+ // margin-top: 15px;
+ //}
+ .ant-table-pagination.ant-pagination {
+ margin: 6px 0;
+ float: none;
+ text-align: center;
+ }
+}
+
+.botTable {
+ margin-top: -2px;
+
+ table thead {
+ display: none;
+ }
+
+ .ant-table-body {
+ height: auto !important;
+ min-height: inherit !important;
+ overflow-y: scroll;
+ }
+}
+
+.TabPaneStyle {
+ height: 96%;
+ /*解决Tab按键 界面跳动问题 94通用*/
+}
+
+.SetModelTable {
+ display: flex;
+ width: 100%;
+ height: 100%;
+ overflow: hide !important;
+}
+
+.SetModelTable>div:first-child {
+ flex-shrink: 0;
+ transition: width 0.2s;
+}
+
+// 整体布局相关
+.content {
+ height: 100%;
+}
+
+/* 通用footer样式设置 */
+.ant-table-footer {
+ height: 30px !important;
+ padding: 0px !important;
+ left: -1px;
+ background-color: rgb(240, 242, 245) !important;
+ //top: -30px;
+ z-index: 10;
+ /* 合计行层级比Modal1000低 */
+}
+
+/* 解决footer有边线 */
+.ant-table.ant-table-bordered .ant-table-footer {
+ border: none !important;
+}
+
+.ant-table-footer:before {
+ height: 0 !important;
+}
+
+.hover-droping-cell {
+ border-left: 4px dashed #1890FF;
+ background-color: rgba(1, 193, 222, 0.2);
+}
+
+.react-resizable {
+ position: relative;
+}
+
+.react-resizable-handle {
+ position: absolute;
+ width: 10px;
+ height: 100%;
+ bottom: 0;
+ right: -10px;
+ cursor: col-resize;
+ z-index: 999;
+}
+
+/* 快速下单modal */
+.fast-order-modal {
+ padding: 0px;
+}
+
+.modalBlockTitle {
+ height: 40px;
+ line-height: 40px;
+ text-align: center;
+ background-color: #00c1e0;
+ color: #fff;
+}
+
+.toolBarSubDisabled .ant-menu-submenu-title {
+ color: rgba(255, 255, 255, 0.35) !important;
+}
+
+.dark-select {
+ background-color: #eaeaea !important;
+}
+
+.clayout>* {
+ font-size: 12px !important;
+ color: #ff0000 !important;
+}
+
+.clayout .fastFilter>* {
+ font-size: 12px !important
+}
+
+/* 设置通用选择器下拉框文字大小 */
+.ant-select-dropdown {
+ font-size: 12px;
+}
+
+.ant-select-dropdown-menu-item:last-child {
+ height: 30px;
+}
+
+/* 通用时间选择框*/
+.ant-calendar-picker {
+ width: 100%;
+}
+
+.fastFilter .ant-input,
+.fastFilter .ant-select-selection__rendered {
+ font-size: 12px !important;
+ line-height: 32px;
+}
+
+.ant-table-column-has-filters .ant-table-filter-icon {
+ display: none !important;
+}
+
+.ant-table-column-has-filters:hover .ant-table-filter-icon {
+ display: block !important;
+}
+
+.ant-tabs-content {
+ height: 100%;
+}
+
+.staticEditTable .ant-table-thead>tr>th.ant-table-column-has-actions.ant-table-column-has-sorters.ant-table-column-has-filters {
+ padding-right: 24px !important;
+ position: relative;
+}
+
+.table>tr>th.ant-table-column-has-actions.ant-table-column-has-sorters.ant-table-column-has-filters {
+ padding-right: 30px !important;
+}
+
+.workorder-modal .ant-modal-content .ant-modal-body .searchMainForm {
+ padding: 0px !important;
+}
+
+.ant-select-search--inline .ant-select-search__field__wrap {
+ width: 100% !important;
+}
+
+#staticEditTable .ant-select-search--inline .ant-select-search__field__wrap {
+ width: 100% !important;
+ border-radius: 0px;
+}
+
+.product-plan-info-box {
+ height: 100vh;
+
+ .ant-spin-nested-loading {
+ height: 100%
+ }
+
+ .ant-spin-container {
+ height: 100%;
+ }
+}
+
+.product-plan-sider {
+ background-color: #fff !important;
+ float: left;
+
+ .ant-layout-sider-children {
+ display: flex;
+ flex-direction: column;
+ border: 1px solid #ddd;
+ border-top: 0px;
+ height: calc(~'100% - 60px');
+ }
+}
+
+#product-info-header .ant-select-selection--single,
+#product-info-header .ant-select-selection__rendered {
+ height: 20px !important;
+}
+
+#product-info-header .ant-form-item {
+ height: 20px !important;
+ margin-top: 3px;
+}
+
+#product-info-header .ant-form-item div {
+ height: 20px !important;
+}
+
+.product-plain-container-layout {
+ height: calc(~'100% - 60px')
+}
+
+/* 设置生产排程侧边栏样式 */
+.product-plan-sider {
+ .topTable {
+ height: 200px !important;
+ max-height: 200px;
+ overflow-y: auto !important;
+ }
+
+ .ant-table-scroll {
+ width: 100%;
+ height: 100%;
+ overflow-y: hidden !important;
+ overflow-y: hidden !important;
+ }
+
+ .ant-table-body {
+ height: 100%;
+ overflow-y: hidden !important;
+ overflow-x: hidden !important;
+ }
+}
+
+/* 产量上报 、物料需求表*/
+.xly-tab-table,
+.xly-MaterialRequirementPlane {
+ font-size: 12px;
+
+ .topTable {
+ height: 250px;
+ overflow-y: auto;
+ }
+
+ .ant-table-scroll {
+ overflow-x: hidden !important;
+ overflow-y: auto !important;
+ }
+
+ .ant-table-body {
+ max-height: none !important;
+ overflow-y: hidden !important;
+ overflow-x: auto !important;
+ }
+}
+
+/* 产量上报*/
+#productionReport {
+ .topTable {
+ height: 250px;
+ }
+}
+
+#productionReport .ant-table-body {
+ padding-bottom: 0px !important;
+ overflow-y: auto !important;
+}
+
+.xly-MaterialRequirementPlane table tr td div {
+ background: none;
+}
+
+.xly-MaterialRequirementPlane #staticEditTable td {
+ font-size: 12px !important;
+ color: #000 !important;
+ padding: 0 5px !important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ /*超出变成省略号 */
+}
+
+/* 计算方案 */
+#calTab .ant-btn {
+ font-size: 12px !important;
+}
+
+#calTab textarea.ant-input {
+ font-size: 12px !important;
+ height: 500px !important;
+ max-height: 500px !important;
+}
+
+/* 物料需求表*/
+.xly-MaterialRequirementPlane {
+ .topTable {
+ height: auto !important;
+ }
+}
+
+/* 物料需求展开明细表*/
+.materialRequirementPlane {
+ .topTable .ant-table-content .ant-table-scroll {
+ padding-bottom: 30px !important;
+ }
+
+ .ant-table-expanded-row {
+ .topTable .ant-table-content .ant-table-scroll {
+ height: auto !important;
+ overflow: auto !important;
+ overflow-x: auto !important;
+ /* 嵌套子表不要x滚动条 */
+ }
+
+ .ant-table-placeholder {
+ margin-top: 18px !important;
+ }
+ }
+}
+
+#expandTable td {
+ padding: 0 4px !important;
+ font-size: 12px !important;
+}
+
+.ant-select-selection__placeholder,
+.ant-select-search__field__placeholder {
+ margin-left: 3px;
+}
+
+.ant-table-fixed {
+ border: 0px !important;
+ border-radius: 0px;
+}
+
+.ant-table-thead>tr:first-child>th:first-child {
+ border-radius: 0px !important;
+}
+
+.ant-table-thead>tr:first-child>th:last-child {
+ border-radius: 0px !important;
+}
+
+
+/* 控制不显示-因fixed属性增加的表格双显示问题 */
+
+.ant-table-scroll table .ant-table-fixed-columns-in-body {
+ visibility: hidden !important;
+}
+
+/* 解决横向拉动覆盖fixed问题 */
+
+.ant-table.ant-table-scroll-position-left .ant-table-fixed-left {
+ height: 100%;
+ overflow: hidden !important;
+ z-index: 900;
+}
+
+
+
+.ant-modal-body {
+ padding-top: 12px !important;
+
+ .ant-col-5 {
+ width: 20%;
+ }
+}
+
+.ant-modal-footer {
+ border-top: 0 !important;
+}
+
+
+.ant-table-footer {
+ background: none !important;
+ border-top: none !important;
+}
+
+.ant-table-fixed-right {
+ z-index: 20 !important;
+}
+
+.ant-table-fixed-right .ant-table-body-outer {
+ margin-bottom: 0 !important;
+}
+
+/* 通用输入框是有边框 */
+.ant-select-auto-complete.ant-select .ant-input {
+ border-width: 1px !important;
+}
+
+/* 表格中输入框不设置边框 */
+table tr td .ant-select-auto-complete.ant-select .ant-input {
+ border-width: 0px !important;
+ ;
+}
+
+/* 所有单据通用滚动条 */
+.xly-bill-list .ant-table-scroll {
+ overflow-y: hidden !important;
+
+ .ant-table-body {
+ //padding-bottom: 30px;/* 解决固定列与内容滚动不联动 */
+ overflow-x: hidden !important;
+ //overflow-y: hidden!important;/* 解决固定列与内容滚动不联动 */
+ max-height: 100% !important;
+ height: 100% !important;
+ /* 合计行*/
+ }
+}
+
+/*基础信息*/
+.basicInfo .xly-bill-list .ant-table-scroll {
+ /*
+ 修改日期:2021-03-18
+ 修改人:吕杰
+ 区域:以下一行
+ 需求变更:fix 2104 解决table操作列下拉错位问题
+ 说明:下边距多加17px,为x轴滚动条预留空间
+ 原代码: padding-bottom: 30px;
+ */
+ padding-bottom: 47px;
+
+ .ant-table-body {
+ padding-bottom: 0px;
+ overflow-y: auto !important;
+ }
+}
+
+/* 生产施工单单据通用滚动条 */
+.xly-workorder-list .ant-layout {
+ background-color: #ffffff !important;
+}
+
+.xly-workorder-list {
+ height: 100vh;
+}
+
+/* 解决生产施工单下拉框没边框问题 */
+.xly-workorder-list .ant-select-selection__rendered {
+ line-height: 31px;
+}
+
+/* 解决通用单据CommonBill下拉框没边框问题 */
+.xly-bill-list .ant-select-selection__rendered {
+ line-height: 31px;
+}
+
+/* 解决通用单据CommonBill产品名称没边框问题*/
+.ant-select-auto-complete.ant-select .ant-select-search--inline {
+ height: 31px !important;
+}
+
+/* 解决通用头部带滚动条*/
+.ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ //overflow: hidden!important;
+ overflow-x: hidden !important;
+ overflow-y: scroll !important;
+ margin-bottom: 0px !important;
+ /*
+ 修改日期:2021-03-17
+ 修改人:吕杰
+ 区域:以下一行
+ 需求变更:解决在mac电脑上表头与表体之间存在间隙问题
+ */
+ padding-bottom: 0px !important;
+}
+
+.xly-bill-list .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: auto !important;
+}
+
+.xly-workorder-list .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: auto !important;
+}
+
+#StatementInfo .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: hidden !important;
+ /* 设计报表不设置表头Y滚动 */
+}
+
+.product-plan-sider,
+.xly-tab-table,
+.ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: hidden !important;
+ /* 不设置表头Y滚动 */
+}
+
+/* 设置通用头部滚动条样式 */
+.ant-table-fixed-header .ant-table-scroll .ant-table-header::-webkit-scrollbar {
+ width: 18px;
+ background-color: rgb(230, 230, 230, 1);
+}
+
+.MProcess .ant-modal-body {
+ padding-top: 0px !important;
+}
+
+.ant-modal-body #modalChooseProcess .ant-table-scroll {
+ overflow: hidden;
+ height: 100% !important;
+
+ .ant-table-body {
+ height: 295px !important;
+ /* 调整选择材料,选择工序高度为250,兼容1366*768*/
+ overflow: auto;
+ }
+
+ .ant-table-placeholder {
+ margin-top: -68px;
+ /*暂无数据样式调整*/
+ }
+}
+
+.sProcessParamsModal {
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: space-between;
+
+ .sProcessParamsModalType>span {
+ //margin-right: 7px;
+ width: 75px;
+ font-size: 12px;
+ }
+
+ .sProcessParamsModalType {
+ width: 47%;
+ margin-bottom: 10px;
+ margin-right: 10px;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+
+ .changeClassName {
+ border: 1px solid #d9d9d9;
+ flex: 1;
+ max-width: calc(100% - 75px);
+ }
+ }
+
+ .sProcessParamsModalType:nth-child(2n) {
+ margin-right: 0;
+ }
+}
+
+/* 选择工序弹出框列tree布局 */
+#modalChooseProcess .ant-tree {
+ font-size: 12px;
+}
+
+/* 选择工序树 */
+.xly-tree-box {
+ width: 179px;
+ border: 1px solid #d9d9d9;
+}
+
+.xly-tree-box .ant-form-item {
+ margin-bottom: 0px !important;
+}
+
+.xly-tree-title {
+ padding-left: 8px;
+ height: 30px;
+ line-height: 30px;
+ font-size: 12px;
+ color: #000;
+ font-weight: bold;
+ background-color: #f5f5f5;
+}
+
+//#modalChooseProcess .ant-col-5{
+// margin-left: 4px;
+//}
+//#modalChooseProcess .ant-col-15 .subForm___2sIdI{
+// margin-left: 0px!important;
+//}
+/* 快速下单单独样式调整 */
+.workorder-modal {
+ .ant-modal-body {
+ padding: 0 !important;
+ }
+
+ .ant-modal-footer {
+ padding: 13px 25px !important;
+ }
+}
+
+/* 备注弹出框设置 */
+.slaveMemo {
+ .ant-modal-body {
+ padding: 12px !important;
+ }
+
+ .ant-modal-footer {
+ padding: 0px 16px 12px 16px !important;
+ }
+
+ .ant-input[disabled] {
+ color: #000 !important;
+ }
+}
+
+/* 生产排程单独样式搜索框调整 */
+.product-plan-info-box .fastFilter___gHbps {
+ margin-left: 5px;
+}
+
+.product-plan-info-box .advCol___CU0FP {
+ left: 850px;
+}
+
+/* 材料备注弹出框样式 设置 */
+#ModalMaterialRemark .topTable {
+ height: 100%;
+
+ .ant-table-scroll {
+ height: 120px !important;
+ overflow-x: auto !important;
+ }
+
+ .ant-table-header {
+ width: max-content;
+ overflow-x: hidden !important;
+ /* 当暂无数据时,没有滚动条没法拉动,解决方案设置auto */
+ overflow-y: scroll !important;
+ }
+
+ .ant-table-content {
+ height: 100%;
+
+ .ant-table-scroll {
+ height: 100%;
+ }
+ }
+
+ .ant-spin-nested-loading {
+ height: 100%;
+
+ .ant-spin-container {
+ height: 100%;
+
+ .ant-table {
+ height: 100%;
+ }
+ }
+ }
+
+ .ant-table-body {
+ width: max-content;
+ height: 100%;
+ //height: 75px;
+ //max-height: 75px!important;
+ overflow-x: hidden !important;
+ overflow-y: auto !important;
+ //overflow-y: hidden!important; /* 设置固定列时 需要将ant-table-body y轴设置hidden*/
+ //border:1px solid #d9d9d9;
+ }
+
+ .ant-table-fixed-right .ant-table-body-inner {
+ height: 100%;
+ overflow-x: hidden !important;
+ overflow-y: scroll !important;
+ }
+
+ .ant-table-placeholder {
+ margin-top: 15px;
+ }
+}
+
+/* 包装订单Tree样式 */
+#ModalMaterialRemark .xly-bill-pack {
+ display: flex;
+
+ .controlhandcover {
+ width: 30%;
+ }
+
+ .ant-table-scroll {
+ height: 180px !important;
+ overflow-x: auto !important;
+ }
+
+ //.ant-table-body{
+ // overflow-x: auto!important;
+ //}
+ .controlhandcover.ant-layout-sider {
+ background-color: #fafafa !important;
+ font-size: 12px;
+ font-weight: normal;
+ writing-mode: horizontal-tb;
+ flex: 0 0 27% !important;
+ max-width: 27% !important;
+ margin-right: 5px;
+ }
+
+ .xly-control {
+ width: 100%;
+ height: 100%;
+ position: relative;
+ }
+
+ .xly-control-tree {
+ text-align: left !important;
+ width: 100%;
+ padding-left: 20px;
+ min-height: 35px !important;
+
+ .ant-tree {
+ text-align: left;
+ }
+
+ #staticEditTree {
+ width: 100%;
+ height: 120px;
+ overflow: auto;
+
+ .ant-tree-child-tree {
+ font-size: 12px;
+ }
+ }
+
+ .ant-tree>li {
+ padding: 3px !important;
+ }
+ }
+
+ .xly-control-operate {
+ position: absolute;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ background-color: #f5f5f5;
+ height: 24px !important;
+ line-height: 24px !important;
+ display: flex;
+ justify-content: space-around;
+ }
+}
+
+#chooseProcessModal .topTable {
+ .ant-table-scroll {
+ height: 180px !important;
+ }
+}
+
+/* 选择合拼产品 */
+#packModal .topTable {
+ .ant-table-scroll {
+ height: 350px !important;
+ }
+}
+
+/* 列自定义配置 */
+#searchColumn .topTable {
+ .ant-table-scroll {
+ width: max-content !important;
+ overflow: hidden !important;
+ overflow: auto !important;
+ }
+
+ .ant-table-header {
+ width: max-content !important;
+ }
+
+ .ant-table-body {
+ height: 400px;
+ max-height: 400px !important;
+ overflow-x: auto !important;
+ overflow-y: scroll !important;
+ border-left: 1px solid #d9d9d9;
+ border-bottom: 1px solid #d9d9d9;
+ width: max-content !important;
+ }
+}
+
+/* Moal-价格更新样式 */
+.priceUpdate {
+ span:last-child {
+ border-bottom: 1px solid #d9d9d9 !important;
+ }
+
+ .ant-input-group-addon {
+ line-height: 0.9 !important;
+ width: 20% !important;
+ border-radius: 0 !important;
+ border-bottom: 0px !important;
+ }
+
+ input[type='text'] {
+ border-bottom: 0px;
+ }
+}
+
+/* CommonBill 导入数据 */
+#btnImportData {
+ width: 100px;
+ height: 24px;
+ //background-color: rgb(100,100,100,100);
+ //position: relative;
+ //text-align: center;
+ //left:951px;
+ //top:-27px;
+ position: absolute;
+ text-align: center;
+ right: 60px;
+ top: 3px;
+ z-index: 999;
+}
+
+.btnGroupHasImport {
+ width: calc(100% - 120px);
+}
+
+#btnImportData i {
+ margin-right: 8px;
+}
+
+#btnImportData button {
+ opacity: 0;
+ top: 0;
+ left: 0;
+ position: absolute;
+ width: 100%;
+ height: 100%;
+}
+
+.importData.true {
+ color: rgb(250, 250, 250, 250) !important;
+}
+
+.importData.undefined span {
+ color: #a2a2a2 !important;
+}
+
+.importData.false span {
+ color: #a2a2a2 !important;
+}
+
+.importData.true span {
+ color: #ffffff;
+}
+
+.importData span:hover {
+ color: #1890FF !important;
+}
+
+/* 审核信息界面 */
+//#AudiInfomation .subForm___2sIdI{
+// margin-right: 0px!important;
+// background: #fff;
+//}
+/* 生产排程按钮样式 */
+#product-info-header span[disabled] {
+ color: #a2a2a2 !important;
+}
+
+#product-info-header span[disabled]:hover {
+ color: #1890FF !important;
+}
+
+#product-info-header span:hover {
+ color: #1890FF !important;
+
+ img {
+ opacity: 0.3;
+ filter: alpha(opacity=30);
+ /* 设置透明度 */
+ background-color: #1890FF !important;
+ }
+}
+
+#product-info-header img {
+ width: 14px;
+ height: 14px;
+ margin-right: 8px;
+}
+
+#product-info-header img[disabled] {
+ opacity: 0.5;
+ filter: alpha(opacity=50);
+ /* 设置透明度 */
+}
+
+#product-info-header i {
+ margin-right: 8px;
+}
+
+/* 会计期间 */
+.financePeriod {
+ .ant-table-fixed-header .ant-table-scroll .ant-table-header {
+ overflow-y: scroll !important;
+ }
+
+ .ant-table-body {
+ height: 370px;
+ overflow-y: auto !important;
+ }
+}
+
+/* 列表弹出树 */
+.xly-eject {
+ position: fixed;
+ top: 50%;
+ right: 0px;
+}
+
+.xly-eject img {
+ width: 50px;
+ height: 50px;
+}
+
+/* 列表过滤树 */
+.xly-filter-tree {
+ border-radius: 4px;
+ display: none;
+ width: 300px;
+ background-color: #fff;
+ position: fixed;
+ top: 80px;
+ right: 0px;
+ z-index: 20000;
+ box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.05)
+ /*阴影出现在元素的左侧*/
+}
+
+.xly-filter-tree #staticEditTree {
+ width: 280px;
+ margin: 10px auto;
+ height: calc(100vh - 100px);
+ overflow: auto;
+
+ .ant-tree-child-tree {
+ font-size: 12px;
+ }
+}
+
+.xly-tree-close {
+ position: fixed;
+ right: 300px;
+ top: 50%;
+}
+
+.xly-tree-close img {
+ width: 40px;
+ height: 40px;
+}
+
+/* 工单悬浮窗 */
+.xly-workorder-list .xly-eject {
+ width: 50px;
+ height: 50px;
+ left: 0px;
+ z-index: 2;
+}
+
+.xly-workorder-list .xly-filter-tree {
+ width: 210px;
+ left: 0px;
+ top: 40%;
+ background: #fff;
+ border-radius: 4px;
+ box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.05);
+ overflow-y: auto;
+ padding-left: 20px;
+}
+
+.xly-workorder-list .xly-filter-tree #staticEditTree {
+ width: 100%;
+ height: 100%;
+ max-height: calc(55vh);
+ overflow-y: auto !important;
+ overflow-x: hidden !important;
+}
+
+.xly-workorder-list .xly-tree-close {
+ left: 210px;
+ top: 43%;
+}
+
+/* 下拉框为空 */
+.dropdown-empty {
+ height: 30px;
+}
+
+
+#modalChooseProcess {
+ .ant-tree.ant-tree-show-line li span.ant-tree-switcher {
+ background: none;
+ }
+
+ .ant-tree.ant-tree-show-line li:not(:last-child):before {
+ margin: 0;
+ }
+
+ .ant-tree>li[role=treeitem] {
+ &:before {
+ border-left: none;
+ }
+ }
+
+ .ant-tree-child-tree {
+ .process {
+ max-width: 48px !important;
+ }
+
+ .ant-tree-switcher-noop {
+ display: none;
+ }
+
+ li[role=treeitem] {
+ padding-left: 24px;
+
+ &:before {
+ content: ' ';
+ width: 1px;
+ border-left: 1px solid #bbbbbb;
+ height: 100%;
+ position: absolute;
+ left: 12px;
+ margin: 0px 0;
+ }
+
+ &:after {
+ content: ' ';
+ width: 8px;
+ height: 1px;
+ background: #bbbbbb;
+ position: absolute;
+ left: 13px;
+ top: 18px;
+ margin: 0px 0;
+ }
+ }
+
+ li[role=treeitem]:last-child {
+ &:before {
+ content: ' ';
+ width: 1px;
+ border-left: 1px solid #bbbbbb;
+ height: ~"calc(50% - 1px)";
+ position: absolute;
+ left: 12px;
+ margin: 0px 0;
+ }
+ }
+ }
+}
+
+/* 审核进度条 */
+.dataAuditProgress {
+ width: 20%;
+ height: 5%;
+ position: fixed;
+ bottom: 1%;
+ left: 1%;
+}
+
+/* 变量设定 */
+.customizeParam {
+ .ant-table-body {
+ max-height: 350px !important;
+ overflow: auto !important;
+ }
+}
+
+.commonNewBillContainer {
+ .ant-table-pagination.ant-pagination {
+ /* 工单从表分页 */
+ position: sticky;
+ margin: 10px 0px 0px 0px;
+ }
+}
+
+.subbill {
+ .ant-table-pagination.ant-pagination {
+ /* subbill分页组件样式 */
+ position: absolute !important;
+ margin: 10px 0px 0px 0px;
+ bottom: -38px;
+ }
+}
+
+.hasSlave {
+ .ant-table-pagination.ant-pagination {
+ /* commonListTab从表分页组件样式 */
+ position: absolute !important;
+ margin: 10px 0px 0px 0px;
+ bottom: -34px;
+ }
+}
+
+
+
+// 工单系统弹窗样式
+.workOrderSystemModal {
+ :global {
+ .ant-modal-close {
+ color: #4a495f !important;
+ }
+
+ .ant-modal-close-x {
+ width: 30px;
+ }
+
+ .ant-modal-header {
+ background-color: #e1edfe !important;
+ border: 0;
+
+ .ant-modal-title {
+ font-size: 14px;
+ color: #4a495f !important;
+
+ span:nth-child(1) {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ display: inline-block;
+ max-width: 30vw;
+ }
+ }
+ }
+
+ .ant-modal-body {
+ padding: 0 !important;
+ }
+ }
+}
+
+.commonAntSpace {
+ width: 100%;
+
+ :global {
+ .ant-space-item:nth-child(1) {
+ width: 100%;
+ }
+
+ .ant-space-item:nth-child(2) {
+ width: auto;
+ }
+ }
+}
+
+// 自定义单据工艺卡选择
+.costomTabBillProcessCard {
+ position: relative;
+ width: 100%;
+ height: 30px;
+ padding: 0 0 0 20px;
+
+ :global {
+ .radioDiv {
+ width: 100%;
+ height: 30px;
+ display: flex;
+ align-items: center;
+
+ .viewStyle {
+ background-color: rgb(240, 242, 245);
+ font-size: 14px !important;
+ }
+
+ .viewStyle input[disabled] {
+ font-size: 14px !important;
+ }
+
+ .ant-col-7 {
+ background: none !important;
+ color: rgb(0, 0, 0, 0.65) !important;
+
+ label {
+ font-size: 14px !important;
+ }
+ }
+
+ .ant-radio-wrapper-disabled {
+ span {
+ color: rgba(0, 0, 0, 0.88) !important;
+ }
+ }
+ }
+ }
+}
+
+.costomTabBillProcessCardTab {
+ height: calc(100% - 80px);
+}
+
+.costomTabBillTable {
+ :global {
+ .ant-table-expanded-row-fixed {
+ padding: 20px 20px 35px 0 !important;
+ }
+
+ .ant-spin-container {
+ background: #FFF;
+ }
+ }
+}
+
+.costomTabBillDiff {
+ :global {
+ .ant-form-item-control-input-content {
+ .ant-input {
+ color: red !important;
+ }
+ }
+ }
+}
+
+// .costomTabBillAutoHeight {
+// :global {
+// .virtuallist {
+// height: auto !important;
+// }
+// }
+// }
+
+.costomTabBillDivider {
+ :global {
+
+ // .ant-divider-horizontal.ant-divider-with-text-left::before {
+ // width: 70px !important;
+ // }
+ .ant-form-item[class*="subForm"] {
+ margin-bottom: 0 !important;
+ }
+
+ /* 订单评审 材料信息 折叠Pane */
+ .ant-collapse>.ant-collapse-item>.ant-collapse-header {
+ padding: 0px 0px 0px 8px !important;
+ }
+
+ span.ant-radio+* {
+ font-size: 12px !important;
+ }
+
+ }
+}
+
+.costomTabDelAll {
+ position: absolute;
+ top: -22px;
+ right: 0;
+ z-index: 15;
+
+ :global {
+ .ant-btn {
+ height: 22px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+}
+
+.leftTab {
+ position: absolute;
+ top: 8px;
+ left: 0;
+ z-index: 1;
+
+ :global {
+ .ant-radio-group {
+ display: flex;
+ flex-direction: column;
+
+ .ant-radio-button-wrapper {
+ height: auto;
+ }
+
+ span {
+ display: block;
+ width: 15px;
+ line-height: 20px;
+ }
+ }
+ }
+}
+
+
+.xlyCommonBase {
+ .ant-tabs-nav-list {
+ visibility: hidden;
+ }
+}
+
+.CommonTabModal {
+ header {
+ display: none !important;
+ }
+
+ .ant-layout {
+ padding: 10px 0 0 0 !important;
+ }
+}
+
+#modalChooseProcess td.ant-table-cell-fix-right-first {
+ background-color: #fff;
+}
+
+.oper {
+ display: flex;
+ width: 22%;
+ height: 38px;
+ justify-content: space-between;
+}
+
+
+.sActiveIdStyle {
+ top: 0;
+}
+
+.select-table-option {
+ max-width: 100wh;
+ overflow: hidden;
+
+ .select-table {
+ td {
+ font-weight: normal !important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+}
+
+.select-search {
+ box-sizing: border-box;
+ padding: 5px;
+ background: #f1f1f1;
+}
+
+.select-pagination {
+ padding: 5px 0;
+ margin-bottom: -5px;
+ background: #f1f1f1;
+ display: flex;
+ justify-content: space-between;
+}
+
+.toolbarIcon {
+ width: 13px;
+ height: 13px;
+ display: inline-block;
+ fill: #fff;
+ stroke: #fff;
+ margin-right: 3px;
+ position: relative;
+ top: 2px;
+}
+
+.commonNewBillContainer {
+ .ant-form-item-control-input-content {
+ .ant-input-number {
+ width: 100% !important;
+
+ .ant-input-number-input {
+ height: 28px;
+ }
+ }
+ }
+}
+
+.homeTab {
+ width: 80px;
+ text-align: center;
+ font-size: 14px;
+ cursor: pointer;
+
+ span {
+ margin-left: 8px;
+ }
+}
+
+.homeTab__active {
+ color: var(--xly-skin-active-color, #1890FF);
+}
+
+.mainTabWrap {
+ &>.ant-tabs-nav {
+ .ant-tabs-tab {
+ &:first-child {
+ display: none;
+ }
+ }
+ }
+}
+
+.placeHidden {
+ opacity: 0;
+ visibility: hidden;
+}
+
+.ant-tabs-dropdown-menu {
+ padding: 0px !important;
+}
+
+// 空表单margin高度改为0
+.ant-empty-normal {
+ margin: 0 !important;
+
+ .ant-empty-image {
+ display: none;
+ }
+}
+
+.custom-collapse {
+ .ant-collapse-item {
+ border-bottom: 1.5px solid #f5f5f5;
+ }
+
+ .ant-collapse-content-box {
+ padding: 0;
+ }
+
+ .ant-collapse-header {
+ font-size: 14px;
+ font-weight: bold;
+ background: rgba(204, 204, 204, 1);
+ }
+
+ .ant-collapse-content {
+ border-top: none;
+ }
+
+ .ant-table-container {
+ border-left: none !important;
+ }
+
+ .ant-collapse-extra {
+ margin-left: 8px !important;
+ }
+}
+
+div,
+span,
+p,
+input,
+textarea {
+ font-family: @font_family !important;
+}
+
+#slaveTabs {
+ margin-top: 8px;
+ height: auto;
+}
+
+#slaveTabs::-webkit-scrollbar {
+ width: 1px;
+ background-color: rgb(230, 230, 230, 1);
+ opacity: 5%;
+}
+
+tr.ant-table-measure-row {
+ td {
+ padding: 0;
+ }
+}
+
+tr:not(.ant-table-measure-row) {
+ td {
+ padding: 4px;
+ }
+}
+
+.xly-bill-list,
+.xly-workorder-list,
+.other-list,
+.productPlan {
+ td {
+ padding: 0 !important;
+
+ .listDiv {
+ padding: 4px;
+ }
+ }
+}
+
+// 处理表单详情的样式问题开始
+button.ant-table-row-expand-icon {
+ margin-left: ~'calc(50% - 9px)';
+}
+
+.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table {
+ margin: 0 0 0 47px;
+}
+
+.ant-table-bordered .virtuallist>table>.ant-table-tbody>tr>td {
+ border-right: 1px solid #d9d9d9 !important;
+}
+
+// 处理表单详情的样式问题结束
+
+.ant-input {
+ padding: 3px 4px;
+}
+
+.ant-input-number-input {
+ padding: 3px 4px;
+ font-size: 12px;
+}
+
+.ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
+ //padding: 3px 4px;
+}
+
+td {
+
+ .ant-input:focus,
+ .ant-input-focused {
+ border: none;
+ box-shadow: none;
+ }
+
+ .ant-picker-focused {
+ border: none;
+ box-shadow: none;
+ }
+
+ .ant-select-focused {
+ border: none;
+ box-shadow: none;
+ outline: none;
+
+ .ant-select-selector {
+ border: none;
+ box-shadow: none !important;
+ outline: none;
+ }
+ }
+
+ .ant-input-number-focused {
+ border: none;
+ box-shadow: none;
+ }
+
+ .ant-select:not(.ant-select-customize-input) .ant-select-selector {
+ padding: 0 4px;
+ border: none;
+ line-height: 26px;
+ height: 26px;
+ background-color: transparent;
+ }
+
+ .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
+ line-height: 26px;
+ height: 26px;
+ background-color: transparent;
+ }
+
+ .ant-input {
+ border: none;
+ background-color: transparent;
+ }
+
+ .ant-input-number {
+ border: none;
+ background-color: transparent;
+ }
+
+ .ant-picker {
+ border: none;
+ padding: 3px 4px 3px;
+ background-color: transparent;
+ }
+}
+
+.noInput {
+ max-width: 100%;
+ min-height: @cell-height;
+ line-height: @cell-height;
+ display: block; // inline-block会引发line-height问题
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+
+ &>span {
+ padding: @td_padding_sub;
+ }
+}
+
+input[disabled] {
+ color: #000 !important;
+ background: #fff !important;
+ font: 12px @font_family;
+ line-height: 1.66667;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.ant-select-selector {
+ color: #000 !important;
+}
+
+.ant-form-item-control-input-content {
+ //height: 100%;
+ min-height: @cell-height;
+ line-height: @cell-height;
+}
+
+tbody {
+ color: #000;
+ font-size: 12px;
+
+ tr:not(.selected-record-row):not(.ant-table-expanded-row-level-1) {
+ &:hover {
+ background: #fff7e6 !important;
+
+ td {
+ background: #fff7e6 !important;
+ font-weight: bold;
+ }
+
+ .sActiveIdStyle {
+ background: #fff7e6 !important;
+ }
+ }
+ }
+
+ .ant-input-number {
+ max-width: 100%;
+ }
+
+ input[disabled] {
+ border: none;
+ padding: @td_padding_sub;
+ background: transparent !important;
+ }
+
+ button[class*='ant-table-row-expand-icon']+.changeClassName {
+ display: inline;
+ }
+
+ .changeClassName {
+ .ant-checkbox {
+ padding: @td_padding_sub;
+ }
+ }
+
+ .ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector {
+ background-color: transparent;
+ color: #000 !important;
+ }
+
+ .ant-select-single .ant-select-selector .ant-select-selection-search {
+ left: 4px;
+ background-color: transparent;
+ line-height: @cell-height;
+ display: inline-block;
+ }
+
+ .sActiveIdStyle {
+ height: 100%;
+ max-width: 100%;
+ padding: @td_padding_sub;
+ font-size: 12px;
+ z-index: 9;
+ white-space: nowrap;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ background: #fff;
+ top: 0;
+ left: 0;
+ position: absolute !important;
+
+ &+.ant-select {
+ display: none;
+ }
+
+ &+input {
+ //display: none;
+ }
+
+ span {
+ font-size: 12px;
+ position: relative;
+ top: 50%;
+ transform: translateY(-50%);
+ display: inline-block;
+ cursor: pointer;
+
+ &:hover {
+ text-decoration: underline;
+ }
+ }
+
+ .viewChooseSpan {
+ display: block;
+ top: 14px;
+ white-space: nowrap;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ }
+ }
+
+ .sActiveIdStyle_viewChooseSpan {
+ width: 100%;
+ }
+
+ .sActiveIdStyleNone,
+ .sActiveIdStyleBlock {
+ &+.ant-select {
+ display: block;
+ }
+ }
+
+ .ant-table-row-indent+button.ant-table-row-expand-icon {
+ margin-left: 6px;
+ margin-top: 6px;
+ }
+}
+
+.xlyCommonTable.tableEnabled tbody {
+ tr:not(.selected-record-row):not(.ant-table-expanded-row-level-1) {
+ &:hover {
+ background: #FFF !important;
+
+ td {
+ background: #FFF !important;
+ font-weight: bold;
+ }
+
+ .sActiveIdStyle {
+ background: #FFF !important;
+ }
+
+ .readonlyStyle {
+ background: #f1f2f8 !important;
+
+ .sActiveIdStyle {
+ background: #f1f2f8 !important;
+ }
+ }
+ }
+ }
+
+ .readonlyStyle {
+ background: #f1f2f8 !important;
+
+ .sActiveIdStyle {
+ background: #f1f2f8 !important;
+ }
+ }
+
+ .ant-input-search {
+ height: 25px;
+ top: -2px;
+
+ .ant-input-group-addon {
+ left: 0;
+
+ .ant-input-search-button {
+ height: 26px;
+ }
+ }
+ }
+}
+
+.ant-modal {
+ max-width: unset;
+}
+
+.xlyCommonTable:not(.tableEnabled) .ant-table-tbody>tr.ant-table-row-selected>td {
+ background: #e6f7ff;
+}
+
+.xlyCommonTable.tableEnabled .ant-table-tbody>tr.ant-table-row:hover>td,
+.ant-table-tbody>tr>td.ant-table-cell-row-hover {
+ background: initial;
+}
+
+@selected-line-border-color: #1296db;
+
+.xlyCommonTable.tableEnabled .ant-table-tbody>tr.ant-table-row-selected,
+.xlyCommonTable.tableEnabled .ant-table-tbody>tr.selected-record-row {
+
+ // box-shadow: 0px 2px 0px 0px #2400ff inset, 0px -2px 0px 0px red inset;
+ >td {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+
+ .sActiveIdStyle {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+
+ .readonlyStyle {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+
+ .sActiveIdStyle {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+
+ // background-color: transparent !important;
+ // border: 1px solid @selected-line-border-color !important;
+ // border-left: 0 !important;
+ // border-right: 0 !important;
+ &:first-child {
+ // border-left: 1px solid @selected-line-border-color !important;
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+
+ .sActiveIdStyle {
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+
+ .readonlyStyle {
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+
+ .sActiveIdStyle {
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ }
+
+ &:last-child {
+ // border-right: 1px solid @selected-line-border-color !important;
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+
+ .sActiveIdStyle {
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+
+ .readonlyStyle {
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+
+ .sActiveIdStyle {
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ }
+ }
+
+ // &.dark-record-row {
+ // >td {
+ // background-color: #f5f5f5 !important;
+ // }
+ // }
+}
+
+.xlyCommonTable.tableEnabled .ant-table-tbody>tr.selected-record-row {
+ >td {
+ .readonlySpanStyle {
+ box-shadow: 0px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+
+ &:first-child {
+ .readonlySpanStyle {
+ box-shadow: 1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+
+ &:last-child {
+ .readonlySpanStyle {
+ box-shadow: -1px 1px 0px 0px @selected-line-border-color inset, 0px -1px 0px 0px @selected-line-border-color inset;
+ }
+ }
+ }
+}
+
+// .ant-table-bordered .virtuallist>table>.ant-table-tbody>tr.ant-table-row-selected {
+// >td {
+// &:last-child {
+// border-right: 1px solid @selected-line-border-color !important;
+// }
+// }
+// }
+
+
+.selected-record-row {
+ background-color: #e6f7ff !important;
+ font-weight: bold;
+
+ input {
+ font-weight: bold;
+ }
+
+ td {
+ background: #e6f7ff !important;
+ font-weight: bold;
+ }
+
+ .ant-input-number-disabled {
+ background: transparent;
+ transition: unset;
+ border: none;
+ width: unset;
+ }
+
+ .sActiveIdStyle {
+ background: #e6f7ff !important;
+ }
+
+ .ant-select-selector {
+ transition: unset;
+ }
+}
+
+.xlyCommonTable.tableEnabled .selected-record-row {
+ background-color: #FFF !important;
+
+ td {
+ background: #FFF !important;
+ }
+
+ .sActiveIdStyle {
+ background: #FFF !important;
+ }
+}
+
+.ant-form-item-label {
+ vertical-align: middle;
+ display: inline-block;
+ text-align: left !important;
+}
+
+.ant-form-item-label label {
+ //color: rgba(0, 0, 0, 0.65)!important;
+ color: inherit !important;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ padding-right: 0 !important;
+ text-align: left;
+
+ &:before {
+ content: '';
+ width: 10px;
+ }
+}
+
+.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before {
+ width: auto;
+}
+
+.ant-form-item-label .ant-form-item-required {
+ font-size: 12px !important;
+ left: 0px;
+}
+
+.commonCheckBill {
+ .sActiveIdStyle {
+ left: 1px;
+ top: 1px;
+ width: ~'calc(100% - 2px)';
+ height: ~'calc(100% - 2px)';
+ }
+
+ .ant-input-number {
+ width: 100% !important;
+ }
+}
+
+.searchMainForm {
+ .sActiveIdStyle {
+ left: 1px;
+ top: 1px !important;
+ padding: 0px !important;
+ max-width: 90% !important;
+ //width: ~'calc(100% - 2px)'!important;
+ height: ~'calc(100% - 2px)' !important;
+ background: #fff;
+ }
+
+ .sActiveIdStyle-sMemo {
+ max-width: 100% !important;
+ }
+
+ #sMemo {
+ margin-bottom: 0;
+ }
+
+ .ant-input-number {
+ width: 100% !important;
+ }
+
+ .masterMemo {
+ background-color: #f1f2f8 !important;
+ color: #000 !important;
+ top: 4px !important;
+ left: 1px !important;
+ height: ~'calc(100% - 9px)' !important;
+ line-height: 20px;
+ letter-spacing: -1px;
+ font-family: Monospaced Number, Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif !important
+ }
+}
+
+.suit .searchMainForm {
+ .sActiveIdStyle {
+ left: 8px;
+ }
+}
+
+.insertTd {
+ z-index: 999 !important;
+}
+
+.ant-form-item {
+ margin-bottom: 0;
+}
+
+.linksActiveIdStyle {
+ color: @active_color2 !important;
+ cursor: pointer;
+ backgroundColor: transparent !important;
+ padding: 4px 0px;
+}
+
+.linksActiveIdStyle:hover {
+ text-decoration: underline !important;
+}
+
+.ant-checkbox-wrapper {
+ line-height: 14px;
+}
+
+.ant-tabs-tab.ant-tabs-tab-disabled {
+ &:hover {
+ color: rgba(0, 0, 0, 0.25) !important;
+ }
+}
+
+// 因紧凑型主题,修改部分过小的样式
+.ant-tabs-tab {
+ font-size: 14px;
+}
+
+#allBtnNav {
+ font-size: 14px;
+
+ &[disabled] {
+ &:hover {
+ color: unset !important;
+ }
+ }
+}
+
+.ant-card-head {
+ font-size: 14px;
+}
+
+// end
+// tab样式与老版本统一
+.ant-tabs-content-holder {
+ .ant-tabs-nav-wrap {
+ background: #fff;
+
+ .ant-tabs-nav-list {
+ background: #fff;
+
+ .ant-tabs-tab {
+ border: 1px solid #d9d9d9;
+ border-right: 0;
+ padding: 0 18px;
+ height: 30px;
+ line-height: 30px;
+ margin-left: 0;
+ background: #fafafa;
+
+ &:nth-last-child(2) {
+ border-right: 1px solid #d9d9d9;
+ }
+ }
+
+ .ant-tabs-tab-active {
+ border-bottom: 1px solid transparent;
+ background: #fff;
+ }
+
+ .ant-tabs-ink-bar {
+ top: 0;
+ bottom: unset;
+ }
+ }
+ }
+}
+
+// end
+.input24 {
+ :global {
+ .ant-col-2.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 24 * 100%)';
+ }
+
+ .ant-col-22.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 87 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 87 / 24 * 100%)';
+ }
+
+ .ant-col-7.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 24 * 100%)';
+ }
+
+ .ant-col-15.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 87 / 24 * 100%)';
+ max-width: ~'calc(0.25 * 87 / 24 * 100%)';
+ }
+ }
+}
+
+.input18 {
+ :global {
+ .ant-col-7.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 18 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 18 * 100%)';
+ }
+
+ .ant-col-15.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 42 / 12 * 100%)';
+ max-width: ~'calc(0.25 * 42 / 12 * 100%)';
+ }
+ }
+}
+
+.input12 {
+ :global {
+ .ant-col-7.ant-form-item-label {
+ flex: 0 0 ~'calc(0.25 * 7 / 12 * 100%)';
+ max-width: ~'calc(0.25 * 7 / 12 * 100%)';
+ }
+
+ .ant-col-15.ant-form-item-control {
+ flex: 0 0 ~'calc(0.25 * 39 / 12 * 100%)';
+ max-width: ~'calc(0.25 * 39 / 12 * 100%)';
+ }
+ }
+}
+
+.ant-table-pagination.ant-pagination {
+ position: fixed;
+ bottom: 0;
+ right: 8px;
+ z-index: 999;
+}
+
+.ant-table-summary td {
+ padding: 4px !important;
+ text-align: center;
+}
+
+.ant-table-column-title {
+ moz-user-select: -moz-none;
+ -moz-user-select: none;
+ -o-user-select: none;
+ -khtml-user-select: none;
+ -webkit-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ text-overflow: ellipsis;
+ overflow: hidden;
+}
+
+#calTab {
+ .ant-tabs>.ant-tabs-nav {
+ margin-bottom: 0;
+ }
+
+ .formula {
+ textarea.ant-input {
+ height: 140px !important;
+ }
+ }
+}
+
+/* 调整系统权限界面 */
+#SysPermissionList {
+ .ant-tree {
+ margin-top: 1px;
+ border: 1px solid #d9d9d9;
+ overflow-y: auto;
+ height: 516px;
+ }
+
+ .ant-tabs-nav {
+ margin-bottom: 0;
+ //border-bottom: 1px solid #d9d9d9;
+ }
+
+ #staticEditTree .ant-input-search {
+ //width: 63%
+ width: 405px;
+ }
+}
+
+#modalChooseProcess,
+#modalChooseProductMaterial {
+ .ant-table-pagination.ant-pagination {
+ position: static;
+ }
+}
+
+.xly-eject {
+ z-index: 999;
+}
+
+.xly-normal-list {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+.xly-normal-list1 {
+ padding-left: 0;
+ padding-right: 0;
+}
+
+.react-resizable {
+ user-select: none;
+}
+
+.xly-workorder-list {
+ .ant-layout {
+ overflow: hidden;
+ }
+}
+
+.ant-table-sticky-holder {
+ z-index: 15;
+}
+
+thead {
+
+ .ant-table-cell-fix-left,
+ .ant-table-cell-fix-right,
+ .ant-table-cell-fix-left-last,
+ .ant-table-cell-fix-left-first,
+ .ant-table-cell-fix-right-first,
+ .ant-table-cell-fix-right-last,
+ .ant-table-cell-fix-sticky {
+ z-index: 15;
+ }
+}
+
+tbody {
+
+ .ant-table-cell-fix-left,
+ .ant-table-cell-fix-right,
+ .ant-table-cell-fix-left-last,
+ .ant-table-cell-fix-left-first,
+ .ant-table-cell-fix-right-first,
+ .ant-table-cell-fix-right-last,
+ .ant-table-cell-fix-sticky {
+ z-index: 10;
+ }
+
+ .ant-select-multiple.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector {
+ background: none;
+ }
+
+ .ant-select-disabled.ant-select-multiple .ant-select-selection-item {
+ background: none;
+ border: none;
+ color: #000;
+ padding-left: 0px;
+ }
+}
+
+.modalChooseProcessContent,
+#modalChooseProcess,
+#modalChooseProcessContent,
+#modalChooseProductMaterial {
+
+ .ant-table-body,
+ #staticEditTree {
+ height: @modal-table-height;
+ }
+}
+
+.dark-mode {}
+
+.ant-table-sticky-scroll {
+ display: none;
+}
+
+.ant-table-body::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+.ant-table-body::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+}
+
+/*鼠标悬浮在该类指向的控件上时滑块的样式*/
+.ant-table-body:hover::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+}
+
+/*鼠标悬浮在滑块上时滑块的样式*/
+.ant-table-body::-webkit-scrollbar-thumb:hover {
+ background-color: rgba(180, 180, 180, 1);
+}
+
+/*正常时候的主干部分*/
+.ant-table-body::-webkit-scrollbar-track {
+ background: #f5f5f5;
+}
+
+/*鼠标悬浮在滚动条上的主干部分*/
+.ant-table-body::-webkit-scrollbar-track:hover {
+ background: #f5f5f5;
+}
+
+.ant-table-body::-webkit-scrollbar-corner {
+ background: rgba(204, 204, 204, 1);
+}
+
+.custom-scroll::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+.custom-scroll::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+}
+
+/*鼠标悬浮在该类指向的控件上时滑块的样式*/
+.custom-scroll:hover::-webkit-scrollbar-thumb {
+ background-color: rgba(204, 204, 204, 1);
+ //border-radius: 10px;
+}
+
+/*鼠标悬浮在滑块上时滑块的样式*/
+.custom-scroll::-webkit-scrollbar-thumb:hover {
+ background-color: rgba(180, 180, 180, 1);
+}
+
+/*正常时候的主干部分*/
+.custom-scroll::-webkit-scrollbar-track {
+ background: #f5f5f5;
+}
+
+/*鼠标悬浮在滚动条上的主干部分*/
+.custom-scroll::-webkit-scrollbar-track:hover {
+ background: #f5f5f5;
+}
+
+.custom-scroll::-webkit-scrollbar-corner {
+ background: rgba(204, 204, 204, 1);
+}
+
+.row-dragging {
+ background: #fafafa;
+ border: 1px solid #ccc;
+ z-index: 99999;
+ height: 29px;
+ line-height: 29px;
+ overflow: hidden;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ //font-size: 12px!important;
+ //td, span, input, div{
+ // display: inline-block!important;
+ // padding: 0;
+ // margin: 0;
+ // height: 29px!important;
+ // line-height: 20px!important;
+ // font-size: 12px!important;
+ //}
+}
+
+.row-dragging .drag-visible {
+ visibility: visible !important;
+ opacity: 1 !important;
+}
+
+.xly-workorder-list {
+ .ant-tabs-nav {
+ margin-bottom: 0;
+ }
+}
+
+.drag-visible {
+ text-align: center;
+}
+
+.insertTd {
+ z-index: 999 !important;
+}
+
+.ant-table-small .ant-table-thead>tr>th {
+ background: #f5f5f5;
+}
+
+.ant-modal-mask {
+ z-index: 999;
+}
+
+.commonCheckBillContainer {
+ .ant-table-pagination.ant-pagination {
+ position: static;
+ }
+}
+
+.ant-tabs {
+ overflow: unset;
+}
+
+.operate-bar {
+ min-height: 28px;
+
+ a {
+ width: 40px;
+ margin: 0 !important;
+ position: relative;
+
+ img {
+ display: block;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: auto;
+ }
+
+ svg {
+ display: block;
+ position: absolute !important;
+ top: 0 !important;
+ bottom: 0;
+ left: 0 !important;
+ right: 0;
+ margin: auto;
+ }
+ }
+}
+
+.ant-tree-switcher-leaf-line::before {
+ right: 10px;
+}
+
+.masterLinkSpan {
+ width: auto;
+ height: 26px;
+ line-height: 26px;
+ overflow: hidden;
+ color: #2f54eb;
+ //position: absolute;
+ padding-right: 2px;
+ z-index: 10;
+ cursor: pointer;
+}
+
+/* checkBill commonView区域 */
+.checkbillStyle .masterLinkSpan {
+ width: 100%;
+}
+
+.checkbillStyle .sActiveIdStyleBlock {
+ width: 100%;
+}
+
+.commonNewBillContainer .changeClassName .sActiveIdStyleBlock,
+.commonNewBillContainer .input12 .sActiveIdStyleBlock,
+.commonNewBillContainer .input18 .sActiveIdStyleBlock,
+.commonNewBillContainer .input24 .sActiveIdStyleBlock {
+ top: 0;
+ left: 3px !important;
+
+ .masterLinkSpan {
+ left: 0 !important;
+ }
+}
+
+.bill-search-group {
+ .masterLinkSpan {
+ padding-left: 7px;
+ background: #fff;
+ }
+
+ .sActiveIdStyle {
+ height: calc(100% - 2px);
+ max-width: 100%;
+ padding: @td_padding_sub;
+ font-size: 12px;
+ z-index: 9;
+ white-space: nowrap;
+ word-break: break-all;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ background: #fff;
+ top: 0;
+ left: 0;
+ position: absolute !important;
+ }
+
+ :global {
+ .searchMainFormArrow {
+ z-index: 1000 !important;
+ }
+
+ .searchMainFormArrowMaxHeight {
+ max-height: 91px !important;
+ overflow: hidden !important;
+ }
+ }
+}
+
+.bill-search-group1 {
+ :global {
+ .searchMainFormArrowMaxHeight {
+ max-height: none !important;
+ }
+ }
+}
+
+.ant-pagination-options-size-changer.ant-select {
+ width: auto !important;
+}
+
+// 富文本编辑器
+.braft-output-content {
+ border: 1px solid #d9d9d9;
+ border-radius: 2px;
+ min-height: 28.5px;
+}
+
+// 英文版样式
+.xlyerpEnglish {
+ .homeTab {
+ width: 100px;
+ }
+}
+
+.ant-select-multiple .ant-select-selection-search input {
+ width: auto !important;
+}
+
+.commonTitle {
+ padding-top: 0;
+
+ .ant-tooltip-arrow {
+ display: none;
+ }
+}
+
+.commonSpecialTitle {
+ padding-top: 0;
+
+ .ant-tooltip-arrow {
+ display: block;
+ }
+}
\ No newline at end of file
diff --git a/src/index.less b/src/index.less
index 175a039..6166f05 100644
--- a/src/index.less
+++ b/src/index.less
@@ -3281,4 +3281,4 @@ ton:focus {
height: 38px;
justify-content: space-between;
}
-}
+}
\ No newline at end of file
diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx
index 8b84d85..fd6ae27 100644
--- a/src/layouts/index.tsx
+++ b/src/layouts/index.tsx
@@ -1,8 +1,7 @@
import { Outlet } from 'umi';
import 'antd-v4/dist/antd.css';
-import '../index.less';
export default function Layout() {
return (
);
-}
+}
\ No newline at end of file
diff --git a/src/oee/common/oeeKeyBoard.css b/src/oee/common/oeeKeyBoard.css
new file mode 100644
index 0000000..4ad77be
--- /dev/null
+++ b/src/oee/common/oeeKeyBoard.css
@@ -0,0 +1,114 @@
+*{
+ margin:0;
+ padding:0;
+ font-family: "Microsoft YaHei", "Helvetica Neue", Helvetica, STHeiTi, sans-serif;
+ box-sizing: border-box;
+}
+html,body{
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+body{
+ background: #fff;
+ font-size:14px;
+ white-space:normal;
+ word-break:break-all;
+}
+a{
+ background-color: transparent;
+ text-decoration: none;
+ color: #666;
+}
+a:active,a:hover{
+ outline: 0;
+}
+input,button{
+ outline:none;
+ border:none;
+ background:none;
+}
+li{
+ list-style: none;
+}
+img{
+ border: 0;
+ outline: none;
+ vertical-align: middle;
+}
+input{
+ outline: none;
+}
+
+/* input框 */
+.keyboards{
+ margin:30px;
+}
+.keyboards input{
+ height:35px;
+ border:solid 1px #ccc;
+ padding:0 5px;
+ width:calc(100% - 2px - 10px);
+ margin-bottom:15px;
+ border-radius: 20px;
+}
+
+/* 数字键盘 */
+.keyboard{
+ padding:0;
+}
+.keyboard ul{
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: center;
+ padding-bottom:0.06rem;
+}
+.keyboard ul li{
+ width:10%;
+ text-align: center;
+ margin-top:0.09rem;
+ font-size:14px;
+ color:#000;
+}
+.keyboard ul li span{
+ background: #fff;
+ width:0.3rem;
+ height:0.35rem;
+ line-height:0.35rem;
+ border-radius: 4px;
+ display: inline-block;
+}
+
+/* 省份简称 */
+.province{
+ width: 100%;
+ padding:0 0.15rem 0.2rem 0.15rem;
+ position:fixed;
+ left:0;
+ right:0;
+ bottom:0;
+ background: #f2f2f2;
+}
+.keyboard{
+ width: 100%;
+ padding:0.1rem 0;
+ position:fixed;
+ left:0;
+ right:0;
+ bottom:0;
+ background: #f2f2f2;
+}
+.p-box{
+ display: flex;
+ flex-wrap:wrap;
+}
+.province p{
+ width: calc(100% / 8);
+ text-align: center;
+ margin-top:0.2rem;
+ font-size:15px;
+ color:#333;
+}
+.province p span{
+ background: #fff;
+ padding: 5px 8px;
+ border-radius: 4px;
+}
\ No newline at end of file
diff --git a/src/oee/common/oeeKeyBoard.js b/src/oee/common/oeeKeyBoard.js
new file mode 100644
index 0000000..6d46dc3
--- /dev/null
+++ b/src/oee/common/oeeKeyBoard.js
@@ -0,0 +1,420 @@
+
+/*--
+海皮智造 虚拟键盘 20200930
+=============================================
+React 内调用说明:
+import { VirtualKeyboard } from './VK'
+VirtualKeyboard 有2个参数,3个方法。
+//
+参数1:
+VirtualKeyboard.isDisableEnter=true|false
+是否禁用Enter键,默认为true。
+参数2:
+VirtualKeyboard.isDisableTab=true|false
+是否禁用Tab键,默认为true。
+------------------------
+方法1:
+.showKeyboardSetState(valueObject,reactComponent)
+显示虚拟键盘,此方式主要用于Antd Input组件,由于Antd的输入组件直接修改dom的value不生效,故只能传入值Object对象。
+valueObject 是一个Object,Object对象必须使用value属性来传递值。
+reactComponent 是当前React Component,用于按键后setState更新显示。
+如下例子:
+let V={value:'123'}
+VirtualKeyboard.showKeyboardSetState(V,this)} value={V.value}/>
+方法2:
+.showKeyboard(e)
+显示虚拟键盘,此方式主要用于大部分模式。
+参数e可是3种类型,
+1、字符串,即要联动的dom的id
+使用举例: VirtualKeyboard.showKeyboard("inputA")
+2、直接是要联动的dom对象,
+使用举例: VirtualKeyboard.showKeyboard(document.getElementById("xxx"))
+3、鼠标/触摸事件
+使用举例:
+方法3:
+.closeKeyboard()
+用命令来关闭键盘,一般来说用不到。
+--*/
+import React from 'react';
+import ReactDOM from 'react-dom';
+import * as commonUtils from '../../utils/utils';
+
+class VK extends React.Component {
+ constructor(props) {
+ super(props);
+ if (props.values.dom !== null) {
+ this.V.currentDom = props.values.dom;
+ }
+ if (props.values.value !== null && props.values.state !== null) {
+ this.V.reactValueObject = props.values.value;
+ this.V.reactStateObject = props.values.state;
+ }
+ const w = document.body.clientWidth;
+ // const h = document.body.clientHeight;
+ // eslint-disable-next-line no-mixed-operators
+ // this.V.x = w / 2 - 970 / 2;
+ // this.V.y = h - 300;
+ this.V.x = w - 214;
+ this.V.y = 10;
+ }
+ // eslint-disable-next-line react/sort-comp
+ // C = [
+ // '~`', '!1', '@2', '#3', '$4', '%5', '^6', '&7', '*8', '(9', ')0', '_-', '+=', 'Backspace',
+ // 'Tab', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{[', '}]', '|\\',
+ // 'CapsLock', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'L', 'L', ':;', "\"'", 'Enter',
+ // 'Shift', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<,', '>.', '?/', 'Space'];
+ // eslint-disable-next-line react/sort-comp
+ C = [
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '0', '←',
+ ];
+ // eslint-disable-next-line no-sparse-arrays
+ W = [, , , , , , , , , , , , , 120, 90, , , , , , , , , , , , , 90, 110, , , , , , , , , , , , 135, 140, , , , , , , , , , , 170]
+
+ componentWillReceiveProps(nextProps) {
+ if (nextProps.values.dom !== null) {
+ this.V.currentDom = nextProps.values.dom;
+ this.V.reactValueObject = null;
+ this.V.reactStateObject = null;
+ } else if (nextProps.values.value !== null && nextProps.values.state !== null) {
+ this.V.reactValueObject = nextProps.values.value;
+ this.V.reactStateObject = nextProps.values.state;
+ this.V.currentDom = null;
+ }
+ }
+ getComponentFocus = () => {
+ const { inputRef, state } = this.props.values;
+ let componentId = '';
+ if (commonUtils.isNotEmptyObject(state.props.showConfig)) {
+ componentId = state[inputRef].props ? state[inputRef].props.id : state[inputRef].getAttribute('id');
+ } else {
+ componentId = inputRef;
+ }
+ // 获取光标
+ if (commonUtils.isNotEmptyStr('inputRef') && document.getElementById(`${componentId}`) !== null) {
+ document.getElementById(`${componentId}`).focus();
+ } else {
+ console.log('没有获得id');
+ }
+ }
+ // eslint-disable-next-line camelcase
+ F_ChangeInput = (c) => {
+ let inputContent = '';
+ if (this.V.currentDom !== null) {
+ inputContent = this.V.currentDom.innerText || this.V.currentDom.textContent || this.V.currentDom.value;
+ } else inputContent = this.V.reactValueObject.value;
+ inputContent = inputContent.toString();
+ const strArr = inputContent.split('');
+ if (c === -1) {
+ strArr.pop();
+ } else strArr.push(c);
+ if (this.V.currentDom !== null) {
+ if (this.V.currentDom.nodeName === 'INPUT') {
+ this.V.currentDom.value = strArr.join('');
+ } else if (this.V.currentDom.nodeName !== undefined) {
+ this.V.currentDom.innerHTML = strArr.join('');
+ }
+ } else if (this.V.reactStateObject !== null && this.V.reactValueObject !== null) {
+ this.V.reactValueObject.value = strArr.join('');
+ }
+ const { state, inputRef } = this.props.values;
+ const thisProps = state.props;
+ if (commonUtils.isNotEmptyObject(thisProps.showConfig)) { // 走配置,commonComponent组件
+ const returnValue = {};
+ if (inputRef.substring(0, 1) === 'd') {
+ if (commonUtils.isNotEmptyStr(this.V.reactValueObject.value)) {
+ returnValue[thisProps.showConfig.sName] = this.V.reactValueObject.value * 1;
+ } else {
+ returnValue[thisProps.showConfig.sName] = '';
+ }
+ } else {
+ returnValue[thisProps.showConfig.sName] = this.V.reactValueObject.value;
+ }
+ thisProps.onChange(thisProps.name, thisProps.showConfig.sName, returnValue, thisProps.sId, []);
+ } else if (commonUtils.isNotEmptyObject(state.form)) { // input存在form组件中
+ state.form.setFields({
+ [inputRef]: {
+ value: commonUtils.isEmptyStr(this.V.reactValueObject.value) ? '' : this.V.reactValueObject.value * 1,
+ },
+ });
+ } else { // 其他类型
+ state.handleKeyeBoardValueChange(state[inputRef], this.V.reactValueObject.value);
+ }
+ this.getComponentFocus();
+ };
+ V = {
+ isCaps: false,
+ isShift: false,
+ currentDom: null,
+ reactValueObject: null,
+ reactStateObject: null,
+ }
+ // eslint-disable-next-line camelcase
+ F_Close = () => {
+ this.props.values.closeKeyboard();
+ }
+ // eslint-disable-next-line camelcase
+ F_MouseDown = (e) => {
+ e = e.nativeEvent;
+ if (e.button !== 0) return;
+ if (e.target.id.indexOf('VK_') !== 0) {
+ if ((e.target.innerText === 'Enter' && this.props.values.isDisableEnter === true) || (e.target.innerText === 'Tab' && this.props.values.isDisableTab === true)) {
+ return;
+ }
+ e.target.style.backgroundColor = '#F80';
+ e.target.style.boxShadow = '0px 0px 4px #000 inset';
+ this.V.keydom = e.target;
+ document.addEventListener('mouseup', this.F_KeyMouseUp);
+ return;
+ }
+ document.addEventListener('mousemove', this.F_MouseMove);
+ document.addEventListener('mouseup', this.F_MouseUp);
+ // this.V.posX = -e.pageX;
+ // this.V.posY = -e.pageY;
+ this.V.posX = -e.pageX;
+ this.V.posY = -e.pageY;
+ }
+ // eslint-disable-next-line camelcase
+ F_MouseMove = (e) => {
+ const tx = this.V.posX + e.pageX + this.V.x;
+ const ty = this.V.posY + e.pageY + this.V.y;
+ this.dom.style.left = `${tx}px`;
+ this.dom.style.top = `${ty}px`;
+ }
+ // eslint-disable-next-line camelcase
+ F_MouseUp = (e) => {
+ this.V.x = this.V.posX + e.pageX + this.V.x;
+ this.V.y = this.V.posY + e.pageY + this.V.y;
+ document.removeEventListener('mousemove', this.F_MouseMove);
+ document.removeEventListener('mouseup', this.F_MouseUp);
+ this.getComponentFocus();
+ }
+ // eslint-disable-next-line camelcase
+ F_KeyMouseUp = () => {
+ this.V.keydom.style.backgroundColor = '#FFF';
+ this.V.keydom.style.boxShadow = null;
+ document.removeEventListener('mouseup', this.F_KeyMouseUp);
+ }
+ // eslint-disable-next-line camelcase
+ F_TouchStart = (e) => {
+ e = e.nativeEvent;
+ if (e.target.id.indexOf('VK_') !== 0) {
+ if ((e.target.innerText === 'Enter' && this.props.values.isDisableEnter === true) || (e.target.innerText === 'Tab' && this.props.values.isDisableTab === true)) {
+ return;
+ }
+ e.target.style.backgroundColor = '#F80';
+ e.target.style.boxShadow = '0px 0px 4px #000 inset';
+ this.V.keydom = e.target;
+ document.addEventListener('touchend', this.F_KeyTouchEnd);
+ return;
+ }
+ document.addEventListener('touchmove', this.F_TouchMove);
+ document.addEventListener('touchend', this.F_TouchEnd);
+ this.V.posX = -e.targetTouches[0].pageX;
+ this.V.posY = -e.targetTouches[0].pageY;
+ }
+ // eslint-disable-next-line camelcase
+ F_TouchMove = (e) => {
+ const tx = this.V.posX + e.targetTouches[0].pageX + this.V.x;
+ const ty = this.V.posY + e.targetTouches[0].pageY + this.V.y;
+ this.dom.style.left = `${tx}px`;
+ this.dom.style.top = `${ty}px`;
+ }
+ // eslint-disable-next-line camelcase
+ F_TouchEnd = (e) => {
+ this.V.x = this.V.posX + e.changedTouches[0].pageX + this.V.x;
+ this.V.y = this.V.posY + e.changedTouches[0].pageY + this.V.y;
+ document.removeEventListener('touchmove', this.F_TouchMove);
+ document.removeEventListener('touchend', this.F_TouchEnd);
+ }
+ // eslint-disable-next-line camelcase
+ F_KeyTouchEnd = () => {
+ this.V.keydom.style.backgroundColor = '#FFF';
+ this.V.keydom.style.boxShadow = null;
+ document.removeEventListener('touchend', this.F_KeyTouchEnd);
+ }
+ // eslint-disable-next-line camelcase
+ F_KeyDown = (e) => {
+ const dom = e.target;
+ const txt = dom.innerText;
+ if (txt === 'CapsLock') {
+ this.V.isCaps = !this.V.isCaps;
+ if (this.V.isCaps) {
+ dom.style.backgroundColor = '#F80';
+ } else {
+ dom.style.backgroundColor = '#FFF';
+ }
+ this.setState({});
+ } else if (txt === 'Shift') {
+ this.V.isShift = !this.V.isShift;
+ if (this.V.isShift) {
+ dom.style.backgroundColor = '#F80';
+ } else {
+ dom.style.backgroundColor = '#FFF';
+ }
+ this.setState({});
+ } else if (txt === 'Enter') {
+ if (this.props.values.isDisableEnter === false) {
+ this.F_ChangeInput(String.fromCharCode(13));
+ }
+ } else if (txt === 'Space') {
+ this.F_ChangeInput(' ');
+ } else if (txt === 'Tab') {
+ if (this.props.values.isDisableTab === false) {
+ this.F_ChangeInput(String.fromCharCode(9));
+ }
+ } else if (txt === '←') {
+ this.F_ChangeInput(-1);
+ } else if (txt.indexOf('\n') >= 0) {
+ if (this.V.isShift) {
+ this.F_ChangeInput(txt[0]);
+ } else {
+ this.F_ChangeInput(txt[2]);
+ }
+ } else if (this.V.isShift) {
+ this.F_ChangeInput(txt.toUpperCase() === txt ? txt.toLowerCase() : txt.toUpperCase());
+ } else {
+ this.F_ChangeInput(txt);
+ }
+ }
+ render() {
+ const keyStyle = {
+ boxSizing: 'border-box',
+ float: 'left',
+ height: 60,
+ margin: 2.5,
+ borderRadius: 4,
+ border: '1px solid #333',
+ textAlign: 'center',
+ cursor: 'pointer',
+ };
+ return (
+ e.preventDefault()}
+ tabIndex="-1"
+ id="VK_Main"
+ /* eslint-disable-next-line no-return-assign */
+ ref={dom => this.dom = dom}
+ style={{
+ outline: 'none',
+ top: this.V.y,
+ left: this.V.x,
+ position: 'absolute',
+ zIndex: '999999999',
+ backgroundColor: 'rgb(217 217 217)',
+ padding: 3,
+ width: 204,
+ fontSize: 20,
+ border: '1px solid #444',
+ borderRadius: 8,
+ userSelect: 'none',
+ }}
+ onMouseDown={this.F_MouseDown}
+ onTouchStart={this.F_TouchStart}
+ // onBlur={this.F_Close}
+ >
+
可以拖动移开或 关闭键盘
+
+ {this.C.map((c, n) => {
+ return (
+
+ {c}
+
+ );
+ })}
+
+
+ );
+ }
+}
+// ===========================================
+const data = {
+ VK: VK.prototype,
+ div: null,
+ props: {},
+};
+
+export const VirtualKeyboard = {
+ isDisableEnter: true,
+ isDisableTab: true,
+ showKeyboardSetState: (valueObject, reactComponent, inputId) => {
+ data.props.value = valueObject;
+ data.props.state = reactComponent;
+ data.props.inputRef = inputId;
+ data.props.dom = null;
+ if (data.div !== null) {
+ data.VK.setState({});
+ } else {
+ data.props.closeKeyboard = VirtualKeyboard.closeKeyboard;
+ data.props.isDisableEnter = VirtualKeyboard.isDisableEnter;
+ data.props.isDisableTab = VirtualKeyboard.isDisableTab;
+ const body = document.getElementsByTagName('body')[0];
+ if (body === undefined) return;
+ const div = document.createElement('div');
+ data.div = div;
+ body.appendChild(div);
+ // eslint-disable-next-line no-return-assign
+ const V = data.VK = dom} values={data.props} />;
+ ReactDOM.render(V, div);
+ }
+ },
+ showValue: () => {
+ return data.props.value;
+ },
+ showKeyboard: (e) => {
+ data.props.value = null;
+ data.props.state = null;
+ data.props.dom = null;
+ if (typeof (e) === 'string') {
+ const dom = document.getElementById(e);
+ if (dom !== null) {
+ data.props.dom = dom;
+ }
+ } else if (typeof (e) === 'object') {
+ if (typeof (e.type) === 'string' && typeof (e.nodeName) === 'string') {
+ data.props.dom = e;
+ } else if (e.target !== undefined) {
+ e = e.target;
+ if (typeof (e.type) === 'string' && typeof (e.nodeName) === 'string') {
+ data.props.dom = e;
+ }
+ }
+ }
+ if (data.props.dom === null) return;
+ if (data.div !== null) {
+ data.VK.setState({});
+ } else {
+ data.props.closeKeyboard = VirtualKeyboard.closeKeyboard;
+ data.props.isDisableEnter = VirtualKeyboard.isDisableEnter;
+ data.props.isDisableTab = VirtualKeyboard.isDisableTab;
+ const body = document.getElementsByTagName('body')[0];
+ if (body === undefined) return;
+ const div = document.createElement('div');
+ data.div = div;
+ body.appendChild(div);
+ // eslint-disable-next-line no-return-assign
+ const V = data.VK = dom} values={data.props} />;
+ ReactDOM.render(V, div);
+ }
+ },
+ isKeyBoard: () => { // 判断之前是否有全键盘打开
+ if (data.div === null) {
+ return false;
+ } else {
+ return true;
+ }
+ },
+ closeKeyboard: () => { // 关闭键盘
+ ReactDOM.render(, data.div);
+ data.div.remove();
+ data.div = null;
+ },
+};
diff --git a/src/routes/common/AffixMenu.js b/src/routes/common/AffixMenu.js
new file mode 100644
index 0000000..05ba78f
--- /dev/null
+++ b/src/routes/common/AffixMenu.js
@@ -0,0 +1,17 @@
+import React from 'react';
+import { connect } from 'umi';
+import AffixMenuComponent from '../../components/Common/AffixMenu';
+
+function AffixMenu({ dispatch, app, ...props }) {
+ const AffixMenuProps = {
+ ...props,
+ app,
+ dispatch,
+ };
+ return (
+
+ );
+}
+
+export default connect(({ app }) =>
+ ({ app }))(AffixMenu);
diff --git a/src/routes/commonList/commonList.js b/src/routes/commonList/commonList.js
new file mode 100644
index 0000000..adb9a49
--- /dev/null
+++ b/src/routes/commonList/commonList.js
@@ -0,0 +1,23 @@
+import { connect } from 'umi';
+import CommonList from '../../components/Common/CommonList';
+
+function commonList({
+ dispatch, app, content,
+}) {
+ const commonListProps = {
+ app,
+ content,
+ dispatch,
+ onAddPane: getAddPane, /* 增加标签 */
+ };
+ function getAddPane(pane) {
+ /* 增加标签 */
+ dispatch({ type: 'app/addPane', payload: { pane } });
+ }
+ return (
+
+ );
+}
+
+export default connect(({ app, content }) =>
+ ({ app, content }))(commonList);
diff --git a/src/routes/commonList/commonListA.js b/src/routes/commonList/commonListA.js
new file mode 100644
index 0000000..7ee2d18
--- /dev/null
+++ b/src/routes/commonList/commonListA.js
@@ -0,0 +1,29 @@
+/**
+ * @Date: 2019-05-20T16:45:00+08:00
+ * @Last modified time: 2019-06-26T18:40:44+08:00
+ */
+
+import React from 'react';
+import { connect } from 'dva';
+import CommonListA from '../../components/Common/CommonListA';
+
+function commonListA({
+ dispatch, app, content,
+}) {
+ const commonListProps = {
+ app,
+ content,
+ dispatch,
+ onAddPane: getAddPane, /* 增加标签 */
+ };
+ function getAddPane(pane) {
+ /* 增加标签 */
+ dispatch({ type: 'app/addPane', payload: { pane } });
+ }
+ return (
+
+ );
+}
+
+export default connect(({ app, content }) =>
+ ({ app, content }))(commonListA);
diff --git a/src/routes/commonList/commonListEdit.js b/src/routes/commonList/commonListEdit.js
new file mode 100644
index 0000000..4f00697
--- /dev/null
+++ b/src/routes/commonList/commonListEdit.js
@@ -0,0 +1,29 @@
+/**
+ * @Date: 2019-05-20T16:45:00+08:00
+ * @Last modified time: 2019-06-26T18:40:44+08:00
+ */
+
+import React from 'react';
+import { connect } from 'dva';
+import CommonListEdit from '../../components/Common/CommonListEdit';
+
+function commonListEdit({
+ dispatch, app, content,
+}) {
+ const commonListEitProps = {
+ app,
+ content,
+ dispatch,
+ onAddPane: getAddPane, /* 增加标签 */
+ };
+ function getAddPane(pane) {
+ /* 增加标签 */
+ dispatch({ type: 'app/addPane', payload: { pane } });
+ }
+ return (
+
+ );
+}
+
+export default connect(({ app, content }) =>
+ ({ app, content }))(commonListEdit);
diff --git a/src/routes/commonList/commonListLeft.js b/src/routes/commonList/commonListLeft.js
new file mode 100644
index 0000000..e334fdd
--- /dev/null
+++ b/src/routes/commonList/commonListLeft.js
@@ -0,0 +1,30 @@
+/**
+ * @Date: 2019-05-20T16:45:00+08:00
+ * @Last modified time: 2019-06-26T18:40:44+08:00
+ */
+
+import React from 'react';
+import { connect } from 'dva';
+// import CommonListLeft from '../../components/Common/CommonListLeft';
+import CommonListLeft from '@/components/Common/CommonListLeft';
+
+function commonList({
+ dispatch, app, content,
+}) {
+ const commonListProps = {
+ app,
+ content,
+ dispatch,
+ onAddPane: getAddPane, /* 增加标签6767 */
+ };
+ function getAddPane(pane) {
+ /* 增加标签 */
+ dispatch({ type: 'app/addPane', payload: { pane } });
+ }
+ return (
+
+ );
+}
+
+export default connect(({ app, content }) =>
+ ({ app, content }))(commonList);
diff --git a/src/routes/commonList/commonListTab.js b/src/routes/commonList/commonListTab.js
new file mode 100644
index 0000000..e0313d6
--- /dev/null
+++ b/src/routes/commonList/commonListTab.js
@@ -0,0 +1,28 @@
+/**
+ * @Date: 2019-05-20T16:45:00+08:00
+ * @Last modified time: 2019-06-26T18:40:44+08:00
+ */
+
+import React from 'react';
+import { connect } from 'dva';
+import CommonListTabComponent from '@/components/Common/CommonListTab';
+
+function CommonTab({ dispatch, app, content }) {
+ function removePane(changePanes, currentPane) {
+ dispatch({ type: 'app/removePane', payload: { changePanes, currentPane } });
+ }
+
+ const commonTabProps = {
+ app,
+ content,
+ dispatch,
+ onRemovePane: removePane,
+ };
+
+ return (
+
+ );
+}
+
+export default connect(({ app, content }) =>
+ ({ app, content }))(CommonTab);
diff --git a/src/routes/tab/tab.js b/src/routes/tab/tab.js
index 0ddad7e..cc74e09 100644
--- a/src/routes/tab/tab.js
+++ b/src/routes/tab/tab.js
@@ -4,6 +4,7 @@ import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Tabs, Modal } from 'antd';
import IndexCenter from '@/routes/indexCenter/indexCenter';/* 首页 */
import TabComponent from '@/components/Tab/TabComponent';
+import CommonList from '@/routes/commonList/commonList';/* 公共列表 */
import styles from '@/index.less';
import { sendWebSocketMessage } from '@/components/Common/commonFunc';
import { isNotEmptyObject, isNotEmptyArr } from '@/utils/utils'; /* 通用方法 */
@@ -18,7 +19,11 @@ function Tab({ dispatch, app }) {
const tagLastKey = tagArr !== undefined && tagArr.length > 0 ? tagArr[tagArr.length - 1].key : '';
const tabpanes = panes.map((pane) => {
const bRecordFlagDisabled = (tagArr.length > 0 && pane.key !== tagLastKey);
- const content = ;
+ const routeList = {
+ '/indexPage/commonList': ,
+ }
+ const content = routeList[pane.route] || ;
+
if (pane.paneType) {
paneType = {pane.title};
} else {
diff --git a/src/utils/common/calcuate.js b/src/utils/common/calcuate.js
new file mode 100644
index 0000000..b0e352d
--- /dev/null
+++ b/src/utils/common/calcuate.js
@@ -0,0 +1,11 @@
+const getPower = (a, b) => {
+ const aLen = a.toString().split('.')[1]?.length || 0;
+ const bLen = b.toString().split('.')[1]?.length || 0;
+ const len = Math.max(aLen, bLen);
+ return 10 ** len;
+};
+
+export const addResult = (a, b) => {
+ const power = getPower(a, b);
+ return ((a * power) + (b * power)) / power;
+};
diff --git a/src/utils/common/message.js b/src/utils/common/message.js
new file mode 100644
index 0000000..bf8c709
--- /dev/null
+++ b/src/utils/common/message.js
@@ -0,0 +1,57 @@
+/* eslint-disable */
+import { Modal, message as antdMessage } from 'antd-v4';
+// import { Modal as mobileModal } from 'antd-mobile';
+
+const { warning } = Modal;
+// const antdMobileAlert = mobileModal.alert;
+
+let debounceCount;
+let secondContent = [];
+let width;
+
+const queryWidth = () => {
+ width = document?.documentElement?.getBoundingClientRect()?.width <= 750 ? '80%' : 500;
+}
+
+const openConfirm = (config) => {
+
+ queryWidth();
+ const { message, ...rest } = config;
+ secondContent.push({message}
)
+
+ if (debounceCount) {
+ clearTimeout(debounceCount);
+ };
+
+ const fn = () => {
+ if (location.pathname.toLocaleLowerCase().includes('mobile')) {
+ antdMobileAlert('温馨提示', secondContent || '出错了', [
+ { text: '确认', },
+ ])
+ } else {
+ warning({
+ title: '温馨提示',
+ content: {secondContent || '出错了'}
,
+ okText: '确认',
+ zIndex: 1000,
+ width,
+ ...rest,
+ });
+ }
+ }
+
+ debounceCount = setTimeout(() => {
+ fn();
+ secondContent = [];
+ });
+};
+
+/**
+ * 替换message.error信息提示方式为warning
+ */
+export const message = {
+ ...antdMessage,
+ error: (content, ...rest) => {
+ openConfirm({ message: content, ...rest });
+ },
+};
--
libgit2 0.22.2