Commit ba58beaa046dbe794cc77a724182edc405cacfa7
1 parent
c8d15790
解决冲突
Showing
1 changed file
with
2562 additions
and
3773 deletions
src/components/Common/CommonTable/index.js
Changes suppressed. Click to show
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | /* eslint-disable react/no-array-index-key */ |
| 6 | 6 | /* eslint-disable react/jsx-closing-tag-location */ |
| 7 | 7 | /* eslint-disable */ |
| 8 | -import React, { useEffect, useRef, useState } from "react"; | |
| 8 | +import React, { useEffect, useRef, useState } from 'react'; | |
| 9 | 9 | import { |
| 10 | 10 | CheckCircleFilled, |
| 11 | 11 | ClockCircleFilled, |
| ... | ... | @@ -26,53 +26,57 @@ import { |
| 26 | 26 | ClearOutlined, |
| 27 | 27 | CaretUpOutlined, |
| 28 | 28 | CaretDownOutlined, |
| 29 | - PlaySquareOutlined, | |
| 30 | -} from "@ant-design/icons"; | |
| 31 | -import { Icon as LegacyIcon } from "@ant-design/compatible"; | |
| 29 | + PlaySquareOutlined | |
| 30 | +} from '@ant-design/icons'; | |
| 31 | +import { Icon as LegacyIcon } from '@ant-design/compatible'; | |
| 32 | 32 | // import '@ant-design/compatible/assets/index.css'; |
| 33 | -import lodash from "lodash"; | |
| 34 | -import { Table, Input, Checkbox, Button, Upload, message, Popover, Spin, Space, Form, Tooltip, Row, Progress, Modal, Col, Pagination } from "antd-v4"; | |
| 35 | -import { DndProvider, DropTarget, DragSource } from "react-dnd"; | |
| 36 | -import { sortableContainer, sortableElement, sortableHandle } from "react-sortable-hoc"; | |
| 37 | -import { MenuOutlined } from "@ant-design/icons"; | |
| 38 | -import { HTML5Backend } from "react-dnd-html5-backend"; | |
| 39 | -import { Resizable } from "react-resizable"; | |
| 40 | -import styles from "./index.less"; | |
| 41 | -import * as commonUtils from "@/utils/utils"; | |
| 42 | -import ShowTypeNew from "@/components/Common/CommonComponent"; | |
| 43 | -import Highlighter from "react-highlight-words"; | |
| 44 | -import commonConfig from "@/utils/config"; | |
| 45 | -import update from "immutability-helper"; | |
| 46 | -import * as commonFunc from "@/components/Common/commonFunc"; | |
| 47 | -import moment from "moment"; | |
| 48 | -import ParamIcon from "@/assets/param.svg"; | |
| 49 | -import sAlumiteIcon from "@/assets/sAlumite.svg"; | |
| 50 | -import ReplaceIcon from "@/assets/extract.svg"; | |
| 51 | -import DisReplaceIcon from "@/assets/disableExtract.svg"; | |
| 52 | -import DisAlumiteIcon from "@/assets/disabledsAlumite.svg"; | |
| 53 | -import ShowImg from "@/components/Common/ShowImage/ShowImage"; | |
| 54 | -import ShowImgStyle from "@/components/Common/ShowImage/ShowImage.less"; | |
| 55 | -import AntdDraggableModal from "@/components/Common/AntdDraggableModal"; | |
| 56 | -import CommonListSelectTree from "@/components/Common/CommonListSelectTree"; | |
| 57 | -import CommonListSelect from "@/components/Common/CommonListSelect"; | |
| 58 | -import CommonList from "@/components/Common/CommonList"; | |
| 59 | -import CommonListTreeSelect from "@/components/Common/CommonListTreeSelect"; | |
| 60 | -import AntdDraggableDiv from "@/components/Common/AntdDraggableDiv"; | |
| 61 | -import SlaveMemo from "@/components/Common/SlaveMemo"; | |
| 62 | -import { VList } from "@/components/Vlist"; | |
| 63 | -import { VList as VListNew } from "@/components/VlistNew"; | |
| 33 | +import lodash from 'lodash'; | |
| 34 | +import { Table, Input, Checkbox, Button, Upload, message, Popover, Spin, Space, Form, Tooltip, Row, Progress,Modal, Col, Pagination } from 'antd-v4'; | |
| 35 | +import { DndProvider, DropTarget, DragSource } from 'react-dnd'; | |
| 36 | +import { | |
| 37 | + sortableContainer, | |
| 38 | + sortableElement, | |
| 39 | + sortableHandle, | |
| 40 | +} from 'react-sortable-hoc'; | |
| 41 | +import { MenuOutlined } from '@ant-design/icons'; | |
| 42 | +import { HTML5Backend } from 'react-dnd-html5-backend'; | |
| 43 | +import { Resizable } from 'react-resizable'; | |
| 44 | +import styles from './index.less'; | |
| 45 | +import * as commonUtils from '@/utils/utils'; | |
| 46 | +import ShowTypeNew from '@/components/Common/CommonComponent'; | |
| 47 | +import Highlighter from 'react-highlight-words'; | |
| 48 | +import commonConfig from '@/utils/config'; | |
| 49 | +import update from 'immutability-helper'; | |
| 50 | +import * as commonFunc from '@/components/Common/commonFunc'; | |
| 51 | +import moment from 'moment'; | |
| 52 | +import ParamIcon from '@/assets/param.svg'; | |
| 53 | +import sAlumiteIcon from '@/assets/sAlumite.svg'; | |
| 54 | +import ReplaceIcon from '@/assets/extract.svg'; | |
| 55 | +import DisReplaceIcon from '@/assets/disableExtract.svg'; | |
| 56 | +import DisAlumiteIcon from '@/assets/disabledsAlumite.svg'; | |
| 57 | +import ShowImg from '@/components/Common/ShowImage/ShowImage'; | |
| 58 | +import ShowImgStyle from '@/components/Common/ShowImage/ShowImage.less'; | |
| 59 | +import AntdDraggableModal from '@/components/Common/AntdDraggableModal'; | |
| 60 | +import CommonListSelectTree from '@/components/Common/CommonListSelectTree'; | |
| 61 | +import CommonListSelect from '@/components/Common/CommonListSelect'; | |
| 62 | +import CommonList from '@/components/Common/CommonList'; | |
| 63 | +import CommonListTreeSelect from '@/components/Common/CommonListTreeSelect'; | |
| 64 | +import AntdDraggableDiv from '@/components/Common/AntdDraggableDiv'; | |
| 65 | +import SlaveMemo from '@/components/Common/SlaveMemo'; | |
| 66 | +import { VList } from '@/components/Vlist'; | |
| 67 | +import { VList as VListNew } from '@/components/VlistNew'; | |
| 64 | 68 | import SvgIcon from "../../SvgIcon"; |
| 65 | -import PrintPdf from "@/components/PrintPdf/PrintPdf"; | |
| 66 | -import OfficePreview from "@/components/Common/OfficePreview"; | |
| 67 | -import EditTableCommonListSelectFlex from "@/components/Common/CommonListSelectFlex/EditTableCommonListSelectFlex"; | |
| 68 | -import ColorInfo from "./colorInfo"; | |
| 69 | -import cloneDeep from "lodash/cloneDeep"; | |
| 69 | +import PrintPdf from '@/components/PrintPdf/PrintPdf'; | |
| 70 | +import OfficePreview from '@/components/Common/OfficePreview'; | |
| 71 | +import EditTableCommonListSelectFlex from '@/components/Common/CommonListSelectFlex/EditTableCommonListSelectFlex'; | |
| 72 | +import ColorInfo from './colorInfo'; | |
| 70 | 73 | // import { VList } from 'virtuallist-antd'; |
| 71 | 74 | |
| 75 | + | |
| 72 | 76 | /* 获取配置及数据 */ |
| 73 | 77 | const FormItem = Form.Item; |
| 74 | 78 | const { confirm } = Modal; |
| 75 | -const ResizeableTitle = props => { | |
| 79 | +const ResizeableTitle = (props) => { | |
| 76 | 80 | const { onResize, width, ...restProps } = props; |
| 77 | 81 | if (!width) { |
| 78 | 82 | return <th {...restProps} key={lodash.uniqueId()} />; |
| ... | ... | @@ -84,7 +88,7 @@ const ResizeableTitle = props => { |
| 84 | 88 | handle={ |
| 85 | 89 | <span |
| 86 | 90 | className="react-resizable-handle" |
| 87 | - onClick={e => { | |
| 91 | + onClick={(e) => { | |
| 88 | 92 | e.stopPropagation(); |
| 89 | 93 | }} |
| 90 | 94 | key={lodash.uniqueId()} |
| ... | ... | @@ -100,18 +104,20 @@ const ResizeableTitle = props => { |
| 100 | 104 | |
| 101 | 105 | let dragingIndex = -1; // 用于设置拖拽Row时样式 |
| 102 | 106 | let moverow = null; // 定义move事件,解决warn |
| 103 | -const BodyRow = props => { | |
| 104 | - const { isOver, connectDragSource, connectDropTarget, move, ...restProps } = props; | |
| 107 | +const BodyRow = (props) => { | |
| 108 | + const { | |
| 109 | + isOver, connectDragSource, connectDropTarget, move, ...restProps | |
| 110 | + } = props; | |
| 105 | 111 | moverow = move; |
| 106 | 112 | const ref = useRef(null); |
| 107 | - const style = { ...restProps.style, cursor: "move" }; | |
| 113 | + const style = { ...restProps.style, cursor: 'move' }; | |
| 108 | 114 | let { className } = restProps; |
| 109 | 115 | if (isOver) { |
| 110 | 116 | if (restProps.index > dragingIndex) { |
| 111 | - className += " drop-over-downward"; | |
| 117 | + className += ' drop-over-downward'; | |
| 112 | 118 | } |
| 113 | 119 | if (restProps.index < dragingIndex) { |
| 114 | - className += " drop-over-upward"; | |
| 120 | + className += ' drop-over-upward'; | |
| 115 | 121 | } |
| 116 | 122 | } |
| 117 | 123 | connectDragSource(connectDropTarget(ref)); |
| ... | ... | @@ -120,12 +126,12 @@ const BodyRow = props => { |
| 120 | 126 | // DragSource 拖拽事件的方法对象 |
| 121 | 127 | const rowSource = { |
| 122 | 128 | beginDrag(props) { |
| 123 | - const dragingKey = props["data-row-key"]; | |
| 129 | + const dragingKey = props["data-row-key"] | |
| 124 | 130 | dragingIndex = props.index; |
| 125 | 131 | return { |
| 126 | - "data-row-key": dragingKey, | |
| 132 | + 'data-row-key':dragingKey, | |
| 127 | 133 | index: props.index, |
| 128 | - }; | |
| 134 | + } | |
| 129 | 135 | // dragingIndex = props.index; |
| 130 | 136 | // return { |
| 131 | 137 | // index: props.index, |
| ... | ... | @@ -142,19 +148,19 @@ const rowTarget = { |
| 142 | 148 | if (dragKey === hoverKey) { |
| 143 | 149 | return; |
| 144 | 150 | } |
| 145 | - props.moveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 151 | + props.moveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 146 | 152 | monitor.getItem().index = hoverIndex; |
| 147 | 153 | monitor.getItem()["data-row-key"] = hoverKey; |
| 148 | 154 | }, |
| 149 | 155 | }; |
| 150 | 156 | |
| 151 | -const DragableBodyRow = DropTarget("row", rowTarget, (connect, monitor) => ({ | |
| 157 | +const DragableBodyRow = DropTarget('row', rowTarget, (connect, monitor) => ({ | |
| 152 | 158 | connectDropTarget: connect.dropTarget(), |
| 153 | 159 | isOver: monitor.isOver(), |
| 154 | 160 | }))( |
| 155 | - DragSource("row", rowSource, connect => ({ | |
| 161 | + DragSource('row', rowSource, connect => ({ | |
| 156 | 162 | connectDragSource: connect.dragSource(), |
| 157 | - }))(BodyRow) | |
| 163 | + }))(BodyRow), | |
| 158 | 164 | ); |
| 159 | 165 | /* ================================================================== */ |
| 160 | 166 | class CommonTableRc extends React.Component { |
| ... | ... | @@ -162,57 +168,54 @@ class CommonTableRc extends React.Component { |
| 162 | 168 | constructor(props) { |
| 163 | 169 | super(props); |
| 164 | 170 | this.state = { |
| 165 | - navigation: "navigation", | |
| 166 | - previewVisible: false /* 图片预览弹窗 */, | |
| 167 | - previewImage: "" /* 预览图片地址 */, | |
| 168 | - headerColumn: [] /* 表头信息(数据类型:数组对象) */, | |
| 169 | - slaveInfoHeaderColumn: [] /* 表头信息(数据类型:数组对象) */, | |
| 170 | - tableColumn: [] /* table的表头信息(数据类型:数组对象) */, | |
| 171 | + navigation: 'navigation', | |
| 172 | + previewVisible: false, /* 图片预览弹窗 */ | |
| 173 | + previewImage: '', /* 预览图片地址 */ | |
| 174 | + headerColumn: [], /* 表头信息(数据类型:数组对象) */ | |
| 175 | + slaveInfoHeaderColumn: [], /* 表头信息(数据类型:数组对象) */ | |
| 176 | + tableColumn: [], /* table的表头信息(数据类型:数组对象) */ | |
| 171 | 177 | tableInfoColumn: [], |
| 172 | 178 | slaveInfoTableColumn: [], |
| 173 | - selectedRowKeys: [] /* 已选择的数据行(数据格式:数组) */, | |
| 179 | + selectedRowKeys: [], /* 已选择的数据行(数据格式:数组) */ | |
| 174 | 180 | slaveInfoSelectedRowKeys: [], |
| 175 | - dataSource: [] /* 数据(数据格式:数组对象) */, | |
| 176 | - totalData: [] /* 总计数据 */, | |
| 177 | - totalData1: [] /* 总计数据1 */, | |
| 178 | - enabled: false /* 是否为编辑 */, | |
| 179 | - filteredValue: [] /* 过滤数据值 */, | |
| 180 | - expKeys: [] /* 展开数据行(数据格式:数组) */, | |
| 181 | + dataSource: [], /* 数据(数据格式:数组对象) */ | |
| 182 | + totalData: [], /* 总计数据 */ | |
| 183 | + totalData1: [], /* 总计数据1 */ | |
| 184 | + enabled: false, /* 是否为编辑 */ | |
| 185 | + filteredValue: [], /* 过滤数据值 */ | |
| 186 | + expKeys:[], /* 展开数据行(数据格式:数组) */ | |
| 181 | 187 | showimgs: false, // 必须字段控制弹框显示隐藏 |
| 182 | 188 | firstIndex: 0, // 点击时默认下标 |
| 183 | - commonPopupVisible: false, | |
| 184 | - commonFieldPopupVisible: false, | |
| 189 | + commonPopupVisible:false, | |
| 190 | + commonFieldPopupVisible:false, | |
| 185 | 191 | openNewTabFlag: false, // 是否因在弹窗中打开新页签离开本页; |
| 186 | 192 | randomId: commonUtils.createSid(), |
| 187 | 193 | realizeHeight: 0, |
| 188 | - tableClassName: "table_" + commonUtils.createSid(), | |
| 194 | + tableClassName: 'table_' + commonUtils.createSid(), | |
| 189 | 195 | commonFileDownloadVisible: false, // 多文件下载弹窗 |
| 190 | 196 | commonFileDownloadList: [], // 多文件列表 |
| 191 | 197 | pdfFileVisible: false, // pdf文件弹窗 |
| 192 | - bOperateMoreVisible: false /* 复制更多弹窗 */, | |
| 193 | - pdfFileUrl: "", | |
| 194 | - currentHoverSid: "", | |
| 198 | + bOperateMoreVisible : false, /* 复制更多弹窗 */ | |
| 199 | + pdfFileUrl: '', | |
| 200 | + currentHoverSid: '', | |
| 195 | 201 | simpleModalVisible: false, |
| 196 | - simpleModalWord: "", | |
| 202 | + simpleModalWord: '', | |
| 197 | 203 | }; |
| 198 | - this.rowKey = | |
| 199 | - commonUtils.isNotEmptyObject(props.tableProps) && !commonUtils.isEmpty(props.tableProps.rowKey) | |
| 200 | - ? props.tableProps.rowKey | |
| 201 | - : "sId"; /* 表格主键 */ | |
| 204 | + this.rowKey = commonUtils.isNotEmptyObject(props.tableProps) && !commonUtils.isEmpty(props.tableProps.rowKey) ? props.tableProps.rowKey : 'sId'; /* 表格主键 */ | |
| 202 | 205 | this.config = {}; /* 配置信息(基础)(数据格式:对象) */ |
| 203 | 206 | this.tableColumn = []; /* table的表头信息(数据类型:数组对象) */ |
| 204 | 207 | this.tableInfoColumn = []; |
| 205 | 208 | this.scrollX = 0; /* 表格宽度统计值(数据格式:整形) */ |
| 206 | - this.scrollY = this.props.tableProps ? (this.props.tableProps.AutoTableHeight ? this.props.tableProps.AutoTableHeight : 0) : 0; | |
| 209 | + this.scrollY = this.props.tableProps ? this.props.tableProps.AutoTableHeight ? this.props.tableProps.AutoTableHeight : 0 : 0; | |
| 207 | 210 | this.scrollInfoX = 0; /* 表格宽度统计值(数据格式:整形) */ |
| 208 | - this.formId = ""; /* 窗体Id(数据格式:字符串) */ | |
| 209 | - this.sId = ""; /* 表格Id(数据格式:字符串) */ | |
| 211 | + this.formId = ''; /* 窗体Id(数据格式:字符串) */ | |
| 212 | + this.sId = ''; /* 表格Id(数据格式:字符串) */ | |
| 210 | 213 | this.isUploadShow = false; /* 是否显示上传控件(数据格式:布尔) */ |
| 211 | 214 | this.isDownloadShow = false; /* 是否显示上传控件(数据格式:布尔) */ |
| 212 | 215 | this.isLookShow = false; /* 是否显示查看控件(数据格式:布尔) */ |
| 213 | 216 | this.isAddShow = false; /* 是否显示添加控件(数据格式:布尔) */ |
| 214 | 217 | this.isModalShow = false; /* 是否显示modal控件(数据格式:布尔) */ |
| 215 | - this.isModalRemarkShow = false; /* 是否显示材料备注控件(数据格式:布尔) */ | |
| 218 | + this.isModalRemarkShow = false;/* 是否显示材料备注控件(数据格式:布尔) */ | |
| 216 | 219 | this.isChooseProcessShow = false; /* 是否显示选择工序控件(数据格式:布尔) */ |
| 217 | 220 | this.isCopyShow = false; /* 是否显示复制控件(数据格式:布尔) */ |
| 218 | 221 | this.isCopyAllShow = false; /* 是否显示复制全部控件(数据格式:布尔) */ |
| ... | ... | @@ -246,12 +249,12 @@ class CommonTableRc extends React.Component { |
| 246 | 249 | this.slaveInfoHeaderMap = {}; |
| 247 | 250 | this.mergeCellList = []; |
| 248 | 251 | this.tableFilterData = []; |
| 249 | - this.pathname = ""; | |
| 252 | + this.pathname = ''; | |
| 250 | 253 | this.hasSpanBgColor = false; // 是否有span背景色 |
| 251 | 254 | this.curPagination = {}; // 当前分页数据 |
| 252 | 255 | this.selectedRowKeysOld = []; // 记录选中数据 |
| 253 | 256 | this.tableId = this.props.tableId; |
| 254 | - this.isAllowConExpendKeys = ["19211681019715708440774010"].includes(props.formId); | |
| 257 | + this.isAllowConExpendKeys = ['19211681019715708440774010'].includes(props.formId); | |
| 255 | 258 | } |
| 256 | 259 | |
| 257 | 260 | /** 渲染前只执行一次 */ |
| ... | ... | @@ -278,7 +281,7 @@ class CommonTableRc extends React.Component { |
| 278 | 281 | this.props.onRenderFinish(); |
| 279 | 282 | } |
| 280 | 283 | |
| 281 | - window.addEventListener("resize", () => { | |
| 284 | + window.addEventListener('resize', () => { | |
| 282 | 285 | this.computedTableHeight(); |
| 283 | 286 | this.computedTdWidth(true); |
| 284 | 287 | this.forceUpdate(); |
| ... | ... | @@ -295,22 +298,22 @@ class CommonTableRc extends React.Component { |
| 295 | 298 | } |
| 296 | 299 | |
| 297 | 300 | componentDidUpdate() { |
| 298 | - if ( | |
| 299 | - this.props.app && | |
| 300 | - this.props.app.currentPane && | |
| 301 | - (this.props.app.currentPane.route.indexOf("commonList") !== -1 || this.props.app.currentPane.route.indexOf("productionScheduleTree") !== -1) | |
| 301 | + if( | |
| 302 | + this.props.app && this.props.app.currentPane && (this.props.app.currentPane.route.indexOf('commonList') !== -1 | |
| 303 | + || | |
| 304 | + this.props.app.currentPane.route.indexOf('productionScheduleTree') !== -1) | |
| 302 | 305 | ) { |
| 303 | - if (this.tableHeight !== "100%" && this.tableHeight !== 0) { | |
| 304 | - if (this.props.name !== "report") { | |
| 305 | - this.mydiv.getElementsByClassName("ant-table-body")[0].style.height = this.tableHeight ? this.tableHeight + "px" : 80 + "px"; | |
| 306 | + if (this.tableHeight !== '100%' && this.tableHeight !== 0) { | |
| 307 | + if (this.props.name !== 'report') { | |
| 308 | + this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = this.tableHeight ? this.tableHeight + 'px': 80 + 'px'; | |
| 306 | 309 | } |
| 307 | 310 | } |
| 308 | 311 | } |
| 309 | 312 | |
| 310 | - let divs = document.getElementsByClassName("noInputInsert"); | |
| 313 | + let divs = document.getElementsByClassName('noInputInsert'); | |
| 311 | 314 | if (divs.length) { |
| 312 | 315 | Array.prototype.forEach.call(divs, item => { |
| 313 | - item.parentNode.parentNode.parentNode.parentNode.classList.add("insertTd"); | |
| 316 | + item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 314 | 317 | }); |
| 315 | 318 | } |
| 316 | 319 | |
| ... | ... | @@ -318,33 +321,33 @@ class CommonTableRc extends React.Component { |
| 318 | 321 | const { tableClassName } = this.state; |
| 319 | 322 | const oTable = document.querySelectorAll(`.${tableClassName}`)[0]; |
| 320 | 323 | if (this.showExpAll && oTable) { |
| 321 | - const getTh = dom => { | |
| 324 | + const getTh = (dom) => { | |
| 322 | 325 | if (!dom) { |
| 323 | 326 | return false; |
| 324 | 327 | } |
| 325 | - if (dom.nodeName === "TH") { | |
| 328 | + if (dom.nodeName === 'TH') { | |
| 326 | 329 | return dom; |
| 327 | 330 | } else { |
| 328 | 331 | return getTh(dom.parentNode); |
| 329 | 332 | } |
| 330 | - }; | |
| 331 | - const oHeader = oTable.querySelector(".ant-table-header"); | |
| 332 | - const oThDivs = oHeader.querySelectorAll(".th-div"); | |
| 333 | + } | |
| 334 | + const oHeader = oTable.querySelector('.ant-table-header'); | |
| 335 | + const oThDivs = oHeader.querySelectorAll('.th-div'); | |
| 333 | 336 | const oThs = Array.from(oThDivs).map(item => getTh(item)); |
| 334 | 337 | // const oThs = oHeader.querySelectorAll('th[tabindex]'); |
| 335 | - const oExpAllIcon = oHeader.querySelector(".table-expAllIcon"); | |
| 338 | + const oExpAllIcon = oHeader.querySelector('.table-expAllIcon'); | |
| 336 | 339 | if (oExpAllIcon) { |
| 337 | 340 | const oTh = getTh(oExpAllIcon); |
| 338 | 341 | if (oTh) { |
| 339 | 342 | const index = [].indexOf.call(oThs, oTh); |
| 340 | 343 | if (index > 0) { |
| 341 | - const oFirstThDiv = oHeader.querySelector(".th-div"); | |
| 344 | + const oFirstThDiv = oHeader.querySelector('.th-div'); | |
| 342 | 345 | oFirstThDiv && oFirstThDiv.prepend(oExpAllIcon); |
| 343 | 346 | } |
| 344 | 347 | } |
| 345 | 348 | } |
| 346 | 349 | } |
| 347 | - if (this.simpleModalRef.current) this.simpleModalRef.current.innerHTML = this.state.simpleModalWord || ""; | |
| 350 | + if (this.simpleModalRef.current) this.simpleModalRef.current.innerHTML = this.state.simpleModalWord || ''; | |
| 348 | 351 | } |
| 349 | 352 | |
| 350 | 353 | /** props改变的时候触发s */ |
| ... | ... | @@ -364,7 +367,7 @@ class CommonTableRc extends React.Component { |
| 364 | 367 | } |
| 365 | 368 | if (this.state.openNewTabFlag && this.pathname === location.pathname) { |
| 366 | 369 | const dom = document.getElementsByClassName(`${this.state.randomId}-CommonListSelectTree`)[0]; |
| 367 | - dom.parentElement.parentElement.style.display = "block"; | |
| 370 | + dom.parentElement.parentElement.style.display = 'block'; | |
| 368 | 371 | this.setState({ |
| 369 | 372 | openNewTabFlag: false, |
| 370 | 373 | }); |
| ... | ... | @@ -374,26 +377,11 @@ class CommonTableRc extends React.Component { |
| 374 | 377 | /** 返回true执行渲染,返回false不渲染 */ |
| 375 | 378 | shouldComponentUpdate(nextProps, nextState) { |
| 376 | 379 | const { |
| 377 | - headerColumn, | |
| 378 | - tableColumn, | |
| 379 | - dataSource, | |
| 380 | - totalData, | |
| 381 | - totalData1, | |
| 382 | - selectedRowKeys, | |
| 383 | - enabled, | |
| 384 | - filteredValue, | |
| 385 | - previewVisible, | |
| 386 | - previewImage, | |
| 387 | - slaveInfoSelectedRowKeys, | |
| 388 | - slaveInfo, | |
| 389 | - expKeys, | |
| 390 | - commonPopupVisible, | |
| 391 | - commonFieldPopupVisible, | |
| 392 | - realizeHeight, | |
| 380 | + headerColumn, tableColumn, dataSource, totalData, totalData1, selectedRowKeys, enabled, filteredValue, | |
| 381 | + previewVisible, previewImage, slaveInfoSelectedRowKeys, slaveInfo, expKeys, commonPopupVisible, commonFieldPopupVisible, realizeHeight, | |
| 393 | 382 | bOperateMoreVisible, |
| 394 | 383 | } = this.state; |
| 395 | - return ( | |
| 396 | - enabled !== nextState.enabled || | |
| 384 | + return enabled !== nextState.enabled || | |
| 397 | 385 | this.props.updateRowNumTime !== nextState.updateRowNumTime || |
| 398 | 386 | JSON.stringify(this.props.isDragAndDrop) !== JSON.stringify(nextProps.isDragAndDrop) || |
| 399 | 387 | // JSON.stringify(headerColumn) !== JSON.stringify(nextState.headerColumn) || |
| ... | ... | @@ -416,13 +404,12 @@ class CommonTableRc extends React.Component { |
| 416 | 404 | JSON.stringify(nextProps.slaveInfo) !== slaveInfo || |
| 417 | 405 | JSON.stringify(nextProps.realizeHeight) !== realizeHeight || |
| 418 | 406 | this.props.tableProps.newButton !== nextProps.tableProps.newButton || |
| 419 | - this.state.simpleModalVisible !== nextState.simpleModalVisible | |
| 420 | - ); | |
| 407 | + this.state.simpleModalVisible !== nextState.simpleModalVisible; | |
| 421 | 408 | } |
| 422 | 409 | |
| 423 | 410 | componentWillUnmount() { |
| 424 | 411 | this.mounted = false; |
| 425 | - window.removeEventListener("resize", () => { | |
| 412 | + window.removeEventListener('resize', () => { | |
| 426 | 413 | this.computedTableHeight(); |
| 427 | 414 | this.forceUpdate(); |
| 428 | 415 | }); |
| ... | ... | @@ -435,23 +422,23 @@ class CommonTableRc extends React.Component { |
| 435 | 422 | |
| 436 | 423 | simpleModalRef = React.createRef(); |
| 437 | 424 | |
| 438 | - handleLastTdMouseOver = event => { | |
| 425 | + handleLastTdMouseOver = (event) => { | |
| 439 | 426 | try { |
| 440 | - if (event.target.classList.contains("react-resizable-handle") && event.target.parentNode.getAttribute("bnotresize") === "bNotResize") { | |
| 441 | - const oBody = this.mydiv.querySelector(".ant-table-body"); | |
| 427 | + if (event.target.classList.contains('react-resizable-handle') && event.target.parentNode.getAttribute('bnotresize') === 'bNotResize') { | |
| 428 | + const oBody = this.mydiv.querySelector('.ant-table-body'); | |
| 442 | 429 | const { scrollWidth, clientWidth } = oBody; |
| 443 | 430 | const oResizable = event.target; |
| 444 | 431 | if (scrollWidth === clientWidth) { |
| 445 | - oResizable.style.cursor = "default"; | |
| 432 | + oResizable.style.cursor = 'default'; | |
| 446 | 433 | return; |
| 447 | 434 | } |
| 448 | 435 | this.lastTdMouseOver = true; |
| 449 | 436 | let minLeft, maxLeft, diffx; |
| 450 | - oResizable.style.cursor = "col-resize"; | |
| 451 | - const tempDom = document.createElement("div"); | |
| 452 | - const mask = document.createElement("div"); | |
| 453 | - mask.style = "position: absolute; width: 100%; height: 100%; left: 0; top: 0; z-index: 9999;"; | |
| 454 | - const resizableMousemove = e => { | |
| 437 | + oResizable.style.cursor = 'col-resize'; | |
| 438 | + const tempDom = document.createElement('div'); | |
| 439 | + const mask = document.createElement('div'); | |
| 440 | + mask.style= "position: absolute; width: 100%; height: 100%; left: 0; top: 0; z-index: 9999;" | |
| 441 | + const resizableMousemove = (e) => { | |
| 455 | 442 | const { clientX } = e; |
| 456 | 443 | const left = Math.min(Math.max(minLeft, clientX), maxLeft + 200); |
| 457 | 444 | diffx = left - maxLeft; |
| ... | ... | @@ -459,20 +446,20 @@ class CommonTableRc extends React.Component { |
| 459 | 446 | diffx = Math.max(diffx, clientWidth - scrollWidth); |
| 460 | 447 | } |
| 461 | 448 | Object.assign(tempDom.style, { |
| 462 | - left: left + "px", | |
| 449 | + left: left + 'px', | |
| 463 | 450 | }); |
| 464 | - }; | |
| 451 | + } | |
| 465 | 452 | const resizableMouseup = () => { |
| 466 | 453 | this.lastTdMouseOver = false; |
| 467 | 454 | document.body.removeChild(mask); |
| 468 | 455 | document.body.removeChild(tempDom); |
| 469 | - document.removeEventListener("mouseup", resizableMouseup); | |
| 470 | - document.removeEventListener("mousemove", resizableMousemove); | |
| 456 | + document.removeEventListener('mouseup', resizableMouseup); | |
| 457 | + document.removeEventListener('mousemove', resizableMousemove); | |
| 471 | 458 | |
| 472 | 459 | const { tableColumn, headerColumn } = this.state; |
| 473 | 460 | const sessionColumn = sessionStorage.getItem(`${this.props.formId}_${this.props.config.sId}`); |
| 474 | 461 | const column = sessionColumn ? JSON.parse(sessionColumn) : tableColumn; |
| 475 | - const lastIndex = column.findIndex(item => item.dataIndex === "tableLastEmpty") - 1; | |
| 462 | + const lastIndex = column.findIndex(item => item.dataIndex === 'tableLastEmpty') - 1; | |
| 476 | 463 | if (lastIndex > -1 && diffx !== 0) { |
| 477 | 464 | const headerColumnNew = [...headerColumn]; |
| 478 | 465 | const columnNew = [...column]; |
| ... | ... | @@ -512,34 +499,34 @@ class CommonTableRc extends React.Component { |
| 512 | 499 | sessionStorage.setItem(`${this.props.formId}_${this.props.config.sId}`, JSON.stringify(columnNew)); |
| 513 | 500 | this.props.onSaveState({ |
| 514 | 501 | headerColumn: headerColumnNew, |
| 515 | - tableColumn: columnNew, | |
| 502 | + tableColumn: columnNew | |
| 516 | 503 | }); |
| 517 | 504 | } |
| 518 | - }; | |
| 505 | + } | |
| 519 | 506 | oResizable.onmousedown = () => { |
| 520 | - const { y, height } = event.target.getBoundingClientRect(); | |
| 507 | + const { y, height } = event.target.getBoundingClientRect(); | |
| 521 | 508 | minLeft = event.target.parentNode.getBoundingClientRect().x + 50; |
| 522 | 509 | maxLeft = event.target.parentNode.getBoundingClientRect().x + event.target.parentNode.getBoundingClientRect().width; |
| 523 | 510 | Object.assign(tempDom.style, { |
| 524 | - width: "2px", | |
| 525 | - height: height + "px", | |
| 526 | - background: "#1990ff", | |
| 527 | - top: y + "px", | |
| 528 | - left: maxLeft + "px", | |
| 529 | - position: "absolute", | |
| 511 | + width: '2px', | |
| 512 | + height: height + 'px', | |
| 513 | + background: '#1990ff', | |
| 514 | + top: y + 'px', | |
| 515 | + left: maxLeft + 'px', | |
| 516 | + position: 'absolute', | |
| 530 | 517 | zIndex: 9999, |
| 531 | - cursor: "col-resize", | |
| 518 | + cursor: 'col-resize' | |
| 532 | 519 | }); |
| 533 | 520 | document.body.append(mask); |
| 534 | 521 | document.body.append(tempDom); |
| 535 | - document.removeEventListener("mouseup", resizableMouseup); | |
| 536 | - document.addEventListener("mouseup", resizableMouseup); | |
| 537 | - document.removeEventListener("mousemove", resizableMousemove); | |
| 538 | - document.addEventListener("mousemove", resizableMousemove); | |
| 522 | + document.removeEventListener('mouseup', resizableMouseup); | |
| 523 | + document.addEventListener('mouseup', resizableMouseup); | |
| 524 | + document.removeEventListener('mousemove', resizableMousemove); | |
| 525 | + document.addEventListener('mousemove', resizableMousemove); | |
| 539 | 526 | }; |
| 540 | 527 | } |
| 541 | 528 | } catch (error) {} |
| 542 | - }; | |
| 529 | + } | |
| 543 | 530 | |
| 544 | 531 | /** 列拖动s */ |
| 545 | 532 | onHeaderCell = (isSlaveInfo, index, column) => { |
| ... | ... | @@ -551,7 +538,7 @@ class CommonTableRc extends React.Component { |
| 551 | 538 | } |
| 552 | 539 | // 最后一列禁止拖动 |
| 553 | 540 | let bNotResize = false; |
| 554 | - const lastIndex = columns.findIndex(item => item.dataIndex === "tableLastEmpty") - 1; | |
| 541 | + const lastIndex = columns.findIndex(item => item.dataIndex === 'tableLastEmpty') - 1; | |
| 555 | 542 | if (lastIndex > -1) { |
| 556 | 543 | if (commonUtils.isNotEmptyArr(columns[lastIndex].children)) { |
| 557 | 544 | if (columns[lastIndex].children[columns[lastIndex].children.length - 1].dataIndex === column.dataIndex) { |
| ... | ... | @@ -565,7 +552,7 @@ class CommonTableRc extends React.Component { |
| 565 | 552 | return { |
| 566 | 553 | width: column.width, |
| 567 | 554 | onResize: !bNotResize ? this.handleResize(index, column, isSlaveInfo) : null, |
| 568 | - bnotresize: bNotResize ? "bNotResize" : null, | |
| 555 | + bnotresize: bNotResize ? 'bNotResize' : null, | |
| 569 | 556 | onClick: () => {}, |
| 570 | 557 | onMouseDown: () => { |
| 571 | 558 | if (this.lastTdMouseOver) { |
| ... | ... | @@ -603,24 +590,24 @@ class CommonTableRc extends React.Component { |
| 603 | 590 | if (columns[i].children[j].dataIndex === column.dataIndex) { |
| 604 | 591 | columns[i].children[j] = { |
| 605 | 592 | ...columns[i].children[j], |
| 606 | - className: "hover-droping-cell", | |
| 593 | + className: 'hover-droping-cell', | |
| 607 | 594 | }; |
| 608 | 595 | } else { |
| 609 | 596 | columns[i].children[j] = { |
| 610 | 597 | ...columns[i].children[j], |
| 611 | - className: "", | |
| 598 | + className: '', | |
| 612 | 599 | }; |
| 613 | 600 | } |
| 614 | 601 | } |
| 615 | 602 | } else if (columns[i].dataIndex === column.dataIndex) { |
| 616 | 603 | columns[i] = { |
| 617 | 604 | ...columns[i], |
| 618 | - className: "hover-droping-cell", | |
| 605 | + className: 'hover-droping-cell', | |
| 619 | 606 | }; |
| 620 | 607 | } else { |
| 621 | 608 | columns[i] = { |
| 622 | 609 | ...columns[i], |
| 623 | - className: "", | |
| 610 | + className: '', | |
| 624 | 611 | }; |
| 625 | 612 | } |
| 626 | 613 | } |
| ... | ... | @@ -630,7 +617,7 @@ class CommonTableRc extends React.Component { |
| 630 | 617 | if (item.children) { |
| 631 | 618 | item.children.forEach(child => { |
| 632 | 619 | sortArr.push(child.dataIndex); |
| 633 | - }); | |
| 620 | + }) | |
| 634 | 621 | } else { |
| 635 | 622 | sortArr.push(item.dataIndex); |
| 636 | 623 | } |
| ... | ... | @@ -653,10 +640,9 @@ class CommonTableRc extends React.Component { |
| 653 | 640 | const sortItems = []; |
| 654 | 641 | if (this.droping && !commonUtils.isEmpty(this.initColumn) && this.initColumn.dataIndex !== column.dataIndex) { |
| 655 | 642 | const bTargetMuti = columns.findIndex(item => item.dataIndex === column.dataIndex) === -1; // 移动到的目标是否是多表头 |
| 656 | - if (!this.bInitColumnMuti && !bTargetMuti) { | |
| 657 | - // 拖拽对象【单表头】、移动到的目标【单表头】 | |
| 643 | + if (!this.bInitColumnMuti && !bTargetMuti) { // 拖拽对象【单表头】、移动到的目标【单表头】 | |
| 658 | 644 | for (const i in columns) { |
| 659 | - columns[i].className = ""; | |
| 645 | + columns[i].className = ''; | |
| 660 | 646 | if (columns[i].dataIndex === this.initColumn.dataIndex) { |
| 661 | 647 | columns.splice(i, 1); |
| 662 | 648 | spliceIndex = columns.findIndex(item => item.dataIndex === column.dataIndex); |
| ... | ... | @@ -665,8 +651,7 @@ class CommonTableRc extends React.Component { |
| 665 | 651 | sortItems.push(column.dataIndex); |
| 666 | 652 | } |
| 667 | 653 | } |
| 668 | - } else if (!this.bInitColumnMuti && bTargetMuti) { | |
| 669 | - // 拖拽对象【单表头】、移动到的目标【双表头】 | |
| 654 | + } else if (!this.bInitColumnMuti && bTargetMuti) { // 拖拽对象【单表头】、移动到的目标【双表头】 | |
| 670 | 655 | let iIndexArr = []; |
| 671 | 656 | // 获取拖拽对象index |
| 672 | 657 | const initColumnIndex = columns.findIndex(item => item.dataIndex === this.initColumn.dataIndex); |
| ... | ... | @@ -676,7 +661,7 @@ class CommonTableRc extends React.Component { |
| 676 | 661 | if (commonUtils.isNotEmptyArr(children)) { |
| 677 | 662 | const iIndex = children.findIndex(item => item.dataIndex === column.dataIndex); |
| 678 | 663 | if (iIndex !== -1) { |
| 679 | - columns[i].children[iIndex].className = ""; | |
| 664 | + columns[i].children[iIndex].className = ''; | |
| 680 | 665 | iIndexArr = [i, iIndex]; |
| 681 | 666 | break; |
| 682 | 667 | } |
| ... | ... | @@ -690,12 +675,10 @@ class CommonTableRc extends React.Component { |
| 690 | 675 | if (spliceIndex >= initColumnIndex) { |
| 691 | 676 | spliceIndex -= 1; |
| 692 | 677 | } |
| 693 | - if (iIndexArr[1] === 0) { | |
| 694 | - //如果目标对象是第一个 | |
| 678 | + if (iIndexArr[1] === 0) { //如果目标对象是第一个 | |
| 695 | 679 | // 将拖拽对象插入到目标对象前面 |
| 696 | 680 | columns.splice(spliceIndex, 0, this.initColumn); |
| 697 | - } else if (iIndexArr[1] > 0) { | |
| 698 | - // 如果目标对象不是第一个 | |
| 681 | + } else if (iIndexArr[1] > 0) { // 如果目标对象不是第一个 | |
| 699 | 682 | // 取出目标对象数组 |
| 700 | 683 | const targetColumn = columns.splice(spliceIndex, 1)[0]; |
| 701 | 684 | const column1 = { ...targetColumn, children: targetColumn.children.filter((item, index) => index < iIndexArr[1]) }; |
| ... | ... | @@ -703,8 +686,7 @@ class CommonTableRc extends React.Component { |
| 703 | 686 | columns.splice(spliceIndex, 0, column1, this.initColumn, column2); |
| 704 | 687 | } |
| 705 | 688 | } |
| 706 | - } else if (this.bInitColumnMuti && !bTargetMuti) { | |
| 707 | - // 拖拽对象【双表头】、移动到的目标【单表头】 | |
| 689 | + } else if (this.bInitColumnMuti && !bTargetMuti) { // 拖拽对象【双表头】、移动到的目标【单表头】 | |
| 708 | 690 | // 获取拖拽对象index |
| 709 | 691 | let initColumnIndexArr = []; |
| 710 | 692 | for (const i in columns) { |
| ... | ... | @@ -718,23 +700,20 @@ class CommonTableRc extends React.Component { |
| 718 | 700 | } |
| 719 | 701 | if (commonUtils.isNotEmptyArr(initColumnIndexArr)) { |
| 720 | 702 | spliceIndex = columns.findIndex(item => item.dataIndex === column.dataIndex); |
| 721 | - columns[spliceIndex].className = ""; | |
| 703 | + columns[spliceIndex].className = ''; | |
| 722 | 704 | if (columns[initColumnIndexArr[0]].children.length === 1) { |
| 723 | 705 | const initColumnParent = columns.splice(initColumnIndexArr[0], 1)[0]; |
| 724 | 706 | columns.splice(spliceIndex, 0, initColumnParent); |
| 725 | 707 | } else { |
| 726 | 708 | const newColumn = { |
| 727 | 709 | ...columns[initColumnIndexArr[0]], |
| 728 | - children: [columns[initColumnIndexArr[0]].children[initColumnIndexArr[1]]], | |
| 710 | + children: [columns[initColumnIndexArr[0]].children[initColumnIndexArr[1]]] | |
| 729 | 711 | }; |
| 730 | - columns[initColumnIndexArr[0]].children = columns[initColumnIndexArr[0]].children.filter( | |
| 731 | - item => item.dataIndex !== newColumn.children[0].dataIndex | |
| 732 | - ); | |
| 712 | + columns[initColumnIndexArr[0]].children = columns[initColumnIndexArr[0]].children.filter(item => item.dataIndex !== newColumn.children[0].dataIndex); | |
| 733 | 713 | columns.splice(spliceIndex, 0, newColumn); |
| 734 | 714 | } |
| 735 | 715 | } |
| 736 | - } else { | |
| 737 | - // 拖拽对象【双表头】、移动到的目标【双表头】 | |
| 716 | + } else { // 拖拽对象【双表头】、移动到的目标【双表头】 | |
| 738 | 717 | // 获取拖拽对象index |
| 739 | 718 | let initColumnIndexArr = []; |
| 740 | 719 | for (const i in columns) { |
| ... | ... | @@ -754,7 +733,7 @@ class CommonTableRc extends React.Component { |
| 754 | 733 | if (commonUtils.isNotEmptyArr(children)) { |
| 755 | 734 | const iIndex = children.findIndex(item => item.dataIndex === column.dataIndex); |
| 756 | 735 | if (iIndex !== -1) { |
| 757 | - columns[i].children[iIndex].className = ""; | |
| 736 | + columns[i].children[iIndex].className = ''; | |
| 758 | 737 | iIndexArr = [i, iIndex]; |
| 759 | 738 | break; |
| 760 | 739 | } |
| ... | ... | @@ -762,33 +741,27 @@ class CommonTableRc extends React.Component { |
| 762 | 741 | } |
| 763 | 742 | |
| 764 | 743 | if (commonUtils.isNotEmptyArr(initColumnIndexArr) && commonUtils.isNotEmptyArr(iIndexArr)) { |
| 765 | - if (initColumnIndexArr[0] === iIndexArr[0]) { | |
| 766 | - // 同一个一级表头 | |
| 744 | + if (initColumnIndexArr[0] === iIndexArr[0]) { // 同一个一级表头 | |
| 767 | 745 | columns[initColumnIndexArr[0]].children.splice(initColumnIndexArr[1], 1); |
| 768 | 746 | spliceIndex = columns[initColumnIndexArr[0]].children.findIndex(item => item.dataIndex === column.dataIndex); |
| 769 | 747 | columns[initColumnIndexArr[0]].children.splice(spliceIndex, 0, this.initColumn); |
| 770 | - } else { | |
| 771 | - // 不同的一级表头 | |
| 748 | + } else { // 不同的一级表头 | |
| 772 | 749 | const newColumn = { |
| 773 | 750 | ...columns[initColumnIndexArr[0]], |
| 774 | - children: [columns[initColumnIndexArr[0]].children[initColumnIndexArr[1]]], | |
| 751 | + children: [columns[initColumnIndexArr[0]].children[initColumnIndexArr[1]]] | |
| 775 | 752 | }; |
| 776 | - if (iIndexArr[1] === 0) { | |
| 777 | - // 最前面 | |
| 753 | + if (iIndexArr[1] === 0) { // 最前面 | |
| 778 | 754 | columns[initColumnIndexArr[0]].children.splice(initColumnIndexArr[1], 1); |
| 779 | 755 | spliceIndex = iIndexArr[0]; |
| 780 | - if (columns[initColumnIndexArr[0]].children.length === 0) { | |
| 781 | - // 剩下的二层表头为空 | |
| 756 | + if (columns[initColumnIndexArr[0]].children.length === 0) { // 剩下的二层表头为空 | |
| 782 | 757 | columns.splice(initColumnIndexArr[0], 1); |
| 783 | 758 | spliceIndex = initColumnIndexArr[0] < spliceIndex ? spliceIndex - 1 : spliceIndex; |
| 784 | 759 | } |
| 785 | 760 | columns.splice(spliceIndex, 0, newColumn); |
| 786 | - } else { | |
| 787 | - // 插到其它二级表头中间 | |
| 761 | + } else { // 插到其它二级表头中间 | |
| 788 | 762 | columns[initColumnIndexArr[0]].children.splice(initColumnIndexArr[1], 1); |
| 789 | 763 | spliceIndex = iIndexArr[0]; |
| 790 | - if (columns[initColumnIndexArr[0]].children.length === 0) { | |
| 791 | - // 剩下的二层表头为空 | |
| 764 | + if (columns[initColumnIndexArr[0]].children.length === 0) { // 剩下的二层表头为空 | |
| 792 | 765 | columns.splice(initColumnIndexArr[0], 1); |
| 793 | 766 | spliceIndex = initColumnIndexArr[0] < spliceIndex ? spliceIndex - 1 : spliceIndex; |
| 794 | 767 | } |
| ... | ... | @@ -799,6 +772,7 @@ class CommonTableRc extends React.Component { |
| 799 | 772 | } |
| 800 | 773 | } |
| 801 | 774 | } |
| 775 | + | |
| 802 | 776 | } |
| 803 | 777 | // 合并一级表头相同的相邻的column |
| 804 | 778 | columns = columns.reduce((prev, cur) => { |
| ... | ... | @@ -823,7 +797,7 @@ class CommonTableRc extends React.Component { |
| 823 | 797 | if (item.children) { |
| 824 | 798 | item.children.forEach(child => { |
| 825 | 799 | sortArr.push(child.dataIndex); |
| 826 | - }); | |
| 800 | + }) | |
| 827 | 801 | } else { |
| 828 | 802 | sortArr.push(item.dataIndex); |
| 829 | 803 | } |
| ... | ... | @@ -848,7 +822,7 @@ class CommonTableRc extends React.Component { |
| 848 | 822 | this.droping = false; |
| 849 | 823 | } |
| 850 | 824 | }, |
| 851 | - onContextMenu: event => { | |
| 825 | + onContextMenu: (event) => { | |
| 852 | 826 | window.event.returnValue = false; |
| 853 | 827 | }, |
| 854 | 828 | }; |
| ... | ... | @@ -888,16 +862,17 @@ class CommonTableRc extends React.Component { |
| 888 | 862 | // this.handleSelectRowChange(this.props.name, [record[this.rowKey]]); |
| 889 | 863 | }, 150); |
| 890 | 864 | } |
| 891 | - }; | |
| 865 | + } | |
| 892 | 866 | |
| 893 | - onRowMouseLeave = () => { | |
| 867 | + onRowMouseLeave= () => { | |
| 894 | 868 | if (this.timerSelectRowChange) { |
| 895 | 869 | this.setState({ |
| 896 | - currentHoverSid: "", | |
| 870 | + currentHoverSid: '', | |
| 897 | 871 | }); |
| 898 | 872 | clearTimeout(this.timerSelectRowChange); |
| 899 | 873 | } |
| 900 | - }; | |
| 874 | + } | |
| 875 | + | |
| 901 | 876 | |
| 902 | 877 | rowClickRef = React.createRef(); |
| 903 | 878 | |
| ... | ... | @@ -909,32 +884,28 @@ class CommonTableRc extends React.Component { |
| 909 | 884 | this.stopRowClick = false; |
| 910 | 885 | return; |
| 911 | 886 | } |
| 912 | - const { bMutiSelect, tableProps, bMutiSelect1, bRowClick, bContinueClick } = this.props; | |
| 887 | + const { | |
| 888 | + bMutiSelect, tableProps, bMutiSelect1, bRowClick, bContinueClick, | |
| 889 | + } = this.props; | |
| 913 | 890 | const { rowSelection } = tableProps; |
| 914 | 891 | // let { selectedRowKeys } = this.props; |
| 915 | 892 | this.rowClickRef.current = index; |
| 916 | 893 | |
| 917 | - const bSlaveInfo = tabType && tabType.includes("slave") && tabType.includes("Info"); | |
| 894 | + const bSlaveInfo = tabType && tabType.includes('slave') && tabType.includes('Info'); | |
| 918 | 895 | |
| 919 | 896 | const rowKey = bSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) ? this.props.slaveInfo.tableProps.rowKey : this.rowKey; |
| 920 | - let selectedRowKeys = | |
| 921 | - bSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) | |
| 922 | - ? this.props.slaveInfo.selectedRowKeys === undefined | |
| 923 | - ? undefined | |
| 924 | - : [...this.props.slaveInfo.selectedRowKeys] | |
| 925 | - : this.props.selectedRowKeys === undefined | |
| 926 | - ? undefined | |
| 927 | - : [...this.props.selectedRowKeys]; | |
| 897 | + let selectedRowKeys = bSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) ? | |
| 898 | + this.props.slaveInfo.selectedRowKeys === undefined ? undefined : [...this.props.slaveInfo.selectedRowKeys] : | |
| 899 | + this.props.selectedRowKeys === undefined ? undefined : [...this.props.selectedRowKeys]; | |
| 928 | 900 | // bMutiSelect1默认都为false,如果想点击整行时勾选框不勾选,props里面设置bMutiSelect1为true即可 |
| 929 | - if (selectedRowKeys && selectedRowKeys.indexOf(record[rowKey]) !== -1 && name !== "slave" && !this.props.bRowClickRepeat) { | |
| 901 | + if (selectedRowKeys && selectedRowKeys.indexOf(record[rowKey]) !== -1 && name !== 'slave' && !this.props.bRowClickRepeat) { | |
| 930 | 902 | return; |
| 931 | 903 | } |
| 932 | - if (selectedRowKeys && selectedRowKeys.indexOf(record[rowKey]) !== -1 && name !== "slave" && !this.props.enabled && !this.props.bRowClickRepeat) { | |
| 904 | + if (selectedRowKeys && selectedRowKeys.indexOf(record[rowKey]) !== -1 && name !== 'slave' && !this.props.enabled && !this.props.bRowClickRepeat) { | |
| 933 | 905 | this.handleSelectRowChange(name, []); |
| 934 | 906 | return; |
| 935 | 907 | } |
| 936 | - if (bMutiSelect && rowSelection !== null && !bMutiSelect1) { | |
| 937 | - /* 有多选、复选框情况下 */ | |
| 908 | + if (bMutiSelect && rowSelection !== null && !bMutiSelect1) { /* 有多选、复选框情况下 */ | |
| 938 | 909 | if (commonUtils.isEmptyArr(selectedRowKeys) || bContinueClick) { |
| 939 | 910 | const keys = []; |
| 940 | 911 | keys.push(record[rowKey]); |
| ... | ... | @@ -943,7 +914,7 @@ class CommonTableRc extends React.Component { |
| 943 | 914 | const indexKey = selectedRowKeys.indexOf(record[rowKey]); |
| 944 | 915 | if (indexKey === -1) { |
| 945 | 916 | selectedRowKeys.push(record[rowKey]); |
| 946 | - } else if (indexKey !== -1 && type !== "drag") { | |
| 917 | + } else if (indexKey !== -1 && type !== 'drag') { | |
| 947 | 918 | if (!bRowClick) { |
| 948 | 919 | selectedRowKeys.splice(indexKey, 1); /* 可输入行,行内点击时 不去除selectedRowKeys */ |
| 949 | 920 | } |
| ... | ... | @@ -961,28 +932,28 @@ class CommonTableRc extends React.Component { |
| 961 | 932 | return { |
| 962 | 933 | ...item, |
| 963 | 934 | parentRowKeyPath, |
| 964 | - }; | |
| 935 | + } | |
| 965 | 936 | }); |
| 966 | 937 | res.forEach(item => { |
| 967 | 938 | if (commonUtils.isNotEmptyArr(item.children)) { |
| 968 | 939 | res = [...res, ...this.getDataAll(item.children, [...parentRowKeyPath, item[this.rowKey]])]; |
| 969 | 940 | } |
| 970 | - }); | |
| 941 | + }) | |
| 971 | 942 | return res; |
| 972 | - }; | |
| 943 | + } | |
| 973 | 944 | |
| 974 | 945 | // 处理树形表格多选父子联动 |
| 975 | - handleMutiSelectRowKeys = selectedRowKeys => { | |
| 976 | - const { bMutiSelect, tableProps, bMutiSelect1 } = this.props; | |
| 946 | + handleMutiSelectRowKeys = (selectedRowKeys) => { | |
| 947 | + const { | |
| 948 | + bMutiSelect, tableProps, bMutiSelect1, | |
| 949 | + } = this.props; | |
| 977 | 950 | const { rowSelection } = tableProps; |
| 978 | - if (bMutiSelect && rowSelection !== null && !bMutiSelect1) { | |
| 979 | - /* 有多选、复选框情况下 */ | |
| 951 | + if (bMutiSelect && rowSelection !== null && !bMutiSelect1) { /* 有多选、复选框情况下 */ | |
| 980 | 952 | // 判断是选中还是取消 |
| 981 | - const type = selectedRowKeys.length > this.selectedRowKeysOld.length ? "add" : "del"; | |
| 953 | + const type = selectedRowKeys.length > this.selectedRowKeysOld.length ? 'add' : 'del'; | |
| 982 | 954 | // 找出变化的数据 |
| 983 | - const diffArr = this.selectedRowKeysOld | |
| 984 | - .concat(selectedRowKeys) | |
| 985 | - .filter(v => !this.selectedRowKeysOld.includes(v) || !selectedRowKeys.includes(v)); | |
| 955 | + const diffArr = this.selectedRowKeysOld.concat(selectedRowKeys) | |
| 956 | + .filter(v => !this.selectedRowKeysOld.includes((v)) || !selectedRowKeys.includes((v))); | |
| 986 | 957 | if (diffArr.length === 1) { |
| 987 | 958 | // 将数据扁平化 |
| 988 | 959 | let { data } = this.props; |
| ... | ... | @@ -994,7 +965,7 @@ class CommonTableRc extends React.Component { |
| 994 | 965 | } |
| 995 | 966 | return result; |
| 996 | 967 | }, []); |
| 997 | - if (type === "add") { | |
| 968 | + if (type === 'add') { | |
| 998 | 969 | // 合并选中行 |
| 999 | 970 | selectedRowKeys = Array.from(new Set([...selectedRowKeys, ...selectedRowKeysExtra])); |
| 1000 | 971 | } else { |
| ... | ... | @@ -1014,7 +985,7 @@ class CommonTableRc extends React.Component { |
| 1014 | 985 | |
| 1015 | 986 | /** 行选择 */ |
| 1016 | 987 | onDoubleClick = (name, record) => { |
| 1017 | - const picArrConfig = this.props.config.gdsconfigformslave.find(item => item.sName === "picArr"); | |
| 988 | + const picArrConfig = this.props.config.gdsconfigformslave.find(item => item.sName === 'picArr'); | |
| 1018 | 989 | if (picArrConfig?.sActiveId === "172129113112117442504826460") { |
| 1019 | 990 | // 自动拼版 |
| 1020 | 991 | if (record.bMakeUpEnd) { |
| ... | ... | @@ -1032,59 +1003,53 @@ class CommonTableRc extends React.Component { |
| 1032 | 1003 | }; |
| 1033 | 1004 | |
| 1034 | 1005 | onKeyDownDiv = (e, sName) => { |
| 1035 | - if (e.key === "F10") { | |
| 1006 | + if (e.key === 'F10') { | |
| 1036 | 1007 | message.info(sName); |
| 1037 | 1008 | } else if (e.ctrlKey && e.keyCode === 67) { |
| 1038 | - console.log("复制成功!"); | |
| 1009 | + console.log('复制成功!'); | |
| 1039 | 1010 | } else if (e.ctrlKey && e.keyCode === 65) { |
| 1040 | - console.log("全选成功!"); | |
| 1041 | - } else if (e.ctrlKey && (e.altKey || e.metaKey) && e.keyCode === 71) { | |
| 1042 | - /* CTRL+ALT+G F7 设置界面 */ | |
| 1043 | - const { name, config, data, configName } = this.props; | |
| 1044 | - const { sType } = this.props?.app?.userinfo || {}; | |
| 1045 | - if (!["sysadmin"].includes(sType)) { | |
| 1046 | - return; | |
| 1047 | - } | |
| 1048 | - if ( | |
| 1049 | - commonUtils.isNotEmptyObject(this.props) && | |
| 1050 | - commonUtils.isNotEmptyObject(this.props.config) && | |
| 1051 | - commonUtils.isNotEmptyObject(this.props.data) | |
| 1052 | - ) { | |
| 1053 | - const bInModal = el => { | |
| 1011 | + console.log('全选成功!'); | |
| 1012 | + } else if (e.ctrlKey && (e.altKey || e.metaKey) && e.keyCode === 71) { /* CTRL+ALT+G F7 设置界面 */ | |
| 1013 | + const {name, config, data, configName } = this.props; | |
| 1014 | + const { sType } = this.props?.app?.userinfo || {}; | |
| 1015 | + if (!['sysadmin'].includes(sType)) { | |
| 1016 | + return; | |
| 1017 | + } | |
| 1018 | + if (commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.config) && commonUtils.isNotEmptyObject(this.props.data)) { | |
| 1019 | + const bInModal = (el) => { | |
| 1054 | 1020 | if (commonUtils.isEmpty(el) || commonUtils.isEmpty(el.classList)) { |
| 1055 | 1021 | return false; |
| 1056 | - } else if (el.classList.contains("ant-modal-root")) { | |
| 1022 | + } else if (el.classList.contains('ant-modal-root')) { | |
| 1057 | 1023 | return true; |
| 1058 | 1024 | } else { |
| 1059 | 1025 | return bInModal(el.parentNode); |
| 1060 | 1026 | } |
| 1061 | - }; | |
| 1062 | - if (bInModal(e.target)) { | |
| 1063 | - // 如果是在modal里的表格,不允许跳转 | |
| 1027 | + } | |
| 1028 | + if (bInModal(e.target)) { // 如果是在modal里的表格,不允许跳转 | |
| 1064 | 1029 | return; |
| 1065 | 1030 | } |
| 1066 | 1031 | const myTableConfig = JSON.parse(JSON.stringify(config)); |
| 1067 | - myTableConfig.sActiveId = "16411004790004762980820285096000"; | |
| 1032 | + myTableConfig.sActiveId = '16411004790004762980820285096000'; | |
| 1068 | 1033 | myTableConfig.sName = sName; |
| 1069 | 1034 | const myTableConfigArr = []; |
| 1070 | 1035 | myTableConfigArr.push(myTableConfig); |
| 1071 | - this.props.onViewClick(name, "myTableConfig", data[0], 0, myTableConfigArr, configName); | |
| 1036 | + this.props.onViewClick(name, 'myTableConfig', data[0], 0, myTableConfigArr, configName); | |
| 1072 | 1037 | } |
| 1073 | - } else if (e.key !== "F12") { | |
| 1038 | + } else if (e.key !== 'F12') { | |
| 1074 | 1039 | e.preventDefault(); |
| 1075 | 1040 | return false; |
| 1076 | 1041 | } |
| 1077 | - }; | |
| 1042 | + } | |
| 1078 | 1043 | |
| 1079 | 1044 | onExpand = (expanded, record) => { |
| 1080 | 1045 | if (this.props.onExpand !== undefined) { |
| 1081 | 1046 | this.props.onExpand(expanded, record); |
| 1082 | 1047 | } |
| 1083 | - }; | |
| 1048 | + } | |
| 1084 | 1049 | |
| 1085 | 1050 | onOpenNewTab = () => { |
| 1086 | 1051 | const dom = document.getElementsByClassName(`${this.state.randomId}-CommonListSelectTree`)[0]; |
| 1087 | - dom.parentElement.parentElement.style.display = "none"; | |
| 1052 | + dom.parentElement.parentElement.style.display = 'none'; | |
| 1088 | 1053 | this.pathname = location.pathname; |
| 1089 | 1054 | this.setState({ |
| 1090 | 1055 | openNewTabFlag: true, |
| ... | ... | @@ -1095,16 +1060,14 @@ class CommonTableRc extends React.Component { |
| 1095 | 1060 | if (this.showExpAll) { |
| 1096 | 1061 | this.showExpAll = false; |
| 1097 | 1062 | this.setState({ |
| 1098 | - expKeys: [], | |
| 1063 | + expKeys: [] | |
| 1099 | 1064 | }); |
| 1100 | 1065 | } |
| 1101 | 1066 | if (commonUtils.isNotEmptyObject(filters)) { |
| 1102 | 1067 | const filterValueArr = Object.values(filters); |
| 1103 | - if (filterValueArr.join("") !== "" && commonUtils.isNotEmptyArr(extra.currentDataSource)) { | |
| 1104 | - // 过滤了数据 | |
| 1068 | + if (filterValueArr.join('') !== '' && commonUtils.isNotEmptyArr(extra.currentDataSource)) { // 过滤了数据 | |
| 1105 | 1069 | this.tableFilterData = extra.currentDataSource; |
| 1106 | - } else { | |
| 1107 | - // 没有过滤数据 | |
| 1070 | + } else { // 没有过滤数据 | |
| 1108 | 1071 | this.tableFilterData = []; |
| 1109 | 1072 | } |
| 1110 | 1073 | // 生成cell list |
| ... | ... | @@ -1122,53 +1085,44 @@ class CommonTableRc extends React.Component { |
| 1122 | 1085 | this.props.tableProps.onChange(pagination, filters, sorter, extra); |
| 1123 | 1086 | } |
| 1124 | 1087 | this.props.onSaveState({ sortedInfo: sorter }); |
| 1125 | - }; | |
| 1088 | + } | |
| 1126 | 1089 | |
| 1127 | 1090 | /* 动态参数全选、取消全选 */ |
| 1128 | - onParamChange = e => { | |
| 1091 | + onParamChange = (e) => { | |
| 1129 | 1092 | this.props.onCheckChange(this.props.name); |
| 1130 | - }; | |
| 1093 | + } | |
| 1131 | 1094 | |
| 1132 | 1095 | setRowClassName = (tabType, record, index) => { |
| 1133 | 1096 | const styleColor = this.getColorStyle(record, true); |
| 1134 | 1097 | /* 消息列表未读的消息,整行文字加粗 */ |
| 1135 | - let newslistStyle = ""; | |
| 1136 | - if (commonUtils.isNotEmptyObject(this.props.formId) && this.props.formId === "15669750700007338351055957774000") { | |
| 1098 | + let newslistStyle = ''; | |
| 1099 | + if (commonUtils.isNotEmptyObject(this.props.formId) && this.props.formId === '15669750700007338351055957774000') { | |
| 1137 | 1100 | if (record.bIsView === false) { |
| 1138 | - newslistStyle = "newsNoRead"; | |
| 1101 | + newslistStyle = 'newsNoRead'; | |
| 1139 | 1102 | } |
| 1140 | 1103 | } |
| 1141 | - const bSlaveInfo = tabType && tabType.includes("slave") && tabType.includes("Info"); | |
| 1104 | + const bSlaveInfo = tabType && tabType.includes('slave') && tabType.includes('Info'); | |
| 1142 | 1105 | const selectedRowKeys = bSlaveInfo ? this.state.slaveInfoSelectedRowKeys : this.props.selectedRowKeys; |
| 1143 | 1106 | const rowKey = bSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo.tableProps) ? this.props.slaveInfo.tableProps : this.rowKey; |
| 1144 | - const rowClassName = | |
| 1145 | - commonUtils.isNotEmptyArr(selectedRowKeys) && selectedRowKeys.indexOf(record[rowKey]) > -1 | |
| 1146 | - ? `${styleColor} selected-record-row` | |
| 1147 | - : commonUtils.isNotEmptyObject(styleColor) | |
| 1148 | - ? styleColor | |
| 1149 | - : index % 2 === 1 && this.props.tableBelone === "list" | |
| 1150 | - ? "dark-record-row" | |
| 1151 | - : ""; | |
| 1107 | + const rowClassName = commonUtils.isNotEmptyArr(selectedRowKeys) && selectedRowKeys.indexOf(record[rowKey]) > -1 ? `${styleColor} selected-record-row` : commonUtils.isNotEmptyObject(styleColor) ? styleColor : (index % 2 === 1 && this.props.tableBelone === 'list') ? 'dark-record-row' : ''; | |
| 1152 | 1108 | let allRowClassName = commonUtils.isNotEmptyObject(newslistStyle) ? `${rowClassName} ${newslistStyle}` : rowClassName; |
| 1153 | - if (tabType === "slave" && commonUtils.isNotEmptyArr(this.mergeCellList)) { | |
| 1154 | - // 如果有合并单元格 | |
| 1109 | + if (tabType === 'slave' && commonUtils.isNotEmptyArr(this.mergeCellList)) { // 如果有合并单元格 | |
| 1155 | 1110 | allRowClassName = record.sColor; |
| 1156 | 1111 | } else { |
| 1157 | - if (commonUtils.isEmptyObject(allRowClassName) || commonUtils.isEmptyObject(allRowClassName.trim())) { | |
| 1158 | - /* 设置奇 偶行背景色 */ | |
| 1159 | - allRowClassName = index % 2 === 1 ? "dark-record-row" : ""; | |
| 1112 | + if (commonUtils.isEmptyObject(allRowClassName) || commonUtils.isEmptyObject(allRowClassName.trim())) { /* 设置奇 偶行背景色 */ | |
| 1113 | + allRowClassName = (index % 2 === 1) ? 'dark-record-row' : ''; | |
| 1160 | 1114 | } |
| 1161 | 1115 | } |
| 1162 | 1116 | /* 如果行字段的sDivRow有值 则做成特殊样式 */ |
| 1163 | - if (commonUtils.isNotEmptyObject(record) && commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 1164 | - allRowClassName = "split-record-row"; | |
| 1165 | - if (this.props.skipSlaveInfo) { | |
| 1166 | - allRowClassName = "split-record-row-skip"; | |
| 1117 | + if(commonUtils.isNotEmptyObject(record) && commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 1118 | + allRowClassName = 'split-record-row'; | |
| 1119 | + if (this.props.skipSlaveInfo){ | |
| 1120 | + allRowClassName = 'split-record-row-skip'; | |
| 1167 | 1121 | } |
| 1168 | 1122 | } |
| 1169 | 1123 | |
| 1170 | 1124 | if (record?.costomRowColor) { |
| 1171 | - allRowClassName = `SetRow_${record.costomRowColor}`; | |
| 1125 | + allRowClassName = `SetRow_${record.costomRowColor}` | |
| 1172 | 1126 | } |
| 1173 | 1127 | |
| 1174 | 1128 | return allRowClassName; |
| ... | ... | @@ -1177,17 +1131,16 @@ class CommonTableRc extends React.Component { |
| 1177 | 1131 | /** 获取复选框对象的props */ |
| 1178 | 1132 | getRowSelection = (name, type) => { |
| 1179 | 1133 | const { bMutiSelect, bisMutiSelect } = this.props; |
| 1180 | - if (name === "control" || (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.indexOf("commonAuto") > -1)) { | |
| 1181 | - // 控制表中可以通过bisMutiSelect显示或者隐藏勾选框 | |
| 1134 | + if (name === 'control' || (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.indexOf('commonAuto') > -1)) { // 控制表中可以通过bisMutiSelect显示或者隐藏勾选框 | |
| 1182 | 1135 | if (bisMutiSelect) { |
| 1183 | 1136 | return { |
| 1184 | 1137 | preserveSelectedRowKeys: true, |
| 1185 | - selectedRowKeys: type === "slaveInfo" ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys /* 已选择的数据集 */, | |
| 1186 | - onChange: this.handleSelectRowChange.bind(this, name) /* 选择行发生改变时调用的函数 */, | |
| 1138 | + selectedRowKeys: type === 'slaveInfo' ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys, /* 已选择的数据集 */ | |
| 1139 | + onChange: this.handleSelectRowChange.bind(this, name), /* 选择行发生改变时调用的函数 */ | |
| 1187 | 1140 | getCheckboxProps: record => ({ |
| 1188 | - style: record.bSum && commonConfig.hasSum ? { display: "none" } : { display: "checkbox" }, | |
| 1189 | - }) /* 过滤合计的选择框 */, | |
| 1190 | - type: bMutiSelect ? this.props.rowSelectionType : "radio" /* checkbox or radio */, | |
| 1141 | + style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' }, | |
| 1142 | + }), /* 过滤合计的选择框 */ | |
| 1143 | + type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */ | |
| 1191 | 1144 | columnWidth: 37, |
| 1192 | 1145 | }; |
| 1193 | 1146 | } else { |
| ... | ... | @@ -1196,14 +1149,14 @@ class CommonTableRc extends React.Component { |
| 1196 | 1149 | } else { |
| 1197 | 1150 | return { |
| 1198 | 1151 | preserveSelectedRowKeys: true, |
| 1199 | - selectedRowKeys: type === "slaveInfo" ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys /* 已选择的数据集 */, | |
| 1200 | - onChange: value => { | |
| 1152 | + selectedRowKeys: type === 'slaveInfo' ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys, /* 已选择的数据集 */ | |
| 1153 | + onChange: (value) => { | |
| 1201 | 1154 | this.handleSelectRowChange(name, value, true); |
| 1202 | - } /* 选择行发生改变时调用的函数 */, | |
| 1155 | + }, /* 选择行发生改变时调用的函数 */ | |
| 1203 | 1156 | getCheckboxProps: record => ({ |
| 1204 | - style: record.bSum && commonConfig.hasSum ? { display: "none" } : { display: "checkbox" }, | |
| 1205 | - }) /* 过滤合计的选择框 */, | |
| 1206 | - type: bMutiSelect ? this.props.rowSelectionType : "radio" /* checkbox or radio */, | |
| 1157 | + style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' }, | |
| 1158 | + }), /* 过滤合计的选择框 */ | |
| 1159 | + type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */ | |
| 1207 | 1160 | columnWidth: 37, |
| 1208 | 1161 | }; |
| 1209 | 1162 | } |
| ... | ... | @@ -1220,450 +1173,313 @@ class CommonTableRc extends React.Component { |
| 1220 | 1173 | } |
| 1221 | 1174 | return result; |
| 1222 | 1175 | }, []); |
| 1223 | - const sPartNameStatus = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === "sPartNameStatus"); | |
| 1224 | - const sPicturePath = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === "sPicturePath"); | |
| 1225 | - const sMaterialsStatus = [...tableColumn, ...subTableColumn].filter( | |
| 1226 | - item => | |
| 1227 | - item.dataIndex === "sMaterialsStatus" || | |
| 1228 | - (commonUtils.isNotEmptyArr(item.children) && | |
| 1229 | - item.children.findIndex(itemChild => itemChild.dataIndex && itemChild.dataIndex === "sMaterialsStatus") > -1) | |
| 1230 | - ); | |
| 1231 | - const dynamicColumn = [...tableColumn, ...subTableColumn].filter( | |
| 1232 | - item => | |
| 1233 | - (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.includes("_json")) || | |
| 1234 | - (commonUtils.isNotEmptyArr(item.children) && | |
| 1235 | - item.children.findIndex(itemChild => itemChild.dataIndex && itemChild.dataIndex.includes("_json")) > -1) | |
| 1236 | - ); /* 动态列JSON解析 */ | |
| 1237 | - const sTimeStatus = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === "sTimeStatus"); /* 时间进度条状态 */ | |
| 1238 | - const sDownload = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === "sDownload"); | |
| 1239 | - const sScheduleStatusJson = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex && item.dataIndex.includes("sScheduleStatusJson")); // 拼版状态 | |
| 1240 | - const sMakeUpPath = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex?.toLowerCase().includes("makeuppath")); | |
| 1176 | + const sPartNameStatus = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === 'sPartNameStatus'); | |
| 1177 | + const sPicturePath = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === 'sPicturePath'); | |
| 1178 | + const sMaterialsStatus = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === 'sMaterialsStatus' || (commonUtils.isNotEmptyArr(item.children) && item.children.findIndex(itemChild => itemChild.dataIndex && itemChild.dataIndex === 'sMaterialsStatus') > -1)); | |
| 1179 | + const dynamicColumn = [...tableColumn, ...subTableColumn].filter(item => (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.includes('_json')) || (commonUtils.isNotEmptyArr(item.children) && item.children.findIndex(itemChild => itemChild.dataIndex && itemChild.dataIndex.includes('_json')) > -1)); /* 动态列JSON解析 */ | |
| 1180 | + const sTimeStatus = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === 'sTimeStatus'); /* 时间进度条状态 */ | |
| 1181 | + const sDownload = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex === 'sDownload'); | |
| 1182 | + const sScheduleStatusJson = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex && item.dataIndex.includes('sScheduleStatusJson')); // 拼版状态 | |
| 1183 | + const sMakeUpPath = [...tableColumn, ...subTableColumn].filter(item => item.dataIndex?.toLowerCase().includes('makeuppath')); | |
| 1241 | 1184 | |
| 1242 | 1185 | if (commonUtils.isNotEmptyArr(sPicturePath)) { |
| 1243 | - sPicturePath[0].render = (value = "") => { | |
| 1244 | - const picHref = value.includes("xlyerpfiles") | |
| 1245 | - ? `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(value)}&sModelsId=100&token=${encodeURIComponent( | |
| 1246 | - this.props.app.token | |
| 1247 | - )}` | |
| 1248 | - : value; | |
| 1249 | - return ( | |
| 1250 | - <a target="_blank" key="sPicturePath" href={picHref}> | |
| 1251 | - {value} | |
| 1252 | - </a> | |
| 1253 | - ); | |
| 1254 | - }; | |
| 1186 | + sPicturePath[0].render = (value = '') => { | |
| 1187 | + const picHref = value.includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(value)}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}` : value; | |
| 1188 | + return <a target="_blank" key="sPicturePath" href={picHref}>{value}</a>; | |
| 1189 | + } | |
| 1255 | 1190 | } |
| 1256 | 1191 | |
| 1257 | 1192 | if (commonUtils.isNotEmptyArr(sDownload)) { |
| 1258 | - sDownload[0].render = value => { | |
| 1259 | - if (commonUtils.isEmpty(value)) return ""; | |
| 1260 | - const fileList = value.split(","); | |
| 1193 | + sDownload[0].render = (value) => { | |
| 1194 | + if (commonUtils.isEmpty(value)) return ''; | |
| 1195 | + const fileList = value.split(','); | |
| 1261 | 1196 | if (fileList.length === 1) { |
| 1262 | - let fileName = fileList[0].substring(fileList[0].lastIndexOf("/") + 1); | |
| 1263 | - fileName = fileName.substring(fileName.indexOf("_") + 1); | |
| 1264 | - const picHref = `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(value)}&sModelsId=100&token=${encodeURIComponent( | |
| 1265 | - this.props.app.token | |
| 1266 | - )}`; | |
| 1267 | - const fileType = fileName.split(".").pop().toLowerCase(); | |
| 1268 | - const previewFileList = ["jpg", "png", "jepg", "webp", "svg", "bmp", "apng", "pdf"]; | |
| 1269 | - return ( | |
| 1270 | - <div> | |
| 1271 | - <a | |
| 1272 | - style={!previewFileList.includes(fileType) ? { visibility: "hidden" } : {}} | |
| 1273 | - onClick={e => { | |
| 1274 | - if (fileType === "pdf") { | |
| 1275 | - this.setState({ | |
| 1276 | - pdfFileVisible: true, | |
| 1277 | - pdfFileUrl: fileList[0], | |
| 1278 | - }); | |
| 1279 | - } else { | |
| 1280 | - this.handlePreviewImage(e, fileList); | |
| 1281 | - } | |
| 1282 | - }} | |
| 1283 | - title="预览" | |
| 1284 | - > | |
| 1285 | - <EyeOutlined /> | |
| 1286 | - </a> | |
| 1287 | - <a target="_blank" key="sDownload" href={picHref} title="下载"> | |
| 1288 | - <DownloadOutlined /> | |
| 1289 | - </a> | |
| 1290 | - <span>{fileName}</span> | |
| 1291 | - </div> | |
| 1292 | - ); | |
| 1197 | + let fileName = fileList[0].substring(fileList[0].lastIndexOf('/') + 1); | |
| 1198 | + fileName = fileName.substring(fileName.indexOf('_') + 1); | |
| 1199 | + const picHref = `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(value)}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}`; | |
| 1200 | + const fileType = fileName.split('.').pop().toLowerCase(); | |
| 1201 | + const previewFileList = ['jpg', 'png', 'jepg', 'webp', 'svg', 'bmp', 'apng', 'pdf']; | |
| 1202 | + return <div> | |
| 1203 | + <a style={!previewFileList.includes(fileType) ? { visibility: 'hidden' } : {}} onClick={e => { | |
| 1204 | + if (fileType === 'pdf') { | |
| 1205 | + this.setState({ | |
| 1206 | + pdfFileVisible: true, | |
| 1207 | + pdfFileUrl: fileList[0], | |
| 1208 | + }); | |
| 1209 | + } else { | |
| 1210 | + this.handlePreviewImage(e, fileList); | |
| 1211 | + } | |
| 1212 | + }} title="预览"><EyeOutlined /></a> | |
| 1213 | + <a target="_blank" key="sDownload" href={picHref} title="下载"><DownloadOutlined /></a> | |
| 1214 | + <span>{fileName}</span> | |
| 1215 | + </div> | |
| 1293 | 1216 | } else { |
| 1294 | - return ( | |
| 1295 | - <a | |
| 1296 | - target="_blank" | |
| 1297 | - key="sDownload" | |
| 1298 | - title="附件列表" | |
| 1299 | - onClick={() => { | |
| 1300 | - this.setState({ | |
| 1301 | - commonFileDownloadVisible: true, | |
| 1302 | - commonFileDownloadList: fileList.map(item => { | |
| 1303 | - return { url: item, checked: false }; | |
| 1304 | - }), | |
| 1305 | - }); | |
| 1306 | - }} | |
| 1307 | - >{`附件(${fileList.length})`}</a> | |
| 1308 | - ); | |
| 1217 | + return <a target="_blank" key="sDownload" title="附件列表" onClick={() => { | |
| 1218 | + this.setState({ | |
| 1219 | + commonFileDownloadVisible: true, | |
| 1220 | + commonFileDownloadList: fileList.map(item => {return { url: item, checked: false }}), | |
| 1221 | + }) | |
| 1222 | + }} | |
| 1223 | + >{`附件(${fileList.length})`}</a>; | |
| 1309 | 1224 | } |
| 1310 | - }; | |
| 1225 | + } | |
| 1311 | 1226 | } |
| 1312 | 1227 | |
| 1313 | 1228 | if (commonUtils.isNotEmptyArr(sMakeUpPath)) { |
| 1314 | 1229 | sMakeUpPath.forEach(item => { |
| 1315 | - item.render = (value = "", record) => { | |
| 1230 | + item.render = (value = '', record) => { | |
| 1316 | 1231 | const { formId, name, enabled } = this.props; |
| 1317 | - const { token } = this.props.app; | |
| 1318 | - let divProps = { | |
| 1232 | + const { token } = this.props.app; | |
| 1233 | + const divProps = { | |
| 1319 | 1234 | action: `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`, |
| 1320 | - onChange: info => { | |
| 1235 | + onChange: (info) => { | |
| 1321 | 1236 | this.handleUploadChange(info, () => {}); |
| 1322 | 1237 | const savePathStr = info?.file?.response?.dataset?.rows?.[0]?.savePathStr; |
| 1323 | 1238 | this.props.onDataChange(name, item.dataIndex, { [item.dataIndex]: savePathStr }, record.sId, []); |
| 1324 | 1239 | }, |
| 1325 | - accept: "*/*", | |
| 1240 | + accept: '*/*', | |
| 1326 | 1241 | showUploadList: false, |
| 1327 | 1242 | multiple: false, |
| 1328 | 1243 | }; |
| 1329 | - if (config.sTbName === "sisboxcomponent") { | |
| 1330 | - divProps = { | |
| 1331 | - // action: `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`, | |
| 1332 | - action: `${commonConfig.server_host}file/uploadPrice?sLogoName=logo${name}${formId}${new Date().getTime()}`, | |
| 1333 | - onChange: info => { | |
| 1334 | - this.handleUploadChange(info, () => {}); | |
| 1335 | - const savePathStr = info?.file?.response?.dataset?.rows?.[0]?.savePathStr; | |
| 1336 | - this.props.onDataChange(name, item.dataIndex, { [item.dataIndex]: savePathStr }, record.sId, []); | |
| 1337 | - }, | |
| 1338 | - accept: "*/*", | |
| 1339 | - showUploadList: false, | |
| 1340 | - multiple: false, | |
| 1341 | - }; | |
| 1342 | - } | |
| 1343 | - return ( | |
| 1344 | - <div className={styles.makeUpPath}> | |
| 1345 | - {value && | |
| 1346 | - [""].map(() => { | |
| 1347 | - const iconProps = { | |
| 1348 | - className: styles.imgPDf, | |
| 1349 | - onClick: () => { | |
| 1350 | - this.setState({ | |
| 1351 | - officePreviewVisible: true, | |
| 1352 | - officeFileUrl: value, | |
| 1353 | - }); | |
| 1354 | - }, | |
| 1355 | - }; | |
| 1356 | - const removeExtension = filename => { | |
| 1357 | - const lastDotIndex = filename.lastIndexOf("."); | |
| 1358 | - if (lastDotIndex === -1) { | |
| 1359 | - // 如果字符串中没有点,则返回原字符串 | |
| 1360 | - return filename; | |
| 1361 | - } | |
| 1362 | - return filename.substring(0, lastDotIndex); | |
| 1363 | - }; | |
| 1364 | - const getImageUrl = sName => { | |
| 1365 | - const imageUrlNew = `${commonConfig.server_host}file/downloadPrice?sLogoName=${sName}&date=${new Date().getTime()}`; | |
| 1366 | - return imageUrlNew; | |
| 1367 | - }; | |
| 1368 | - const picAddr = commonUtils.isNotEmptyObject(value) ? value.split(",") : ""; | |
| 1369 | - let dataUrl = picAddr[0].includes("xlyerpfiles") | |
| 1370 | - ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` | |
| 1371 | - : picAddr[0]; /* 缩略图 */ | |
| 1372 | - if (config.sTbName === "sisboxcomponent") { | |
| 1373 | - dataUrl = getImageUrl(removeExtension(picAddr[0])); | |
| 1374 | - } | |
| 1375 | - const officeFileTypeList = ["PDF", "DOCX", "XLSX", "MP4", "WEBM", "OGG"]; | |
| 1376 | - const imgTypeList = ["PNG", "SVG", "JPG", "JPEG", "GIF", "BMP", "TIFF", "ICO"]; | |
| 1377 | - const officeFileType = picAddr[0].split(".").pop().toUpperCase(); | |
| 1378 | - let fileIcon = <FilePdfOutlined {...iconProps} />; | |
| 1379 | - | |
| 1380 | - if (officeFileType === "DOCX") { | |
| 1381 | - fileIcon = <FileWordOutlined {...iconProps} />; | |
| 1382 | - } else if (officeFileType === "XLSX") { | |
| 1383 | - fileIcon = <FileExcelOutlined {...iconProps} />; | |
| 1384 | - } else if (["MP4", "WEBM", "OGG"].includes(officeFileType)) { | |
| 1385 | - fileIcon = <PlaySquareOutlined {...iconProps} />; | |
| 1386 | - } | |
| 1387 | 1244 | |
| 1388 | - let imgBox = <FileOutlined />; | |
| 1389 | - | |
| 1390 | - if (officeFileTypeList.includes(officeFileType)) { | |
| 1391 | - imgBox = fileIcon; | |
| 1392 | - } else if (imgTypeList.includes(officeFileType)) { | |
| 1393 | - imgBox = ( | |
| 1394 | - <span style={{ cursor: "pointer" }}> | |
| 1395 | - {" "} | |
| 1396 | - <img | |
| 1397 | - src={dataUrl} | |
| 1398 | - alt="img" | |
| 1399 | - onFocus={() => 0} | |
| 1400 | - onClick={e => this.handlePreviewImage(e, picAddr)} | |
| 1401 | - style={{ width: "30px", height: "20px" }} | |
| 1402 | - /> | |
| 1403 | - </span> | |
| 1404 | - ); | |
| 1245 | + return <div className={styles.makeUpPath}> | |
| 1246 | + { | |
| 1247 | + value && [''].map(() => { | |
| 1248 | + const iconProps = { | |
| 1249 | + className: styles.imgPDf, | |
| 1250 | + onClick: () => { | |
| 1251 | + this.setState({ | |
| 1252 | + officePreviewVisible: true, | |
| 1253 | + officeFileUrl: value, | |
| 1254 | + }) | |
| 1405 | 1255 | } |
| 1256 | + }; | |
| 1257 | + | |
| 1258 | + const picAddr = commonUtils.isNotEmptyObject(value) ? value.split(',') : ''; | |
| 1259 | + const dataUrl = picAddr[0].includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` : picAddr[0]; /* 缩略图 */ | |
| 1260 | + | |
| 1261 | + const officeFileTypeList = ['PDF', 'DOCX', 'XLSX', 'MP4', 'WEBM', 'OGG']; | |
| 1262 | + const imgTypeList = ['PNG', 'SVG', 'JPG', 'JPEG', 'GIF', 'BMP', 'TIFF', 'ICO']; | |
| 1263 | + const officeFileType = picAddr[0].split('.').pop().toUpperCase(); | |
| 1264 | + let fileIcon = <FilePdfOutlined { ...iconProps } />; | |
| 1265 | + | |
| 1266 | + if (officeFileType === 'DOCX') { | |
| 1267 | + fileIcon = <FileWordOutlined { ...iconProps } />; | |
| 1268 | + } else if (officeFileType === 'XLSX') { | |
| 1269 | + fileIcon = <FileExcelOutlined { ...iconProps } />; | |
| 1270 | + } else if (['MP4', 'WEBM', 'OGG'].includes(officeFileType)) { | |
| 1271 | + fileIcon = <PlaySquareOutlined { ...iconProps } />; | |
| 1272 | + } | |
| 1273 | + | |
| 1274 | + let imgBox = <FileOutlined />; | |
| 1275 | + | |
| 1276 | + if (officeFileTypeList.includes(officeFileType)) { | |
| 1277 | + imgBox = fileIcon; | |
| 1278 | + } else if (imgTypeList.includes(officeFileType)) { | |
| 1279 | + imgBox = <span style={{ cursor: 'pointer' }}> <img src={dataUrl} alt="img" onFocus={() => 0} onClick={e => this.handlePreviewImage(e, picAddr)} style={{ width: '30px', height: '20px' }} /></span>; | |
| 1280 | + } | |
| 1406 | 1281 | |
| 1407 | - return imgBox; | |
| 1408 | - })} | |
| 1409 | - {enabled && ( | |
| 1410 | - <Upload {...divProps}> | |
| 1411 | - <UploadOutlined className={styles.imgUpload} /> | |
| 1412 | - </Upload> | |
| 1413 | - )} | |
| 1414 | - </div> | |
| 1415 | - ); | |
| 1416 | - }; | |
| 1417 | - }); | |
| 1282 | + return imgBox; | |
| 1283 | + }) | |
| 1284 | + } | |
| 1285 | + { | |
| 1286 | + enabled && <Upload {...divProps}><UploadOutlined className={styles.imgUpload} /></Upload> | |
| 1287 | + } | |
| 1288 | + </div>; | |
| 1289 | + } | |
| 1290 | + }) | |
| 1418 | 1291 | } |
| 1419 | 1292 | |
| 1420 | - this.props.onCostomColums?.([...tableColumn, ...subTableColumn]); | |
| 1293 | + this.props.onCostomColums?.([ | |
| 1294 | + ...tableColumn, | |
| 1295 | + ...subTableColumn | |
| 1296 | + ]); | |
| 1421 | 1297 | |
| 1422 | 1298 | // 判断工序状态 |
| 1423 | 1299 | if (commonUtils.isNotEmptyArr(sPartNameStatus) && commonUtils.isNotEmptyArr(dataSource)) { |
| 1424 | 1300 | this.useVListNew = true; |
| 1425 | - const sModelsType = | |
| 1426 | - commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.app) ? this.props.app.currentPane.sModelsType : ""; | |
| 1427 | - if ( | |
| 1428 | - sModelsType === "production/productionPlanInfo" || | |
| 1429 | - location.pathname.toLowerCase("commonList") || | |
| 1430 | - sModelsType === "productionMainPlan/productionMainPlan" || | |
| 1431 | - location.pathname.toLowerCase().indexOf("oee") > -1 | |
| 1432 | - ) { | |
| 1433 | - sPartNameStatus[0].render = itemStr => { | |
| 1301 | + const sModelsType = commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.app) ? this.props.app.currentPane.sModelsType : ''; | |
| 1302 | + if (sModelsType === 'production/productionPlanInfo' || location.pathname.toLowerCase('commonList') || sModelsType === 'productionMainPlan/productionMainPlan' || location.pathname.toLowerCase().indexOf('oee') > -1) { | |
| 1303 | + sPartNameStatus[0].render = (itemStr) => { | |
| 1434 | 1304 | if (commonUtils.isJSON(itemStr)) { |
| 1435 | 1305 | const sPartItem = JSON.parse(itemStr); |
| 1436 | 1306 | return ( |
| 1437 | 1307 | // <div> |
| 1438 | - <Tooltip | |
| 1439 | - color="#fff" | |
| 1440 | - title={() => { | |
| 1441 | - return ( | |
| 1442 | - <div> | |
| 1443 | - { | |
| 1444 | - // eslint-disable-next-line array-callback-return | |
| 1445 | - sPartItem.map((t, i) => { | |
| 1446 | - const sPartItemLength = sPartItem.length; | |
| 1447 | - // const record = dataSource[i]; /* 获取每行数据 */ | |
| 1448 | - let colorValue = "#000000"; | |
| 1449 | - if (t?.background) { | |
| 1450 | - colorValue = t.background; | |
| 1451 | - } else { | |
| 1452 | - const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 1453 | - switch ( | |
| 1454 | - Number(sState) // 根据状态显示颜色 | |
| 1455 | - ) { | |
| 1456 | - case 0: | |
| 1457 | - colorValue = "#808080"; /* 0:灰色 */ | |
| 1458 | - break; | |
| 1459 | - case 1: | |
| 1460 | - colorValue = "#808080"; /* 1:灰色 */ | |
| 1461 | - break; | |
| 1462 | - case 2: | |
| 1463 | - colorValue = "#ff4d4f"; /* 2:红色 */ | |
| 1464 | - break; | |
| 1465 | - case 3: | |
| 1466 | - colorValue = "#d4b106"; /* 3:黄色 */ | |
| 1467 | - break; | |
| 1468 | - case 4: | |
| 1469 | - colorValue = "#000000"; /* 黑色 */ | |
| 1470 | - break; | |
| 1471 | - case 5: | |
| 1472 | - colorValue = "#49aa19"; /* 5:绿色 */ | |
| 1473 | - break; | |
| 1474 | - default: | |
| 1475 | - colorValue = "#000000"; | |
| 1476 | - } | |
| 1477 | - } | |
| 1478 | - return ( | |
| 1479 | - <div | |
| 1480 | - style={{ display: "inline-block", color: colorValue }} | |
| 1481 | - key={i} | |
| 1482 | - onClick={this.handlesPartNameStatus.bind(this, "sPartNameStatus", t.sWorkOrderId)} | |
| 1483 | - > | |
| 1484 | - {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ""} | |
| 1485 | - {i + 1 === sPartItemLength ? "" : <RightOutlined />} | |
| 1486 | - </div> | |
| 1487 | - ); | |
| 1488 | - }) | |
| 1308 | + <Tooltip color="#fff" title={() => { | |
| 1309 | + return <div > | |
| 1310 | + { | |
| 1311 | + // eslint-disable-next-line array-callback-return | |
| 1312 | + sPartItem.map((t, i) => { | |
| 1313 | + const sPartItemLength = sPartItem.length; | |
| 1314 | + // const record = dataSource[i]; /* 获取每行数据 */ | |
| 1315 | + let colorValue = '#000000'; | |
| 1316 | + if (t?.background) { | |
| 1317 | + colorValue = t.background; | |
| 1318 | + } else { | |
| 1319 | + const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 1320 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 1321 | + case 0: | |
| 1322 | + colorValue = '#808080'; /* 0:灰色 */ | |
| 1323 | + break; | |
| 1324 | + case 1: | |
| 1325 | + colorValue = '#808080'; /* 1:灰色 */ | |
| 1326 | + break; | |
| 1327 | + case 2: | |
| 1328 | + colorValue = '#ff4d4f'; /* 2:红色 */ | |
| 1329 | + break; | |
| 1330 | + case 3: | |
| 1331 | + colorValue = '#d4b106'; /* 3:黄色 */ | |
| 1332 | + break; | |
| 1333 | + case 4: | |
| 1334 | + colorValue = '#000000'; /* 黑色 */ | |
| 1335 | + break; | |
| 1336 | + case 5: | |
| 1337 | + colorValue = '#49aa19'; /* 5:绿色 */ | |
| 1338 | + break; | |
| 1339 | + default: | |
| 1340 | + colorValue = '#000000'; | |
| 1341 | + } | |
| 1489 | 1342 | } |
| 1490 | - </div> | |
| 1491 | - ); | |
| 1492 | - }} | |
| 1493 | - > | |
| 1494 | - <div | |
| 1495 | - style={{ whiteSpace: "nowrap", width: "100%", height: "29px", overflow: "hidden", lineHeight: "29px", textOverflow: "ellipsis" }} | |
| 1496 | - > | |
| 1343 | + return ( | |
| 1344 | + <div style={{ display: 'inline-block', color:colorValue }} key={i} onClick={this.handlesPartNameStatus.bind(this, 'sPartNameStatus', t.sWorkOrderId)} > | |
| 1345 | + {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ''} | |
| 1346 | + { i + 1 === sPartItemLength ? '' : <RightOutlined />} | |
| 1347 | + </div> | |
| 1348 | + ); | |
| 1349 | + }) | |
| 1350 | + } | |
| 1351 | + </div> | |
| 1352 | + }}> | |
| 1353 | + <div style={{ whiteSpace: 'nowrap', width: '100%', height: '29px', overflow: 'hidden', lineHeight: '29px', textOverflow: 'ellipsis' }}> | |
| 1497 | 1354 | { |
| 1498 | 1355 | // eslint-disable-next-line array-callback-return |
| 1499 | 1356 | sPartItem.map((t, i) => { |
| 1500 | 1357 | const sPartItemLength = sPartItem.length; |
| 1501 | 1358 | // const record = dataSource[i]; /* 获取每行数据 */ |
| 1502 | - let colorValue = "#000000"; | |
| 1359 | + let colorValue = '#000000'; | |
| 1503 | 1360 | if (t?.background) { |
| 1504 | 1361 | colorValue = t.background; |
| 1505 | 1362 | } else { |
| 1506 | 1363 | const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; |
| 1507 | - switch ( | |
| 1508 | - Number(sState) // 根据状态显示颜色 | |
| 1509 | - ) { | |
| 1364 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 1510 | 1365 | case 0: |
| 1511 | - colorValue = "#808080"; /* 0:灰色 */ | |
| 1366 | + colorValue = '#808080'; /* 0:灰色 */ | |
| 1512 | 1367 | break; |
| 1513 | 1368 | case 1: |
| 1514 | - colorValue = "#808080"; /* 1:灰色 */ | |
| 1369 | + colorValue = '#808080'; /* 1:灰色 */ | |
| 1515 | 1370 | break; |
| 1516 | 1371 | case 2: |
| 1517 | - colorValue = "#ff4d4f"; /* 2:红色 */ | |
| 1372 | + colorValue = '#ff4d4f'; /* 2:红色 */ | |
| 1518 | 1373 | break; |
| 1519 | 1374 | case 3: |
| 1520 | - colorValue = "#d4b106"; /* 3:黄色 */ | |
| 1375 | + colorValue = '#d4b106'; /* 3:黄色 */ | |
| 1521 | 1376 | break; |
| 1522 | 1377 | case 4: |
| 1523 | - colorValue = "#000000"; /* 黑色 */ | |
| 1378 | + colorValue = '#000000'; /* 黑色 */ | |
| 1524 | 1379 | break; |
| 1525 | 1380 | case 5: |
| 1526 | - colorValue = "#49aa19"; /* 5:绿色 */ | |
| 1381 | + colorValue = '#49aa19'; /* 5:绿色 */ | |
| 1527 | 1382 | break; |
| 1528 | 1383 | default: |
| 1529 | - colorValue = "#000000"; | |
| 1384 | + colorValue = '#000000'; | |
| 1530 | 1385 | } |
| 1531 | 1386 | } |
| 1532 | 1387 | return ( |
| 1533 | - <div | |
| 1534 | - style={{ display: "inline-block", color: colorValue }} | |
| 1535 | - key={i} | |
| 1536 | - onClick={this.handlesPartNameStatus.bind(this, "sPartNameStatus", t.sWorkOrderId)} | |
| 1537 | - > | |
| 1538 | - {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ""} | |
| 1539 | - {i + 1 === sPartItemLength ? "" : <RightOutlined />} | |
| 1388 | + <div style={{ display: 'inline-block', color:colorValue }} key={i} onClick={this.handlesPartNameStatus.bind(this, 'sPartNameStatus', t.sWorkOrderId)} > | |
| 1389 | + {commonUtils.isNotEmptyObject(t.sProcessName) ? t.sProcessName : ''} | |
| 1390 | + { i + 1 === sPartItemLength ? '' : <RightOutlined />} | |
| 1540 | 1391 | </div> |
| 1541 | 1392 | ); |
| 1542 | 1393 | }) |
| 1543 | 1394 | } |
| 1544 | 1395 | </div> |
| 1545 | 1396 | </Tooltip> |
| 1397 | + | |
| 1546 | 1398 | ); |
| 1547 | 1399 | } |
| 1548 | 1400 | }; |
| 1549 | 1401 | } else { |
| 1550 | - sPartNameStatus[0].render = itemStr => { | |
| 1402 | + sPartNameStatus[0].render = (itemStr) => { | |
| 1551 | 1403 | if (itemStr) { |
| 1552 | - const sPartItem = itemStr.split("->"); | |
| 1404 | + const sPartItem = itemStr.split('->'); | |
| 1553 | 1405 | return ( |
| 1554 | - <div style={{ whiteSpace: "normal" }}> | |
| 1406 | + <div style={{ whiteSpace: 'normal' }}> | |
| 1555 | 1407 | { |
| 1556 | 1408 | // eslint-disable-next-line array-callback-return |
| 1557 | 1409 | sPartItem.map((t, i) => { |
| 1558 | 1410 | const sPartItemLength = sPartItem.length; |
| 1559 | - const ArrItemStr = t.split("#")[0]; /* 工序名称 */ | |
| 1560 | - const ArrItemNum = t.split("#")[1]; /* 状态 */ | |
| 1561 | - const ArrItemName = t.split("#")[2]; /* 机台名称 */ | |
| 1562 | - const ArrItemBanZhu = t.split("#")[3]; /* 班组 */ | |
| 1563 | - const ArrItemTime = t.split("#")[4]; /* 排单时间 */ | |
| 1564 | - const ArrItemPCNum = t.split("#")[5]; /* 排程数 */ | |
| 1565 | - const ArrItemSBNum = t.split("#")[6]; /* 上报数 */ | |
| 1566 | - const ArrItem7Num = commonUtils.isNotEmptyArr(t.split("#")) && t.split("#").length > 8 ? t.split("#")[8] : ""; /* 包数 */ | |
| 1567 | - const ArrItem8Num = commonUtils.isNotEmptyArr(t.split("#")) && t.split("#").length > 9 ? t.split("#")[9] : ""; /* 每包数量 */ | |
| 1568 | - const ArrItem9Num = commonUtils.isNotEmptyArr(t.split("#")) && t.split("#").length > 10 ? t.split("#")[10] : ""; /* 零头数量 */ | |
| 1569 | - let ArrItemNumChange = ""; | |
| 1411 | + const ArrItemStr = t.split('#')[0]; /* 工序名称 */ | |
| 1412 | + const ArrItemNum = t.split('#')[1]; /* 状态 */ | |
| 1413 | + const ArrItemName = t.split('#')[2]; /* 机台名称 */ | |
| 1414 | + const ArrItemBanZhu = t.split('#')[3]; /* 班组 */ | |
| 1415 | + const ArrItemTime = t.split('#')[4]; /* 排单时间 */ | |
| 1416 | + const ArrItemPCNum = t.split('#')[5]; /* 排程数 */ | |
| 1417 | + const ArrItemSBNum = t.split('#')[6]; /* 上报数 */ | |
| 1418 | + const ArrItem7Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 8 ? t.split('#')[8] : ''; /* 包数 */ | |
| 1419 | + const ArrItem8Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 9 ? t.split('#')[9]: ''; /* 每包数量 */ | |
| 1420 | + const ArrItem9Num = commonUtils.isNotEmptyArr(t.split('#')) && t.split('#').length > 10 ? t.split('#')[10]: ''; /* 零头数量 */ | |
| 1421 | + let ArrItemNumChange = ''; | |
| 1570 | 1422 | let icon; |
| 1571 | 1423 | // eslint-disable-next-line default-case |
| 1572 | 1424 | switch (Number(ArrItemNum)) { |
| 1573 | 1425 | case 0: |
| 1574 | - ArrItemNumChange = "未排程"; | |
| 1575 | - icon = <ExclamationCircleFilled style={{ margin: "0 6px 0 0", color: "#ffd591" }} title="未排程" />; | |
| 1426 | + ArrItemNumChange = '未排程'; | |
| 1427 | + icon = <ExclamationCircleFilled style={{ margin: '0 6px 0 0', color: '#ffd591' }} title="未排程" />; | |
| 1576 | 1428 | break; |
| 1577 | 1429 | case 1: |
| 1578 | - ArrItemNumChange = "未完成"; | |
| 1579 | - icon = <CloseCircleFilled style={{ margin: "0 6px 0 0", color: "#ffa39e" }} title="未完成" />; | |
| 1430 | + ArrItemNumChange = '未完成'; | |
| 1431 | + icon = <CloseCircleFilled style={{ margin: '0 6px 0 0', color: '#ffa39e' }} title="未完成" />; | |
| 1580 | 1432 | break; |
| 1581 | 1433 | case 2: |
| 1582 | - ArrItemNumChange = "生产中"; | |
| 1583 | - icon = <ClockCircleFilled style={{ margin: "0 6px 0 0", color: "#69c0ff" }} title="生产中" />; | |
| 1434 | + ArrItemNumChange = '生产中'; | |
| 1435 | + icon = <ClockCircleFilled style={{ margin: '0 6px 0 0', color: '#69c0ff' }} title="生产中" />; | |
| 1584 | 1436 | break; |
| 1585 | 1437 | case 3: |
| 1586 | - ArrItemNumChange = "暂停"; | |
| 1587 | - icon = <LegacyIcon type="ause-circle" theme="filled" style={{ margin: "0 6px 0 0", color: "#fff566" }} title="暂停" />; | |
| 1438 | + ArrItemNumChange = '暂停'; | |
| 1439 | + icon = <LegacyIcon type="ause-circle" theme="filled" style={{ margin: '0 6px 0 0', color: '#fff566' }} title="暂停" />; | |
| 1588 | 1440 | break; |
| 1589 | 1441 | case 4: |
| 1590 | - ArrItemNumChange = "取消"; | |
| 1591 | - icon = <StopFilled style={{ margin: "0 6px 0 0", color: "#ff85c0" }} title="取消" />; | |
| 1442 | + ArrItemNumChange = '取消'; | |
| 1443 | + icon = <StopFilled style={{ margin: '0 6px 0 0', color: '#ff85c0' }} title="取消" />; | |
| 1592 | 1444 | break; |
| 1593 | 1445 | case 5: |
| 1594 | - ArrItemNumChange = "完成"; | |
| 1595 | - icon = <CheckCircleFilled style={{ margin: "0 6px 0 0", color: "#95de64" }} title="完成" />; | |
| 1446 | + ArrItemNumChange = '完成'; | |
| 1447 | + icon = <CheckCircleFilled style={{ margin: '0 6px 0 0', color: '#95de64' }} title="完成" />; | |
| 1596 | 1448 | break; |
| 1597 | 1449 | } |
| 1598 | 1450 | // eslint-disable-next-line no-unused-vars |
| 1599 | 1451 | const content = ( |
| 1600 | 1452 | <div> |
| 1601 | - <div> | |
| 1602 | - <span style={{ color: "#fbca7b" }}>工序名称:</span> | |
| 1603 | - {ArrItemStr} | |
| 1604 | - </div> | |
| 1605 | - <div> | |
| 1606 | - <span style={{ color: "#fbca7b" }}>状态:</span> | |
| 1607 | - {ArrItemNumChange} | |
| 1608 | - </div> | |
| 1609 | - <div> | |
| 1610 | - <span style={{ color: "#fbca7b" }}>机台名称:</span> | |
| 1611 | - {ArrItemName} | |
| 1612 | - </div> | |
| 1613 | - <div> | |
| 1614 | - <span style={{ color: "#fbca7b" }}>班组:</span> | |
| 1615 | - {ArrItemBanZhu} | |
| 1616 | - </div> | |
| 1617 | - <div> | |
| 1618 | - <span style={{ color: "#fbca7b" }}>排单时间:</span> | |
| 1619 | - {ArrItemTime} | |
| 1620 | - </div> | |
| 1621 | - <div> | |
| 1622 | - <span style={{ color: "#fbca7b" }}>排程数:</span> | |
| 1623 | - {ArrItemPCNum} | |
| 1624 | - </div> | |
| 1625 | - <div> | |
| 1626 | - <span style={{ color: "#fbca7b" }}>上报数:</span> | |
| 1627 | - {ArrItemSBNum} | |
| 1628 | - </div> | |
| 1629 | - {ArrItem7Num ? ( | |
| 1630 | - <div> | |
| 1631 | - <span style={{ color: "#fbca7b" }}>包数:</span> | |
| 1632 | - {ArrItem7Num} | |
| 1633 | - </div> | |
| 1634 | - ) : ( | |
| 1635 | - "" | |
| 1636 | - )} | |
| 1637 | - {ArrItem8Num ? ( | |
| 1638 | - <div> | |
| 1639 | - <span style={{ color: "#fbca7b" }}>每包数量:</span> | |
| 1640 | - {ArrItem8Num} | |
| 1641 | - </div> | |
| 1642 | - ) : ( | |
| 1643 | - "" | |
| 1644 | - )} | |
| 1645 | - {ArrItem9Num ? ( | |
| 1646 | - <div> | |
| 1647 | - <span style={{ color: "#fbca7b" }}>零头数量:</span> | |
| 1648 | - {ArrItem9Num} | |
| 1649 | - </div> | |
| 1650 | - ) : ( | |
| 1651 | - "" | |
| 1652 | - )} | |
| 1453 | + <div><span style={{ color: '#fbca7b' }}>工序名称:</span>{ArrItemStr}</div> | |
| 1454 | + <div><span style={{ color: '#fbca7b' }}>状态:</span>{ArrItemNumChange}</div> | |
| 1455 | + <div><span style={{ color: '#fbca7b' }}>机台名称:</span>{ArrItemName}</div> | |
| 1456 | + <div><span style={{ color: '#fbca7b' }}>班组:</span>{ArrItemBanZhu}</div> | |
| 1457 | + <div><span style={{ color: '#fbca7b' }}>排单时间:</span>{ArrItemTime}</div> | |
| 1458 | + <div><span style={{ color: '#fbca7b' }}>排程数:</span>{ArrItemPCNum}</div> | |
| 1459 | + <div><span style={{ color: '#fbca7b' }}>上报数:</span>{ArrItemSBNum}</div> | |
| 1460 | + { | |
| 1461 | + ArrItem7Num ? <div><span style={{ color: '#fbca7b' }}>包数:</span>{ArrItem7Num}</div> :'' | |
| 1462 | + } | |
| 1463 | + { | |
| 1464 | + ArrItem8Num ? <div><span style={{ color: '#fbca7b' }}>每包数量:</span>{ArrItem8Num}</div> :'' | |
| 1465 | + } | |
| 1466 | + { | |
| 1467 | + ArrItem9Num ? <div><span style={{ color: '#fbca7b' }}>零头数量:</span>{ArrItem9Num}</div> :'' | |
| 1468 | + } | |
| 1653 | 1469 | </div> |
| 1654 | 1470 | ); |
| 1655 | 1471 | // 数字转换图标 |
| 1656 | 1472 | return ( |
| 1657 | - <div style={{ display: "inline-block", margin: "5px 5px 5px 0px" }} key={i}> | |
| 1473 | + <div style={{ display: 'inline-block', margin: '5px 5px 5px 0px' }} key={i} > | |
| 1658 | 1474 | {icon} |
| 1659 | - <Popover placement="top" content={content} trigger="click"> | |
| 1660 | - {ArrItemStr} | |
| 1661 | - </Popover> | |
| 1475 | + <Popover placement="top" content={content} trigger="click">{ArrItemStr}</Popover> | |
| 1662 | 1476 | {/*{ i + 1 === sPartItemLength ? '' : <RightOutlined style={{ margin: '0 6px' }} />}*/} |
| 1663 | 1477 | </div> |
| 1664 | 1478 | ); |
| 1665 | 1479 | }) |
| 1666 | 1480 | } |
| 1481 | + | |
| 1482 | + | |
| 1667 | 1483 | </div> |
| 1668 | 1484 | ); |
| 1669 | 1485 | } |
| ... | ... | @@ -1673,168 +1489,112 @@ class CommonTableRc extends React.Component { |
| 1673 | 1489 | // 判断材料准备状态 |
| 1674 | 1490 | if (commonUtils.isNotEmptyArr(sMaterialsStatus) && commonUtils.isNotEmptyArr(dataSource)) { |
| 1675 | 1491 | this.useVListNew = true; |
| 1676 | - const sModelsType = | |
| 1677 | - commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.app) ? this.props.app.currentPane.sModelsType : ""; | |
| 1678 | - if ( | |
| 1679 | - true || | |
| 1680 | - sModelsType === "production/productionPlanInfo" || | |
| 1681 | - sModelsType === "productionMainPlan/productionMainPlan" || | |
| 1682 | - (commonUtils.isNotEmptyObject(sModelsType) && sModelsType.includes("view/")) || | |
| 1683 | - location.pathname.toLowerCase().indexOf("oee") > -1 | |
| 1684 | - ) { | |
| 1492 | + const sModelsType = commonUtils.isNotEmptyObject(this.props) && commonUtils.isNotEmptyObject(this.props.app) ? this.props.app.currentPane.sModelsType : ''; | |
| 1493 | + if (true || sModelsType === 'production/productionPlanInfo' || sModelsType === 'productionMainPlan/productionMainPlan' || (commonUtils.isNotEmptyObject(sModelsType) && sModelsType.includes('view/')) || location.pathname.toLowerCase().indexOf('oee') > -1) { | |
| 1685 | 1494 | /* 动态列Jsonn解析 */ |
| 1686 | 1495 | if (commonUtils.isNotEmptyArr(sMaterialsStatus) && commonUtils.isNotEmptyArr(dataSource)) { |
| 1687 | 1496 | sMaterialsStatus.forEach((jsonStatus, index) => { |
| 1688 | 1497 | const dWidth = jsonStatus.width * 2; |
| 1689 | - const sBackGroundColor = jsonStatus.bReadonly ? "#f1f2f8" : ""; | |
| 1690 | - if (commonUtils.isNotEmptyArr(jsonStatus.children)) { | |
| 1691 | - /* 嵌套列头JSON解析 */ | |
| 1498 | + const sBackGroundColor = jsonStatus.bReadonly ? '#f1f2f8' : ''; | |
| 1499 | + if (commonUtils.isNotEmptyArr(jsonStatus.children)) { /* 嵌套列头JSON解析 */ | |
| 1692 | 1500 | for (const obj of jsonStatus.children) { |
| 1693 | - obj.render = itemStr => { | |
| 1501 | + obj.render = (itemStr) => { | |
| 1694 | 1502 | if (commonUtils.isJSON(itemStr)) { |
| 1695 | 1503 | const sPartItem = JSON.parse(itemStr); |
| 1696 | 1504 | /* 取箭头弹出的窗体配置 */ |
| 1697 | 1505 | let showConfig = {}; |
| 1698 | - let linkStyle = ""; /* 弹窗 */ | |
| 1699 | - if ( | |
| 1700 | - commonUtils.isNotEmptyArr(this.props.config) && | |
| 1701 | - commonUtils.isNotEmptyArr(this.props.config.gdsconfigformslave) && | |
| 1702 | - commonUtils.isNotEmptyStr("sMaterialsStatus") | |
| 1703 | - ) { | |
| 1704 | - const showConfigArr = this.props.config.gdsconfigformslave.filter(item => item.sName === "sMaterialsStatus" && item.bVisible); | |
| 1506 | + let linkStyle = '';/* 弹窗 */ | |
| 1507 | + if (commonUtils.isNotEmptyArr(this.props.config) && commonUtils.isNotEmptyArr(this.props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr('sMaterialsStatus')) { | |
| 1508 | + const showConfigArr = this.props.config.gdsconfigformslave.filter(item => item.sName === 'sMaterialsStatus' && item.bVisible); | |
| 1705 | 1509 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 1706 | 1510 | showConfig = showConfigArr[0]; |
| 1707 | - if ( | |
| 1708 | - commonUtils.isNotEmptyObject(showConfig) && | |
| 1709 | - showConfig.sDropDownType === "picArr" && | |
| 1710 | - !commonUtils.isEmpty(showConfig.sActiveId) && | |
| 1711 | - commonUtils.isEmptyArr(this.props.sGroupByList) | |
| 1712 | - ) { | |
| 1713 | - linkStyle = "sMaterialsStatusStyle"; | |
| 1511 | + if (commonUtils.isNotEmptyObject(showConfig) && showConfig.sDropDownType === 'picArr' && !commonUtils.isEmpty(showConfig.sActiveId) && commonUtils.isEmptyArr(this.props.sGroupByList)) { | |
| 1512 | + linkStyle = 'sMaterialsStatusStyle'; | |
| 1714 | 1513 | } |
| 1715 | 1514 | } |
| 1716 | 1515 | } |
| 1717 | 1516 | return ( |
| 1718 | - <Tooltip | |
| 1719 | - placement="right" | |
| 1720 | - color="#fff" | |
| 1721 | - title={() => { | |
| 1722 | - return ( | |
| 1723 | - <div style={{ whiteSpace: "normal" }}> | |
| 1724 | - { | |
| 1725 | - // eslint-disable-next-line array-callback-return; | |
| 1726 | - sPartItem.map((t, i) => { | |
| 1727 | - const sPartItemLength = sPartItem.length; | |
| 1728 | - let colorValue = "#000000"; | |
| 1729 | - if (t?.background) { | |
| 1730 | - colorValue = t.background; | |
| 1731 | - } else { | |
| 1732 | - const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 1733 | - switch ( | |
| 1734 | - Number(sState) // 根据状态显示颜色 | |
| 1735 | - ) { | |
| 1736 | - case 0: | |
| 1737 | - colorValue = "#000000"; /* 0:黑色 */ | |
| 1738 | - break; | |
| 1739 | - case 1: | |
| 1740 | - colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 1741 | - break; | |
| 1742 | - case 2: | |
| 1743 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 1744 | - break; | |
| 1745 | - case 3: | |
| 1746 | - colorValue = "#49aa19"; /* 3:绿色 */ | |
| 1747 | - break; | |
| 1748 | - case 4: | |
| 1749 | - colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 1750 | - break; | |
| 1751 | - default: | |
| 1752 | - colorValue = "#000000"; | |
| 1753 | - } | |
| 1754 | - } | |
| 1755 | - return ( | |
| 1756 | - <div style={{ display: "inline-block", width: "100%", color: colorValue }} key={i}> | |
| 1757 | - {commonUtils.isNotEmptyObject(t.sMaterialsName) ? ( | |
| 1758 | - <span | |
| 1759 | - className={linkStyle} | |
| 1760 | - onClick={ | |
| 1761 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 1762 | - ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) | |
| 1763 | - : null | |
| 1764 | - } | |
| 1765 | - > | |
| 1766 | - {t.sMaterialsName} | |
| 1767 | - </span> | |
| 1768 | - ) : ( | |
| 1769 | - "" | |
| 1770 | - )} | |
| 1771 | - {i + 1 === sPartItemLength ? "" : <span style={{ color: "#000000", margin: "0 2px" }}>-</span>} | |
| 1772 | - </div> | |
| 1773 | - ); | |
| 1774 | - }) | |
| 1517 | + <Tooltip placement="right" color="#fff" title={() => { | |
| 1518 | + return <div style={{ whiteSpace: 'normal' }}> | |
| 1519 | + { | |
| 1520 | + // eslint-disable-next-line array-callback-return; | |
| 1521 | + sPartItem.map((t, i) => { | |
| 1522 | + const sPartItemLength = sPartItem.length; | |
| 1523 | + let colorValue = '#000000'; | |
| 1524 | + if (t?.background) { | |
| 1525 | + colorValue = t.background; | |
| 1526 | + } else { | |
| 1527 | + const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 1528 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 1529 | + case 0: | |
| 1530 | + colorValue = '#000000'; /* 0:黑色 */ | |
| 1531 | + break; | |
| 1532 | + case 1: | |
| 1533 | + colorValue = '#ff4d4f'; /* 1:红色 */ | |
| 1534 | + break; | |
| 1535 | + case 2: | |
| 1536 | + colorValue = '#49aa19'; /* 2:绿色 */ | |
| 1537 | + break; | |
| 1538 | + case 3: | |
| 1539 | + colorValue = '#49aa19'; /* 3:绿色 */ | |
| 1540 | + break; | |
| 1541 | + case 4: | |
| 1542 | + colorValue = '#ff4d4f'; /* 4:红色 */ | |
| 1543 | + break; | |
| 1544 | + default: | |
| 1545 | + colorValue = '#000000'; | |
| 1546 | + } | |
| 1775 | 1547 | } |
| 1776 | - </div> | |
| 1777 | - ); | |
| 1778 | - }} | |
| 1779 | - > | |
| 1780 | - <div | |
| 1781 | - style={{ | |
| 1782 | - whiteSpace: "nowrap", | |
| 1783 | - width: "100%", | |
| 1784 | - height: "29px", | |
| 1785 | - overflow: "hidden", | |
| 1786 | - lineHeight: "29px", | |
| 1787 | - textOverflow: "ellipsis", | |
| 1788 | - }} | |
| 1789 | - > | |
| 1548 | + return ( | |
| 1549 | + <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1550 | + {commonUtils.isNotEmptyObject(t.sMaterialsName) ? | |
| 1551 | + <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> | |
| 1552 | + {t.sMaterialsName} | |
| 1553 | + </span> : ''} | |
| 1554 | + { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1555 | + </div> | |
| 1556 | + ); | |
| 1557 | + }) | |
| 1558 | + } | |
| 1559 | + </div> | |
| 1560 | + }}> | |
| 1561 | + <div style={{ whiteSpace: 'nowrap', width: '100%', height: '29px', overflow: 'hidden', lineHeight: '29px', textOverflow: 'ellipsis' }}> | |
| 1790 | 1562 | { |
| 1791 | 1563 | // eslint-disable-next-line array-callback-return; |
| 1792 | 1564 | sPartItem.map((t, i) => { |
| 1793 | 1565 | const sPartItemLength = sPartItem.length; |
| 1794 | - let colorValue = "#000000"; | |
| 1566 | + let colorValue = '#000000'; | |
| 1795 | 1567 | if (t?.background) { |
| 1796 | 1568 | colorValue = t.background; |
| 1797 | 1569 | } else { |
| 1798 | 1570 | const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; |
| 1799 | - switch ( | |
| 1800 | - Number(sState) // 根据状态显示颜色 | |
| 1801 | - ) { | |
| 1571 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 1802 | 1572 | case 0: |
| 1803 | - colorValue = "#000000"; /* 0:黑色 */ | |
| 1573 | + colorValue = '#000000'; /* 0:黑色 */ | |
| 1804 | 1574 | break; |
| 1805 | 1575 | case 1: |
| 1806 | - colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 1576 | + colorValue = '#ff4d4f'; /* 1:红色 */ | |
| 1807 | 1577 | break; |
| 1808 | 1578 | case 2: |
| 1809 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 1579 | + colorValue = '#49aa19'; /* 2:绿色 */ | |
| 1810 | 1580 | break; |
| 1811 | 1581 | case 3: |
| 1812 | - colorValue = "#49aa19"; /* 3:绿色 */ | |
| 1582 | + colorValue = '#49aa19'; /* 3:绿色 */ | |
| 1813 | 1583 | break; |
| 1814 | 1584 | case 4: |
| 1815 | - colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 1585 | + colorValue = '#ff4d4f'; /* 4:红色 */ | |
| 1816 | 1586 | break; |
| 1817 | 1587 | default: |
| 1818 | - colorValue = "#000000"; | |
| 1588 | + colorValue = '#000000'; | |
| 1819 | 1589 | } |
| 1820 | 1590 | } |
| 1821 | 1591 | return ( |
| 1822 | - <div style={{ display: "inline-block", width: "100%", color: colorValue }} key={i}> | |
| 1823 | - {commonUtils.isNotEmptyObject(t.sMaterialsName) ? ( | |
| 1824 | - <span | |
| 1825 | - className={linkStyle} | |
| 1826 | - onClick={ | |
| 1827 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 1828 | - ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) | |
| 1829 | - : null | |
| 1830 | - } | |
| 1831 | - > | |
| 1832 | - {t.sMaterialsName} | |
| 1833 | - </span> | |
| 1834 | - ) : ( | |
| 1835 | - "" | |
| 1836 | - )} | |
| 1837 | - {i + 1 === sPartItemLength ? "" : <span style={{ color: "#000000", margin: "0 2px" }}>-</span>} | |
| 1592 | + <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1593 | + {commonUtils.isNotEmptyObject(t.sMaterialsName) ? | |
| 1594 | + <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> | |
| 1595 | + {t.sMaterialsName} | |
| 1596 | + </span> : ''} | |
| 1597 | + { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1838 | 1598 | </div> |
| 1839 | 1599 | ); |
| 1840 | 1600 | }) |
| ... | ... | @@ -1846,157 +1606,105 @@ class CommonTableRc extends React.Component { |
| 1846 | 1606 | return itemStr; |
| 1847 | 1607 | } |
| 1848 | 1608 | }; |
| 1849 | - } | |
| 1850 | - } else { | |
| 1851 | - /* 无嵌套列头JSON列解析 */ | |
| 1852 | - sMaterialsStatus[index].render = itemStr => { | |
| 1609 | + }; | |
| 1610 | + } else { /* 无嵌套列头JSON列解析 */ | |
| 1611 | + sMaterialsStatus[index].render = (itemStr) => { | |
| 1853 | 1612 | if (commonUtils.isJSON(itemStr)) { |
| 1854 | 1613 | const sPartItem = JSON.parse(itemStr); |
| 1855 | 1614 | /* 取箭头弹出的窗体配置 */ |
| 1856 | 1615 | let showConfig = {}; |
| 1857 | - let linkStyle = ""; /* 弹窗 */ | |
| 1858 | - if ( | |
| 1859 | - commonUtils.isNotEmptyArr(this.props.config) && | |
| 1860 | - commonUtils.isNotEmptyArr(this.props.config.gdsconfigformslave) && | |
| 1861 | - commonUtils.isNotEmptyStr("sMaterialsStatus") | |
| 1862 | - ) { | |
| 1863 | - const showConfigArr = this.props.config.gdsconfigformslave.filter(item => item.sName === "sMaterialsStatus" && item.bVisible); | |
| 1616 | + let linkStyle = '';/* 弹窗 */ | |
| 1617 | + if (commonUtils.isNotEmptyArr(this.props.config) && commonUtils.isNotEmptyArr(this.props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr('sMaterialsStatus')) { | |
| 1618 | + const showConfigArr = this.props.config.gdsconfigformslave.filter(item => item.sName === 'sMaterialsStatus' && item.bVisible); | |
| 1864 | 1619 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 1865 | 1620 | showConfig = showConfigArr[0]; |
| 1866 | - if ( | |
| 1867 | - commonUtils.isNotEmptyObject(showConfig) && | |
| 1868 | - showConfig.sDropDownType === "picArr" && | |
| 1869 | - !commonUtils.isEmpty(showConfig.sActiveId) && | |
| 1870 | - commonUtils.isEmptyArr(this.props.sGroupByList) | |
| 1871 | - ) { | |
| 1872 | - linkStyle = "sMaterialsStatusStyle"; | |
| 1621 | + if (commonUtils.isNotEmptyObject(showConfig) && showConfig.sDropDownType === 'picArr' && !commonUtils.isEmpty(showConfig.sActiveId) && commonUtils.isEmptyArr(this.props.sGroupByList)) { | |
| 1622 | + linkStyle = 'sMaterialsStatusStyle'; | |
| 1873 | 1623 | } |
| 1874 | 1624 | } |
| 1875 | 1625 | } |
| 1876 | 1626 | return ( |
| 1877 | - <Tooltip | |
| 1878 | - color="#f1f2f8" | |
| 1879 | - placement="right" | |
| 1880 | - overlayInnerStyle={{ width: dWidth, paddingLeft: "6px" }} | |
| 1881 | - defaultOpen={false} | |
| 1882 | - title={() => { | |
| 1883 | - return ( | |
| 1884 | - <div style={{ whiteSpace: "normal", backgroundColor: "#f1f2f8", borderRight: "1px solid #f0f0f0", width: dWidth - 8 }}> | |
| 1885 | - { | |
| 1886 | - // eslint-disable-next-line array-callback-return; | |
| 1887 | - sPartItem.map((t, i) => { | |
| 1888 | - const sPartItemLength = sPartItem.length; | |
| 1889 | - let colorValue = "#000000"; | |
| 1890 | - if (t?.background) { | |
| 1891 | - colorValue = t.background; | |
| 1892 | - } else { | |
| 1893 | - const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 1894 | - switch ( | |
| 1895 | - Number(sState) // 根据状态显示颜色 | |
| 1896 | - ) { | |
| 1897 | - case 0: | |
| 1898 | - colorValue = "#000000"; /* 0:黑色 */ | |
| 1899 | - break; | |
| 1900 | - case 1: | |
| 1901 | - colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 1902 | - break; | |
| 1903 | - case 2: | |
| 1904 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 1905 | - break; | |
| 1906 | - case 3: | |
| 1907 | - colorValue = "#49aa19"; /* 3:绿色 */ | |
| 1908 | - break; | |
| 1909 | - case 4: | |
| 1910 | - colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 1911 | - break; | |
| 1912 | - default: | |
| 1913 | - colorValue = "#000000"; | |
| 1914 | - } | |
| 1915 | - } | |
| 1916 | - return ( | |
| 1917 | - <div style={{ display: "inline-block", width: "100%", color: colorValue }} key={i}> | |
| 1918 | - {commonUtils.isNotEmptyObject(t.sMaterialsName) ? ( | |
| 1919 | - <span | |
| 1920 | - className={linkStyle} | |
| 1921 | - onClick={ | |
| 1922 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 1923 | - ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) | |
| 1924 | - : null | |
| 1925 | - } | |
| 1926 | - > | |
| 1927 | - {t.sMaterialsName} | |
| 1928 | - </span> | |
| 1929 | - ) : ( | |
| 1930 | - "" | |
| 1931 | - )} | |
| 1932 | - {i + 1 === sPartItemLength ? "" : <span style={{ color: "#000000", margin: "0 2px" }}>-</span>} | |
| 1933 | - </div> | |
| 1934 | - ); | |
| 1935 | - }) | |
| 1627 | + <Tooltip color='#f1f2f8' placement='right' overlayInnerStyle ={{ width: dWidth, paddingLeft:'6px' }} defaultOpen={false} title={() => { | |
| 1628 | + return <div style={{ whiteSpace: 'normal', backgroundColor:'#f1f2f8', borderRight:'1px solid #f0f0f0', width: dWidth - 8 }}> | |
| 1629 | + { | |
| 1630 | + // eslint-disable-next-line array-callback-return; | |
| 1631 | + sPartItem.map((t, i) => { | |
| 1632 | + const sPartItemLength = sPartItem.length; | |
| 1633 | + let colorValue = '#000000'; | |
| 1634 | + if (t?.background) { | |
| 1635 | + colorValue = t.background; | |
| 1636 | + } else { | |
| 1637 | + const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; | |
| 1638 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 1639 | + case 0: | |
| 1640 | + colorValue = '#000000'; /* 0:黑色 */ | |
| 1641 | + break; | |
| 1642 | + case 1: | |
| 1643 | + colorValue = '#ff4d4f'; /* 1:红色 */ | |
| 1644 | + break; | |
| 1645 | + case 2: | |
| 1646 | + colorValue = '#49aa19'; /* 2:绿色 */ | |
| 1647 | + break; | |
| 1648 | + case 3: | |
| 1649 | + colorValue = '#49aa19'; /* 3:绿色 */ | |
| 1650 | + break; | |
| 1651 | + case 4: | |
| 1652 | + colorValue = '#ff4d4f'; /* 4:红色 */ | |
| 1653 | + break; | |
| 1654 | + default: | |
| 1655 | + colorValue = '#000000'; | |
| 1656 | + } | |
| 1936 | 1657 | } |
| 1937 | - </div> | |
| 1938 | - ); | |
| 1939 | - }} | |
| 1940 | - > | |
| 1941 | - <div | |
| 1942 | - style={{ | |
| 1943 | - whiteSpace: "nowrap", | |
| 1944 | - backgroundColor: sBackGroundColor, | |
| 1945 | - width: "100%", | |
| 1946 | - height: "29px", | |
| 1947 | - overflow: "hidden", | |
| 1948 | - lineHeight: "29px", | |
| 1949 | - textOverflow: "ellipsis", | |
| 1950 | - }} | |
| 1951 | - > | |
| 1658 | + return ( | |
| 1659 | + <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1660 | + {commonUtils.isNotEmptyObject(t.sMaterialsName) ? | |
| 1661 | + <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> | |
| 1662 | + {t.sMaterialsName} | |
| 1663 | + </span> : ''} | |
| 1664 | + { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 1665 | + </div> | |
| 1666 | + ); | |
| 1667 | + }) | |
| 1668 | + } | |
| 1669 | + </div> | |
| 1670 | + }}> | |
| 1671 | + <div style={{ whiteSpace: 'nowrap', backgroundColor: sBackGroundColor, width: '100%', height: '29px', overflow: 'hidden', lineHeight: '29px', textOverflow: 'ellipsis' }}> | |
| 1952 | 1672 | { |
| 1953 | 1673 | // eslint-disable-next-line array-callback-return; |
| 1954 | 1674 | sPartItem.map((t, i) => { |
| 1955 | 1675 | const sPartItemLength = sPartItem.length; |
| 1956 | - let colorValue = "#000000"; | |
| 1676 | + let colorValue = '#000000'; | |
| 1957 | 1677 | if (t?.background) { |
| 1958 | 1678 | colorValue = t.background; |
| 1959 | 1679 | } else { |
| 1960 | 1680 | const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; |
| 1961 | - switch ( | |
| 1962 | - Number(sState) // 根据状态显示颜色 | |
| 1963 | - ) { | |
| 1681 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 1964 | 1682 | case 0: |
| 1965 | - colorValue = "#000000"; /* 0:黑色 */ | |
| 1683 | + colorValue = '#000000'; /* 0:黑色 */ | |
| 1966 | 1684 | break; |
| 1967 | 1685 | case 1: |
| 1968 | - colorValue = "#ff4d4f"; /* 1:红色 */ | |
| 1686 | + colorValue = '#ff4d4f'; /* 1:红色 */ | |
| 1969 | 1687 | break; |
| 1970 | 1688 | case 2: |
| 1971 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 1689 | + colorValue = '#49aa19'; /* 2:绿色 */ | |
| 1972 | 1690 | break; |
| 1973 | 1691 | case 3: |
| 1974 | - colorValue = "#49aa19"; /* 3:绿色 */ | |
| 1692 | + colorValue = '#49aa19'; /* 3:绿色 */ | |
| 1975 | 1693 | break; |
| 1976 | 1694 | case 4: |
| 1977 | - colorValue = "#ff4d4f"; /* 4:红色 */ | |
| 1695 | + colorValue = '#ff4d4f'; /* 4:红色 */ | |
| 1978 | 1696 | break; |
| 1979 | 1697 | default: |
| 1980 | - colorValue = "#000000"; | |
| 1698 | + colorValue = '#000000'; | |
| 1981 | 1699 | } |
| 1982 | 1700 | } |
| 1983 | 1701 | return ( |
| 1984 | - <div style={{ display: "inline-block", width: "100%", color: colorValue }} key={i}> | |
| 1985 | - {commonUtils.isNotEmptyObject(t.sMaterialsName) ? ( | |
| 1986 | - <span | |
| 1987 | - className={linkStyle} | |
| 1988 | - onClick={ | |
| 1989 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 1990 | - ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) | |
| 1991 | - : null | |
| 1992 | - } | |
| 1993 | - > | |
| 1994 | - {t.sMaterialsName} | |
| 1995 | - </span> | |
| 1996 | - ) : ( | |
| 1997 | - "" | |
| 1998 | - )} | |
| 1999 | - {i + 1 === sPartItemLength ? "" : <span style={{ color: "#000000", margin: "0 2px" }}>-</span>} | |
| 1702 | + <div style={{ display: 'inline-block', width: '100%', color:colorValue }} key={i} > | |
| 1703 | + {commonUtils.isNotEmptyObject(t.sMaterialsName) ? | |
| 1704 | + <span className={linkStyle} onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, this.props.name, showConfig.sName, t, i, showConfig) : null}> | |
| 1705 | + {t.sMaterialsName} | |
| 1706 | + </span> : ''} | |
| 1707 | + { i + 1 === sPartItemLength ? '' : <span style={{ color:'#000000', margin: '0 2px' }}>-</span>} | |
| 2000 | 1708 | </div> |
| 2001 | 1709 | ); |
| 2002 | 1710 | }) |
| ... | ... | @@ -2005,12 +1713,7 @@ class CommonTableRc extends React.Component { |
| 2005 | 1713 | </Tooltip> |
| 2006 | 1714 | ); |
| 2007 | 1715 | } else { |
| 2008 | - return ( | |
| 2009 | - <div className="noInput readonlySpanStyle" style={{ backgroundColor: sBackGroundColor, height: "29px" }}> | |
| 2010 | - {" "} | |
| 2011 | - {itemStr}{" "} | |
| 2012 | - </div> | |
| 2013 | - ); | |
| 1716 | + return <div className='noInput readonlySpanStyle' style={{ backgroundColor: sBackGroundColor, height: '29px' }}> {itemStr} </div>; | |
| 2014 | 1717 | } |
| 2015 | 1718 | }; |
| 2016 | 1719 | } |
| ... | ... | @@ -2021,51 +1724,40 @@ class CommonTableRc extends React.Component { |
| 2021 | 1724 | /* 动态列Jsonn解析 */ |
| 2022 | 1725 | if (commonUtils.isNotEmptyArr(dynamicColumn) && commonUtils.isNotEmptyArr(dataSource)) { |
| 2023 | 1726 | dynamicColumn.forEach((jsonStatus, index) => { |
| 2024 | - if (commonUtils.isNotEmptyArr(jsonStatus.children)) { | |
| 2025 | - /* 嵌套列头JSON解析 */ | |
| 2026 | - const childrenJson = jsonStatus.children.filter(itemChild => itemChild.dataIndex && itemChild.dataIndex.includes("json")); | |
| 1727 | + if (commonUtils.isNotEmptyArr(jsonStatus.children)) { /* 嵌套列头JSON解析 */ | |
| 1728 | + const childrenJson = jsonStatus.children.filter(itemChild=> itemChild.dataIndex && itemChild.dataIndex.includes('json')); | |
| 2027 | 1729 | for (const obj of childrenJson) { |
| 2028 | - obj.render = itemStr => { | |
| 1730 | + obj.render = (itemStr) => { | |
| 2029 | 1731 | if (commonUtils.isNotEmptyObject(itemStr) && commonUtils.isJSON(itemStr)) { |
| 2030 | 1732 | const sPartItem = JSON.parse(itemStr); |
| 2031 | 1733 | return ( |
| 2032 | - <div style={{ whiteSpace: "normal", position: "absolute", width: "100%", left: 0, top: 0, bottom: 0 }}> | |
| 1734 | + <div style={{ whiteSpace: 'normal', position:'absolute', width:'100%', left:0, top:0, bottom:0 }}> | |
| 2033 | 1735 | { |
| 2034 | 1736 | // eslint-disable-next-line array-callback-return; |
| 2035 | 1737 | sPartItem.map((t, i) => { |
| 2036 | 1738 | // const sPartItemLength = sPartItem.length; |
| 2037 | - let colorValue = "#000000"; | |
| 1739 | + let colorValue = '#000000'; | |
| 2038 | 1740 | const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; |
| 2039 | - switch ( | |
| 2040 | - Number(sState) // 根据状态显示颜色 | |
| 2041 | - ) { | |
| 1741 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 2042 | 1742 | case 1: |
| 2043 | - colorValue = "#ff0000"; /* 1:红色 */ | |
| 1743 | + colorValue = '#ff0000'; /* 1:红色 */ | |
| 2044 | 1744 | break; |
| 2045 | 1745 | case 2: |
| 2046 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 1746 | + colorValue = '#49aa19'; /* 2:绿色 */ | |
| 2047 | 1747 | break; |
| 2048 | 1748 | case 3: |
| 2049 | - colorValue = "#ffff00"; /* 3:黄色 */ | |
| 1749 | + colorValue = '#ffff00'; /* 3:黄色 */ | |
| 2050 | 1750 | break; |
| 2051 | 1751 | case 0: |
| 2052 | - colorValue = ""; /* 3:不要颜色 */ | |
| 1752 | + colorValue = ''; /* 3:不要颜色 */ | |
| 2053 | 1753 | break; |
| 2054 | 1754 | default: |
| 2055 | - colorValue = ""; | |
| 1755 | + colorValue = ''; | |
| 2056 | 1756 | } |
| 2057 | 1757 | return ( |
| 2058 | 1758 | <div |
| 2059 | 1759 | className="dynamicColumnStyle" |
| 2060 | - style={{ | |
| 2061 | - display: "flex", | |
| 2062 | - alignItems: "center", | |
| 2063 | - padding: "4px", | |
| 2064 | - backgroundColor: colorValue, | |
| 2065 | - color: "#000", | |
| 2066 | - width: "100%", | |
| 2067 | - height: "100%", | |
| 2068 | - }} | |
| 1760 | + style={{ display:'flex', alignItems:'center', padding:'4px', backgroundColor: colorValue, color: '#000', width:'100%', height:'100%' }} | |
| 2069 | 1761 | key={i} |
| 2070 | 1762 | > |
| 2071 | 1763 | <div>{t.dSchedulHours}</div> |
| ... | ... | @@ -2077,37 +1769,38 @@ class CommonTableRc extends React.Component { |
| 2077 | 1769 | ); |
| 2078 | 1770 | } |
| 2079 | 1771 | }; |
| 2080 | - } | |
| 2081 | - } else { | |
| 2082 | - /* 无嵌套列头JSON列解析 */ | |
| 2083 | - dynamicColumn[index].render = itemStr => { | |
| 1772 | + }; | |
| 1773 | + } else { /* 无嵌套列头JSON列解析 */ | |
| 1774 | + dynamicColumn[index].render = (itemStr) => { | |
| 2084 | 1775 | if (commonUtils.isNotEmptyObject(itemStr) && commonUtils.isJSON(itemStr)) { |
| 2085 | 1776 | const sPartItem = JSON.parse(itemStr); |
| 2086 | 1777 | return ( |
| 2087 | - <div style={{ whiteSpace: "normal" }}> | |
| 1778 | + <div style={{ whiteSpace: 'normal' }}> | |
| 2088 | 1779 | { |
| 2089 | 1780 | // eslint-disable-next-line array-callback-return; |
| 2090 | 1781 | sPartItem.map((t, i) => { |
| 2091 | 1782 | // const sPartItemLength = sPartItem.length; |
| 2092 | - let colorValue = "#000000"; | |
| 1783 | + let colorValue = '#000000'; | |
| 2093 | 1784 | const sState = commonUtils.isEmpty(t.sState) ? 4 : t.sState; |
| 2094 | - switch ( | |
| 2095 | - Number(sState) // 根据状态显示颜色 | |
| 2096 | - ) { | |
| 1785 | + switch (Number(sState)) { // 根据状态显示颜色 | |
| 2097 | 1786 | case 1: |
| 2098 | - colorValue = "#ff0000"; /* 1:红色 */ | |
| 1787 | + colorValue = '#ff0000'; /* 1:红色 */ | |
| 2099 | 1788 | break; |
| 2100 | 1789 | case 2: |
| 2101 | - colorValue = "#49aa19"; /* 2:绿色 */ | |
| 1790 | + colorValue = '#49aa19'; /* 2:绿色 */ | |
| 2102 | 1791 | break; |
| 2103 | 1792 | case 3: |
| 2104 | - colorValue = "#ffff00"; /* 3:黄色 */ | |
| 1793 | + colorValue = '#ffff00'; /* 3:黄色 */ | |
| 2105 | 1794 | break; |
| 2106 | 1795 | default: |
| 2107 | - colorValue = "#666"; | |
| 1796 | + colorValue = '#666'; | |
| 2108 | 1797 | } |
| 2109 | 1798 | return ( |
| 2110 | - <div className="dynamicColumnStyle" style={{ backgroundColor: colorValue, color: "#000" }} key={i}> | |
| 1799 | + <div | |
| 1800 | + className="dynamicColumnStyle" | |
| 1801 | + style={{ backgroundColor: colorValue, color: '#000' }} | |
| 1802 | + key={i} | |
| 1803 | + > | |
| 2111 | 1804 | <div>{t.dSchedulHours}</div> |
| 2112 | 1805 | </div> |
| 2113 | 1806 | ); |
| ... | ... | @@ -2125,18 +1818,18 @@ class CommonTableRc extends React.Component { |
| 2125 | 1818 | |
| 2126 | 1819 | // 判断时间状态 |
| 2127 | 1820 | if (commonUtils.isNotEmptyArr(sTimeStatus) && commonUtils.isNotEmptyArr(dataSource)) { |
| 2128 | - sTimeStatus[0].render = itemStr => { | |
| 1821 | + sTimeStatus[0].render = (itemStr) => { | |
| 2129 | 1822 | if (commonUtils.isJSON(itemStr)) { |
| 2130 | 1823 | const sPartItem = JSON.parse(itemStr); |
| 2131 | - const linkStyle = "sTimeStatusStyle"; /* 弹窗 */ | |
| 1824 | + const linkStyle = 'sTimeStatusStyle';/* 弹窗 */ | |
| 2132 | 1825 | return ( |
| 2133 | - <div style={{ display: "flex" }}> | |
| 1826 | + <div style={{ display:'flex' }}> | |
| 2134 | 1827 | { |
| 2135 | 1828 | // eslint-disable-next-line array-callback-return; |
| 2136 | 1829 | sPartItem.map((t, i) => { |
| 2137 | 1830 | const sPartItemLength = sPartItem.length; |
| 2138 | 1831 | const sColor = t.sColor; |
| 2139 | - const dWidth = t.dRate !== undefined && t.dRate !== 0 ? `${t.dRate * 500}px` : "100px"; | |
| 1832 | + const dWidth = t.dRate !== undefined && t.dRate !== 0 ? `${t.dRate * 500}px` : '100px'; | |
| 2140 | 1833 | const content = ( |
| 2141 | 1834 | <div> |
| 2142 | 1835 | <p>{`${t.sName} :${t.sValue}`}</p> |
| ... | ... | @@ -2148,13 +1841,7 @@ class CommonTableRc extends React.Component { |
| 2148 | 1841 | <div |
| 2149 | 1842 | className={linkStyle} |
| 2150 | 1843 | style={{ |
| 2151 | - width: dWidth, | |
| 2152 | - color: "#000", | |
| 2153 | - textAlign: "center", | |
| 2154 | - backgroundColor: sColor, | |
| 2155 | - fontSize: "10px", | |
| 2156 | - height: "20px", | |
| 2157 | - borderRadius: i === 0 ? "10px 0 0 10px" : i === sPartItemLength - 1 ? "0 10px 10px 0" : "0px", | |
| 1844 | + width:dWidth, color:'#000', textAlign: 'center', backgroundColor:sColor, fontSize:'10px', height:'20px', borderRadius:i === 0 ? '10px 0 0 10px' : ( i === sPartItemLength - 1 ? '0 10px 10px 0' : '0px'), | |
| 2158 | 1845 | }} |
| 2159 | 1846 | key={i} |
| 2160 | 1847 | > |
| ... | ... | @@ -2174,39 +1861,34 @@ class CommonTableRc extends React.Component { |
| 2174 | 1861 | // 判断拼板状态 |
| 2175 | 1862 | if (commonUtils.isNotEmptyArr(sScheduleStatusJson) && commonUtils.isNotEmptyArr(dataSource)) { |
| 2176 | 1863 | this.useVListNew = true; |
| 2177 | - sScheduleStatusJson[0].render = itemStr => { | |
| 1864 | + sScheduleStatusJson[0].render = (itemStr) => { | |
| 2178 | 1865 | if (commonUtils.isJSON(itemStr)) { |
| 2179 | 1866 | const itemJson = commonUtils.convertStrToObj(itemStr); |
| 2180 | 1867 | const itemLength = itemJson.length; |
| 2181 | 1868 | const content = itemJson.map((t, i) => { |
| 2182 | - const { sState, sColor = "#000000", sName = "" } = t; | |
| 1869 | + const { sState, sColor = '#000000', sName = '' } = t; | |
| 2183 | 1870 | return ( |
| 2184 | - <div style={{ display: "inline-block", color: sColor }} key={i}> | |
| 2185 | - {sName} | |
| 2186 | - {i + 1 === itemLength ? "" : <RightOutlined />} | |
| 1871 | + <div style={{ display: 'inline-block', color: sColor }} key={i} > | |
| 1872 | + {sName}{ i + 1 === itemLength ? '' : <RightOutlined />} | |
| 2187 | 1873 | </div> |
| 2188 | 1874 | ); |
| 2189 | - }); | |
| 1875 | + }) | |
| 2190 | 1876 | return ( |
| 2191 | 1877 | <div |
| 2192 | 1878 | style={{ |
| 2193 | - whiteSpace: "nowrap", | |
| 2194 | - width: "auto", | |
| 2195 | - maxWidth: "100%", | |
| 2196 | - height: "29px", | |
| 2197 | - overflow: "hidden", | |
| 2198 | - lineHeight: "29px", | |
| 2199 | - textOverflow: "ellipsis", | |
| 2200 | - }} | |
| 2201 | - > | |
| 2202 | - <Tooltip | |
| 2203 | - color="#fff" | |
| 2204 | - title={() => { | |
| 2205 | - return <div>{content}</div>; | |
| 2206 | - }} | |
| 2207 | - > | |
| 2208 | - {content} | |
| 2209 | - </Tooltip> | |
| 1879 | + whiteSpace: 'nowrap', | |
| 1880 | + width: 'auto', | |
| 1881 | + maxWidth: '100%', | |
| 1882 | + height: '29px', | |
| 1883 | + overflow: 'hidden', | |
| 1884 | + lineHeight: '29px', | |
| 1885 | + textOverflow: 'ellipsis' | |
| 1886 | + }}> | |
| 1887 | + <Tooltip color="#fff" title={() => { | |
| 1888 | + return <div>{content}</div> | |
| 1889 | + }}> | |
| 1890 | + {content} | |
| 1891 | + </Tooltip> | |
| 2210 | 1892 | </div> |
| 2211 | 1893 | ); |
| 2212 | 1894 | } |
| ... | ... | @@ -2221,16 +1903,16 @@ class CommonTableRc extends React.Component { |
| 2221 | 1903 | } |
| 2222 | 1904 | let bPagination = true; /* 默认表格分页s */ |
| 2223 | 1905 | if (commonUtils.isNotEmptyObject(this.props)) { |
| 2224 | - bPagination = commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination); | |
| 1906 | + bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination)); | |
| 2225 | 1907 | } |
| 2226 | 1908 | let noVlistController = false; |
| 2227 | - if (this.props.config && this.props.config.gdsconfigformslave.filter(item => item.sControlName === "bNoVlist")[0]) { | |
| 1909 | + if(this.props.config && this.props.config.gdsconfigformslave.filter(item => item.sControlName === 'bNoVlist')[0]) { | |
| 2228 | 1910 | noVlistController = true; |
| 2229 | 1911 | } |
| 2230 | 1912 | |
| 2231 | 1913 | /* 特殊情况的表格 在虚拟列表情况 会无法滑动 */ |
| 2232 | 1914 | let noVlistTable = false; |
| 2233 | - if (this.props.noVlistTable) { | |
| 1915 | + if(this.props.noVlistTable) { | |
| 2234 | 1916 | noVlistTable = true; |
| 2235 | 1917 | } |
| 2236 | 1918 | // 判断是否有合并单元格, 有的话默认关闭虚拟滚动 |
| ... | ... | @@ -2251,26 +1933,22 @@ class CommonTableRc extends React.Component { |
| 2251 | 1933 | const { tableClassName } = this.state; |
| 2252 | 1934 | const oTable = document.querySelectorAll(`.${tableClassName}`)[0]; |
| 2253 | 1935 | if (oTable) { |
| 2254 | - const oBody = oTable.querySelector(".ant-table-body"); | |
| 1936 | + const oBody = oTable.querySelector('.ant-table-body'); | |
| 2255 | 1937 | oBody && (oBody.scrollTop = 0); |
| 2256 | 1938 | } |
| 2257 | 1939 | window.vlistNewSearh = null; |
| 2258 | - this.Vcomponents = VListNew({ | |
| 2259 | - height: this.scrollY, | |
| 2260 | - vid: this.uniqueId, | |
| 2261 | - onScroll: () => { | |
| 2262 | - setTimeout(() => { | |
| 2263 | - let divs = document.getElementsByClassName("noInputInsert"); | |
| 2264 | - if (divs.length) { | |
| 2265 | - Array.prototype.forEach.call(divs, item => { | |
| 2266 | - item.parentNode.parentNode.parentNode.parentNode.classList.add("insertTd"); | |
| 2267 | - }); | |
| 2268 | - } | |
| 2269 | - }, 20); | |
| 2270 | - }, | |
| 2271 | - }); | |
| 1940 | + this.Vcomponents = VListNew({height: this.scrollY, vid: this.uniqueId, onScroll: () => { | |
| 1941 | + setTimeout(() => { | |
| 1942 | + let divs = document.getElementsByClassName('noInputInsert'); | |
| 1943 | + if (divs.length) { | |
| 1944 | + Array.prototype.forEach.call(divs, item => { | |
| 1945 | + item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 1946 | + }); | |
| 1947 | + } | |
| 1948 | + }, 20); | |
| 1949 | + }}); | |
| 2272 | 1950 | } |
| 2273 | - components = { ...this.Vcomponents, ...components }; | |
| 1951 | + components = {...this.Vcomponents, ...components}; | |
| 2274 | 1952 | } else { |
| 2275 | 1953 | // vid是多个列表在同个页面中,同时渲染会促发问题 |
| 2276 | 1954 | // vid不可以为随机数,随机数会导致双击时,点击的两个VList id不同 |
| ... | ... | @@ -2281,51 +1959,46 @@ class CommonTableRc extends React.Component { |
| 2281 | 1959 | const { tableClassName } = this.state; |
| 2282 | 1960 | const oTable = document.querySelectorAll(`.${tableClassName}`)[0]; |
| 2283 | 1961 | if (oTable) { |
| 2284 | - const oBody = oTable.querySelector(".ant-table-body"); | |
| 1962 | + const oBody = oTable.querySelector('.ant-table-body'); | |
| 2285 | 1963 | oBody && (oBody.scrollTop = 0); |
| 2286 | 1964 | } |
| 2287 | 1965 | window.vlistNewSearh = null; |
| 2288 | - this.Vcomponents1 = VList({ | |
| 2289 | - height: this.scrollY, | |
| 2290 | - vid: this.uniqueId, | |
| 2291 | - rowKey: this.rowKey, | |
| 2292 | - onScroll: () => { | |
| 2293 | - setTimeout(() => { | |
| 2294 | - let divs = document.getElementsByClassName("noInputInsert"); | |
| 2295 | - if (divs.length) { | |
| 2296 | - Array.prototype.forEach.call(divs, item => { | |
| 2297 | - item.parentNode.parentNode.parentNode.parentNode.classList.add("insertTd"); | |
| 2298 | - }); | |
| 2299 | - } | |
| 2300 | - }, 20); | |
| 2301 | - }, | |
| 2302 | - }); | |
| 1966 | + this.Vcomponents1 = VList({ height: this.scrollY, vid: this.uniqueId, rowKey: this.rowKey, onScroll: () => { | |
| 1967 | + setTimeout(() => { | |
| 1968 | + let divs = document.getElementsByClassName('noInputInsert'); | |
| 1969 | + if (divs.length) { | |
| 1970 | + Array.prototype.forEach.call(divs, item => { | |
| 1971 | + item.parentNode.parentNode.parentNode.parentNode.classList.add('insertTd'); | |
| 1972 | + }); | |
| 1973 | + } | |
| 1974 | + }, 20); | |
| 1975 | + } }); | |
| 2303 | 1976 | } |
| 2304 | 1977 | components = { ...this.Vcomponents1, ...components }; |
| 2305 | 1978 | } |
| 2306 | 1979 | } |
| 2307 | 1980 | if (this.props.config && this.props.config.iFreezeColumn) { |
| 2308 | 1981 | tableColumn.forEach((val, index) => { |
| 2309 | - if (tableColumn[index].fixedHelp) { | |
| 1982 | + if(tableColumn[index].fixedHelp) { | |
| 2310 | 1983 | tableColumn[index].fixed = false; |
| 2311 | 1984 | tableColumn[index].fixedHelp = false; |
| 2312 | 1985 | } |
| 2313 | 1986 | if (index < this.props.config.iFreezeColumn) { |
| 2314 | - tableColumn[index].fixed = "left"; | |
| 1987 | + tableColumn[index].fixed = 'left'; | |
| 2315 | 1988 | tableColumn[index].fixedHelp = true; |
| 2316 | 1989 | } |
| 2317 | 1990 | }); |
| 2318 | 1991 | } |
| 2319 | 1992 | // 处理拖拽排序 |
| 2320 | 1993 | if (this.props.dragHandle) { |
| 2321 | - const handleSortTitle = commonFunc.showMessage(this.props.app.commonConst, "sort") || "排序"; | |
| 2322 | - const handleSort = tableColumn.filter(item => item.dataIndex === "handleSort").length; | |
| 1994 | + const handleSortTitle = commonFunc.showMessage(this.props.app.commonConst, 'sort') || '排序' ; | |
| 1995 | + const handleSort = tableColumn.filter(item => item.dataIndex === 'handleSort').length; | |
| 2323 | 1996 | if (tableColumn[0]) { |
| 2324 | 1997 | function arrayMoveMutable(array, fromIndex, toIndex) { |
| 2325 | 1998 | const startIndex = fromIndex < 0 ? array.length + fromIndex : fromIndex; |
| 2326 | 1999 | if (startIndex >= 0 && startIndex < array.length) { |
| 2327 | 2000 | const endIndex = toIndex < 0 ? array.length + toIndex : toIndex; |
| 2328 | - if (commonUtils.isNotEmptyObject(array[fromIndex].sWorkOrderUsed)) { | |
| 2001 | + if(commonUtils.isNotEmptyObject(array[fromIndex].sWorkOrderUsed)) { | |
| 2329 | 2002 | message.error(array[fromIndex].sWorkOrderUsed); |
| 2330 | 2003 | return; |
| 2331 | 2004 | } |
| ... | ... | @@ -2338,7 +2011,7 @@ class CommonTableRc extends React.Component { |
| 2338 | 2011 | arrayMoveMutable(array, fromIndex, toIndex); |
| 2339 | 2012 | return array; |
| 2340 | 2013 | } |
| 2341 | - const DragHandle = sortableHandle(() => <MenuOutlined style={{ cursor: "grab", color: "#999" }} />); | |
| 2014 | + const DragHandle = sortableHandle(() => <MenuOutlined style={{ cursor: 'grab', color: '#999' }} />); | |
| 2342 | 2015 | const SortableItem = sortableElement(props => <tr {...props} />); |
| 2343 | 2016 | const SortableContainer = sortableContainer(props => <tbody {...props} />); |
| 2344 | 2017 | const onSortEnd = ({ oldIndex, newIndex }) => { |
| ... | ... | @@ -2349,17 +2022,23 @@ class CommonTableRc extends React.Component { |
| 2349 | 2022 | } |
| 2350 | 2023 | }; |
| 2351 | 2024 | const DraggableContainer = props => ( |
| 2352 | - <SortableContainer useDragHandle disableAutoscroll helperClass="row-dragging" onSortEnd={onSortEnd} {...props} /> | |
| 2025 | + <SortableContainer | |
| 2026 | + useDragHandle | |
| 2027 | + disableAutoscroll | |
| 2028 | + helperClass="row-dragging" | |
| 2029 | + onSortEnd={onSortEnd} | |
| 2030 | + {...props} | |
| 2031 | + /> | |
| 2353 | 2032 | ); |
| 2354 | 2033 | const DraggableBodyRow = ({ className, style, ...restProps }) => { |
| 2355 | 2034 | const { dataSource } = this.state; |
| 2356 | 2035 | // function findIndex base on Table rowKey props and should always be a right array index |
| 2357 | - const index = dataSource.findIndex(x => x.index === restProps["data-row-key"]); | |
| 2358 | - return <SortableItem index={index} className={className} style={{ ...style }} {...restProps} />; | |
| 2036 | + const index = dataSource.findIndex(x => x.index === restProps['data-row-key']); | |
| 2037 | + return <SortableItem index={index} className={className} style={{...style}} {...restProps} />; | |
| 2359 | 2038 | }; |
| 2360 | 2039 | // 处理渲染后丢失input focus的bug. |
| 2361 | - let bDrag = this.props.enabled && !this.props.bForbiddenDrag; /* 是否可以拖动 */ | |
| 2362 | - if (bDrag) { | |
| 2040 | + let bDrag = this.props.enabled && !this.props.bForbiddenDrag;/* 是否可以拖动 */ | |
| 2041 | + if(bDrag) { | |
| 2363 | 2042 | if (!this.DraggableContainer) { |
| 2364 | 2043 | this.DraggableContainer = DraggableContainer; |
| 2365 | 2044 | } |
| ... | ... | @@ -2367,20 +2046,22 @@ class CommonTableRc extends React.Component { |
| 2367 | 2046 | this.DraggableBodyRow = DraggableBodyRow; |
| 2368 | 2047 | } |
| 2369 | 2048 | } |
| 2370 | - if (!handleSort) { | |
| 2371 | - components = { ...components, body: { wrapper: this.DraggableContainer, row: this.DraggableBodyRow } }; | |
| 2049 | + if(!handleSort) { | |
| 2050 | + components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}}; | |
| 2372 | 2051 | } else { |
| 2373 | - components = { ...components, body: { wrapper: this.DraggableContainer, row: this.DraggableBodyRow } }; | |
| 2052 | + components = {...components, body: {wrapper: this.DraggableContainer, row: this.DraggableBodyRow}}; | |
| 2374 | 2053 | tableColumn.shift(); |
| 2375 | 2054 | } |
| 2376 | - tableColumn.unshift({ | |
| 2377 | - title: handleSortTitle, | |
| 2378 | - dataIndex: "handleSort", | |
| 2379 | - fixed: "left", | |
| 2380 | - width: 40, | |
| 2381 | - className: "drag-visible", | |
| 2382 | - render: () => <DragHandle />, | |
| 2383 | - }); | |
| 2055 | + tableColumn.unshift( | |
| 2056 | + { | |
| 2057 | + title: handleSortTitle, | |
| 2058 | + dataIndex: 'handleSort', | |
| 2059 | + fixed: 'left', | |
| 2060 | + width: 40, | |
| 2061 | + className: 'drag-visible', | |
| 2062 | + render: () => <DragHandle />, | |
| 2063 | + }, | |
| 2064 | + ) | |
| 2384 | 2065 | } |
| 2385 | 2066 | } |
| 2386 | 2067 | |
| ... | ... | @@ -2394,9 +2075,9 @@ class CommonTableRc extends React.Component { |
| 2394 | 2075 | } |
| 2395 | 2076 | } |
| 2396 | 2077 | |
| 2397 | - let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getRowSelection(this.props.name, "slave"); // 是否选择多选框的问题 | |
| 2078 | + let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getRowSelection(this.props.name, 'slave'); // 是否选择多选框的问题 | |
| 2398 | 2079 | if (this.props.config && !this.props.config.bisMutiSelect) { |
| 2399 | - rowSelection = null; | |
| 2080 | + rowSelection = null | |
| 2400 | 2081 | } |
| 2401 | 2082 | const { expKeys } = this.state; |
| 2402 | 2083 | |
| ... | ... | @@ -2404,54 +2085,36 @@ class CommonTableRc extends React.Component { |
| 2404 | 2085 | return { |
| 2405 | 2086 | components, |
| 2406 | 2087 | rowKey: this.rowKey, |
| 2407 | - size: "middle", | |
| 2408 | - bordered: true /* 显示边框 */, | |
| 2409 | - className: !this.props.enabled ? styles.disabledProup : styles.proup /* 样式控制 */, | |
| 2410 | - scroll: { x: "max-content" } /* 宽度 */, | |
| 2411 | - dataSource /* 数据 */, | |
| 2412 | - columns: tableColumn /* 表头 */, | |
| 2088 | + size: 'middle', | |
| 2089 | + bordered: true, /* 显示边框 */ | |
| 2090 | + className: !this.props.enabled ? styles.disabledProup : styles.proup, /* 样式控制 */ | |
| 2091 | + scroll: { x: 'max-content' }, /* 宽度 */ | |
| 2092 | + dataSource, /* 数据 */ | |
| 2093 | + columns: tableColumn, /* 表头 */ | |
| 2413 | 2094 | // rowSelection: this.props.rowSelection !== undefined ? this.props.rowSelection : this.getRowSelection(this.props.name, 'slave'), /* 添加的复选框(checkbox)功能 */ |
| 2414 | 2095 | rowSelection, |
| 2415 | 2096 | // pagination: false, /* 不分页 */ |
| 2416 | - rowClassName: this.setRowClassName.bind(this, "slave"), | |
| 2097 | + rowClassName: this.setRowClassName.bind(this, 'slave'), | |
| 2417 | 2098 | onRow: (record, index) => { |
| 2418 | 2099 | if (this.isDragAndDrop) { |
| 2419 | 2100 | return { |
| 2420 | 2101 | index, |
| 2421 | - onClick: () => { | |
| 2422 | - this.onRowClick(record, index, undefined, this.props.name, "slave"); | |
| 2423 | - }, | |
| 2424 | - onMouseEnter: () => { | |
| 2425 | - this.onRowMouseEnter(record); | |
| 2426 | - }, | |
| 2427 | - onMouseLeave: () => { | |
| 2428 | - this.onRowMouseLeave(record); | |
| 2429 | - }, | |
| 2430 | - onDoubleClick: () => { | |
| 2431 | - this.onDoubleClick(this.props.name, record); | |
| 2432 | - }, | |
| 2433 | - moveRow: (dragIndex, hoverIndex, dragKey, hoverKey) => { | |
| 2434 | - this.moveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 2435 | - }, | |
| 2436 | - onDragClick: type => { | |
| 2437 | - this.onRowClick(record, index, type, this.props.name, "slave"); | |
| 2102 | + onClick: () => { this.onRowClick(record, index, undefined, this.props.name, 'slave'); }, | |
| 2103 | + onMouseEnter: () => { this.onRowMouseEnter(record); }, | |
| 2104 | + onMouseLeave: () => { this.onRowMouseLeave(record); }, | |
| 2105 | + onDoubleClick: () => { this.onDoubleClick(this.props.name, record); }, | |
| 2106 | + moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => { | |
| 2107 | + this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 2438 | 2108 | }, |
| 2109 | + onDragClick: (type) => { this.onRowClick(record, index, type, this.props.name, 'slave'); }, | |
| 2439 | 2110 | }; |
| 2440 | 2111 | } else { |
| 2441 | 2112 | return { |
| 2442 | 2113 | index, |
| 2443 | - onClick: () => { | |
| 2444 | - this.onRowClick(record, index, undefined, this.props.name, "slave"); | |
| 2445 | - }, | |
| 2446 | - onDoubleClick: () => { | |
| 2447 | - this.onDoubleClick(this.props.name, record); | |
| 2448 | - }, | |
| 2449 | - onMouseEnter: () => { | |
| 2450 | - this.onRowMouseEnter(record); | |
| 2451 | - }, | |
| 2452 | - onMouseLeave: () => { | |
| 2453 | - this.onRowMouseLeave(); | |
| 2454 | - }, | |
| 2114 | + onClick: () => { this.onRowClick(record, index, undefined, this.props.name, 'slave'); }, | |
| 2115 | + onDoubleClick: () => { this.onDoubleClick(this.props.name, record); }, | |
| 2116 | + onMouseEnter: () => { this.onRowMouseEnter(record); }, | |
| 2117 | + onMouseLeave: () => { this.onRowMouseLeave(); }, | |
| 2455 | 2118 | }; |
| 2456 | 2119 | } |
| 2457 | 2120 | }, |
| ... | ... | @@ -2461,32 +2124,31 @@ class CommonTableRc extends React.Component { |
| 2461 | 2124 | const expKeysNew = [...expKeys, record[this.rowKey]]; |
| 2462 | 2125 | this.currentExpKeys = expKeysNew; |
| 2463 | 2126 | this.setState({ |
| 2464 | - expKeys: expKeysNew, | |
| 2127 | + expKeys: expKeysNew | |
| 2465 | 2128 | }); |
| 2466 | 2129 | } else { |
| 2467 | 2130 | const expKeysNew = expKeys.filter(item => item !== record[this.rowKey]); |
| 2468 | 2131 | this.currentExpKeys = expKeysNew; |
| 2469 | 2132 | this.setState({ |
| 2470 | - expKeys: expKeysNew, | |
| 2133 | + expKeys: expKeysNew | |
| 2471 | 2134 | }); |
| 2472 | 2135 | } |
| 2473 | 2136 | } |
| 2474 | - this.onExpand(expanded, record, "slave"); /* 点击展开图标时触发s */ | |
| 2137 | + this.onExpand(expanded, record, 'slave'); /* 点击展开图标时触发s */ | |
| 2475 | 2138 | }, |
| 2476 | 2139 | expandedRowKeys: expKeys.length || this.showExpAll || this.isAllowConExpendKeys ? expKeys : null, |
| 2477 | - id: commonUtils.isEmptyArr(dataSource) ? "unDataBox" : "dataBox" /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */, | |
| 2140 | + id: commonUtils.isEmptyArr(dataSource) ? | |
| 2141 | + 'unDataBox' : | |
| 2142 | + 'dataBox', /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */ | |
| 2478 | 2143 | ...this.props.tableProps, |
| 2479 | - pagination: bPagination | |
| 2480 | - ? { | |
| 2481 | - ...this.props.tableProps.pagination, | |
| 2482 | - onChange: (current, size) => { | |
| 2483 | - this.curPagination = { | |
| 2484 | - current, | |
| 2485 | - pageSize: size, | |
| 2486 | - }; | |
| 2487 | - }, | |
| 2144 | + pagination: bPagination ? { | |
| 2145 | + ...this.props.tableProps.pagination, | |
| 2146 | + onChange: (current, size) => { | |
| 2147 | + this.curPagination = { | |
| 2148 | + current, pageSize: size | |
| 2488 | 2149 | } |
| 2489 | - : false /* 表格是否分页 */, | |
| 2150 | + } | |
| 2151 | + } : false, /* 表格是否分页 */ | |
| 2490 | 2152 | onChange: this.onChange, |
| 2491 | 2153 | }; |
| 2492 | 2154 | }; |
| ... | ... | @@ -2494,21 +2156,20 @@ class CommonTableRc extends React.Component { |
| 2494 | 2156 | /** 获取子从表复选框对象的props */ |
| 2495 | 2157 | getSlaveRowSelection = (name, type) => { |
| 2496 | 2158 | const { bMutiSelect } = this.props.slaveInfo; /* 显示单选框还是复选框 */ |
| 2497 | - let { bisMutiSelect } = this.props.slaveInfo; /* 是否显示选择框 */ | |
| 2159 | + let { bisMutiSelect } = this.props.slaveInfo; /* 是否显示选择框 */ | |
| 2498 | 2160 | if (this.props.slaveInfo.config) { |
| 2499 | - bisMutiSelect = this.props.slaveInfo.config.bisMutiSelect; | |
| 2161 | + bisMutiSelect = this.props.slaveInfo.config.bisMutiSelect | |
| 2500 | 2162 | } |
| 2501 | - if (name === "control" || (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.indexOf("commonAuto") > -1)) { | |
| 2502 | - // 控制表中可以通过bisMutiSelect显示或者隐藏勾选框 | |
| 2163 | + if (name === 'control' || (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.indexOf('commonAuto') > -1)) { // 控制表中可以通过bisMutiSelect显示或者隐藏勾选框 | |
| 2503 | 2164 | if (bisMutiSelect) { |
| 2504 | 2165 | return { |
| 2505 | 2166 | preserveSelectedRowKeys: true, |
| 2506 | - selectedRowKeys: type === "slaveInfo" ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys /* 已选择的数据集 */, | |
| 2507 | - onChange: this.handleSelectRowChange.bind(this, name) /* 选择行发生改变时调用的函数 */, | |
| 2167 | + selectedRowKeys: type === 'slaveInfo' ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys, /* 已选择的数据集 */ | |
| 2168 | + onChange: this.handleSelectRowChange.bind(this, name), /* 选择行发生改变时调用的函数 */ | |
| 2508 | 2169 | getCheckboxProps: record => ({ |
| 2509 | - style: record.bSum && commonConfig.hasSum ? { display: "none" } : { display: "checkbox" }, | |
| 2510 | - }) /* 过滤合计的选择框 */, | |
| 2511 | - type: bMutiSelect ? this.props.rowSelectionType : "radio" /* checkbox or radio */, | |
| 2170 | + style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' }, | |
| 2171 | + }), /* 过滤合计的选择框 */ | |
| 2172 | + type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */ | |
| 2512 | 2173 | columnWidth: 37, |
| 2513 | 2174 | }; |
| 2514 | 2175 | } else { |
| ... | ... | @@ -2517,12 +2178,12 @@ class CommonTableRc extends React.Component { |
| 2517 | 2178 | } else { |
| 2518 | 2179 | return { |
| 2519 | 2180 | preserveSelectedRowKeys: true, |
| 2520 | - selectedRowKeys: type === "slaveInfo" ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys /* 已选择的数据集 */, | |
| 2521 | - onChange: this.handleSelectRowChange.bind(this, name) /* 选择行发生改变时调用的函数 */, | |
| 2181 | + selectedRowKeys: type === 'slaveInfo' ? this.state.slaveInfoSelectedRowKeys : this.state.selectedRowKeys, /* 已选择的数据集 */ | |
| 2182 | + onChange: this.handleSelectRowChange.bind(this, name), /* 选择行发生改变时调用的函数 */ | |
| 2522 | 2183 | getCheckboxProps: record => ({ |
| 2523 | - style: record.bSum && commonConfig.hasSum ? { display: "none" } : { display: "checkbox" }, | |
| 2524 | - }) /* 过滤合计的选择框 */, | |
| 2525 | - type: bMutiSelect ? this.props.rowSelectionType : "radio" /* checkbox or radio */, | |
| 2184 | + style: record.bSum && commonConfig.hasSum ? { display: 'none' } : { display: 'checkbox' }, | |
| 2185 | + }), /* 过滤合计的选择框 */ | |
| 2186 | + type: bMutiSelect ? this.props.rowSelectionType : 'radio', /* checkbox or radio */ | |
| 2526 | 2187 | columnWidth: 37, |
| 2527 | 2188 | }; |
| 2528 | 2189 | } |
| ... | ... | @@ -2531,8 +2192,10 @@ class CommonTableRc extends React.Component { |
| 2531 | 2192 | /** 获取table对象的props */ |
| 2532 | 2193 | getSlaveTableProps = () => { |
| 2533 | 2194 | /* 给数据都添加上key */ |
| 2534 | - if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === "Y") { | |
| 2535 | - const { dataSource, tableColumn, tableProps, name: slaveInfoName, config: slaveInfoConfig } = this.props.slaveInfo; | |
| 2195 | + if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === 'Y') { | |
| 2196 | + const { | |
| 2197 | + dataSource, tableColumn, tableProps, name: slaveInfoName, config: slaveInfoConfig, | |
| 2198 | + } = this.props.slaveInfo; | |
| 2536 | 2199 | // const scrollHeight = parseInt(document.body.clientHeight - 400, 10); |
| 2537 | 2200 | const components = {}; |
| 2538 | 2201 | if (this.isDragAndDrop) { |
| ... | ... | @@ -2542,46 +2205,45 @@ class CommonTableRc extends React.Component { |
| 2542 | 2205 | components.header = { cell: ResizeableTitle }; |
| 2543 | 2206 | } |
| 2544 | 2207 | |
| 2545 | - let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getSlaveRowSelection(slaveInfoName, "slaveInfo"); | |
| 2546 | - if (slaveInfoConfig && !slaveInfoConfig.bisMutiSelect) { | |
| 2547 | - /* 如果子表配置不显示选择框 则不显示选择框 */ | |
| 2208 | + let rowSelection = this.props.rowSelection !== undefined ? this.props.rowSelection : this.getSlaveRowSelection(slaveInfoName, 'slaveInfo'); | |
| 2209 | + if (slaveInfoConfig && !slaveInfoConfig.bisMutiSelect) { /* 如果子表配置不显示选择框 则不显示选择框 */ | |
| 2548 | 2210 | rowSelection = null; |
| 2549 | 2211 | } |
| 2550 | 2212 | /* 返回值 */ |
| 2551 | 2213 | return { |
| 2552 | 2214 | components, |
| 2553 | 2215 | rowKey: tableProps.rowKey, |
| 2554 | - size: "small", | |
| 2555 | - bordered: true /* 显示边框 */, | |
| 2556 | - className: !this.props.enabled ? styles.disabledProup : styles.proup /* 样式控制 */, | |
| 2557 | - scroll: { x: "max-content" } /* 宽度 */, | |
| 2558 | - dataSource /* 数据 */, | |
| 2559 | - columns: tableColumn /* 表头 */, | |
| 2560 | - rowSelection: rowSelection /* s 添加的复选框(checkbox)功能 */, | |
| 2561 | - pagination: false /* 不分页 */, | |
| 2562 | - rowClassName: this.setRowClassName.bind(this, "slaveInfo"), | |
| 2216 | + size: 'small', | |
| 2217 | + bordered: true, /* 显示边框 */ | |
| 2218 | + className: !this.props.enabled ? styles.disabledProup : styles.proup, /* 样式控制 */ | |
| 2219 | + scroll: { x: 'max-content' }, /* 宽度 */ | |
| 2220 | + dataSource, /* 数据 */ | |
| 2221 | + columns: tableColumn, /* 表头 */ | |
| 2222 | + rowSelection: rowSelection, /* s 添加的复选框(checkbox)功能 */ | |
| 2223 | + pagination: false, /* 不分页 */ | |
| 2224 | + rowClassName: this.setRowClassName.bind(this, 'slaveInfo'), | |
| 2563 | 2225 | onRow: (record, index) => { |
| 2564 | 2226 | if (this.isDragAndDrop) { |
| 2565 | 2227 | return { |
| 2566 | 2228 | index, |
| 2567 | 2229 | onClick: () => { |
| 2568 | - this.onRowClick(record, index, undefined, slaveInfoName, "slaveInfo"); | |
| 2230 | + this.onRowClick(record, index, undefined, slaveInfoName, 'slaveInfo'); | |
| 2569 | 2231 | }, |
| 2570 | 2232 | onDoubleClick: () => { |
| 2571 | - this.onDoubleClick(record, index, undefined, slaveInfoName, "slaveInfo"); | |
| 2233 | + this.onDoubleClick(record, index, undefined, slaveInfoName, 'slaveInfo'); | |
| 2572 | 2234 | }, |
| 2573 | - moveRow: (dragIndex, hoverIndex, dragKey, hoverKey) => { | |
| 2574 | - this.moveRow(dragIndex, hoverIndex, dragKey, hoverKey); | |
| 2235 | + moveRow: (dragIndex, hoverIndex,dragKey,hoverKey) => { | |
| 2236 | + this.moveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 2575 | 2237 | }, |
| 2576 | - onDragClick: type => { | |
| 2577 | - this.onRowClick(record, index, type, slaveInfoName, "slaveInfo"); | |
| 2238 | + onDragClick: (type) => { | |
| 2239 | + this.onRowClick(record, index, type, slaveInfoName, 'slaveInfo'); | |
| 2578 | 2240 | }, |
| 2579 | 2241 | }; |
| 2580 | 2242 | } else { |
| 2581 | 2243 | return { |
| 2582 | 2244 | index, |
| 2583 | 2245 | onClick: () => { |
| 2584 | - this.onRowClick(record, index, undefined, slaveInfoName, "slaveInfo"); | |
| 2246 | + this.onRowClick(record, index, undefined, slaveInfoName, 'slaveInfo'); | |
| 2585 | 2247 | }, |
| 2586 | 2248 | onDoubleClick: () => { |
| 2587 | 2249 | this.onDoubleClick(slaveInfoName, record); |
| ... | ... | @@ -2590,13 +2252,13 @@ class CommonTableRc extends React.Component { |
| 2590 | 2252 | } |
| 2591 | 2253 | }, |
| 2592 | 2254 | // footer: this.props.footer === undefined ? this.tableFooter : undefined, |
| 2593 | - id: commonUtils.isEmptyArr(dataSource) ? "unDataBox" : "dataBox" /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */, | |
| 2255 | + id: commonUtils.isEmptyArr(dataSource) ? | |
| 2256 | + 'unDataBox' : | |
| 2257 | + 'dataBox', /* 用户修改antd table中自带的样式(我听别人说的要这么弄,你们别骂我) */ | |
| 2594 | 2258 | ...this.props.slaveInfo.tableProps, |
| 2595 | 2259 | onChange: this.onChange, |
| 2596 | 2260 | }; |
| 2597 | - } else { | |
| 2598 | - return null; | |
| 2599 | - } | |
| 2261 | + } else { return null; } | |
| 2600 | 2262 | }; |
| 2601 | 2263 | |
| 2602 | 2264 | getTableFilterData = () => { |
| ... | ... | @@ -2609,13 +2271,13 @@ class CommonTableRc extends React.Component { |
| 2609 | 2271 | } else { |
| 2610 | 2272 | filterData = dataSource.length; |
| 2611 | 2273 | } |
| 2612 | - if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) { | |
| 2613 | - if (masterData.sZczlxShowName === "删除" || masterData.sZczlxShowName === "恢复") { | |
| 2274 | + if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sZczlxShowName)) { | |
| 2275 | + if(masterData.sZczlxShowName === '删除' || masterData.sZczlxShowName === '恢复'){ | |
| 2614 | 2276 | filterData += 1; |
| 2615 | 2277 | } |
| 2616 | 2278 | } |
| 2617 | 2279 | return filterData; |
| 2618 | - }; | |
| 2280 | + } | |
| 2619 | 2281 | /** 获取showConfig */ |
| 2620 | 2282 | getShowConfig = (props, sName, isSlaveInfo) => { |
| 2621 | 2283 | /* 返回值声明 */ |
| ... | ... | @@ -2637,9 +2299,10 @@ class CommonTableRc extends React.Component { |
| 2637 | 2299 | if (isSlaveInfo && commonUtils.isNotEmptyObject(this.props.slaveInfo) && commonUtils.isNotEmptyObject(this.props.slaveInfo.config)) { |
| 2638 | 2300 | const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter(item => item.sName === sName && item.bVisible); |
| 2639 | 2301 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 2640 | - showConfig = showConfigArr[0]; | |
| 2302 | + showConfig = showConfigArr[0]; | |
| 2641 | 2303 | } |
| 2642 | 2304 | } |
| 2305 | + | |
| 2643 | 2306 | } |
| 2644 | 2307 | /* 返回值 */ |
| 2645 | 2308 | return showConfig; |
| ... | ... | @@ -2651,30 +2314,25 @@ class CommonTableRc extends React.Component { |
| 2651 | 2314 | /* 通过sName过滤出对应的showConfig */ |
| 2652 | 2315 | /* 通过sName过滤出对应的showConfig */ |
| 2653 | 2316 | if (this.props.customConfig) { |
| 2654 | - const showConfigArr = this.props.customConfig.filter( | |
| 2655 | - item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible | |
| 2656 | - ); | |
| 2317 | + const showConfigArr = this.props.customConfig.filter(item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible); | |
| 2657 | 2318 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 2658 | 2319 | showConfig = showConfigArr; |
| 2659 | 2320 | } |
| 2660 | 2321 | } else { |
| 2661 | 2322 | if (this.props.config) { |
| 2662 | - const showConfigArr = this.props.config.gdsconfigformslave.filter( | |
| 2663 | - item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible | |
| 2664 | - ); | |
| 2323 | + const showConfigArr = this.props.config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible); | |
| 2665 | 2324 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 2666 | 2325 | showConfig = showConfigArr; |
| 2667 | 2326 | } |
| 2668 | 2327 | } |
| 2669 | 2328 | |
| 2670 | 2329 | if (commonUtils.isNotEmptyObject(this.props.slaveInfo) && commonUtils.isNotEmptyObject(this.props.slaveInfo.config)) { |
| 2671 | - const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter( | |
| 2672 | - item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible | |
| 2673 | - ); | |
| 2330 | + const showConfigArr = this.props.slaveInfo.config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sName) && commonUtils.isNotEmptyObject(item.sColorTerms) && item.bVisible); | |
| 2674 | 2331 | if (commonUtils.isNotEmptyArr(showConfigArr)) { |
| 2675 | 2332 | showConfig = showConfigArr; |
| 2676 | 2333 | } |
| 2677 | 2334 | } |
| 2335 | + | |
| 2678 | 2336 | } |
| 2679 | 2337 | /* 返回值 */ |
| 2680 | 2338 | return showConfig; |
| ... | ... | @@ -2683,66 +2341,65 @@ class CommonTableRc extends React.Component { |
| 2683 | 2341 | rowColorData = React.createRef(); |
| 2684 | 2342 | |
| 2685 | 2343 | getColorStyle = (record, isRowShow) => { |
| 2686 | - let styleColorArrTotal = ""; | |
| 2344 | + let styleColorArrTotal = ''; | |
| 2687 | 2345 | const showConfigArr = this.getColorConfig(); /* 拿到颜色配置json */ |
| 2688 | 2346 | if (commonUtils.isNotEmptyArr(showConfigArr) && showConfigArr.length > 0) { |
| 2689 | 2347 | for (const showConfig of showConfigArr) { |
| 2690 | - let styleColorArr = ""; | |
| 2348 | + let styleColorArr = ''; | |
| 2691 | 2349 | const colorConditon = commonUtils.isNotEmptyObject(showConfig) ? showConfig.sColorTerms : null; |
| 2692 | - if (commonUtils.isNotEmptyObject(colorConditon)) { | |
| 2693 | - let colorConditionArr = ""; | |
| 2350 | + if (commonUtils.isNotEmptyObject((colorConditon))) { | |
| 2351 | + let colorConditionArr = ''; | |
| 2694 | 2352 | try { |
| 2695 | 2353 | colorConditionArr = JSON.parse(colorConditon); /* 转化为json */ |
| 2696 | 2354 | } catch (e) { |
| 2697 | - colorConditionArr = ""; | |
| 2355 | + colorConditionArr = ''; | |
| 2698 | 2356 | } |
| 2699 | - colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ""; /* 判断是否是数组 */ | |
| 2357 | + colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ''; /* 判断是否是数组 */ | |
| 2700 | 2358 | for (const item of colorConditionArr) { |
| 2701 | - let styleColor = ""; | |
| 2702 | - const { column, condition, conditionValue, color, isRow } = item; | |
| 2359 | + let styleColor = ''; | |
| 2360 | + const { | |
| 2361 | + column, condition, conditionValue, color, isRow, | |
| 2362 | + } = item; | |
| 2703 | 2363 | if (record[column] !== undefined) { |
| 2704 | - if (color && !document.getElementById(`color${color.replace("#", "-")}`)) { | |
| 2705 | - var style = document.createElement("style"); | |
| 2706 | - style.type = "text/css"; | |
| 2707 | - style.id = `color${color.replace("#", "-")}`; | |
| 2364 | + if (color && !document.getElementById(`color${color.replace('#', '-')}`)) { | |
| 2365 | + var style = document.createElement('style'); | |
| 2366 | + style.type = 'text/css'; | |
| 2367 | + style.id = `color${color.replace('#', '-')}`; | |
| 2708 | 2368 | style.innerHTML = ` |
| 2709 | - .color${color.replace("#", "-")} td { | |
| 2369 | + .color${color.replace('#', '-')} td { | |
| 2710 | 2370 | background-color:${color}!important; |
| 2711 | 2371 | .ant-table-selection-column { |
| 2712 | 2372 | background-color:${color}!important; |
| 2713 | 2373 | } |
| 2714 | 2374 | } |
| 2715 | 2375 | `; |
| 2716 | - document.getElementsByTagName("head")[0].appendChild(style); | |
| 2376 | + document.getElementsByTagName('head')[0].appendChild(style); | |
| 2717 | 2377 | } |
| 2718 | - if (isRow && isRowShow && !commonUtils.isEmpty(record[column]) && commonUtils.isNotEmptyObject(record[column].toString())) { | |
| 2719 | - /* 配置行 */ | |
| 2378 | + if (isRow && isRowShow && !commonUtils.isEmpty(record[column]) && commonUtils.isNotEmptyObject(record[column].toString())) { /* 配置行 */ | |
| 2720 | 2379 | let { conditionValue: conditionValueOld } = item; |
| 2721 | - const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld; | |
| 2722 | - if (condition === "=") { | |
| 2723 | - if (commonUtils.isNotEmptyObject(conditionValue) && conditionValue.includes("#")) { | |
| 2724 | - const sXName = conditionValue.replace("#", "").replace("#", "").trim(); | |
| 2725 | - if (sXName && commonUtils.isNotEmptyObject(this.props[sXName])) { | |
| 2380 | + const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld; | |
| 2381 | + if (condition === '=') { | |
| 2382 | + if(commonUtils.isNotEmptyObject(conditionValue) && conditionValue.includes('#')) { | |
| 2383 | + const sXName = conditionValue.replace('#','').replace('#','').trim(); | |
| 2384 | + if(sXName && commonUtils.isNotEmptyObject(this.props[sXName])) { | |
| 2726 | 2385 | const sXValue = this.props[sXName]; |
| 2727 | - styleColor = record[column] === sXValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2386 | + styleColor = record[column] === sXValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2728 | 2387 | } |
| 2729 | 2388 | } else { |
| 2730 | - styleColor = record[column] === conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2389 | + styleColor = record[column] === conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2731 | 2390 | } |
| 2732 | - } else if (condition === "!=") { | |
| 2733 | - styleColor = record[column] != conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2734 | - } else if (condition === "like") { | |
| 2735 | - if (column.substring(0, 1) === "s") { | |
| 2736 | - styleColor = record[column]?.indexOf(conditionValue) > -1 ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2737 | - } | |
| 2738 | - } else if (condition === ">") { | |
| 2739 | - styleColor = record[column] > conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2740 | - } else if (condition === ">=") { | |
| 2741 | - styleColor = record[column] >= conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2742 | - } else if (condition === "<") { | |
| 2743 | - styleColor = record[column] < conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2744 | - } else if (condition === "<=") { | |
| 2745 | - styleColor = record[column] <= conditionValue ? `SetRow_${color} color${color.replace("#", "-")}` : ""; | |
| 2391 | + } else if (condition === '!=') { | |
| 2392 | + styleColor = record[column] != conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2393 | + } else if (condition === 'like') { | |
| 2394 | + if (column.substring(0, 1) === 's') { styleColor = record[column]?.indexOf(conditionValue) > -1 ? `SetRow_${color} color${color.replace('#', '-')}` : ''; } | |
| 2395 | + } else if (condition === '>') { | |
| 2396 | + styleColor = record[column] > conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2397 | + } else if (condition === '>=') { | |
| 2398 | + styleColor = record[column] >= conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2399 | + } else if (condition === '<') { | |
| 2400 | + styleColor = record[column] < conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2401 | + } else if (condition === '<=') { | |
| 2402 | + styleColor = record[column] <= conditionValue ? `SetRow_${color} color${color.replace('#', '-')}` : ''; | |
| 2746 | 2403 | } |
| 2747 | 2404 | } |
| 2748 | 2405 | } |
| ... | ... | @@ -2752,7 +2409,7 @@ class CommonTableRc extends React.Component { |
| 2752 | 2409 | if (Array.isArray(this.rowColorData.current) && index >= 0) { |
| 2753 | 2410 | this.rowColorData.current[index] = { key: record?.[this.rowKey], color }; |
| 2754 | 2411 | } else { |
| 2755 | - this.rowColorData.current = [...(this.rowColorData.current || []), { key: record?.[this.rowKey], color }]; | |
| 2412 | + this.rowColorData.current = [...this.rowColorData.current || [], { key: record?.[this.rowKey], color }]; | |
| 2756 | 2413 | } |
| 2757 | 2414 | } else { |
| 2758 | 2415 | if (Array.isArray(this.rowColorData.current) && index >= 0) this.rowColorData.current?.splice(index, 1); |
| ... | ... | @@ -2763,93 +2420,94 @@ class CommonTableRc extends React.Component { |
| 2763 | 2420 | } |
| 2764 | 2421 | } |
| 2765 | 2422 | return styleColorArrTotal; |
| 2766 | - }; | |
| 2423 | + } | |
| 2767 | 2424 | /** 获取单元格颜色配置 */ |
| 2768 | 2425 | getCellColorConfig = (text, record, sName) => { |
| 2769 | - let styleColorArrTotal = ""; /* 单元格文字颜色 */ | |
| 2770 | - let styleColorArrTotalB = ""; /* 单元格背景颜色 */ | |
| 2771 | - let styleColorArr = ""; | |
| 2772 | - let styleColorArrB = ""; | |
| 2426 | + let styleColorArrTotal = ''; /* 单元格文字颜色 */ | |
| 2427 | + let styleColorArrTotalB = ''; /* 单元格背景颜色 */ | |
| 2428 | + let styleColorArr = ''; | |
| 2429 | + let styleColorArrB = ''; | |
| 2773 | 2430 | const styleColorArrTotalM = {}; |
| 2774 | 2431 | const showConfigArr = this.getColorConfig(); /* 拿到颜色配置json */ |
| 2775 | 2432 | if (commonUtils.isNotEmptyArr(showConfigArr) && showConfigArr.length > 0) { |
| 2776 | 2433 | for (const showConfig of showConfigArr) { |
| 2777 | 2434 | const colorConditon = commonUtils.isNotEmptyObject(showConfig) ? showConfig.sColorTerms : null; |
| 2778 | - if (commonUtils.isNotEmptyObject(colorConditon)) { | |
| 2779 | - let colorConditionArr = ""; | |
| 2435 | + if (commonUtils.isNotEmptyObject((colorConditon))) { | |
| 2436 | + let colorConditionArr = ''; | |
| 2780 | 2437 | try { |
| 2781 | 2438 | colorConditionArr = JSON.parse(colorConditon); /* 转化为json */ |
| 2782 | 2439 | } catch (e) { |
| 2783 | - colorConditionArr = ""; | |
| 2440 | + colorConditionArr = ''; | |
| 2784 | 2441 | } |
| 2785 | - colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ""; | |
| 2442 | + colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ''; | |
| 2786 | 2443 | for (const item of colorConditionArr) { |
| 2787 | - let styleColor = ""; | |
| 2444 | + let styleColor = ''; | |
| 2788 | 2445 | // eslint-disable-next-line no-unused-vars |
| 2789 | - let styleBackground = ""; | |
| 2790 | - const { column, condition, color, background, isRow } = item; | |
| 2791 | - if (!isRow) { | |
| 2792 | - /* 根据配置设置单元格颜色 */ | |
| 2446 | + let styleBackground = ''; | |
| 2447 | + const { | |
| 2448 | + column, condition, color, background, isRow, | |
| 2449 | + } = item; | |
| 2450 | + if (!isRow) { /* 根据配置设置单元格颜色 */ | |
| 2793 | 2451 | let { conditionValue: conditionValueOld } = item; |
| 2794 | - const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld; | |
| 2795 | - if (column === sName && (column === showConfig.sName || showConfig.sControlName?.startsWith("canOtherConfig"))) { | |
| 2796 | - /* 只控制该配置的单元格 */ | |
| 2797 | - if (condition === "=") { | |
| 2798 | - styleColor = record[column] === conditionValue ? color : ""; | |
| 2799 | - styleBackground = record[column] === conditionValue ? background : ""; | |
| 2800 | - } else if (condition === "!=") { | |
| 2801 | - styleColor = record[column] != conditionValue ? color : ""; | |
| 2802 | - styleBackground = record[column] !== conditionValue ? background : ""; | |
| 2803 | - } else if (condition === "like") { | |
| 2804 | - if (sName.substring(0, 1) === "s") { | |
| 2805 | - styleColor = record[column]?.indexOf(conditionValue) > -1 ? color : ""; | |
| 2806 | - styleBackground = record[column]?.indexOf(conditionValue) > -1 ? background : ""; | |
| 2452 | + const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld; | |
| 2453 | + if (column === sName && (column === showConfig.sName || showConfig.sControlName?.startsWith('canOtherConfig'))) { /* 只控制该配置的单元格 */ | |
| 2454 | + if (condition === '=') { | |
| 2455 | + styleColor = record[column] === conditionValue ? color : ''; | |
| 2456 | + styleBackground = record[column] === conditionValue ? background : ''; | |
| 2457 | + } else if (condition === '!=') { | |
| 2458 | + styleColor = record[column] != conditionValue ? color : ''; | |
| 2459 | + styleBackground = record[column] !== conditionValue ? background : ''; | |
| 2460 | + } else if (condition === 'like') { | |
| 2461 | + if (sName.substring(0, 1) === 's') { | |
| 2462 | + styleColor = record[column]?.indexOf(conditionValue) > -1 ? color : ''; | |
| 2463 | + styleBackground = record[column]?.indexOf(conditionValue) > -1 ? background : ''; | |
| 2807 | 2464 | } |
| 2808 | - } else if (condition === "!=") { | |
| 2809 | - styleColor = record[column] !== conditionValue ? color : ""; | |
| 2810 | - styleBackground = record[column] !== conditionValue ? background : ""; | |
| 2811 | - } else if (condition === ">") { | |
| 2812 | - styleColor = record[column] > conditionValue ? color : ""; | |
| 2813 | - styleBackground = record[column] > conditionValue ? background : ""; | |
| 2814 | - } else if (condition === ">=") { | |
| 2815 | - styleColor = record[column] >= conditionValue ? color : ""; | |
| 2816 | - styleBackground = record[column] >= conditionValue ? background : ""; | |
| 2817 | - } else if (condition === "<") { | |
| 2818 | - styleColor = record[column] < conditionValue ? color : ""; | |
| 2819 | - styleBackground = record[column] < conditionValue ? background : ""; | |
| 2820 | - } else if (condition === "<=") { | |
| 2821 | - styleColor = record[column] <= conditionValue ? color : ""; | |
| 2822 | - styleBackground = record[column] <= conditionValue ? background : ""; | |
| 2823 | - } else if (Array.isArray(condition)) { | |
| 2824 | - /* 通过其他列条件控制该字段的颜色显示 */ | |
| 2825 | - if (commonUtils.isNotEmptyArr(condition)) { | |
| 2465 | + } else if (condition === '!=') { | |
| 2466 | + styleColor = record[column] !== conditionValue ? color : ''; | |
| 2467 | + styleBackground = record[column] !== conditionValue ? background : ''; | |
| 2468 | + } else if (condition === '>') { | |
| 2469 | + styleColor = record[column] > conditionValue ? color : ''; | |
| 2470 | + styleBackground = record[column] > conditionValue ? background : ''; | |
| 2471 | + } else if (condition === '>=') { | |
| 2472 | + styleColor = record[column] >= conditionValue ? color : ''; | |
| 2473 | + styleBackground = record[column] >= conditionValue ? background : ''; | |
| 2474 | + } else if (condition === '<') { | |
| 2475 | + styleColor = record[column] < conditionValue ? color : ''; | |
| 2476 | + styleBackground = record[column] < conditionValue ? background : ''; | |
| 2477 | + } else if (condition === '<=') { | |
| 2478 | + styleColor = record[column] <= conditionValue ? color : ''; | |
| 2479 | + styleBackground = record[column] <= conditionValue ? background : ''; | |
| 2480 | + } else if (Array.isArray(condition)) { /* 通过其他列条件控制该字段的颜色显示 */ | |
| 2481 | + if(commonUtils.isNotEmptyArr(condition)) { | |
| 2826 | 2482 | for (const itemConditon of condition) { |
| 2827 | - const { bFilterName, bFilterCondition, color, background } = itemConditon; | |
| 2483 | + const { | |
| 2484 | + bFilterName, bFilterCondition, color, background, | |
| 2485 | + } = itemConditon; | |
| 2828 | 2486 | let { bFilterValue: bFilterValueOld } = itemConditon; |
| 2829 | - const bFilterValue = record[bFilterValueOld] ? record[bFilterValueOld] : bFilterValueOld; | |
| 2830 | - if (bFilterCondition === "=") { | |
| 2831 | - styleColor = record[bFilterName] === bFilterValue ? color : ""; | |
| 2832 | - styleBackground = record[bFilterName] === bFilterValue ? background : ""; | |
| 2833 | - } else if (bFilterCondition === "like") { | |
| 2834 | - if (sName.substring(0, 1) === "s") { | |
| 2835 | - styleColor = record[bFilterName].indexOf(bFilterValue) > -1 ? color : ""; | |
| 2836 | - styleBackground = record[bFilterName].indexOf(bFilterValue) > -1 ? background : ""; | |
| 2487 | + const bFilterValue = record[bFilterValueOld] ? record[bFilterValueOld]: bFilterValueOld; | |
| 2488 | + if (bFilterCondition === '=') { | |
| 2489 | + styleColor = record[bFilterName] === bFilterValue ? color : ''; | |
| 2490 | + styleBackground = record[bFilterName] === bFilterValue ? background : ''; | |
| 2491 | + } else if (bFilterCondition === 'like') { | |
| 2492 | + if (sName.substring(0, 1) === 's') { | |
| 2493 | + styleColor = record[bFilterName].indexOf(bFilterValue) > -1 ? color : ''; | |
| 2494 | + styleBackground = record[bFilterName].indexOf(bFilterValue) > -1 ? background : ''; | |
| 2837 | 2495 | } |
| 2838 | - } else if (bFilterCondition === "!=") { | |
| 2839 | - styleColor = record[bFilterName] !== bFilterValue ? color : ""; | |
| 2840 | - styleBackground = record[bFilterName] !== bFilterValue ? background : ""; | |
| 2841 | - } else if (bFilterCondition === ">") { | |
| 2842 | - styleColor = record[bFilterName] > bFilterValue ? color : ""; | |
| 2843 | - styleBackground = record[bFilterName] > bFilterValue ? background : ""; | |
| 2844 | - } else if (bFilterCondition === ">=") { | |
| 2845 | - styleColor = record[bFilterName] >= bFilterValue ? color : ""; | |
| 2846 | - styleBackground = record[bFilterName] >= bFilterValue ? background : ""; | |
| 2847 | - } else if (bFilterCondition === "<") { | |
| 2848 | - styleColor = record[bFilterName] < bFilterValue ? color : ""; | |
| 2849 | - styleBackground = record[bFilterName] < bFilterValue ? background : ""; | |
| 2850 | - } else if (bFilterCondition === "<=") { | |
| 2851 | - styleColor = record[bFilterName] <= bFilterValue ? color : ""; | |
| 2852 | - styleBackground = record[bFilterName] <= bFilterValue ? background : ""; | |
| 2496 | + } else if (bFilterCondition === '!=') { | |
| 2497 | + styleColor = record[bFilterName] !== bFilterValue ? color : ''; | |
| 2498 | + styleBackground = record[bFilterName] !== bFilterValue ? background : ''; | |
| 2499 | + } else if (bFilterCondition === '>') { | |
| 2500 | + styleColor = record[bFilterName] > bFilterValue ? color : ''; | |
| 2501 | + styleBackground = record[bFilterName] > bFilterValue ? background : ''; | |
| 2502 | + } else if (bFilterCondition === '>=') { | |
| 2503 | + styleColor = record[bFilterName] >= bFilterValue ? color : ''; | |
| 2504 | + styleBackground = record[bFilterName] >= bFilterValue ? background : ''; | |
| 2505 | + } else if (bFilterCondition === '<') { | |
| 2506 | + styleColor = record[bFilterName] < bFilterValue ? color : ''; | |
| 2507 | + styleBackground = record[bFilterName] < bFilterValue ? background : ''; | |
| 2508 | + } else if (bFilterCondition === '<=') { | |
| 2509 | + styleColor = record[bFilterName] <= bFilterValue ? color : ''; | |
| 2510 | + styleBackground = record[bFilterName] <= bFilterValue ? background : ''; | |
| 2853 | 2511 | } |
| 2854 | 2512 | } |
| 2855 | 2513 | } |
| ... | ... | @@ -2858,10 +2516,10 @@ class CommonTableRc extends React.Component { |
| 2858 | 2516 | } |
| 2859 | 2517 | styleColorArr += styleColor; |
| 2860 | 2518 | styleColorArrB += styleBackground; |
| 2861 | - if (styleColor) { | |
| 2519 | + if(styleColor) { | |
| 2862 | 2520 | styleColorArr = styleColor; |
| 2863 | 2521 | } |
| 2864 | - if (styleBackground) { | |
| 2522 | + if(styleBackground) { | |
| 2865 | 2523 | styleColorArrB = styleBackground; |
| 2866 | 2524 | } |
| 2867 | 2525 | } |
| ... | ... | @@ -2873,7 +2531,7 @@ class CommonTableRc extends React.Component { |
| 2873 | 2531 | const iIndex = showConfigArr.findIndex(item => item.sName === sName); |
| 2874 | 2532 | if (iIndex !== -1) { |
| 2875 | 2533 | const { sColorTerms } = showConfigArr[iIndex]; |
| 2876 | - if (sColorTerms && sColorTerms.startsWith("#")) { | |
| 2534 | + if (sColorTerms && sColorTerms.startsWith('#')) { | |
| 2877 | 2535 | styleColorArrTotal = sColorTerms; |
| 2878 | 2536 | } |
| 2879 | 2537 | } |
| ... | ... | @@ -2883,8 +2541,8 @@ class CommonTableRc extends React.Component { |
| 2883 | 2541 | }; |
| 2884 | 2542 | |
| 2885 | 2543 | /** |
| 2886 | - * 部分字段不可编辑 | |
| 2887 | - */ | |
| 2544 | + * 部分字段不可编辑 | |
| 2545 | + */ | |
| 2888 | 2546 | getSelectRowEditState = (sName, record, enabled) => { |
| 2889 | 2547 | const { config, name, masterData } = this.props; |
| 2890 | 2548 | let result = enabled; |
| ... | ... | @@ -2895,15 +2553,15 @@ class CommonTableRc extends React.Component { |
| 2895 | 2553 | const btnConfig = data.find(item => item && item.name === sName && item.enabled !== undefined); |
| 2896 | 2554 | if (btnConfig && enabled) { |
| 2897 | 2555 | const { enabled: enabledContent } = btnConfig; |
| 2898 | - if (typeof enabledContent === "boolean") { | |
| 2556 | + if (typeof enabledContent === 'boolean') { | |
| 2899 | 2557 | result = enabledContent; |
| 2900 | 2558 | } else if (enabledContent) { |
| 2901 | 2559 | const tempData = { |
| 2902 | 2560 | props: { |
| 2903 | - enabled, | |
| 2561 | + enabled | |
| 2904 | 2562 | }, |
| 2905 | 2563 | master: masterData, |
| 2906 | - [name]: record, | |
| 2564 | + [name]: record | |
| 2907 | 2565 | }; |
| 2908 | 2566 | |
| 2909 | 2567 | let strNew = enabledContent; |
| ... | ... | @@ -2922,7 +2580,7 @@ class CommonTableRc extends React.Component { |
| 2922 | 2580 | } |
| 2923 | 2581 | |
| 2924 | 2582 | return result; |
| 2925 | - }; | |
| 2583 | + } | |
| 2926 | 2584 | |
| 2927 | 2585 | // 获取表格行按钮状态 |
| 2928 | 2586 | getTableBtnState = (btnName, record) => { |
| ... | ... | @@ -2935,10 +2593,10 @@ class CommonTableRc extends React.Component { |
| 2935 | 2593 | result = false; |
| 2936 | 2594 | } |
| 2937 | 2595 | /* 若红冲单据 则按钮锁定 不能操作 */ |
| 2938 | - if (commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === "1") { | |
| 2596 | + if(commonUtils.isNotEmptyObject(masterData) && commonUtils.isNotEmptyObject(masterData.sMinusSrcId) && masterData.sMinusType === '1') { | |
| 2939 | 2597 | result = false; |
| 2940 | 2598 | } |
| 2941 | - if (btnName === "BtnAdd" && bLimitOperate) { | |
| 2599 | + if(btnName === 'BtnAdd' && bLimitOperate){ | |
| 2942 | 2600 | result = false; |
| 2943 | 2601 | } |
| 2944 | 2602 | |
| ... | ... | @@ -2949,15 +2607,15 @@ class CommonTableRc extends React.Component { |
| 2949 | 2607 | const btnConfig = data.find(item => item && item.name === btnName && item.enabled !== undefined); |
| 2950 | 2608 | if (btnConfig) { |
| 2951 | 2609 | const { enabled: enabledContent } = btnConfig; |
| 2952 | - if (typeof enabledContent === "boolean") { | |
| 2610 | + if (typeof enabledContent === 'boolean') { | |
| 2953 | 2611 | result = enabledContent; |
| 2954 | 2612 | } else if (enabledContent) { |
| 2955 | 2613 | const tempData = { |
| 2956 | 2614 | props: { |
| 2957 | - enabled, | |
| 2615 | + enabled | |
| 2958 | 2616 | }, |
| 2959 | 2617 | master: masterData, |
| 2960 | - [name]: record, | |
| 2618 | + [name]: record | |
| 2961 | 2619 | }; |
| 2962 | 2620 | |
| 2963 | 2621 | let strNew = enabledContent; |
| ... | ... | @@ -2970,52 +2628,51 @@ class CommonTableRc extends React.Component { |
| 2970 | 2628 | result = !!eval(evalStr); |
| 2971 | 2629 | // console.log('=====表格行按钮状态结果', result, { btnName, enabledContent, tempData, strNew, evalStr }); |
| 2972 | 2630 | } catch (error) { |
| 2973 | - console.log("=====表格行按钮状态错误", { error, enabledContent, strNew, tempData }); | |
| 2631 | + console.log('=====表格行按钮状态错误', { error, enabledContent, strNew, tempData }); | |
| 2974 | 2632 | } |
| 2975 | 2633 | } |
| 2976 | 2634 | } |
| 2977 | 2635 | |
| 2978 | 2636 | return result; |
| 2979 | - }; | |
| 2637 | + } | |
| 2980 | 2638 | |
| 2981 | - bCheckBoxColumm = column => { | |
| 2639 | + bCheckBoxColumm = (column) => { | |
| 2982 | 2640 | const { gdsconfigformslave } = this.props.config || {}; |
| 2983 | 2641 | const item = gdsconfigformslave?.find(i => i && i.sName === column?.dataIndex && i.bVisible); |
| 2984 | - if (item?.sControlName?.startsWith("bCheckBox")) { | |
| 2642 | + if (item?.sControlName?.startsWith('bCheckBox')) { | |
| 2985 | 2643 | const checked = !!this.state.dataSource.length && !this.state.dataSource?.find(i => !i || !i[column?.dataIndex]); |
| 2986 | - return ( | |
| 2987 | - <> | |
| 2988 | - <Checkbox | |
| 2989 | - style={{ marginRight: 5 }} | |
| 2990 | - disabled={!this.props.enabled} | |
| 2991 | - checked={checked} | |
| 2992 | - onChange={e => { | |
| 2993 | - const { handleCheckBoxStatus } = this.props; | |
| 2994 | - typeof handleCheckBoxStatus === "function" && handleCheckBoxStatus(e.target.checked, column?.dataIndex, this.props.name); | |
| 2995 | - }} | |
| 2996 | - /> | |
| 2997 | - {column?.title} | |
| 2998 | - </> | |
| 2999 | - ); | |
| 2644 | + return <> | |
| 2645 | + <Checkbox | |
| 2646 | + style={{ marginRight: 5 }} | |
| 2647 | + disabled={!this.props.enabled} | |
| 2648 | + checked={checked} | |
| 2649 | + onChange={(e) => { | |
| 2650 | + const { handleCheckBoxStatus } = this.props; | |
| 2651 | + typeof handleCheckBoxStatus === 'function' && handleCheckBoxStatus(e.target.checked, column?.dataIndex, this.props.name) | |
| 2652 | + }} | |
| 2653 | + /> | |
| 2654 | + {column?.title} | |
| 2655 | + </> | |
| 3000 | 2656 | } |
| 3001 | - }; | |
| 2657 | + } | |
| 3002 | 2658 | |
| 3003 | 2659 | /** 获取table的表头信息(主要是table中的表头信息合并,[{title:1-1},{title:1-2}]变成[{title:1,children:[{title:1},{title:2}]}]) type:是否过滤 */ |
| 3004 | 2660 | getTableColumn = (headerColumn, type, props) => { |
| 3005 | 2661 | // this.hasMergeHeader = false; |
| 3006 | 2662 | // 判断是否是表单详情 |
| 3007 | - const isSlaveInfo = | |
| 3008 | - props.name === "slaveInfo" || | |
| 3009 | - (location.pathname === "/indexPage/commonCostomTabBill" && | |
| 2663 | + const isSlaveInfo = props.name === 'slaveInfo' || | |
| 2664 | + ( | |
| 2665 | + location.pathname === '/indexPage/commonCostomTabBill' && | |
| 3010 | 2666 | props.name && |
| 3011 | - props.name.includes("Info") && | |
| 3012 | - commonUtils.isNotEmptyObject(this.props.slaveInfo)); | |
| 2667 | + props.name.includes('Info') && | |
| 2668 | + commonUtils.isNotEmptyObject(this.props.slaveInfo) | |
| 2669 | + ); | |
| 3013 | 2670 | const config = isSlaveInfo ? this.props.slaveInfo.config : this.props.config; |
| 3014 | - const isSlaveInfoM = isSlaveInfo && commonUtils.isNotEmptyObject(config) ? config.showName === "工单物资评审" : false; | |
| 2671 | + const isSlaveInfoM = isSlaveInfo && commonUtils.isNotEmptyObject(config) ? config.showName === '工单物资评审' : false; | |
| 3015 | 2672 | /* 返回值声明 */ |
| 3016 | 2673 | const tableColumn = []; |
| 3017 | 2674 | let iIndex = 0; |
| 3018 | - const specialRoute = commonUtils.isNotEmptyObject(this.props.app.currentPane) ? this.props.app.currentPane.route : ""; /* 获取路由名称 */ | |
| 2675 | + const specialRoute = commonUtils.isNotEmptyObject(this.props.app.currentPane) ? this.props.app.currentPane.route : ''; /* 获取路由名称 */ | |
| 3019 | 2676 | /* 遍历每一个表头标题 */ |
| 3020 | 2677 | for (const column of headerColumn) { |
| 3021 | 2678 | /* 表头标题 */ |
| ... | ... | @@ -3023,65 +2680,44 @@ class CommonTableRc extends React.Component { |
| 3023 | 2680 | const width = column.width; |
| 3024 | 2681 | const bNotEmpty = column.bNotEmpty; |
| 3025 | 2682 | /* 带'-'的表头是需要合并滴 */ |
| 3026 | - const index = commonUtils.isNotEmptyObject(title) ? title.indexOf("-") : -1; | |
| 2683 | + const index = commonUtils.isNotEmptyObject(title) ? title.indexOf('-') : -1; | |
| 3027 | 2684 | /* 合并走合并的,不合并就直接push */ |
| 3028 | 2685 | let columnNew = {}; |
| 3029 | 2686 | let sorter; |
| 3030 | 2687 | let search = true; |
| 3031 | - if ( | |
| 3032 | - props.tableProps !== undefined && | |
| 3033 | - props.tableProps.rowKey !== undefined && | |
| 3034 | - props.tableProps.rowKey !== "sId" && | |
| 3035 | - !props.tableProps.sortSelf | |
| 3036 | - ) { | |
| 2688 | + if (props.tableProps !== undefined && props.tableProps.rowKey !== undefined && props.tableProps.rowKey !== 'sId' && !props.tableProps.sortSelf) { | |
| 3037 | 2689 | sorter = true; |
| 3038 | 2690 | } else { |
| 3039 | 2691 | const firstDataIndex = column.dataIndex.substring(0, 1); |
| 3040 | - if (firstDataIndex === "d" || firstDataIndex === "i") { | |
| 3041 | - sorter = (a, b) => | |
| 3042 | - (commonUtils.isEmpty(a[column.dataIndex]) ? 0 : a[column.dataIndex]) - | |
| 3043 | - (commonUtils.isEmpty(b[column.dataIndex]) ? 0 : b[column.dataIndex]); | |
| 3044 | - } else if (firstDataIndex === "t") { | |
| 3045 | - sorter = (a, b) => | |
| 3046 | - moment(commonUtils.isEmpty(a[column.dataIndex]) ? "2000-01-01" : a[column.dataIndex]).diff( | |
| 3047 | - moment(commonUtils.isEmpty(b[column.dataIndex]) ? "2000-01-01" : b[column.dataIndex]) | |
| 3048 | - ); | |
| 2692 | + if (firstDataIndex === 'd' || firstDataIndex === 'i') { | |
| 2693 | + sorter = (a, b) => ((commonUtils.isEmpty(a[column.dataIndex]) ? 0 : a[column.dataIndex]) - (commonUtils.isEmpty(b[column.dataIndex]) ? 0 : b[column.dataIndex])); | |
| 2694 | + } else if (firstDataIndex === 't') { | |
| 2695 | + 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]))); | |
| 3049 | 2696 | } else { |
| 3050 | - sorter = (a, b) => | |
| 3051 | - (commonUtils.isEmpty(a[column.dataIndex]) ? "0" : a[column.dataIndex]).localeCompare( | |
| 3052 | - commonUtils.isEmpty(b[column.dataIndex]) ? "1" : b[column.dataIndex] | |
| 3053 | - ); | |
| 2697 | + sorter = (a, b) => ((commonUtils.isEmpty(a[column.dataIndex]) ? '0' : a[column.dataIndex]).localeCompare((commonUtils.isEmpty(b[column.dataIndex]) ? '1' : b[column.dataIndex]))); | |
| 3054 | 2698 | } |
| 3055 | 2699 | } |
| 3056 | 2700 | |
| 3057 | 2701 | /* 工单、工艺卡、报价单 去掉排序 */ |
| 3058 | - if ( | |
| 3059 | - this.props.name === "sParam" || | |
| 3060 | - specialRoute.includes("workOrder") || | |
| 3061 | - specialRoute.includes("processCard") || | |
| 3062 | - specialRoute.includes("quotation") | |
| 3063 | - ) { | |
| 2702 | + if (this.props.name === 'sParam' || specialRoute.includes('workOrder') || specialRoute.includes('processCard') || specialRoute.includes('quotation')) { | |
| 3064 | 2703 | sorter = false; |
| 3065 | 2704 | } |
| 3066 | 2705 | /* 默认字段是排序的 通过配置bNotSort来设置字段不排序 */ |
| 3067 | 2706 | if (config && commonUtils.isNotEmptyStr(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex))) { |
| 3068 | - if ( | |
| 3069 | - config.gdsconfigformslave.filter(item => item.sName === column.dataIndex).length > 0 && | |
| 3070 | - config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSort | |
| 3071 | - ) { | |
| 2707 | + if(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex).length > 0 && config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSort){ | |
| 3072 | 2708 | sorter = false; |
| 3073 | 2709 | } |
| 3074 | 2710 | } |
| 3075 | 2711 | if (config && commonUtils.isNotEmptyStr(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex))) { |
| 3076 | - if (config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSearch) { | |
| 2712 | + if(config.gdsconfigformslave.filter(item => item.sName === column.dataIndex)[0].bNotSearch){ | |
| 3077 | 2713 | search = false; |
| 3078 | 2714 | } |
| 3079 | 2715 | } |
| 3080 | 2716 | if (column.dataIndex === "spicture" || column.dataIndex === "tableLastEmpty") { |
| 3081 | 2717 | sorter = false; |
| 3082 | 2718 | } |
| 3083 | - let sTitleBgColor = commonUtils.isNotEmptyObject(column.sTitleBgColor) ? column.sTitleBgColor : ""; /* 标题背景颜色 */ | |
| 3084 | - let sTitleColor = commonUtils.isNotEmptyObject(column.sTitleColor) ? column.sTitleColor : ""; /* 标题字体颜色 */ | |
| 2719 | + let sTitleBgColor =commonUtils.isNotEmptyObject(column.sTitleBgColor) ? column.sTitleBgColor : ''; /* 标题背景颜色 */ | |
| 2720 | + let sTitleColor =commonUtils.isNotEmptyObject(column.sTitleColor) ? column.sTitleColor : ''; /* 标题字体颜色 */ | |
| 3085 | 2721 | const styleObj = {}; |
| 3086 | 2722 | if (commonUtils.isNotEmptyObject(sTitleBgColor)) { |
| 3087 | 2723 | styleObj.background = sTitleBgColor; |
| ... | ... | @@ -3091,7 +2727,7 @@ class CommonTableRc extends React.Component { |
| 3091 | 2727 | } |
| 3092 | 2728 | const renderTitle = () => { |
| 3093 | 2729 | // 树形表格在第一个column上加上全部展开/收起功能 |
| 3094 | - let expandedAllIcon = ""; | |
| 2730 | + let expandedAllIcon = ''; | |
| 3095 | 2731 | const columnIndex = headerColumn.findIndex(item => column.title === item.title); |
| 3096 | 2732 | let { data } = this.props; |
| 3097 | 2733 | let { expKeys } = this.state; |
| ... | ... | @@ -3100,45 +2736,41 @@ class CommonTableRc extends React.Component { |
| 3100 | 2736 | data = commonUtils.isNotEmptyArr(data) ? data : []; |
| 3101 | 2737 | |
| 3102 | 2738 | const childrenList = []; |
| 3103 | - const getChildrenList = data => { | |
| 2739 | + const getChildrenList = (data) => { | |
| 3104 | 2740 | data.forEach(item => { |
| 3105 | - if (item && typeof item.children === "object") { | |
| 2741 | + if (item && typeof item.children === 'object') { | |
| 3106 | 2742 | childrenList.push(item); |
| 3107 | 2743 | getChildrenList(item.children); |
| 3108 | 2744 | } |
| 3109 | 2745 | }); |
| 3110 | - }; | |
| 2746 | + } | |
| 3111 | 2747 | getChildrenList(data); |
| 3112 | - if (columnIndex === 0 && childrenList.length) { | |
| 3113 | - // 第一个column并且数据中有children | |
| 2748 | + if (columnIndex === 0 && childrenList.length) { // 第一个column并且数据中有children | |
| 3114 | 2749 | this.showExpAll = true; |
| 3115 | 2750 | this.tableCollapsed = !expKeys.length; |
| 3116 | - const marginLeft = this.props.bMutiSelect ? "6px" : "2px"; | |
| 2751 | + const marginLeft = this.props.bMutiSelect ? '6px' : '2px'; | |
| 3117 | 2752 | expandedAllIcon = ( |
| 3118 | 2753 | <button |
| 3119 | - class={`table-expAllIcon ant-table-row-expand-icon ${this.tableCollapsed ? "ant-table-row-expand-icon-collapsed" : ""}`} | |
| 2754 | + class={`table-expAllIcon ant-table-row-expand-icon ${this.tableCollapsed ? 'ant-table-row-expand-icon-collapsed' : ''}`} | |
| 3120 | 2755 | style={{ margin: `1px 4px 0 ${marginLeft}` }} |
| 3121 | - ref={ref => { | |
| 3122 | - this.expRef = ref; | |
| 3123 | - }} | |
| 3124 | - onClick={e => { | |
| 2756 | + ref={(ref) => {this.expRef = ref}} | |
| 2757 | + onClick={(e) => { | |
| 3125 | 2758 | e.stopPropagation(); |
| 3126 | 2759 | if (this.tableCollapsed) { |
| 3127 | 2760 | this.tableCollapsed = false; |
| 3128 | - this.expRef.classList.remove("ant-table-row-expand-icon-collapsed"); | |
| 2761 | + this.expRef.classList.remove('ant-table-row-expand-icon-collapsed'); | |
| 3129 | 2762 | this.setState({ |
| 3130 | - expKeys: childrenList.map(item => item[this.rowKey]), | |
| 2763 | + expKeys: childrenList.map(item => item[this.rowKey]) | |
| 3131 | 2764 | }); |
| 3132 | 2765 | } else { |
| 3133 | 2766 | this.tableCollapsed = true; |
| 3134 | - this.expRef.classList.add("ant-table-row-expand-icon-collapsed"); | |
| 2767 | + this.expRef.classList.add('ant-table-row-expand-icon-collapsed'); | |
| 3135 | 2768 | this.setState({ |
| 3136 | - expKeys: [], | |
| 2769 | + expKeys: [] | |
| 3137 | 2770 | }); |
| 3138 | 2771 | } |
| 3139 | 2772 | }} |
| 3140 | - /> | |
| 3141 | - ); | |
| 2773 | + />); | |
| 3142 | 2774 | } |
| 3143 | 2775 | |
| 3144 | 2776 | const titleCheckBox = this.bCheckBoxColumm({ ...column }); |
| ... | ... | @@ -3149,30 +2781,16 @@ class CommonTableRc extends React.Component { |
| 3149 | 2781 | |
| 3150 | 2782 | let res = column.title; |
| 3151 | 2783 | if (bNotEmpty) { |
| 3152 | - res = ( | |
| 3153 | - <div className="th-div" style={styleObj}> | |
| 3154 | - {expandedAllIcon} | |
| 3155 | - <span className="table-title-required">*</span> {column.title} | |
| 3156 | - </div> | |
| 3157 | - ); | |
| 2784 | + res = <div className='th-div' style={styleObj}>{expandedAllIcon}<span className="table-title-required">*</span> {column.title}</div>; | |
| 3158 | 2785 | } else { |
| 3159 | - res = ( | |
| 3160 | - <div className="th-div" style={styleObj}> | |
| 3161 | - {expandedAllIcon} | |
| 3162 | - {column.title} | |
| 3163 | - </div> | |
| 3164 | - ); | |
| 2786 | + res = <div className='th-div' style={styleObj}>{expandedAllIcon}{column.title}</div>; | |
| 3165 | 2787 | } |
| 3166 | - if (column.dataIndex === "bSelfCbx") { | |
| 3167 | - res = ( | |
| 3168 | - <div style={{ marginLeft: "5px" }}> | |
| 3169 | - <Checkbox disabled={!props.enabled} checked={column.bCheckAll} onChange={e => this.onParamChange(e)}></Checkbox> | |
| 3170 | - </div> | |
| 3171 | - ); | |
| 2788 | + if (column.dataIndex ==='bSelfCbx') { | |
| 2789 | + res = <div style={{marginLeft:'5px'}}><Checkbox disabled={!props.enabled} checked={column.bCheckAll} onChange={(e) =>this.onParamChange(e)}></Checkbox></div>; | |
| 3172 | 2790 | } |
| 3173 | 2791 | |
| 3174 | 2792 | return res; |
| 3175 | - }; | |
| 2793 | + } | |
| 3176 | 2794 | columnNew = { |
| 3177 | 2795 | ...column, |
| 3178 | 2796 | title: renderTitle(), |
| ... | ... | @@ -3182,11 +2800,9 @@ class CommonTableRc extends React.Component { |
| 3182 | 2800 | onHeaderCell: !column.bNotResize ? this.onHeaderCell.bind(this, isSlaveInfo, iIndex) : null, |
| 3183 | 2801 | ...this.getColumnSearchProps(iIndex, column, type, props, search), |
| 3184 | 2802 | }; |
| 3185 | - if (index > -1) { | |
| 3186 | - /* 合并 */ | |
| 2803 | + if (index > -1) { /* 合并 */ | |
| 3187 | 2804 | this.mergeTableColumn(title, columnNew, tableColumn, index, bNotEmpty, styleObj); |
| 3188 | - } else { | |
| 3189 | - /* 不合并 */ | |
| 2805 | + } else { /* 不合并 */ | |
| 3190 | 2806 | // columnNew.onHeaderCell = this.onHeaderCell.bind(this, iIndex); |
| 3191 | 2807 | tableColumn.push(columnNew); |
| 3192 | 2808 | } |
| ... | ... | @@ -3194,13 +2810,13 @@ class CommonTableRc extends React.Component { |
| 3194 | 2810 | } |
| 3195 | 2811 | let tableWidth = 0; |
| 3196 | 2812 | if (this.mydiv && !isSlaveInfo) { |
| 3197 | - const ths = this.mydiv.getElementsByClassName("ant-table-header")[0].getElementsByClassName("react-resizable"); | |
| 2813 | + const ths = this.mydiv.getElementsByClassName('ant-table-header')[0].getElementsByClassName('react-resizable'); | |
| 3198 | 2814 | for (let i = 0; i < ths.length - 1; i += 1) { |
| 3199 | 2815 | tableWidth += ths[i].offsetWidth; |
| 3200 | 2816 | } |
| 3201 | 2817 | } |
| 3202 | 2818 | if (this.myInfoDiv && isSlaveInfo) { |
| 3203 | - const ths = this.myInfoDiv.getElementsByClassName("ant-table-header")[0].getElementsByClassName("react-resizable"); | |
| 2819 | + const ths = this.myInfoDiv.getElementsByClassName('ant-table-header')[0].getElementsByClassName('react-resizable'); | |
| 3204 | 2820 | for (let i = 0; i < ths.length - 1; i += 1) { |
| 3205 | 2821 | tableWidth += ths[i].offsetWidth; |
| 3206 | 2822 | } |
| ... | ... | @@ -3212,13 +2828,13 @@ class CommonTableRc extends React.Component { |
| 3212 | 2828 | if (props.tableProps.rowSelection !== null && props.tableProps.rowSelection !== undefined) { |
| 3213 | 2829 | CheckBoxWidth = 37; |
| 3214 | 2830 | } |
| 3215 | - if (this.props.setOpterationColumn === "Y") { | |
| 2831 | + if (this.props.setOpterationColumn === 'Y') { | |
| 3216 | 2832 | /* 获取choose的props */ |
| 3217 | 2833 | const chooseProcessProps = { ...this.getChooseProcessPropsTableRow(), disabled: false }; |
| 3218 | 2834 | /* 获取modal的props */ |
| 3219 | 2835 | const modalProps = { ...this.getModalPropsTableRow(), disabled: false }; |
| 3220 | 2836 | /* 获取modal的props */ |
| 3221 | - const modalRemarkProps = { ...this.getModalRemarkPropsTableRow(), disabled: false, style: { display: "block", margin: "0 10px" } }; | |
| 2837 | + const modalRemarkProps = { ...this.getModalRemarkPropsTableRow(), disabled: false, style: { display: 'block', margin: '0 10px' } }; | |
| 3222 | 2838 | /* 获取add的props */ |
| 3223 | 2839 | const addProps = { ...this.getAddPropsTableRow(), disabled: false }; |
| 3224 | 2840 | const headProps = { ...this.getHeadPropsTableRow(), disabled: false }; |
| ... | ... | @@ -3238,20 +2854,20 @@ class CommonTableRc extends React.Component { |
| 3238 | 2854 | /* 获取复制全部的props */ |
| 3239 | 2855 | // const copyAllProps = { ...this.getCopyAllProps(), disabled: false, style: { display: 'block', margin: '0 10px' } }; |
| 3240 | 2856 | const copyAllProps = { ...this.getCopyAllProps(), disabled: false }; |
| 3241 | - const uploadProps = { ...this.getUploadProps(), disabled: false, style: { margin: "0 10px", "caret-color": "transparent" } }; | |
| 3242 | - const downloadProps = { ...this.getDownProps(), disabled: false, style: { display: "block", margin: "0 5px" } }; | |
| 3243 | - if (isSlaveInfoM) { | |
| 3244 | - addProps.style.display = "block"; | |
| 3245 | - delProps.style.display = "block"; | |
| 2857 | + const uploadProps = { ...this.getUploadProps(), disabled: false, style: { margin: '0 10px', 'caret-color': 'transparent'} }; | |
| 2858 | + const downloadProps = { ...this.getDownProps(), disabled: false, style: { display: 'block', margin: '0 5px' } }; | |
| 2859 | + if(isSlaveInfoM) { | |
| 2860 | + addProps.style.display ='block'; | |
| 2861 | + delProps.style.display ='block'; | |
| 3246 | 2862 | } |
| 3247 | 2863 | const { formId } = props; |
| 3248 | 2864 | const { token } = props.app; |
| 3249 | 2865 | const divProps = { |
| 3250 | 2866 | action: `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`, |
| 3251 | 2867 | onChange: this.handleUploadChange, |
| 3252 | - accept: "*/*", | |
| 2868 | + accept: '*/*', | |
| 3253 | 2869 | showUploadList: false, |
| 3254 | - multiple: true, | |
| 2870 | + multiple:true, | |
| 3255 | 2871 | beforeUpload: this.handleBeforeUpload, |
| 3256 | 2872 | }; |
| 3257 | 2873 | const addIcon = props.tableProps.setAdd; /* 增加操作 */ |
| ... | ... | @@ -3260,50 +2876,42 @@ class CommonTableRc extends React.Component { |
| 3260 | 2876 | const delIcon = props.tableProps.setDelete; /* 删除操作 */ |
| 3261 | 2877 | const materialIcon = props.tableProps.setMaterial; /* 材料操作 */ |
| 3262 | 2878 | const processIcon = props.tableProps.setProcess; /* 工序操作 */ |
| 3263 | - const materailremarkIcon = props.tableProps.setMaterialRemark; /* 材料备注 */ | |
| 3264 | - let uploadIcon = props.tableProps.setUpload; /* 上传 */ | |
| 3265 | - let downloadIcon = props.tableProps.setDownload; /* 下载 */ | |
| 2879 | + const materailremarkIcon = props.tableProps.setMaterialRemark;/* 材料备注 */ | |
| 2880 | + let uploadIcon = props.tableProps.setUpload;/* 上传 */ | |
| 2881 | + let downloadIcon = props.tableProps.setDownload;/* 下载 */ | |
| 3266 | 2882 | let headPopup = false; /* 表头放大镜 */ |
| 3267 | 2883 | let sAlumitePopup = false; /* 选择电化铝 */ |
| 3268 | 2884 | let bCopyMore = false; /* 复制多行 */ |
| 3269 | 2885 | let bReplace = false; /* 替换数据 */ |
| 3270 | - const setOperation = commonFunc.showMessage(props.app.commonConst, "operation") || "操作"; | |
| 3271 | - const bShowTreeAdd = props.tableProps.bShowTreeAdd && this.findIsExistByControlName(props, "BtnAdd"); /* 添加树节点 */ | |
| 3272 | - const bShowTreeAddChild = props.tableProps.bShowTreeAddChild && this.findIsExistByControlName(props, "BtnAddChildNode"); /* 添加树节点 */ | |
| 3273 | - const bShowTreeDel = props.tableProps.bShowTreeDel && this.findIsExistByControlName(props, "BtnDel"); /* 添加树节点 */ | |
| 3274 | - const bShowTreeCopyAll = props.tableProps.bShowTreeCopyAll && this.findIsExistByControlName(props, "BtnCopyAll"); /* 添加树节点 */ | |
| 2886 | + const setOperation = commonFunc.showMessage(props.app.commonConst, 'operation') || '操作'; | |
| 2887 | + const bShowTreeAdd = props.tableProps.bShowTreeAdd && this.findIsExistByControlName(props, 'BtnAdd'); /* 添加树节点 */ | |
| 2888 | + const bShowTreeAddChild = props.tableProps.bShowTreeAddChild && this.findIsExistByControlName(props, 'BtnAddChildNode'); /* 添加树节点 */ | |
| 2889 | + const bShowTreeDel = props.tableProps.bShowTreeDel && this.findIsExistByControlName(props, 'BtnDel'); /* 添加树节点 */ | |
| 2890 | + const bShowTreeCopyAll = props.tableProps.bShowTreeCopyAll && this.findIsExistByControlName(props, 'BtnCopyAll'); /* 添加树节点 */ | |
| 3275 | 2891 | const exitIcon = props.tableProps.setExit; /* 退出操作 */ |
| 3276 | - let bShowProductProcess = false; /* 选择成品工序 */ | |
| 3277 | - if ( | |
| 3278 | - commonUtils.isNotEmptyObject(props) && | |
| 3279 | - commonUtils.isNotEmptyObject(props.tableProps) && | |
| 3280 | - props.tableProps.bShowProductProcess !== undefined | |
| 3281 | - ) { | |
| 3282 | - bShowProductProcess = props.tableProps.bShowProductProcess; /* 选择成品工序 */ | |
| 3283 | - } | |
| 3284 | - let bShowProductMaterials = false; /* 选择成品材料 */ | |
| 3285 | - if ( | |
| 3286 | - commonUtils.isNotEmptyObject(props) && | |
| 3287 | - commonUtils.isNotEmptyObject(props.tableProps) && | |
| 3288 | - props.tableProps.bShowProductMaterials !== undefined | |
| 3289 | - ) { | |
| 3290 | - bShowProductMaterials = props.tableProps.bShowProductMaterials; /* 选择成品工序 */ | |
| 2892 | + let bShowProductProcess = false;/* 选择成品工序 */ | |
| 2893 | + if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductProcess !== undefined) { | |
| 2894 | + bShowProductProcess = props.tableProps.bShowProductProcess;/* 选择成品工序 */ | |
| 2895 | + } | |
| 2896 | + let bShowProductMaterials = false;/* 选择成品材料 */ | |
| 2897 | + if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductMaterials !== undefined) { | |
| 2898 | + bShowProductMaterials = props.tableProps.bShowProductMaterials;/* 选择成品工序 */ | |
| 3291 | 2899 | } |
| 3292 | 2900 | /* 操作栏设置上传 */ |
| 3293 | - uploadIcon = this.findVisibleControlName(this.props, "BtnSetUpload"); | |
| 3294 | - downloadIcon = this.findVisibleControlName(this.props, "BtnSetDownload"); | |
| 3295 | - headPopup = this.findVisibleControlName(this.props, "BtnHeadPopup"); /* 表头放大镜 */ | |
| 3296 | - sAlumitePopup = this.findVisibleControlName(this.props, "BtnPopupsAlumiteBomBillNo"); /* 表头放大镜 */ | |
| 3297 | - bCopyMore = this.findVisibleControlName(this.props, "BtnCopyMore"); /* 复制多行 */ | |
| 3298 | - bReplace = this.findVisibleControlName(this.props, "BtnReplace"); /* 替换材料 */ | |
| 2901 | + uploadIcon = this.findVisibleControlName(this.props, 'BtnSetUpload') ; | |
| 2902 | + downloadIcon = this.findVisibleControlName(this.props, 'BtnSetDownload') ; | |
| 2903 | + headPopup = this.findVisibleControlName(this.props, 'BtnHeadPopup'); /* 表头放大镜 */ | |
| 2904 | + sAlumitePopup = this.findVisibleControlName(this.props, 'BtnPopupsAlumiteBomBillNo'); /* 表头放大镜 */ | |
| 2905 | + bCopyMore = this.findVisibleControlName(this.props, 'BtnCopyMore'); /* 复制多行 */ | |
| 2906 | + bReplace = this.findVisibleControlName(this.props, 'BtnReplace'); /* 替换材料 */ | |
| 3299 | 2907 | |
| 3300 | 2908 | const setNoCommonOperate = props.tableProps.setNoCommonOperate; /* 没有默认的增加删除按钮 */ |
| 3301 | 2909 | let operateWidth = isSlaveInfoM ? 80 : 0; |
| 3302 | 2910 | |
| 3303 | - if (addProps.style.display === "inline-block") { | |
| 2911 | + if (addProps.style.display === 'inline-block') { | |
| 3304 | 2912 | operateWidth += 40; |
| 3305 | 2913 | } |
| 3306 | - if (delProps.style.display === "inline-block") { | |
| 2914 | + if (delProps.style.display === 'inline-block') { | |
| 3307 | 2915 | operateWidth += 40; |
| 3308 | 2916 | } |
| 3309 | 2917 | if (bCopyMore) { |
| ... | ... | @@ -3312,39 +2920,39 @@ class CommonTableRc extends React.Component { |
| 3312 | 2920 | if (bReplace) { |
| 3313 | 2921 | operateWidth += 40; |
| 3314 | 2922 | } |
| 3315 | - if (copyProps.style.display === "inline-block") { | |
| 2923 | + if (copyProps.style.display === 'inline-block') { | |
| 3316 | 2924 | operateWidth += 40; |
| 3317 | 2925 | } |
| 3318 | - if (copyAllProps.style.display === "inline-block") { | |
| 2926 | + if (copyAllProps.style.display === 'inline-block') { | |
| 3319 | 2927 | operateWidth += 40; |
| 3320 | 2928 | } |
| 3321 | 2929 | if (setNoCommonOperate) { |
| 3322 | 2930 | operateWidth = 0; |
| 3323 | 2931 | } |
| 3324 | - if (!setNoCommonOperate && this.props.name === "sWorkOrderParamList") { | |
| 2932 | + if (!setNoCommonOperate && this.props.name === 'sWorkOrderParamList') { | |
| 3325 | 2933 | operateWidth -= 80; |
| 3326 | 2934 | } |
| 3327 | 2935 | if (this.props.bHideCopyAll) { |
| 3328 | 2936 | operateWidth -= 40; |
| 3329 | 2937 | } |
| 3330 | - if (modalProps.style.display === "inline-block") { | |
| 2938 | + if (modalProps.style.display === 'inline-block') { | |
| 3331 | 2939 | operateWidth += 40; |
| 3332 | 2940 | } |
| 3333 | 2941 | if (!commonUtils.isEmpty(materailremarkIcon)) { |
| 3334 | 2942 | operateWidth += 40; |
| 3335 | 2943 | } |
| 3336 | - if (chooseProcessProps.style.display === "inline-block") { | |
| 2944 | + if (chooseProcessProps.style.display === 'inline-block') { | |
| 3337 | 2945 | operateWidth += 40; |
| 3338 | 2946 | } |
| 3339 | - if (choosePopupProps.style.display === "inline-block") { | |
| 2947 | + if (choosePopupProps.style.display === 'inline-block') { | |
| 3340 | 2948 | operateWidth += 40; |
| 3341 | 2949 | } |
| 3342 | 2950 | |
| 3343 | - if (chooseParamProps.style.display === "inline-block") { | |
| 2951 | + if (chooseParamProps.style.display === 'inline-block') { | |
| 3344 | 2952 | operateWidth += 40; |
| 3345 | 2953 | } |
| 3346 | 2954 | |
| 3347 | - if (bShowProductProcess) { | |
| 2955 | + if (bShowProductProcess ) { | |
| 3348 | 2956 | operateWidth += 40; |
| 3349 | 2957 | } |
| 3350 | 2958 | if (bShowTreeAdd) { |
| ... | ... | @@ -3359,7 +2967,7 @@ class CommonTableRc extends React.Component { |
| 3359 | 2967 | if (bShowTreeCopyAll) { |
| 3360 | 2968 | operateWidth += 40; |
| 3361 | 2969 | } |
| 3362 | - if (bShowProductMaterials) { | |
| 2970 | + if (bShowProductMaterials ) { | |
| 3363 | 2971 | operateWidth += 40; |
| 3364 | 2972 | } |
| 3365 | 2973 | if (exitIcon) { |
| ... | ... | @@ -3372,8 +2980,7 @@ class CommonTableRc extends React.Component { |
| 3372 | 2980 | operateWidth += 40; |
| 3373 | 2981 | } |
| 3374 | 2982 | let scrollWidth = 18; |
| 3375 | - if (commonUtils.isNotEmptyStr(this.props.tableProps.f) && this.props.tableProps.AutoTableHeight.indexOf("calc") === -1) { | |
| 3376 | - /* 固定列计算 */ | |
| 2983 | + if (commonUtils.isNotEmptyStr(this.props.tableProps.f) && this.props.tableProps.AutoTableHeight.indexOf('calc') === -1) { /* 固定列计算 */ | |
| 3377 | 2984 | scrollWidth = 0; |
| 3378 | 2985 | } |
| 3379 | 2986 | |
| ... | ... | @@ -3387,8 +2994,7 @@ class CommonTableRc extends React.Component { |
| 3387 | 2994 | scrollWidth = 18; |
| 3388 | 2995 | } |
| 3389 | 2996 | let lastRow = 0; |
| 3390 | - if (props.bNaturalWidth) { | |
| 3391 | - /* 取后台配置原始宽度 不进行最后一列计算 */ | |
| 2997 | + if (props.bNaturalWidth) { /* 取后台配置原始宽度 不进行最后一列计算 */ | |
| 3392 | 2998 | tableColumn[tableColumn.length - 1].width = lastRowOld; |
| 3393 | 2999 | } else if (tableAllWidth < this.tableContentWidth) { |
| 3394 | 3000 | lastRow = this.tableContentWidth - tableWidth - operateWidth - CheckBoxWidth - scrollWidth - 1; // 1像素为border宽度; |
| ... | ... | @@ -3401,7 +3007,7 @@ class CommonTableRc extends React.Component { |
| 3401 | 3007 | } |
| 3402 | 3008 | /* 动态加载操作行 */ |
| 3403 | 3009 | tableColumn.push({ |
| 3404 | - dataIndex: "operation", | |
| 3010 | + dataIndex: 'operation', | |
| 3405 | 3011 | render: (text, record, index) => { |
| 3406 | 3012 | let operateAdd = null; |
| 3407 | 3013 | let operateCopy = null; |
| ... | ... | @@ -3423,18 +3029,14 @@ class CommonTableRc extends React.Component { |
| 3423 | 3029 | let operateTreeAddChild = null; |
| 3424 | 3030 | let operateExit = null; |
| 3425 | 3031 | let operatesAlumitePopup = null; |
| 3426 | - const setAdd = commonFunc.showMessage(props.app.commonConst, "setAdd"); /* 新增s */ | |
| 3427 | - const setCopy = commonFunc.showMessage(props.app.commonConst, "setCopy"); /* 复制 */ | |
| 3428 | - const setDelete = commonFunc.showMessage(props.app.commonConst, "setDelete"); /* 删除 */ | |
| 3429 | - const setCopyMore = commonFunc.showMessage(props.app.commonConst, "setCopyMore") | |
| 3430 | - ? commonFunc.showMessage(props.app.commonConst, "setCopyMore") | |
| 3431 | - : "复制多行"; /* 删除 */ | |
| 3432 | - const setReplace = commonFunc.showMessage(props.app.commonConst, "setCopyMore") | |
| 3433 | - ? commonFunc.showMessage(props.app.commonConst, "setReplace") | |
| 3434 | - : "提取"; /* 提取 */ | |
| 3435 | - const setCopyAll = commonFunc.showMessage(props.app.commonConst, "setCopyAll"); /* 复制部件 */ | |
| 3032 | + const setAdd = commonFunc.showMessage(props.app.commonConst, 'setAdd');/* 新增s */ | |
| 3033 | + const setCopy = commonFunc.showMessage(props.app.commonConst, 'setCopy');/* 复制 */ | |
| 3034 | + const setDelete = commonFunc.showMessage(props.app.commonConst, 'setDelete');/* 删除 */ | |
| 3035 | + const setCopyMore = commonFunc.showMessage(props.app.commonConst, 'setCopyMore') ? commonFunc.showMessage(props.app.commonConst, 'setCopyMore') : '复制多行'; /* 删除 */ | |
| 3036 | + const setReplace = commonFunc.showMessage(props.app.commonConst, 'setCopyMore') ? commonFunc.showMessage(props.app.commonConst, 'setReplace') : '提取'; /* 提取 */ | |
| 3037 | + const setCopyAll = commonFunc.showMessage(props.app.commonConst, 'setCopyAll');/* 复制部件 */ | |
| 3436 | 3038 | let { rowTag } = record; /* 锁定行标识 */ |
| 3437 | - const { sWorkOrderUsed } = record; /* 订单被工单占用,则该行不能修改、删除 */ | |
| 3039 | + const { sWorkOrderUsed } = record;/* 订单被工单占用,则该行不能修改、删除 */ | |
| 3438 | 3040 | if (commonUtils.isNotEmptyObject(sWorkOrderUsed)) { |
| 3439 | 3041 | record.rowTag = 1; |
| 3440 | 3042 | rowTag = 1; |
| ... | ... | @@ -3444,514 +3046,221 @@ class CommonTableRc extends React.Component { |
| 3444 | 3046 | } |
| 3445 | 3047 | /** 树节点添加 */ |
| 3446 | 3048 | if (bShowTreeAdd) { |
| 3447 | - const enabled = this.getTableBtnState("BtnAdd", record); | |
| 3448 | - operateTreeAdd = ( | |
| 3449 | - <a title="添加同级" alt="添加同级" style={{ margin: "0 10px" }} onClick={enabled ? this.handleTreeAdd.bind(this, index) : null}> | |
| 3450 | - {enabled ? ( | |
| 3451 | - <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> | |
| 3452 | - ) : ( | |
| 3453 | - <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon> | |
| 3454 | - )} | |
| 3455 | - </a> | |
| 3456 | - ); | |
| 3049 | + const enabled = this.getTableBtnState('BtnAdd', record); | |
| 3050 | + operateTreeAdd = <a title="添加同级" alt="添加同级" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeAdd.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon>}</a> | |
| 3457 | 3051 | } |
| 3458 | 3052 | /** 树节点删除 */ |
| 3459 | 3053 | if (bShowTreeDel) { |
| 3460 | - const enabled = this.getTableBtnState("BtnDel", record); | |
| 3461 | - operateTreeDel = ( | |
| 3462 | - <a title="删除" alt="删除" style={{ margin: "0 10px" }} onClick={enabled ? this.handleTreeDel.bind(this, index) : null}> | |
| 3463 | - {enabled ? ( | |
| 3464 | - <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> | |
| 3465 | - ) : ( | |
| 3466 | - <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> | |
| 3467 | - )} | |
| 3468 | - </a> | |
| 3469 | - ); | |
| 3054 | + const enabled = this.getTableBtnState('BtnDel', record); | |
| 3055 | + operateTreeDel = <a title="删除" alt="删除" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeDel.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> : <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon>}</a> | |
| 3470 | 3056 | } |
| 3471 | 3057 | /** 树节点添加子类 */ |
| 3472 | 3058 | if (bShowTreeAddChild) { |
| 3473 | - const enabled = this.getTableBtnState("BtnAddChildNode", record); | |
| 3474 | - operateTreeAddChild = ( | |
| 3475 | - <a title="添加子级" alt="添加子级" style={{ margin: "0 10px" }} onClick={enabled ? this.handleTreeAddChild.bind(this, index) : null}> | |
| 3476 | - {enabled ? ( | |
| 3477 | - <SvgIcon iconClass="tree" fill="#1296db" size="14" alt="增加"></SvgIcon> | |
| 3478 | - ) : ( | |
| 3479 | - <SvgIcon iconClass="tree" fill="rgb(189, 189, 189)" size="14" alt="增加"></SvgIcon> | |
| 3480 | - )} | |
| 3481 | - </a> | |
| 3482 | - ); | |
| 3059 | + const enabled = this.getTableBtnState('BtnAddChildNode', record); | |
| 3060 | + operateTreeAddChild = <a title="添加子级" alt="添加子级" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeAddChild.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="tree" fill="#1296db" size="14"alt="增加"></SvgIcon> : <SvgIcon iconClass="tree" fill="rgb(189, 189, 189)" size="14" alt="增加"></SvgIcon>}</a> | |
| 3483 | 3061 | } |
| 3484 | 3062 | /** 树节点复制 */ |
| 3485 | 3063 | if (bShowTreeCopyAll) { |
| 3486 | - const enabled = this.getTableBtnState("BtnCopyAll", record); | |
| 3487 | - operateTreeCopyAll = ( | |
| 3488 | - <a title="复制全部" alt="复制全部" style={{ margin: "0 10px" }} onClick={enabled ? this.handleTreeCopyAll.bind(this, index) : null}> | |
| 3489 | - {enabled ? ( | |
| 3490 | - <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制"></SvgIcon> | |
| 3491 | - ) : ( | |
| 3492 | - <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon> | |
| 3493 | - )} | |
| 3494 | - </a> | |
| 3495 | - ); | |
| 3064 | + const enabled = this.getTableBtnState('BtnCopyAll', record); | |
| 3065 | + operateTreeCopyAll = <a title="复制全部" alt="复制全部" style={{margin: '0 10px'}} onClick={enabled ? this.handleTreeCopyAll.bind(this, index) : null}>{enabled ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon>}</a> | |
| 3496 | 3066 | } |
| 3497 | 3067 | /** 放置添加图标 添加为默认显示 */ |
| 3498 | 3068 | if (!commonUtils.isEmpty(addIcon)) { |
| 3499 | - const enabled = this.getTableBtnState("BtnAdd", record); | |
| 3500 | - operateAdd = ( | |
| 3501 | - <a | |
| 3502 | - title={setAdd} | |
| 3503 | - {...addProps} | |
| 3504 | - onClick={enabled || this.findIsUpdByControlName(this.props, "BtnAdd") ? this.addTbRow.bind(this, index) : null} | |
| 3505 | - > | |
| 3506 | - {enabled || this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 3507 | - <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> | |
| 3508 | - ) : ( | |
| 3509 | - <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon> | |
| 3510 | - )} | |
| 3511 | - </a> | |
| 3512 | - ); | |
| 3069 | + const enabled = this.getTableBtnState('BtnAdd', record); | |
| 3070 | + operateAdd = <a title={setAdd} {...addProps} onClick={enabled || this.findIsUpdByControlName(this.props, 'BtnAdd') ? this.addTbRow.bind(this, index) : null}>{enabled || this.findIsUpdByControlName(this.props, 'BtnAdd') ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon>}</a>; | |
| 3513 | 3071 | } else if (setNoCommonOperate) { |
| 3514 | - operateAdd = ""; | |
| 3072 | + operateAdd = ''; | |
| 3515 | 3073 | } else { |
| 3516 | - const enabled = this.getTableBtnState("BtnAdd", record); | |
| 3517 | - operateAdd = ( | |
| 3518 | - <a | |
| 3519 | - title={setAdd} | |
| 3520 | - {...addProps} | |
| 3521 | - onClick={enabled || this.findIsUpdByControlName(this.props, "BtnAdd") ? this.addTbRow.bind(this, index) : null} | |
| 3522 | - > | |
| 3523 | - {" "} | |
| 3524 | - {enabled || this.findIsUpdByControlName(this.props, "BtnAdd") ? ( | |
| 3525 | - <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> | |
| 3526 | - ) : ( | |
| 3527 | - <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon> | |
| 3528 | - )} | |
| 3529 | - </a> | |
| 3530 | - ); | |
| 3074 | + const enabled = this.getTableBtnState('BtnAdd', record); | |
| 3075 | + operateAdd = <a title={setAdd} {...addProps} onClick={enabled || this.findIsUpdByControlName(this.props, 'BtnAdd') ? this.addTbRow.bind(this, index) : null} > {enabled || this.findIsUpdByControlName(this.props, 'BtnAdd') ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加"></SvgIcon>}</a>; | |
| 3531 | 3076 | } |
| 3532 | 3077 | /** 放置复制图标 */ |
| 3533 | 3078 | if (!commonUtils.isEmpty(copyIcon)) { |
| 3534 | - const enabled = this.getTableBtnState("BtnCopy", record); | |
| 3535 | - operateCopy = ( | |
| 3536 | - <a title={setCopy} {...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null}> | |
| 3537 | - {enabled ? ( | |
| 3538 | - <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> | |
| 3539 | - ) : ( | |
| 3540 | - <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon> | |
| 3541 | - )} | |
| 3542 | - </a> | |
| 3543 | - ); | |
| 3544 | - } else if (setNoCommonOperate || this.props.name === "sWorkOrderParamList") { | |
| 3545 | - operateCopy = ""; | |
| 3079 | + const enabled = this.getTableBtnState('BtnCopy', record); | |
| 3080 | + operateCopy = <a title={setCopy} {...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14"alt="复制"></SvgIcon>}</a>; | |
| 3081 | + } else if (setNoCommonOperate || this.props.name === 'sWorkOrderParamList') { | |
| 3082 | + operateCopy = ''; | |
| 3546 | 3083 | } else { |
| 3547 | - const enabled = this.getTableBtnState("BtnCopy", record); | |
| 3548 | - operateCopy = ( | |
| 3549 | - <a title={setCopy} {...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null}> | |
| 3550 | - {" "} | |
| 3551 | - {enabled ? ( | |
| 3552 | - <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> | |
| 3553 | - ) : ( | |
| 3554 | - <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14" alt="复制"></SvgIcon> | |
| 3555 | - )} | |
| 3556 | - </a> | |
| 3557 | - ); | |
| 3084 | + const enabled = this.getTableBtnState('BtnCopy', record); | |
| 3085 | + operateCopy = <a title={setCopy}{...copyProps} onClick={enabled ? this.copyTbRow.bind(this, index) : null} > {enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14"alt="复制"></SvgIcon>}</a>; | |
| 3558 | 3086 | } |
| 3559 | 3087 | /** 放置复制部件图标 */ |
| 3560 | 3088 | if (!commonUtils.isEmpty(copyAllIcon)) { |
| 3561 | - const enabled = this.getTableBtnState("BtnCopyAll", record); | |
| 3562 | - operateCopyAll = ( | |
| 3563 | - <a | |
| 3564 | - title={setCopyAll} | |
| 3565 | - {...copyAllProps} | |
| 3566 | - onClick={enabled ? this.copyAllTbRow.bind(this, index) : this.handleTbRowUsed.bind(this, index, record, "copyAll")} | |
| 3567 | - > | |
| 3568 | - {enabled ? ( | |
| 3569 | - <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> | |
| 3570 | - ) : ( | |
| 3571 | - <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制全部"></SvgIcon> | |
| 3572 | - )} | |
| 3573 | - </a> | |
| 3574 | - ); | |
| 3575 | - } else if (setNoCommonOperate || this.props.bHideCopyAll || this.props.name === "sWorkOrderParamList") { | |
| 3576 | - operateCopyAll = ""; | |
| 3089 | + const enabled = this.getTableBtnState('BtnCopyAll', record); | |
| 3090 | + operateCopyAll = <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : this.handleTbRowUsed.bind(this, index, record, 'copyAll')}>{enabled ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14"alt="复制全部"></SvgIcon>}</a>; | |
| 3091 | + } else if (setNoCommonOperate || this.props.bHideCopyAll || this.props.name === 'sWorkOrderParamList') { | |
| 3092 | + operateCopyAll = ''; | |
| 3577 | 3093 | } else { |
| 3578 | - const enabled = this.getTableBtnState("BtnCopyAll", record); | |
| 3579 | - operateCopyAll = ( | |
| 3580 | - <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : null}> | |
| 3581 | - {enabled || this.findIsUpdByControlName(this.props, "BtnCopyAll") ? ( | |
| 3582 | - <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> | |
| 3583 | - ) : ( | |
| 3584 | - <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14" alt="复制全部"></SvgIcon> | |
| 3585 | - )} | |
| 3586 | - </a> | |
| 3587 | - ); | |
| 3094 | + const enabled = this.getTableBtnState('BtnCopyAll', record); | |
| 3095 | + operateCopyAll = <a title={setCopyAll} {...copyAllProps} onClick={enabled ? this.copyAllTbRow.bind(this, index) : null}>{enabled || this.findIsUpdByControlName(this.props, 'BtnCopyAll') ? <SvgIcon iconClass="copyall" fill="#1296db" size="14" alt="复制全部"></SvgIcon> : <SvgIcon iconClass="copyall" fill="rgb(189, 189, 189)" size="14"alt="复制全部"></SvgIcon> }</a>; | |
| 3588 | 3096 | } |
| 3589 | 3097 | /** 放置删除图标 删除为默认显示 */ |
| 3590 | 3098 | if (!commonUtils.isEmpty(delIcon)) { |
| 3591 | - const enabled = this.getTableBtnState("BtnDel", record); | |
| 3592 | - operateDel = ( | |
| 3593 | - <a | |
| 3594 | - title={setDelete} | |
| 3595 | - {...delProps} | |
| 3596 | - onClick={ | |
| 3597 | - props.bDirectDel || (enabled && rowTag !== 1) | |
| 3598 | - ? this.delTbRow.bind(this, index, record) | |
| 3599 | - : this.handleTbRowUsed.bind(this, index, record, "del") | |
| 3600 | - } | |
| 3601 | - > | |
| 3602 | - {props.bDirectDel || (enabled && rowTag !== 1) ? ( | |
| 3603 | - <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> | |
| 3604 | - ) : ( | |
| 3605 | - <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> | |
| 3606 | - )} | |
| 3607 | - </a> | |
| 3608 | - ); | |
| 3099 | + const enabled = this.getTableBtnState('BtnDel', record); | |
| 3100 | + operateDel = <a title={setDelete} {...delProps} onClick={props.bDirectDel || (enabled && rowTag !== 1) ? this.delTbRow.bind(this, index, record) : this.handleTbRowUsed.bind(this, index, record, 'del')} >{props.bDirectDel || (enabled && rowTag !== 1) ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> :<SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> }</a>; | |
| 3609 | 3101 | } else if (setNoCommonOperate) { |
| 3610 | - operateDel = ""; | |
| 3102 | + operateDel = ''; | |
| 3611 | 3103 | } else { |
| 3612 | - const enabled = this.getTableBtnState("BtnDel", record); | |
| 3613 | - operateDel = ( | |
| 3614 | - <a | |
| 3615 | - title={setDelete} | |
| 3616 | - {...delProps} | |
| 3617 | - onClick={ | |
| 3618 | - props.bDirectDel || enabled || this.findIsUpdByControlName(this.props, "BtnDel") ? this.delTbRow.bind(this, index, record) : null | |
| 3619 | - } | |
| 3620 | - > | |
| 3621 | - {props.bDirectDel || enabled || this.findIsUpdByControlName(this.props, "BtnDel") ? ( | |
| 3622 | - <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> | |
| 3623 | - ) : ( | |
| 3624 | - <SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> | |
| 3625 | - )} | |
| 3626 | - </a> | |
| 3627 | - ); | |
| 3104 | + const enabled = this.getTableBtnState('BtnDel', record); | |
| 3105 | + operateDel = <a title={setDelete} {...delProps} onClick={props.bDirectDel || (enabled || this.findIsUpdByControlName(this.props, 'BtnDel')) ? this.delTbRow.bind(this, index, record) : null} >{props.bDirectDel || (enabled || this.findIsUpdByControlName(this.props, 'BtnDel')) ? <SvgIcon iconClass="close" fill="#1296db" size="14" alt="删除"></SvgIcon> :<SvgIcon iconClass="close" fill="rgb(189, 189, 189)" size="14" alt="删除"></SvgIcon> }</a>; | |
| 3628 | 3106 | } |
| 3629 | 3107 | |
| 3630 | 3108 | /* 复制多行 */ |
| 3631 | 3109 | if (bCopyMore) { |
| 3632 | - const enabled = this.getTableBtnState("BtnDelMore", record); | |
| 3633 | - operateCopyMore = ( | |
| 3634 | - <a title={setCopyMore} {...copyMoreProps} onClick={enabled ? this.copyTbMoreRow.bind(this, index) : null}> | |
| 3635 | - {enabled ? ( | |
| 3636 | - <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> | |
| 3637 | - ) : ( | |
| 3638 | - <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14" alt="复制多行"></SvgIcon> | |
| 3639 | - )} | |
| 3640 | - </a> | |
| 3641 | - ); | |
| 3110 | + const enabled = this.getTableBtnState('BtnDelMore', record); | |
| 3111 | + operateCopyMore = <a title={setCopyMore} {...copyMoreProps} onClick={enabled ? this.copyTbMoreRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="copy" fill="#1296db" size="14" alt="复制"></SvgIcon> : <SvgIcon iconClass="copy" fill="rgb(189, 189, 189)" size="14"alt="复制多行"></SvgIcon>}</a>; | |
| 3112 | + | |
| 3642 | 3113 | } |
| 3643 | 3114 | /* 提取数据 */ |
| 3644 | 3115 | if (bReplace) { |
| 3645 | - const enabled = this.getTableBtnState("BtnReplace", record); | |
| 3646 | - operateReplace = ( | |
| 3647 | - <a title={setReplace} onClick={enabled ? this.replaceTbRow.bind(this, index, record) : null}> | |
| 3648 | - {enabled ? ( | |
| 3649 | - <img src={ReplaceIcon} alt="提取数据" width="18px" height="18px" /> | |
| 3650 | - ) : ( | |
| 3651 | - <img src={DisReplaceIcon} alt="查看工艺参数" width="16px" height="16px" /> | |
| 3652 | - )} | |
| 3653 | - </a> | |
| 3654 | - ); | |
| 3116 | + const enabled = this.getTableBtnState('BtnReplace', record); | |
| 3117 | + operateReplace = <a title={setReplace} onClick={enabled ? this.replaceTbRow.bind(this, index, record) : null} >{enabled ?<img src={ReplaceIcon} alt="提取数据" width="18px" height="18px" />:<img src={DisReplaceIcon} alt="查看工艺参数" width="16px" height="16px" />}</a>; | |
| 3118 | + | |
| 3655 | 3119 | } |
| 3656 | 3120 | |
| 3657 | 3121 | /** 放置选择材料图标 */ |
| 3658 | 3122 | if (!commonUtils.isEmpty(materialIcon)) { |
| 3659 | - const enabled = this.getTableBtnState("BtnChooseMaterials", record); | |
| 3660 | - const setMaterial = commonFunc.showMessage(props.app.commonConst, "setMaterial"); /* 选择材料 */ | |
| 3123 | + const enabled = this.getTableBtnState('BtnChooseMaterials', record); | |
| 3124 | + const setMaterial = commonFunc.showMessage(props.app.commonConst, 'setMaterial');/* 选择材料 */ | |
| 3661 | 3125 | operateMaterial = ( |
| 3662 | 3126 | <a |
| 3663 | 3127 | title={setMaterial} |
| 3664 | 3128 | {...modalProps} |
| 3665 | 3129 | onClick={ |
| 3666 | - enabled && rowTag !== 1 | |
| 3667 | - ? this.modalTbRow.bind(this, index, props.name) | |
| 3668 | - : this.handleTbRowUsed.bind(this, index, record, "setMaterial") | |
| 3130 | + enabled && rowTag !== 1 ? | |
| 3131 | + this.modalTbRow.bind(this, index, props.name) : | |
| 3132 | + this.handleTbRowUsed.bind(this, index, record, 'setMaterial') | |
| 3669 | 3133 | } |
| 3670 | 3134 | > |
| 3671 | - {enabled && rowTag !== 1 ? ( | |
| 3672 | - <SvgIcon iconClass="material" fill="#1296db" size="14" alt="选择材料" /> | |
| 3673 | - ) : ( | |
| 3674 | - <SvgIcon iconClass="material" fill="rgb(189, 189, 189)" size="14" alt="选择材料" /> | |
| 3675 | - )} | |
| 3135 | + { | |
| 3136 | + enabled && rowTag !== 1 ? | |
| 3137 | + <SvgIcon iconClass="material" fill="#1296db" size="14" alt="选择材料" /> : | |
| 3138 | + <SvgIcon iconClass="material" fill="rgb(189, 189, 189)" size="14" alt="选择材料" /> | |
| 3139 | + } | |
| 3676 | 3140 | </a> |
| 3677 | 3141 | ); |
| 3678 | 3142 | } |
| 3679 | 3143 | /** 放置材料备注图标 */ |
| 3680 | 3144 | if (!commonUtils.isEmpty(materailremarkIcon)) { |
| 3681 | - const enabled = this.getTableBtnState("BtnChooseMaterials", record); | |
| 3682 | - const setMaterailRemark = commonFunc.showMessage(props.app.commonConst, "setMaterailRemark"); /* 选择材料工艺 */ | |
| 3145 | + const enabled = this.getTableBtnState('BtnChooseMaterials', record); | |
| 3146 | + const setMaterailRemark = commonFunc.showMessage(props.app.commonConst, 'setMaterailRemark');/* 选择材料工艺 */ | |
| 3683 | 3147 | operateMaterailRemark = ( |
| 3684 | - <a title={setMaterailRemark} {...modalRemarkProps} onClick={enabled ? this.modalRemarkTbRow.bind(this, index) : () => {}}> | |
| 3685 | - <SvgIcon iconClass="material" fill={enabled ? "#1296db" : "rgb(189, 189, 189)"} size="14" alt="选择材料"></SvgIcon> | |
| 3686 | - </a> | |
| 3687 | - ); | |
| 3148 | + <a | |
| 3149 | + title={setMaterailRemark} | |
| 3150 | + {...modalRemarkProps} | |
| 3151 | + onClick={enabled ? this.modalRemarkTbRow.bind(this, index) : () => {}} | |
| 3152 | + > | |
| 3153 | + <SvgIcon iconClass="material" fill={enabled ? "#1296db": "rgb(189, 189, 189)"} size="14" alt="选择材料"> | |
| 3154 | + </SvgIcon></a> | |
| 3155 | + ) | |
| 3688 | 3156 | } |
| 3689 | 3157 | /** 放置选择工序材料图标 */ |
| 3690 | 3158 | if (!commonUtils.isEmpty(processIcon)) { |
| 3691 | - const enabled = this.getTableBtnState("BtnChooseProcess", record); | |
| 3692 | - const setProcess = commonFunc.showMessage(props.app.commonConst, "setProcess"); /* 选择工序 */ | |
| 3693 | - operateProcess = ( | |
| 3694 | - <a title={setProcess} {...chooseProcessProps} onClick={enabled ? this.chooseProcessTbRow.bind(this, index) : null}> | |
| 3695 | - {enabled ? ( | |
| 3696 | - <SvgIcon iconClass="process" fill="#1296db" size="14" alt="选择工序"></SvgIcon> | |
| 3697 | - ) : ( | |
| 3698 | - <SvgIcon iconClass="process" fill="rgb(189, 189, 189)" size="14" alt="选择工序"></SvgIcon> | |
| 3699 | - )} | |
| 3700 | - </a> | |
| 3701 | - ); | |
| 3159 | + const enabled = this.getTableBtnState('BtnChooseProcess', record); | |
| 3160 | + const setProcess = commonFunc.showMessage(props.app.commonConst, 'setProcess');/* 选择工序 */ | |
| 3161 | + operateProcess = <a title={setProcess} {...chooseProcessProps} onClick={enabled ? this.chooseProcessTbRow.bind(this, index) : null} >{enabled ? <SvgIcon iconClass="process" fill="#1296db" size="14" alt="选择工序"></SvgIcon> : <SvgIcon iconClass="process" fill="rgb(189, 189, 189)" size="14" alt="选择工序"></SvgIcon>}</a>; | |
| 3702 | 3162 | } |
| 3703 | 3163 | /** 选择成品工序图标 */ |
| 3704 | 3164 | if (bShowProductProcess) { |
| 3705 | - const enabled = this.getTableBtnState("BtnChooseProductProcess", record); | |
| 3706 | - const setProductProcess = commonFunc.showMessage(props.app.commonConst, "setProductProcess"); /* 选择成品工序 */ | |
| 3707 | - operateProductProcess = ( | |
| 3708 | - <a | |
| 3709 | - title={setProductProcess} | |
| 3710 | - {...chooseProductProcessProps} | |
| 3711 | - onClick={enabled ? this.chooseProductProcessModalTbRow.bind(this, index, record) : null} | |
| 3712 | - > | |
| 3713 | - {enabled ? ( | |
| 3714 | - <SvgIcon iconClass="process" fill="#1296db" size="14" alt="选择成品工序"></SvgIcon> | |
| 3715 | - ) : ( | |
| 3716 | - <SvgIcon iconClass="process" fill="rgb(189, 189, 189)" size="14" alt="选择成品工序"></SvgIcon> | |
| 3717 | - )} | |
| 3718 | - </a> | |
| 3719 | - ); | |
| 3165 | + const enabled = this.getTableBtnState('BtnChooseProductProcess', record); | |
| 3166 | + const setProductProcess = commonFunc.showMessage(props.app.commonConst, 'setProductProcess');/* 选择成品工序 */ | |
| 3167 | + operateProductProcess = <a title={setProductProcess} {...chooseProductProcessProps} onClick={enabled ? this.chooseProductProcessModalTbRow.bind(this, index, record) : null}>{enabled ? <SvgIcon iconClass="process" fill="#1296db" size="14" alt="选择成品工序"></SvgIcon> : <SvgIcon iconClass="process" fill="rgb(189, 189, 189)" size="14" alt="选择成品工序"></SvgIcon>}</a>; | |
| 3720 | 3168 | } |
| 3721 | 3169 | /** 选择成品材料图标 */ |
| 3722 | 3170 | if (bShowProductMaterials) { |
| 3723 | - const enabled = this.getTableBtnState("BtnChooseProductMaterials", record); | |
| 3724 | - const setProductMaterials = commonFunc.showMessage(props.app.commonConst, "setProductMaterials"); /* 选择成品材料 */ | |
| 3725 | - operateProductMaterials = ( | |
| 3726 | - <a | |
| 3727 | - title={setProductMaterials} | |
| 3728 | - {...chooseProductMaterialsProps} | |
| 3729 | - onClick={enabled ? this.chooseProductMaterialsModalTbRow.bind(this, index, record) : null} | |
| 3730 | - > | |
| 3731 | - {enabled ? ( | |
| 3732 | - <SvgIcon iconClass="material" fill="#1296db" size="14" alt="选择成品材料"></SvgIcon> | |
| 3733 | - ) : ( | |
| 3734 | - <SvgIcon iconClass="material" fill="rgb(189, 189, 189)" size="14" alt="选择成品材料"></SvgIcon> | |
| 3735 | - )} | |
| 3736 | - </a> | |
| 3737 | - ); | |
| 3171 | + const enabled = this.getTableBtnState('BtnChooseProductMaterials', record); | |
| 3172 | + const setProductMaterials = commonFunc.showMessage(props.app.commonConst, 'setProductMaterials');/* 选择成品材料 */ | |
| 3173 | + operateProductMaterials = <a title={setProductMaterials} {...chooseProductMaterialsProps} onClick={enabled ? this.chooseProductMaterialsModalTbRow.bind(this, index, record) : null}>{enabled ? <SvgIcon iconClass="material" fill="#1296db" size="14" alt="选择成品材料"></SvgIcon> : <SvgIcon iconClass="material" fill="rgb(189, 189, 189)" size="14" alt="选择成品材料"></SvgIcon>}</a>; | |
| 3738 | 3174 | } |
| 3739 | 3175 | |
| 3740 | 3176 | if (downloadIcon) { |
| 3741 | - const setDownload = commonFunc.showMessage(props.app.commonConst, "setDownload"); /* 下载 */ | |
| 3742 | - operateDownload = ( | |
| 3743 | - <a title={setDownload} {...downloadProps} onClick={this.downloadTbRow.bind(this, index, record)}> | |
| 3744 | - {<DownloadOutlined />} | |
| 3745 | - </a> | |
| 3746 | - ); | |
| 3177 | + const setDownload = commonFunc.showMessage(props.app.commonConst, 'setDownload');/* 下载 */ | |
| 3178 | + operateDownload = <a title={setDownload} {...downloadProps} onClick={this.downloadTbRow.bind(this, index, record)}>{ <DownloadOutlined />}</a>; | |
| 3747 | 3179 | } |
| 3748 | 3180 | |
| 3749 | 3181 | if (this.isPopupShow) { |
| 3750 | - const enabled = this.getTableBtnState("BtnPopup", record); | |
| 3751 | - const setDownload = commonFunc.showMessage(props.app.commonConst, "setPopup"); /* 弹窗 */ | |
| 3752 | - operatePopupModal = ( | |
| 3753 | - <a title={setDownload} {...choosePopupProps} onClick={enabled ? this.popupModalTbRow.bind(this, index, record) : null}> | |
| 3754 | - {enabled ? ( | |
| 3755 | - <SvgIcon iconClass="search" fill="#1296db" size="14" alt="弹窗"></SvgIcon> | |
| 3756 | - ) : ( | |
| 3757 | - <SvgIcon iconClass="search" fill="rgb(189, 189, 189)" size="14" alt="弹窗"></SvgIcon> | |
| 3758 | - )} | |
| 3759 | - </a> | |
| 3760 | - ); | |
| 3182 | + const enabled = this.getTableBtnState('BtnPopup', record); | |
| 3183 | + const setDownload = commonFunc.showMessage(props.app.commonConst, 'setPopup');/* 弹窗 */ | |
| 3184 | + operatePopupModal = <a title={setDownload} {...choosePopupProps} onClick={enabled ? this.popupModalTbRow.bind(this, index, record) : null}>{enabled ? <SvgIcon iconClass="search" fill="#1296db" size="14" alt="弹窗"></SvgIcon> : <SvgIcon iconClass="search" fill="rgb(189, 189, 189)" size="14" alt="弹窗"></SvgIcon>}</a>; | |
| 3761 | 3185 | } |
| 3762 | 3186 | |
| 3763 | 3187 | if (this.isParamShow) { |
| 3764 | - const setParam = commonUtils.isNotEmptyObject(commonFunc.showMessage(props.app.commonConst, "setParam")) | |
| 3765 | - ? commonFunc.showMessage(props.app.commonConst, "setParam") | |
| 3766 | - : "查看参数"; /* 参数 */ | |
| 3767 | - operateParamModal = ( | |
| 3768 | - <a title={setParam} {...chooseParamProps} onClick={this.paramModalTbRow.bind(this, index, record)}> | |
| 3769 | - {<img src={ParamIcon} alt="查看工艺参数" width="16px" height="16px" />} | |
| 3770 | - </a> | |
| 3771 | - ); | |
| 3188 | + const setParam = commonUtils.isNotEmptyObject(commonFunc.showMessage(props.app.commonConst, 'setParam')) ? commonFunc.showMessage(props.app.commonConst, 'setParam') : '查看参数' ;/* 参数 */ | |
| 3189 | + operateParamModal = <a title={setParam} {...chooseParamProps} onClick={this.paramModalTbRow.bind(this, index, record)}>{<img src={ParamIcon} alt="查看工艺参数" width="16px" height="16px" />}</a>; | |
| 3772 | 3190 | } |
| 3773 | 3191 | |
| 3774 | 3192 | if (exitIcon) { |
| 3775 | - const setExit = "退出"; | |
| 3776 | - operateExit = ( | |
| 3777 | - <a title={setExit} onClick={this.exitTbRow.bind(this, index, record)}> | |
| 3778 | - {<ExportOutlined style={{ color: "#8e1f13" }} />} | |
| 3779 | - </a> | |
| 3780 | - ); | |
| 3193 | + const setExit = '退出'; | |
| 3194 | + operateExit = <a title={setExit} onClick={this.exitTbRow.bind(this, index, record)}>{ <ExportOutlined style={{color: '#8e1f13'}}/>}</a>; | |
| 3781 | 3195 | } |
| 3782 | 3196 | if (sAlumitePopup) { |
| 3783 | - const setAlumitePopup = "电化铝"; | |
| 3784 | - const enabled = this.getTableBtnState("BtnPopupsAlumiteBomBillNo", record); | |
| 3785 | - operatesAlumitePopup = ( | |
| 3786 | - <a title={setAlumitePopup} onClick={enabled ? this.popupModalTbRow.bind(this, index, record, "BtnPopupsAlumiteBomBillNo") : null}> | |
| 3787 | - {enabled ? ( | |
| 3788 | - <img src={sAlumiteIcon} alt="电化铝" width="18px" height="18px" /> | |
| 3789 | - ) : ( | |
| 3790 | - <img src={DisAlumiteIcon} alt="电化铝" width="18px" height="18px" /> | |
| 3791 | - )} | |
| 3792 | - </a> | |
| 3793 | - ); | |
| 3197 | + const setAlumitePopup = '电化铝'; | |
| 3198 | + const enabled = this.getTableBtnState('BtnPopupsAlumiteBomBillNo', record); | |
| 3199 | + operatesAlumitePopup = <a title={setAlumitePopup} onClick={enabled ? this.popupModalTbRow.bind(this, index, record, 'BtnPopupsAlumiteBomBillNo') : null}>{ enabled ? <img src={sAlumiteIcon} alt="电化铝" width="18px" height="18px" /> : <img src={DisAlumiteIcon} alt="电化铝" width="18px" height="18px" />}</a>; | |
| 3794 | 3200 | } |
| 3795 | 3201 | |
| 3796 | - return ( | |
| 3797 | - <div | |
| 3798 | - style={{ | |
| 3799 | - width: "100%", | |
| 3800 | - height: "100%", | |
| 3801 | - display: "flex", | |
| 3802 | - justifyContent: !exitIcon ? "right" : "center", | |
| 3803 | - }} | |
| 3804 | - className="operate-bar" | |
| 3805 | - > | |
| 3806 | - {operateTreeAdd} | |
| 3807 | - {operateTreeAddChild} | |
| 3808 | - {operateTreeCopyAll} | |
| 3809 | - {operateTreeDel} | |
| 3810 | - {operateAdd} | |
| 3811 | - {operatesAlumitePopup} | |
| 3812 | - {operatePopupModal} | |
| 3813 | - {operateCopy} | |
| 3814 | - {operateCopyAll} | |
| 3815 | - {operateReplace} | |
| 3816 | - {operateCopyMore} | |
| 3817 | - {operateMaterial} | |
| 3818 | - {operateProductMaterials} | |
| 3819 | - {operateMaterailRemark} | |
| 3820 | - {operateDel} | |
| 3821 | - {operateProcess} | |
| 3822 | - {operateParamModal} | |
| 3823 | - {operateDownload} | |
| 3824 | - {operateProductProcess} | |
| 3825 | - {operateExit} | |
| 3826 | - </div> | |
| 3827 | - ); | |
| 3202 | + return (<div | |
| 3203 | + style={{ | |
| 3204 | + width: '100%', height: '100%', display: 'flex', justifyContent: !exitIcon ? 'right' : 'center', | |
| 3205 | + }} | |
| 3206 | + className="operate-bar" | |
| 3207 | + >{operateTreeAdd}{operateTreeAddChild}{operateTreeCopyAll}{operateTreeDel}{operateAdd}{operatesAlumitePopup}{operatePopupModal}{operateCopy}{operateCopyAll}{operateReplace}{operateCopyMore}{operateMaterial}{operateProductMaterials}{operateMaterailRemark}{operateDel}{operateProcess}{operateParamModal}{operateDownload}{operateProductProcess}{operateExit} | |
| 3208 | + </div>); | |
| 3828 | 3209 | }, |
| 3829 | - title: () => | |
| 3830 | - this.props.setOpterationColumn === "Y" && this.getTableFilterData() === 0 ? ( | |
| 3831 | - <span | |
| 3832 | - style={{ | |
| 3833 | - width: "100%", | |
| 3834 | - height: "100%", | |
| 3835 | - display: "flex", | |
| 3836 | - justifyContent: "left", | |
| 3837 | - textDecoration: "none", | |
| 3838 | - }} | |
| 3210 | + title: () => (this.props.setOpterationColumn === 'Y' && this.getTableFilterData() === 0 ? <span | |
| 3211 | + style={{ | |
| 3212 | + width: '100%', height: '100%', display: 'flex', justifyContent: 'left', textDecoration: 'none', | |
| 3213 | + }} | |
| 3214 | + >{setOperation} {uploadIcon ? <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3215 | + <a {...uploadProps} | |
| 3216 | + contenteditable="true" | |
| 3217 | + ref={(ref) => {this.uploadRef1 = ref;}} | |
| 3218 | + onPaste={this.handleUploadByClipboard} | |
| 3219 | + onMouseOver={() => { | |
| 3220 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3221 | + }} | |
| 3222 | + onKeyDown={() => { | |
| 3223 | + this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 3224 | + }} | |
| 3225 | + onKeyUp={() => { | |
| 3226 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3227 | + }} | |
| 3839 | 3228 | > |
| 3840 | - {setOperation}{" "} | |
| 3841 | - {uploadIcon ? ( | |
| 3842 | - <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3843 | - <a | |
| 3844 | - {...uploadProps} | |
| 3845 | - contenteditable="true" | |
| 3846 | - ref={ref => { | |
| 3847 | - this.uploadRef1 = ref; | |
| 3848 | - }} | |
| 3849 | - onPaste={this.handleUploadByClipboard} | |
| 3850 | - onMouseOver={() => { | |
| 3851 | - this.uploadRef1.setAttribute("contenteditable", "true"); | |
| 3852 | - }} | |
| 3853 | - onKeyDown={() => { | |
| 3854 | - this.uploadRef1.setAttribute("contenteditable", "false"); | |
| 3855 | - }} | |
| 3856 | - onKeyUp={() => { | |
| 3857 | - this.uploadRef1.setAttribute("contenteditable", "true"); | |
| 3858 | - }} | |
| 3859 | - > | |
| 3860 | - {this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{ color: "rgb(189, 189, 189)" }} />} | |
| 3861 | - </a> | |
| 3862 | - </Upload> | |
| 3863 | - ) : ( | |
| 3864 | - <span> | |
| 3865 | - <a | |
| 3866 | - {...addProps} | |
| 3867 | - onClick={ | |
| 3868 | - !this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnAdd")) ? this.addTbRowInHeader : null | |
| 3869 | - } | |
| 3870 | - > | |
| 3871 | - {!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnAdd")) ? ( | |
| 3872 | - <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> | |
| 3873 | - ) : ( | |
| 3874 | - <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon> | |
| 3875 | - )} | |
| 3876 | - </a> | |
| 3877 | - {headPopup ? ( | |
| 3878 | - <a | |
| 3879 | - {...headProps} | |
| 3880 | - onClick={ | |
| 3881 | - !this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnHeadPopup")) | |
| 3882 | - ? this.popupModalTbRow | |
| 3883 | - : null | |
| 3884 | - } | |
| 3885 | - > | |
| 3886 | - {!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnHeadPopup")) ? ( | |
| 3887 | - <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> | |
| 3888 | - ) : ( | |
| 3889 | - <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon> | |
| 3890 | - )} | |
| 3891 | - </a> | |
| 3892 | - ) : ( | |
| 3893 | - "" | |
| 3894 | - )} | |
| 3895 | - </span> | |
| 3896 | - )} | |
| 3897 | - </span> | |
| 3898 | - ) : uploadIcon ? ( | |
| 3899 | - <span> | |
| 3900 | - {" "} | |
| 3901 | - <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3902 | - <a | |
| 3903 | - {...uploadProps} | |
| 3904 | - contenteditable="true" | |
| 3905 | - ref={ref => { | |
| 3906 | - this.uploadRef1 = ref; | |
| 3907 | - }} | |
| 3908 | - onPaste={this.handleUploadByClipboard} | |
| 3909 | - onMouseOver={() => { | |
| 3910 | - this.uploadRef1.setAttribute("contenteditable", "true"); | |
| 3911 | - }} | |
| 3912 | - onKeyDown={() => { | |
| 3913 | - this.uploadRef1.setAttribute("contenteditable", "false"); | |
| 3914 | - }} | |
| 3915 | - onKeyUp={() => { | |
| 3916 | - this.uploadRef1.setAttribute("contenteditable", "true"); | |
| 3917 | - }} | |
| 3918 | - > | |
| 3919 | - {this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{ color: "rgb(189, 189, 189)" }} />} | |
| 3920 | - </a> | |
| 3921 | - </Upload> | |
| 3922 | - </span> | |
| 3923 | - ) : ( | |
| 3924 | - <span> | |
| 3925 | - {" "} | |
| 3926 | - {setOperation}{" "} | |
| 3927 | - {headPopup ? ( | |
| 3928 | - <a | |
| 3929 | - {...headProps} | |
| 3930 | - onClick={ | |
| 3931 | - !this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnHeadPopup")) | |
| 3932 | - ? this.popupModalTbRow | |
| 3933 | - : null | |
| 3934 | - } | |
| 3935 | - > | |
| 3936 | - {!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, "BtnHeadPopup")) ? ( | |
| 3937 | - <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> | |
| 3938 | - ) : ( | |
| 3939 | - <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon> | |
| 3940 | - )} | |
| 3229 | + { | |
| 3230 | + this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{color:'rgb(189, 189, 189)'}} /> | |
| 3231 | + } | |
| 3232 | + </a> | |
| 3233 | + </Upload> : <span><a {...addProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd')) ? this.addTbRowInHeader : null}>{!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> | |
| 3234 | + { headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : '' }</span>} | |
| 3235 | + </span> : | |
| 3236 | + uploadIcon ? <span> <Upload {...divProps} disabled={!this.props.enabled}> | |
| 3237 | + <a {...uploadProps} | |
| 3238 | + contenteditable="true" | |
| 3239 | + ref={(ref) => {this.uploadRef1 = ref;}} | |
| 3240 | + onPaste={this.handleUploadByClipboard} | |
| 3241 | + onMouseOver={() => { | |
| 3242 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3243 | + }} | |
| 3244 | + onKeyDown={() => { | |
| 3245 | + this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 3246 | + }} | |
| 3247 | + onKeyUp={() => { | |
| 3248 | + this.uploadRef1.setAttribute('contenteditable', "true"); | |
| 3249 | + }} | |
| 3250 | + > | |
| 3251 | + { | |
| 3252 | + this.props.enabled ? <UploadOutlined /> : <UploadOutlined style={{color:'rgb(189, 189, 189)'}} /> | |
| 3253 | + } | |
| 3941 | 3254 | </a> |
| 3942 | - ) : ( | |
| 3943 | - "" | |
| 3944 | - )}{" "} | |
| 3945 | - </span> | |
| 3946 | - ), | |
| 3947 | - width: operateWidth + "px", | |
| 3255 | + </Upload></span> : <span> {setOperation} { headPopup ? <a {...headProps} onClick={!this.props.bLimitOperate && (props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? this.popupModalTbRow : null}>{!props.bLimitOperate && ( props.enabled || this.findIsUpdByControlName(this.props, 'BtnHeadPopup')) ? <SvgIcon iconClass="plus" fill="#1296db" size="14" alt="添加" offsetY="2"></SvgIcon> : <SvgIcon iconClass="plus" fill="rgb(189, 189, 189)" size="14" alt="添加" offsetY="2"></SvgIcon>}</a> : '' } </span>), | |
| 3256 | + width: operateWidth + 'px', | |
| 3948 | 3257 | // fixed: commonUtils.isNotEmptyObject(this.props.tableProps.AutoTableHeight) ? 'right' : false, |
| 3949 | - fixed: "right", | |
| 3258 | + fixed: 'right', | |
| 3950 | 3259 | }); |
| 3951 | 3260 | } else { |
| 3952 | 3261 | const tableAllWidth = tableWidth + lastRowOld + CheckBoxWidth; |
| 3953 | 3262 | if (tableAllWidth < this.tableContentWidth) { |
| 3954 | - const lastRow = this.tableContentWidth - tableWidth - CheckBoxWidth - 18; /* ant-table-body的div宽度-操作列宽度-选择列宽度36 */ | |
| 3263 | + const lastRow = this.tableContentWidth - tableWidth - CheckBoxWidth - 18;/* ant-table-body的div宽度-操作列宽度-选择列宽度36 */ | |
| 3955 | 3264 | if (lastRow > 0 && tableColumn.length > 0 && lastRow > lastRowOld) { |
| 3956 | 3265 | delete tableColumn[tableColumn.length - 1].width; |
| 3957 | 3266 | // tableColumn[tableColumn.length - 1].width = lastRow; |
| ... | ... | @@ -3964,20 +3273,20 @@ class CommonTableRc extends React.Component { |
| 3964 | 3273 | |
| 3965 | 3274 | getColumnSearchProps = (iIndex, column, type, props, search) => { |
| 3966 | 3275 | const returnProps = {}; |
| 3967 | - if (props.onFilterData !== undefined && iIndex === 0 && type === "filter" && !this.resize) { | |
| 3276 | + if (props.onFilterData !== undefined && iIndex === 0 && type === 'filter' && !this.resize) { | |
| 3968 | 3277 | returnProps.onFilter = props.onFilterData.bind(this, props.name, column.dataIndex); |
| 3969 | - } else if (column.dataIndex !== undefined && column.bFind && type === "filter" && !this.resize) { | |
| 3278 | + } else if (column.dataIndex !== undefined && column.bFind && type === 'filter' && !this.resize) { | |
| 3970 | 3279 | if (!search) { |
| 3971 | 3280 | return false; |
| 3972 | 3281 | } |
| 3973 | - returnProps.filterDropdown = ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => { | |
| 3282 | + returnProps.filterDropdown = ({ | |
| 3283 | + setSelectedKeys, selectedKeys, confirm, clearFilters, | |
| 3284 | + }) => { | |
| 3974 | 3285 | return ( |
| 3975 | 3286 | <div style={{ padding: 8 }}> |
| 3976 | 3287 | <Input |
| 3977 | 3288 | // id="searchInput" |
| 3978 | - ref={node => { | |
| 3979 | - this.searchInput = node; | |
| 3980 | - }} | |
| 3289 | + ref={(node) => { this.searchInput = node; }} | |
| 3981 | 3290 | // onClick={this.handleInputOnClick.bind(this, 'searchInput')} |
| 3982 | 3291 | placeholder={`Search ${column.title}`} |
| 3983 | 3292 | value={selectedKeys[0]} |
| ... | ... | @@ -3997,15 +3306,19 @@ class CommonTableRc extends React.Component { |
| 3997 | 3306 | > |
| 3998 | 3307 | 搜索 |
| 3999 | 3308 | </Button> |
| 4000 | - <Button onClick={() => this.handleReset(clearFilters, confirm)} size="small" style={{ width: 90 }}> | |
| 3309 | + <Button | |
| 3310 | + onClick={() => this.handleReset(clearFilters, confirm)} | |
| 3311 | + size="small" | |
| 3312 | + style={{ width: 90 }} | |
| 3313 | + > | |
| 4001 | 3314 | 重置 |
| 4002 | 3315 | </Button> |
| 4003 | 3316 | </Space> |
| 4004 | 3317 | </div> |
| 4005 | 3318 | ); |
| 4006 | 3319 | }; |
| 4007 | - returnProps.filterIcon = filtered => <SearchOutlined style={{ color: filtered ? "#1890ff" : undefined }} />; | |
| 4008 | - returnProps.onFilterDropdownVisibleChange = visible => { | |
| 3320 | + returnProps.filterIcon = filtered => <SearchOutlined style={{ color: filtered ? '#1890ff' : undefined }} />; | |
| 3321 | + returnProps.onFilterDropdownVisibleChange = (visible) => { | |
| 4009 | 3322 | if (visible) { |
| 4010 | 3323 | setTimeout(() => this.searchInput.select()); |
| 4011 | 3324 | } |
| ... | ... | @@ -4014,7 +3327,7 @@ class CommonTableRc extends React.Component { |
| 4014 | 3327 | let sValue = record[column.dataIndex]; |
| 4015 | 3328 | const dropdownData = commonUtils.getStoreDropDownData(props.formId, props.name, column.dataIndex); |
| 4016 | 3329 | if (commonUtils.isNotEmptyArr(dropdownData)) { |
| 4017 | - const sId = commonUtils.isEmpty(dropdownData[0].sSlaveId) ? "sId" : "sSlaveId"; | |
| 3330 | + const sId = commonUtils.isEmpty(dropdownData[0].sSlaveId) ? 'sId' : 'sSlaveId'; | |
| 4018 | 3331 | const iDropdownIndex = dropdownData.findIndex(item => item[sId] === record[column.dataIndex]); |
| 4019 | 3332 | if (iDropdownIndex > -1) { |
| 4020 | 3333 | const sFieldName = Object.keys(dropdownData[iDropdownIndex])[0]; |
| ... | ... | @@ -4030,7 +3343,7 @@ class CommonTableRc extends React.Component { |
| 4030 | 3343 | if (record[column.dataIndex] !== undefined && sValue !== undefined) { |
| 4031 | 3344 | return sValue.toString().toLowerCase().includes(value.toLowerCase()); |
| 4032 | 3345 | } else { |
| 4033 | - return "".toString().toLowerCase().includes(value.toLowerCase()); | |
| 3346 | + return ''.toString().toLowerCase().includes(value.toLowerCase()); | |
| 4034 | 3347 | } |
| 4035 | 3348 | }; |
| 4036 | 3349 | if (!props.enabled) { |
| ... | ... | @@ -4039,7 +3352,7 @@ class CommonTableRc extends React.Component { |
| 4039 | 3352 | let sValue = record[column.dataIndex]; |
| 4040 | 3353 | const dropdownData = commonUtils.getStoreDropDownData(props.formId, props.name, column.dataIndex); |
| 4041 | 3354 | if (commonUtils.isNotEmptyArr(dropdownData)) { |
| 4042 | - const sId = commonUtils.isEmpty(dropdownData[0].sSlaveId) ? "sId" : "sSlaveId"; | |
| 3355 | + const sId = commonUtils.isEmpty(dropdownData[0].sSlaveId) ? 'sId' : 'sSlaveId'; | |
| 4043 | 3356 | const iDropdownIndex = dropdownData.findIndex(item => item[sId] === record[column.dataIndex]); |
| 4044 | 3357 | |
| 4045 | 3358 | if (text !== undefined && iDropdownIndex > -1) { |
| ... | ... | @@ -4047,21 +3360,13 @@ class CommonTableRc extends React.Component { |
| 4047 | 3360 | sValue = dropdownData[iDropdownIndex][sFieldName]; |
| 4048 | 3361 | } |
| 4049 | 3362 | } |
| 4050 | - if ( | |
| 4051 | - !commonUtils.isEmpty(this.state.searchText) && | |
| 4052 | - column.bFind && | |
| 4053 | - column.dataIndex === this.state.searchColumnName && | |
| 4054 | - column.dataIndex.substring(0, 1) !== "b" && | |
| 4055 | - column.dataIndex.substring(0, 1) !== "t" | |
| 4056 | - ) { | |
| 4057 | - return ( | |
| 4058 | - <Highlighter | |
| 4059 | - highlightStyle={{ backgroundColor: "#ffc069", padding: 0 }} | |
| 4060 | - searchWords={[this.state.searchText]} | |
| 4061 | - autoEscape | |
| 4062 | - textToHighlight={commonUtils.isEmpty(sValue) ? "" : sValue.toString()} | |
| 4063 | - /> | |
| 4064 | - ); | |
| 3363 | + if (!commonUtils.isEmpty(this.state.searchText) && column.bFind && column.dataIndex === this.state.searchColumnName && column.dataIndex.substring(0, 1) !== 'b' && column.dataIndex.substring(0, 1) !== 't') { | |
| 3364 | + return (<Highlighter | |
| 3365 | + highlightStyle={{ backgroundColor: '#ffc069', padding: 0 }} | |
| 3366 | + searchWords={[this.state.searchText]} | |
| 3367 | + autoEscape | |
| 3368 | + textToHighlight={commonUtils.isEmpty(sValue) ? '' : sValue.toString()} | |
| 3369 | + />); | |
| 4065 | 3370 | } else { |
| 4066 | 3371 | return this.bindShowType(props, text, record, column.dataIndex, index); |
| 4067 | 3372 | } |
| ... | ... | @@ -4076,77 +3381,71 @@ class CommonTableRc extends React.Component { |
| 4076 | 3381 | const { enabled, sUseInfo, app, masterData } = props; |
| 4077 | 3382 | /* 待用数据 */ |
| 4078 | 3383 | const showConfig = this.getShowConfig(props, sName); /* 配置信息 */ |
| 4079 | - if (commonUtils.isEmptyObject(showConfig)) { | |
| 4080 | - console.log("渲染失败:", showConfig, sName); | |
| 3384 | + if(commonUtils.isEmptyObject(showConfig)) { | |
| 3385 | + console.log('渲染失败:', showConfig, sName); | |
| 4081 | 3386 | } |
| 4082 | 3387 | /* 返回值 */ |
| 4083 | - let enabledNew = enabled && !showConfig.bReadonly && !record.bInvalid && commonUtils.isEmpty(sUseInfo); | |
| 3388 | + let enabledNew = (enabled && !showConfig.bReadonly && !record.bInvalid && commonUtils.isEmpty(sUseInfo)); | |
| 4084 | 3389 | if (showConfig.iTag === 1) { |
| 4085 | 3390 | enabledNew = false; |
| 4086 | 3391 | } else if (showConfig.iTag === 3) { |
| 4087 | - if (commonUtils.isNotEmptyObject(masterData) && !masterData.bCheck) { | |
| 3392 | + if(commonUtils.isNotEmptyObject(masterData) && !masterData.bCheck) { | |
| 4088 | 3393 | enabledNew = true; |
| 4089 | 3394 | } |
| 4090 | - } else if (record.rowTag === 1) { | |
| 4091 | - /* 当rowTag为1时,锁定该行不可编辑 */ | |
| 3395 | + } else if (record.rowTag === 1) { /* 当rowTag为1时,锁定该行不可编辑 */ | |
| 4092 | 3396 | enabledNew = false; |
| 4093 | - } else if (record.bInvLock) { | |
| 4094 | - /* 当bInvLock时,锁定该行不可编辑 */ | |
| 3397 | + } else if (record.bInvLock) { /* 当bInvLock时,锁定该行不可编辑 */ | |
| 4095 | 3398 | enabledNew = false; |
| 4096 | 3399 | } |
| 4097 | 3400 | /* 红冲中的单据 不可修改 */ |
| 4098 | - if ( | |
| 4099 | - commonUtils.isNotEmptyObject(masterData) && | |
| 4100 | - (commonUtils.isNotEmptyObject(masterData.sMinusSrcId) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) | |
| 4101 | - ) { | |
| 3401 | + if (commonUtils.isNotEmptyObject(masterData) && ((commonUtils.isNotEmptyObject(masterData.sMinusSrcId)) || commonUtils.isNotEmptyObject(masterData.sMinusUsed)) ) { | |
| 4102 | 3402 | enabledNew = false; |
| 4103 | - if (app?.currentPane?.copyTo?.name && app.currentPane.copyTo.name.toLowerCase().includes("portion")) { | |
| 3403 | + if (app?.currentPane?.copyTo?.name && app.currentPane.copyTo.name.toLowerCase().includes('portion')) { | |
| 4104 | 3404 | // 部分红冲中可修改的字段 |
| 4105 | - const iIndex = props.config.gdsconfigformslave.findIndex(item => item.sName === sName && item.sControlName.includes("portionField")); | |
| 3405 | + const iIndex = props.config.gdsconfigformslave.findIndex(item => item.sName === sName && item.sControlName.includes('portionField')); | |
| 4106 | 3406 | enabledNew = iIndex !== -1; |
| 4107 | 3407 | } |
| 4108 | 3408 | } |
| 4109 | 3409 | |
| 4110 | - enabledNew = this.getSelectRowEditState(sName, record, enabledNew); | |
| 3410 | + enabledNew= this.getSelectRowEditState(sName, record, enabledNew); | |
| 4111 | 3411 | |
| 4112 | - typeof props.otherlimitDisabled === "function" && (enabledNew = props.otherlimitDisabled({ enabledNew, record, sName })); | |
| 3412 | + typeof props.otherlimitDisabled === 'function' && (enabledNew = props.otherlimitDisabled({enabledNew, record, sName})); | |
| 4113 | 3413 | |
| 4114 | 3414 | const showConfigAll = this.getColorConfig(); /* 拿到颜色配置json */ |
| 4115 | 3415 | const showConfigArr = commonUtils.isNotEmptyArr(showConfigAll) ? showConfigAll.filter(item => item.sName === sName) : []; /* 找到该字段颜色配置 */ |
| 4116 | 3416 | const colorConditon = commonUtils.isNotEmptyArr(showConfigArr) ? showConfigArr[0].sColorTerms : null; |
| 4117 | - let styleColorArr = ""; | |
| 4118 | - if (commonUtils.isNotEmptyObject(colorConditon)) { | |
| 4119 | - let colorConditionArr = ""; | |
| 3417 | + let styleColorArr = ''; | |
| 3418 | + if (commonUtils.isNotEmptyObject((colorConditon))) { | |
| 3419 | + let colorConditionArr = ''; | |
| 4120 | 3420 | try { |
| 4121 | 3421 | colorConditionArr = JSON.parse(colorConditon); /* 转化为json */ |
| 4122 | 3422 | } catch (e) { |
| 4123 | - colorConditionArr = ""; | |
| 3423 | + colorConditionArr = ''; | |
| 4124 | 3424 | } |
| 4125 | - colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ""; | |
| 3425 | + colorConditionArr = Array.isArray(colorConditionArr) ? colorConditionArr : ''; | |
| 4126 | 3426 | for (const item of colorConditionArr) { |
| 4127 | - let styleColor = ""; | |
| 4128 | - const { column, condition, background, isRow } = item; | |
| 4129 | - if (!isRow) { | |
| 4130 | - /* 根据配置设置单元格颜色 */ | |
| 3427 | + let styleColor = ''; | |
| 3428 | + const { | |
| 3429 | + column, condition, background, isRow, | |
| 3430 | + } = item; | |
| 3431 | + if (!isRow) { /* 根据配置设置单元格颜色 */ | |
| 4131 | 3432 | let { conditionValue: conditionValueOld } = item; |
| 4132 | - const conditionValue = record[conditionValueOld] ? record[conditionValueOld] : conditionValueOld; | |
| 3433 | + const conditionValue = record[conditionValueOld] ? record[conditionValueOld]: conditionValueOld; | |
| 4133 | 3434 | if (column === sName && !commonUtils.isEmpty(record[column])) { |
| 4134 | - if (condition === "=") { | |
| 4135 | - styleColor = record[column] === conditionValue ? `SetCell_${background}` : ""; | |
| 4136 | - } else if (condition === "!=") { | |
| 4137 | - styleColor = record[column] != conditionValue ? `SetCell_${background}` : ""; | |
| 4138 | - } else if (condition === "like") { | |
| 4139 | - if (sName.substring(0, 1) === "s") { | |
| 4140 | - styleColor = record[column]?.indexOf(conditionValue) > -1 ? `SetCell_${color}` : ""; | |
| 4141 | - } | |
| 4142 | - } else if (condition === ">") { | |
| 4143 | - styleColor = record[column] > conditionValue ? `SetCell_${background}` : ""; | |
| 4144 | - } else if (condition === ">=") { | |
| 4145 | - styleColor = record[column] >= conditionValue ? `SetCell_${background}` : ""; | |
| 4146 | - } else if (condition === "<") { | |
| 4147 | - styleColor = record[column] < conditionValue ? `SetCell_${background}` : ""; | |
| 4148 | - } else if (condition === "<=") { | |
| 4149 | - styleColor = record[column] <= conditionValue ? `SetCell_${background}` : ""; | |
| 3435 | + if (condition === '=') { | |
| 3436 | + styleColor = record[column] === conditionValue ? `SetCell_${background}` : ''; | |
| 3437 | + } else if (condition === '!=') { | |
| 3438 | + styleColor = record[column] != conditionValue ? `SetCell_${background}` : ''; | |
| 3439 | + } else if (condition === 'like') { | |
| 3440 | + if (sName.substring(0, 1) === 's') { styleColor = record[column]?.indexOf(conditionValue) > -1 ? `SetCell_${color}` : ''; } | |
| 3441 | + } else if (condition === '>') { | |
| 3442 | + styleColor = record[column] > conditionValue ? `SetCell_${background}` : ''; | |
| 3443 | + } else if (condition === '>=') { | |
| 3444 | + styleColor = record[column] >= conditionValue ? `SetCell_${background}` : ''; | |
| 3445 | + } else if (condition === '<') { | |
| 3446 | + styleColor = record[column] < conditionValue ? `SetCell_${background}` : ''; | |
| 3447 | + } else if (condition === '<=') { | |
| 3448 | + styleColor = record[column] <= conditionValue ? `SetCell_${background}` : ''; | |
| 4150 | 3449 | } |
| 4151 | 3450 | } |
| 4152 | 3451 | } |
| ... | ... | @@ -4159,19 +3458,19 @@ class CommonTableRc extends React.Component { |
| 4159 | 3458 | name: props.name, |
| 4160 | 3459 | configName: props.configName, |
| 4161 | 3460 | sTabId: props.sTabId, |
| 4162 | - sId: record.sId /* 修改当前编号(数据格式:字符串) */, | |
| 4163 | - dataValue: text /* 本showType数据(数据格式:对象) */, | |
| 4164 | - enabled: enabledNew /* 是否是查看状态(数据格式:布尔) */, | |
| 4165 | - showConfig /* 关于本showType相关配置(数据格式:对象) */, | |
| 4166 | - tableConfig: props.config /* 表格的所有配置 */, | |
| 4167 | - formId: this.formId /* 窗体Id(数据格式:字符串) */, | |
| 4168 | - onChange: props.onDataChange /* 表单数据改变事件方法(数据格式:函数) */, | |
| 3461 | + sId: record.sId, /* 修改当前编号(数据格式:字符串) */ | |
| 3462 | + dataValue: text, /* 本showType数据(数据格式:对象) */ | |
| 3463 | + enabled: enabledNew, /* 是否是查看状态(数据格式:布尔) */ | |
| 3464 | + showConfig, /* 关于本showType相关配置(数据格式:对象) */ | |
| 3465 | + tableConfig: props.config, /* 表格的所有配置 */ | |
| 3466 | + formId: this.formId, /* 窗体Id(数据格式:字符串) */ | |
| 3467 | + onChange: props.onDataChange, /* 表单数据改变事件方法(数据格式:函数) */ | |
| 4169 | 3468 | onKeyDown: (...args) => { |
| 4170 | 3469 | props.onKeyDown && props.onKeyDown(...args, props.data); |
| 4171 | 3470 | }, |
| 4172 | - onInputClick: props.onInputClick /* 鼠标单击事件 */, | |
| 4173 | - onContextMenu: props.onContextMenu /* 字段右侧单击事件 */, | |
| 4174 | - bTable: true /* 是否为表格数据 */, | |
| 3471 | + onInputClick: props.onInputClick, /* 鼠标单击事件 */ | |
| 3472 | + onContextMenu: props.onContextMenu, /* 字段右侧单击事件 */ | |
| 3473 | + bTable: true, /* 是否为表格数据 */ | |
| 4175 | 3474 | getSqlDropDownData: props.getSqlDropDownData, |
| 4176 | 3475 | getSqlCondition: props.getSqlCondition, |
| 4177 | 3476 | handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord, |
| ... | ... | @@ -4185,9 +3484,9 @@ class CommonTableRc extends React.Component { |
| 4185 | 3484 | onPreviewOffice: this.handlePreviewOffice, |
| 4186 | 3485 | onDropdownVisibleChange: this.handleDropdownVisibleChange, |
| 4187 | 3486 | onFilterDropDownData: props.onFilterDropDownData, |
| 4188 | - onFieldPopupModal: this.handleFieldPopupModal /* 字段选择弹窗 */, | |
| 3487 | + onFieldPopupModal:this.handleFieldPopupModal, /* 字段选择弹窗 */ | |
| 4189 | 3488 | onFieldDoubleClick: this.props.onFieldDoubleClick, |
| 4190 | - onDropDownBlur: props.onDropDownBlur /* 下拉框多选离开事件 */, | |
| 3489 | + onDropDownBlur: props.onDropDownBlur, /* 下拉框多选离开事件 */ | |
| 4191 | 3490 | className: styleColorArr, |
| 4192 | 3491 | readOnly: props.readOnly, |
| 4193 | 3492 | onSaveState: props.onSaveState, |
| ... | ... | @@ -4201,130 +3500,131 @@ class CommonTableRc extends React.Component { |
| 4201 | 3500 | /** 获取上传控件的props */ |
| 4202 | 3501 | getUploadProps = () => { |
| 4203 | 3502 | return { |
| 4204 | - disabled: this.props.name === "picFile" ? !this.findIsUpdByControlName(this.props, "BtnUpload") : !this.props.enabled /* 是否可用 */, | |
| 4205 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isUploadShow) } /* 是否显示 */, | |
| 3503 | + disabled:this.props.name === 'picFile' ? !this.findIsUpdByControlName(this.props, 'BtnUpload') : !this.props.enabled, /* 是否可用 */ | |
| 3504 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isUploadShow) }, /* 是否显示 */ | |
| 4206 | 3505 | }; |
| 4207 | 3506 | }; |
| 4208 | 3507 | /** 获取下载控件的props */ |
| 4209 | 3508 | getDownProps = () => { |
| 4210 | 3509 | return { |
| 4211 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4212 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isDownloadShow) } /* 是否显示 */, | |
| 3510 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3511 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isDownloadShow) }, /* 是否显示 */ | |
| 4213 | 3512 | }; |
| 4214 | 3513 | }; |
| 4215 | 3514 | /** 获取查看控件的props */ |
| 4216 | 3515 | getLookProps = () => { |
| 4217 | 3516 | return { |
| 4218 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4219 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isLookShow) } /* 是否显示 */, | |
| 4220 | - onClick: this.handleLookRow /* 点击事件 */, | |
| 3517 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3518 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isLookShow) }, /* 是否显示 */ | |
| 3519 | + onClick: this.handleLookRow, /* 点击事件 */ | |
| 4221 | 3520 | }; |
| 4222 | 3521 | }; |
| 4223 | 3522 | /** 获取添加控件的props */ |
| 4224 | 3523 | getAddProps = () => { |
| 4225 | 3524 | return { |
| 4226 | - disabled: !this.props.enabled || this.findIsUpdByControlName(this.props, "BtnAdd") /* 是否可用 */, | |
| 4227 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isAddShow) } /* 是否显示 */, | |
| 4228 | - onClick: this.handleAddRow /* 点击事件 */, | |
| 3525 | + disabled: !this.props.enabled || this.findIsUpdByControlName(this.props, 'BtnAdd'), /* 是否可用 */ | |
| 3526 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isAddShow) }, /* 是否显示 */ | |
| 3527 | + onClick: this.handleAddRow, /* 点击事件 */ | |
| 4229 | 3528 | }; |
| 4230 | 3529 | }; |
| 4231 | 3530 | getModalPropsTableRow = () => { |
| 4232 | 3531 | return { |
| 4233 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4234 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isModalShow), margin: "0 10px" } /* 是否显示 */, | |
| 3532 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3533 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isModalShow), margin: '0 10px' }, /* 是否显示 */ | |
| 4235 | 3534 | }; |
| 4236 | 3535 | }; |
| 4237 | 3536 | getModalRemarkPropsTableRow = () => { |
| 4238 | 3537 | return { |
| 4239 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4240 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isModalRemarkShow) } /* 是否显示 */, | |
| 3538 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3539 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isModalRemarkShow) }, /* 是否显示 */ | |
| 4241 | 3540 | }; |
| 4242 | 3541 | }; |
| 4243 | 3542 | getChooseProcessPropsTableRow = () => { |
| 4244 | 3543 | return { |
| 4245 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4246 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isChooseProcessShow), margin: "0 10px" } /* 是否显示 */, | |
| 3544 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3545 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isChooseProcessShow), margin: '0 10px' }, /* 是否显示 */ | |
| 4247 | 3546 | }; |
| 4248 | 3547 | }; |
| 4249 | 3548 | getChooseProductProcessPropsTableRow = () => { |
| 4250 | 3549 | return { |
| 4251 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4252 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isChooseProductProcess), margin: "0 10px" } /* 是否显示 */, | |
| 3550 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3551 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isChooseProductProcess), margin: '0 10px' }, /* 是否显示 */ | |
| 4253 | 3552 | }; |
| 4254 | 3553 | }; |
| 4255 | 3554 | getChooseProductMaterialsPropsTableRow = () => { |
| 4256 | 3555 | return { |
| 4257 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4258 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isChooseProductMaterials), margin: "0 10px" } /* 是否显示 */, | |
| 3556 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3557 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isChooseProductMaterials), margin: '0 10px' }, /* 是否显示 */ | |
| 4259 | 3558 | }; |
| 4260 | 3559 | }; |
| 4261 | 3560 | getAddPropsTableRow = () => { |
| 4262 | 3561 | return { |
| 4263 | - disabled: !this.props.enabled || !this.findIsUpdByControlName(this.props, "BtnAdd") /* 是否可用 */, | |
| 4264 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isAddShow), margin: "0 10px" } /* 是否显示 */, | |
| 3562 | + disabled: !this.props.enabled || !this.findIsUpdByControlName(this.props, 'BtnAdd'), /* 是否可用 */ | |
| 3563 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isAddShow), margin: '0 10px' }, /* 是否显示 */ | |
| 4265 | 3564 | }; |
| 4266 | 3565 | }; |
| 4267 | 3566 | |
| 4268 | 3567 | getHeadPropsTableRow = () => { |
| 4269 | 3568 | return { |
| 4270 | - disabled: false /* 是否可用 */, | |
| 4271 | - style: { margin: "0 0" } /* 是否显示 */, | |
| 3569 | + disabled: false, /* 是否可用 */ | |
| 3570 | + style: { margin: '0 0' }, /* 是否显示 */ | |
| 4272 | 3571 | }; |
| 4273 | 3572 | }; |
| 4274 | 3573 | |
| 3574 | + | |
| 4275 | 3575 | /** 获取复制控件的props */ |
| 4276 | 3576 | getCopyProps = () => { |
| 4277 | 3577 | return { |
| 4278 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4279 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isCopyShow), margin: "0 10px" } /* 是否显示 */, | |
| 4280 | - onClick: this.handleCopyRow /* 点击事件 */, | |
| 3578 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3579 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isCopyShow), margin: '0 10px' }, /* 是否显示 */ | |
| 3580 | + onClick: this.handleCopyRow, /* 点击事件 */ | |
| 4281 | 3581 | }; |
| 4282 | 3582 | }; |
| 4283 | 3583 | |
| 4284 | 3584 | /** 获取复制全部控件的props */ |
| 4285 | 3585 | getCopyAllProps = () => { |
| 4286 | 3586 | return { |
| 4287 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4288 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isCopyAllShow), margin: "0 10px" } /* 是否显示 */, | |
| 4289 | - onClick: this.handleCopyAllRow /* 点击事件 */, | |
| 3587 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3588 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isCopyAllShow), margin: '0 10px' }, /* 是否显示 */ | |
| 3589 | + onClick: this.handleCopyAllRow, /* 点击事件 */ | |
| 4290 | 3590 | }; |
| 4291 | 3591 | }; |
| 4292 | 3592 | /** 获取删除控件的props */ |
| 4293 | 3593 | getDelProps = () => { |
| 4294 | 3594 | return { |
| 4295 | - disabled: !this.props.enabled || this.findIsUpdByControlName(this.props, "BtnDel") /* 是否可用 */, | |
| 4296 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isDelShow) } /* 是否显示 */, | |
| 4297 | - className: styles.del /* 样式名 */, | |
| 4298 | - onClick: this.handleDelRow /* 点击事件 */, | |
| 3595 | + disabled: !this.props.enabled || this.findIsUpdByControlName(this.props, 'BtnDel'), /* 是否可用 */ | |
| 3596 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isDelShow) }, /* 是否显示 */ | |
| 3597 | + className: styles.del, /* 样式名 */ | |
| 3598 | + onClick: this.handleDelRow, /* 点击事件 */ | |
| 4299 | 3599 | }; |
| 4300 | 3600 | }; |
| 4301 | 3601 | |
| 4302 | 3602 | getDelPropsTableRow = () => { |
| 4303 | 3603 | return { |
| 4304 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4305 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isDelShow), margin: "0 10px" } /* 是否显示 */, | |
| 4306 | - className: styles.del /* 样式名 */, | |
| 3604 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3605 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isDelShow), margin: '0 10px' }, /* 是否显示 */ | |
| 3606 | + className: styles.del, /* 样式名 */ | |
| 4307 | 3607 | }; |
| 4308 | 3608 | }; |
| 4309 | 3609 | getCopyMorePropsTableRow = () => { |
| 4310 | 3610 | return { |
| 4311 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4312 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isCopyMoreShow), margin: "0 10px" } /* 是否显示 */, | |
| 4313 | - className: styles.del /* 样式名 */, | |
| 3611 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3612 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isCopyMoreShow), margin: '0 10px' }, /* 是否显示 */ | |
| 3613 | + className: styles.del, /* 样式名 */ | |
| 4314 | 3614 | }; |
| 4315 | 3615 | }; |
| 4316 | 3616 | getPopupPropsTableRow = () => { |
| 4317 | 3617 | return { |
| 4318 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 4319 | - style: { display: commonUtils.convertBooleanToDisplayBlock(this.isPopupShow), margin: "0 10px" } /* 是否显示 */, | |
| 3618 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 3619 | + style: { display: commonUtils.convertBooleanToDisplayBlock(this.isPopupShow), margin: '0 10px' }, /* 是否显示 */ | |
| 4320 | 3620 | }; |
| 4321 | 3621 | }; |
| 4322 | 3622 | |
| 4323 | 3623 | getParamPropsTableRow = () => { |
| 4324 | 3624 | return { |
| 4325 | - disabled: !this.props.enabled /* 是否可用 */, | |
| 3625 | + disabled: !this.props.enabled, /* 是否可用 */ | |
| 4326 | 3626 | // style: { display: commonUtils.convertBooleanToDisplayBlock(this.isParamShow), margin: '0 10px' }, /* 是否显示 */ |
| 4327 | - style: { display: "block", margin: "0 10px" } /* 是否显示 */, | |
| 3627 | + style: { display: 'block', margin: '0 10px' }, /* 是否显示 */ | |
| 4328 | 3628 | }; |
| 4329 | 3629 | }; |
| 4330 | 3630 | /** 生成单元格stateMap */ |
| ... | ... | @@ -4334,37 +3634,34 @@ class CommonTableRc extends React.Component { |
| 4334 | 3634 | config = this.props.customConfig; |
| 4335 | 3635 | } else { |
| 4336 | 3636 | if (this.props.config) { |
| 4337 | - config = this.props.config.gdsconfigformslave; | |
| 3637 | + config = this.props.config.gdsconfigformslave | |
| 4338 | 3638 | } |
| 4339 | 3639 | } |
| 4340 | - this.mergeCellStateMap = | |
| 4341 | - config.length && | |
| 4342 | - config.reduce((prev, cur) => { | |
| 4343 | - if (cur.sName) { | |
| 4344 | - prev[cur.sName] = cur.bMergeCell; | |
| 4345 | - if (cur.bMergeCell) { | |
| 4346 | - this.mergeCellList.push(cur.sName); | |
| 4347 | - } | |
| 3640 | + this.mergeCellStateMap = config.length && config.reduce((prev, cur) => { | |
| 3641 | + if (cur.sName) { | |
| 3642 | + prev[cur.sName] = cur.bMergeCell; | |
| 3643 | + if (cur.bMergeCell) { | |
| 3644 | + this.mergeCellList.push(cur.sName); | |
| 4348 | 3645 | } |
| 4349 | - return { ...prev }; | |
| 4350 | - }, {}); | |
| 3646 | + } | |
| 3647 | + return { ...prev }; | |
| 3648 | + }, {}); | |
| 4351 | 3649 | } |
| 4352 | 3650 | genMergeInfoCellStateMap() { |
| 4353 | - this.mergeInfoCellStateMap = | |
| 4354 | - this.props.slaveInfo.config && | |
| 4355 | - this.props.slaveInfo.config.gdsconfigformslave.reduce((prev, cur) => { | |
| 4356 | - if (cur.sName) { | |
| 4357 | - prev[cur.sName] = cur.bMergeCell; | |
| 4358 | - } | |
| 4359 | - return { ...prev }; | |
| 4360 | - }, {}); | |
| 3651 | + this.mergeInfoCellStateMap = this.props.slaveInfo.config && this.props.slaveInfo.config.gdsconfigformslave.reduce((prev, cur) => { | |
| 3652 | + if (cur.sName) { | |
| 3653 | + prev[cur.sName] = cur.bMergeCell; | |
| 3654 | + } | |
| 3655 | + return { ...prev }; | |
| 3656 | + }, {}); | |
| 4361 | 3657 | } |
| 4362 | 3658 | /** 生成单元格list记录Map */ |
| 4363 | 3659 | genMergeListStateMap() { |
| 3660 | + | |
| 4364 | 3661 | let bPagination = true; /* 默认表格分页s */ |
| 4365 | 3662 | let pagination = {}; |
| 4366 | 3663 | if (commonUtils.isNotEmptyObject(this.props)) { |
| 4367 | - bPagination = commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination); | |
| 3664 | + bPagination = (commonUtils.isNotEmptyObject(this.props.tableProps) && commonUtils.isNotEmptyObject(this.props.tableProps.pagination)); | |
| 4368 | 3665 | pagination = this.props.tableProps.pagination; |
| 4369 | 3666 | } |
| 4370 | 3667 | |
| ... | ... | @@ -4393,7 +3690,7 @@ class CommonTableRc extends React.Component { |
| 4393 | 3690 | return; |
| 4394 | 3691 | } |
| 4395 | 3692 | /* 如果是树形 则返回 */ |
| 4396 | - if (this.props.sTableType && this.props.sTableType != "zero") { | |
| 3693 | + if(this.props.sTableType && this.props.sTableType !='zero') { | |
| 4397 | 3694 | return; |
| 4398 | 3695 | } |
| 4399 | 3696 | const obj = {}; |
| ... | ... | @@ -4407,10 +3704,10 @@ class CommonTableRc extends React.Component { |
| 4407 | 3704 | } |
| 4408 | 3705 | } |
| 4409 | 3706 | data.forEach((item, index) => { |
| 4410 | - const mergeCellData = config.filter(item => item.sName === "sMergeCellFiled"); /* 查找合并单元格的基准字段 */ | |
| 4411 | - const sMergeCellFiled = commonUtils.isNotEmptyArr(mergeCellData) ? mergeCellData[0].sActiveKey : ""; /* 基准字段 */ | |
| 3707 | + const mergeCellData = config.filter(item => item.sName === 'sMergeCellFiled'); /* 查找合并单元格的基准字段 */ | |
| 3708 | + const sMergeCellFiled = commonUtils.isNotEmptyArr(mergeCellData) ? mergeCellData[0].sActiveKey : ''; /* 基准字段 */ | |
| 4412 | 3709 | if (index === 0 && commonUtils.isNotEmptyArr(this.mergeCellList)) { |
| 4413 | - item.sColor = ""; | |
| 3710 | + item.sColor = ''; | |
| 4414 | 3711 | } |
| 4415 | 3712 | // 第一条数据不需要检测 |
| 4416 | 3713 | if (index !== 0) { |
| ... | ... | @@ -4418,11 +3715,7 @@ class CommonTableRc extends React.Component { |
| 4418 | 3715 | let flag = false; |
| 4419 | 3716 | for (const key in item) { |
| 4420 | 3717 | // 判断是否与上一个值相同 |
| 4421 | - if ( | |
| 4422 | - item[key] !== "" && | |
| 4423 | - item[key] === prevData[key] && | |
| 4424 | - (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true) | |
| 4425 | - ) { | |
| 3718 | + if (item[key] !== '' && item[key] === prevData[key] && (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true) ) { | |
| 4426 | 3719 | if (!obj[key]) { |
| 4427 | 3720 | obj[key] = []; |
| 4428 | 3721 | } |
| ... | ... | @@ -4434,26 +3727,23 @@ class CommonTableRc extends React.Component { |
| 4434 | 3727 | } |
| 4435 | 3728 | if (commonUtils.isNotEmptyArr(this.mergeCellList)) { |
| 4436 | 3729 | if (flag) { |
| 4437 | - item.sColor = sColorIndex % 2 === 0 ? "dark-record-row" : ""; | |
| 3730 | + item.sColor = sColorIndex % 2 === 0 ? 'dark-record-row' : ''; | |
| 4438 | 3731 | } else { |
| 4439 | 3732 | sColorIndex++; |
| 4440 | - item.sColor = sColorIndex % 2 === 0 ? "dark-record-row" : ""; | |
| 3733 | + item.sColor = sColorIndex % 2 === 0 ? 'dark-record-row' : ''; | |
| 4441 | 3734 | } |
| 4442 | 3735 | } |
| 4443 | 3736 | } |
| 4444 | 3737 | }); |
| 4445 | 3738 | for (const key in obj) { |
| 4446 | - obj[key] = obj[key] | |
| 4447 | - .reduce((prev, cur) => { | |
| 4448 | - if (prev.length && cur - prev[0][0] === 1) { | |
| 4449 | - prev[0].unshift(cur); | |
| 4450 | - } else { | |
| 4451 | - prev.unshift([cur]); | |
| 4452 | - } | |
| 4453 | - return prev; | |
| 4454 | - }, []) | |
| 4455 | - .reverse() | |
| 4456 | - .map(a => a.reverse()); | |
| 3739 | + obj[key] = obj[key].reduce((prev, cur) => { | |
| 3740 | + if (prev.length && (cur - prev[0][0]) === 1) { | |
| 3741 | + prev[0].unshift(cur); | |
| 3742 | + } else { | |
| 3743 | + prev.unshift([cur]); | |
| 3744 | + } | |
| 3745 | + return prev; | |
| 3746 | + }, []).reverse().map(a => a.reverse()); | |
| 4457 | 3747 | } |
| 4458 | 3748 | this.mergeCellListMap = obj; |
| 4459 | 3749 | } |
| ... | ... | @@ -4464,20 +3754,14 @@ class CommonTableRc extends React.Component { |
| 4464 | 3754 | } |
| 4465 | 3755 | const obj = {}; |
| 4466 | 3756 | this.curSlaveInfoData.forEach((item, index) => { |
| 4467 | - const mergeCellData = | |
| 4468 | - this.props.slaveInfo.config && | |
| 4469 | - this.props.slaveInfo.config.gdsconfigformslave.filter(item => item.sName === "sMergeCellFiled"); /* 查找合并单元格的基准字段 */ | |
| 4470 | - const sMergeCellFiled = commonUtils.isNotEmptyArr(mergeCellData) ? mergeCellData[0].sActiveKey : ""; /* 基准字段 */ | |
| 3757 | + const mergeCellData = this.props.slaveInfo.config && this.props.slaveInfo.config.gdsconfigformslave.filter(item => item.sName === 'sMergeCellFiled'); /* 查找合并单元格的基准字段 */ | |
| 3758 | + const sMergeCellFiled = commonUtils.isNotEmptyArr(mergeCellData) ? mergeCellData[0].sActiveKey : ''; /* 基准字段 */ | |
| 4471 | 3759 | // 第一条数据不需要检测 |
| 4472 | 3760 | if (index !== 0) { |
| 4473 | 3761 | const prevData = this.curSlaveInfoData[index - 1]; |
| 4474 | 3762 | for (const key in item) { |
| 4475 | 3763 | // 判断是否与上一个值相同 |
| 4476 | - if ( | |
| 4477 | - item[key] !== "" && | |
| 4478 | - item[key] === prevData[key] && | |
| 4479 | - (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true) | |
| 4480 | - ) { | |
| 3764 | + if (item[key] !== '' && item[key] === prevData[key] && (commonUtils.isNotEmptyObject(sMergeCellFiled) ? item[sMergeCellFiled] === prevData[sMergeCellFiled] : true) ) { | |
| 4481 | 3765 | if (!obj[key]) { |
| 4482 | 3766 | obj[key] = []; |
| 4483 | 3767 | } |
| ... | ... | @@ -4487,17 +3771,14 @@ class CommonTableRc extends React.Component { |
| 4487 | 3771 | } |
| 4488 | 3772 | }); |
| 4489 | 3773 | for (const key in obj) { |
| 4490 | - obj[key] = obj[key] | |
| 4491 | - .reduce((prev, cur) => { | |
| 4492 | - if (prev.length && cur - prev[0][0] === 1) { | |
| 4493 | - prev[0].unshift(cur); | |
| 4494 | - } else { | |
| 4495 | - prev.unshift([cur]); | |
| 4496 | - } | |
| 4497 | - return prev; | |
| 4498 | - }, []) | |
| 4499 | - .reverse() | |
| 4500 | - .map(a => a.reverse()); | |
| 3774 | + obj[key] = obj[key].reduce((prev, cur) => { | |
| 3775 | + if (prev.length && (cur - prev[0][0]) === 1) { | |
| 3776 | + prev[0].unshift(cur); | |
| 3777 | + } else { | |
| 3778 | + prev.unshift([cur]); | |
| 3779 | + } | |
| 3780 | + return prev; | |
| 3781 | + }, []).reverse().map(a => a.reverse()); | |
| 4501 | 3782 | } |
| 4502 | 3783 | this.mergeInfoCellListMap = obj; |
| 4503 | 3784 | } |
| ... | ... | @@ -4505,11 +3786,11 @@ class CommonTableRc extends React.Component { |
| 4505 | 3786 | modalTbRow = (record, tableName) => { |
| 4506 | 3787 | this.handleModalRow(record, tableName); |
| 4507 | 3788 | }; |
| 4508 | - modalRemarkTbRow = async record => { | |
| 3789 | + modalRemarkTbRow = async (record) => { | |
| 4509 | 3790 | await this.onRowClick(record); |
| 4510 | 3791 | this.handleModalRemarkRow(record); |
| 4511 | 3792 | }; |
| 4512 | - chooseProcessTbRow = record => { | |
| 3793 | + chooseProcessTbRow = (record) => { | |
| 4513 | 3794 | this.handleChooseProcessRow(record); |
| 4514 | 3795 | }; |
| 4515 | 3796 | |
| ... | ... | @@ -4523,11 +3804,11 @@ class CommonTableRc extends React.Component { |
| 4523 | 3804 | this.handleChooseProductMaterialsRow(index, record); |
| 4524 | 3805 | }; |
| 4525 | 3806 | |
| 4526 | - addTbRow = index => { | |
| 3807 | + addTbRow = (index) => { | |
| 4527 | 3808 | this.handleAddRow(index); |
| 4528 | 3809 | }; |
| 4529 | 3810 | |
| 4530 | - addTbRowInHeader = index => { | |
| 3811 | + addTbRowInHeader = (index) => { | |
| 4531 | 3812 | this.handleAddRow(index, this.props.bModalAdd); |
| 4532 | 3813 | }; |
| 4533 | 3814 | |
| ... | ... | @@ -4545,43 +3826,30 @@ class CommonTableRc extends React.Component { |
| 4545 | 3826 | const { rowTag, sWorkorderNo } = record; |
| 4546 | 3827 | const { enabled } = this.props; |
| 4547 | 3828 | if (enabled && rowTag === 1) { |
| 4548 | - const warning = commonFunc.showMessage(this.props.app.commonConst, "beUsed"); /* 复制部件 */ | |
| 3829 | + const warning = commonFunc.showMessage(this.props.app.commonConst, 'beUsed');/* 复制部件 */ | |
| 4549 | 3830 | const { sModelsType } = this.props.app.currentPane; |
| 4550 | - if (sModelsType.includes("sales/")) { | |
| 3831 | + if (sModelsType.includes('sales/')) { | |
| 4551 | 3832 | message.error(warning + sWorkorderNo); |
| 4552 | 3833 | } |
| 4553 | 3834 | } else { |
| 4554 | 3835 | return null; |
| 4555 | 3836 | } |
| 4556 | 3837 | }; |
| 4557 | - handleSelectCancel = modelVisible => { | |
| 3838 | + handleSelectCancel = (modelVisible) => { | |
| 4558 | 3839 | this.setState({ |
| 4559 | - [modelVisible]: false, | |
| 3840 | + [modelVisible]:false, | |
| 4560 | 3841 | }); |
| 4561 | 3842 | }; |
| 4562 | 3843 | handleSelectCommonPopup = (name, selectConfig, selectData) => { |
| 4563 | - const { | |
| 4564 | - commonPopupTbName, | |
| 4565 | - commonPopupShowConfig, | |
| 4566 | - commonFieldPopupVisible, | |
| 4567 | - commonPopupVisible, | |
| 4568 | - commonFieldPopupTbName, | |
| 4569 | - commonFieldPopupShowConfig, | |
| 4570 | - commonModalVisible, | |
| 4571 | - commonModalShowConfig, | |
| 4572 | - commonModalTbName, | |
| 4573 | - } = this.state; | |
| 3844 | + const { commonPopupTbName, commonPopupShowConfig, commonFieldPopupVisible, commonPopupVisible, commonFieldPopupTbName, commonFieldPopupShowConfig, | |
| 3845 | + commonModalVisible, commonModalShowConfig, commonModalTbName } = this.state; | |
| 4574 | 3846 | /* 若是产品名称弹窗 并且配置了调用产品工艺卡标识copyFromTechnology 则走自己的逻辑 */ |
| 4575 | - if (selectConfig.sCompareColor === "copyFromTechnology") { | |
| 3847 | + if(selectConfig.sCompareColor === 'copyFromTechnology') { | |
| 4576 | 3848 | this.props.onSelectCommonPopupProduct(name, selectConfig, selectData, commonPopupTbName, commonPopupShowConfig); |
| 4577 | 3849 | } else { |
| 4578 | - let tb = commonPopupVisible | |
| 4579 | - ? { name: commonPopupTbName, config: commonPopupShowConfig } | |
| 4580 | - : commonFieldPopupVisible | |
| 4581 | - ? { name: commonFieldPopupTbName, config: commonFieldPopupShowConfig } | |
| 4582 | - : undefined; | |
| 4583 | - tb = commonModalVisible ? { name: commonModalTbName, config: commonModalShowConfig } : tb; | |
| 4584 | - if (selectConfig.sControlName?.startsWith("BtnPopupEdit")) { | |
| 3850 | + let tb = commonPopupVisible ? { name: commonPopupTbName, config: commonPopupShowConfig } : commonFieldPopupVisible ? { name: commonFieldPopupTbName, config: commonFieldPopupShowConfig } : undefined; | |
| 3851 | + tb = commonModalVisible ? { name: commonModalTbName, config: commonModalShowConfig }: tb; | |
| 3852 | + if (selectConfig.sControlName?.startsWith('BtnPopupEdit')) { | |
| 4585 | 3853 | this.props.onSelectCommonPopup(name, selectConfig, selectData, tb?.name, tb?.config, { index: this.rowClickRef.current }); |
| 4586 | 3854 | return; |
| 4587 | 3855 | } |
| ... | ... | @@ -4594,10 +3862,10 @@ class CommonTableRc extends React.Component { |
| 4594 | 3862 | this.props.onSelectCommonPopup(name, selectConfig, selectData, commonFieldPopupTbName, commonFieldPopupShowConfig); |
| 4595 | 3863 | }; |
| 4596 | 3864 | |
| 4597 | - copyTbRow = index => { | |
| 3865 | + copyTbRow = (index) => { | |
| 4598 | 3866 | this.handleCopyRow(index); |
| 4599 | 3867 | }; |
| 4600 | - copyAllTbRow = index => { | |
| 3868 | + copyAllTbRow = (index) => { | |
| 4601 | 3869 | this.handleCopyAllRow(index); |
| 4602 | 3870 | }; |
| 4603 | 3871 | downloadTbRow = (index, record) => { |
| ... | ... | @@ -4615,23 +3883,19 @@ class CommonTableRc extends React.Component { |
| 4615 | 3883 | |
| 4616 | 3884 | exitTbRow = (index, record) => { |
| 4617 | 3885 | this.props.onExitTbRow(index, record); |
| 4618 | - }; | |
| 3886 | + } | |
| 4619 | 3887 | handleViewClick = (name, sName, record, index, showConfig, configName) => { |
| 4620 | 3888 | // console.log('vvvs', showConfig); |
| 4621 | 3889 | if (commonUtils.isNotEmptyObject(showConfig) && commonUtils.isNotEmptyObject(record)) { |
| 4622 | 3890 | const printPdf = showConfig.sControlName; /* 工单号配置调到打印界面,跳转打印页面 */ |
| 4623 | - const sActiveKey = showConfig.sActiveKey; /* 弹出界面对应数据主字段 */ | |
| 4624 | - if (commonUtils.isNotEmptyObject(printPdf) && printPdf === "printPdf" && commonUtils.isNotEmptyObject(sActiveKey)) { | |
| 3891 | + const sActiveKey = showConfig.sActiveKey;/* 弹出界面对应数据主字段 */ | |
| 3892 | + if (commonUtils.isNotEmptyObject(printPdf) && printPdf === 'printPdf' && commonUtils.isNotEmptyObject(sActiveKey)) { | |
| 4625 | 3893 | const token = this.props.app.token; |
| 4626 | - const sActiveId = | |
| 4627 | - showConfig.sActiveId === "1" ? (commonUtils.isEmpty(record.sFormId) ? record.sSrcFormId : record.sFormId) : showConfig.sActiveId; | |
| 3894 | + const sActiveId = showConfig.sActiveId === '1' ? commonUtils.isEmpty(record.sFormId) ? record.sSrcFormId : record.sFormId : showConfig.sActiveId; | |
| 4628 | 3895 | const printsId = record[sActiveKey]; |
| 4629 | - const urlPrint = `${ | |
| 4630 | - commonConfig.file_host | |
| 4631 | - }printReport/printPdfByFromDataId/${printsId}.pdf?sModelsId=${sActiveId}&sId=${printsId}&token=${encodeURIComponent(token)}`; | |
| 3896 | + const urlPrint = `${commonConfig.file_host}printReport/printPdfByFromDataId/${printsId}.pdf?sModelsId=${sActiveId}&sId=${printsId}&token=${encodeURIComponent(token)}`; | |
| 4632 | 3897 | window.open(urlPrint); |
| 4633 | - } else if (showConfig.sActiveId === "172129113112117442504826460") { | |
| 4634 | - // 生成拼板 | |
| 3898 | + } else if (showConfig.sActiveId === "172129113112117442504826460") { // 生成拼板 | |
| 4635 | 3899 | if (record.bMakeUpEnd) { |
| 4636 | 3900 | this.props.onSaveState({ |
| 4637 | 3901 | makeUpPDFRecord: record, |
| ... | ... | @@ -4639,8 +3903,7 @@ class CommonTableRc extends React.Component { |
| 4639 | 3903 | } else { |
| 4640 | 3904 | message.info("请先完成拼版!"); |
| 4641 | 3905 | } |
| 4642 | - } else if (showConfig.sDropDownType && showConfig.sDropDownType.toLowerCase().includes("picarrmodal")) { | |
| 4643 | - /* 蓝色链接跳转用Modal呈现 */ | |
| 3906 | + } else if (showConfig.sDropDownType && showConfig.sDropDownType.toLowerCase().includes('picarrmodal')) { /* 蓝色链接跳转用Modal呈现 */ | |
| 4644 | 3907 | // this.props.onTabModalClick(name, sName, record, index, showConfig, configName); |
| 4645 | 3908 | this.handleTabModalClick(name, sName, record, index, showConfig, configName); |
| 4646 | 3909 | return; |
| ... | ... | @@ -4658,32 +3921,31 @@ class CommonTableRc extends React.Component { |
| 4658 | 3921 | |
| 4659 | 3922 | handleHideModal = () => { |
| 4660 | 3923 | let antModalRootEl = null; |
| 4661 | - const bInModal = el => { | |
| 3924 | + const bInModal = (el) => { | |
| 4662 | 3925 | if (commonUtils.isEmpty(el) || commonUtils.isEmpty(el.classList)) { |
| 4663 | 3926 | return false; |
| 4664 | - } else if (el.classList.contains("ant-modal-root")) { | |
| 3927 | + } else if (el.classList.contains('ant-modal-root')) { | |
| 4665 | 3928 | antModalRootEl = el; |
| 4666 | 3929 | return true; |
| 4667 | 3930 | } else { |
| 4668 | 3931 | return bInModal(el.parentNode); |
| 4669 | 3932 | } |
| 4670 | - }; | |
| 4671 | - if (bInModal(event.target)) { | |
| 4672 | - // 如果是在modal里的表格,不允许跳转 | |
| 3933 | + } | |
| 3934 | + if (bInModal(event.target)) { // 如果是在modal里的表格,不允许跳转 | |
| 4673 | 3935 | const activeTab = document.querySelector('#navTabWrap .ant-tabs-nav-list>div[class*="ant-tabs-tab-active"]'); |
| 4674 | 3936 | if (activeTab) { |
| 4675 | - const modalId = activeTab.getAttribute("data-node-key"); | |
| 4676 | - antModalRootEl.style.display = "none"; | |
| 4677 | - antModalRootEl.setAttribute("data-attr-modalId", "modalId_" + modalId); | |
| 3937 | + const modalId = activeTab.getAttribute('data-node-key') | |
| 3938 | + antModalRootEl.style.display = 'none'; | |
| 3939 | + antModalRootEl.setAttribute('data-attr-modalId', 'modalId_' + modalId); | |
| 4678 | 3940 | } else { |
| 4679 | 3941 | return false; |
| 4680 | 3942 | } |
| 4681 | 3943 | } |
| 4682 | 3944 | return true; |
| 4683 | - }; | |
| 3945 | + } | |
| 4684 | 3946 | |
| 4685 | 3947 | /* 快捷键跳转 */ |
| 4686 | - handleQuickViewClick = async (name, sName, record, index, myConfigArr) => { | |
| 3948 | + handleQuickViewClick = async (name, sName, record, index , myConfigArr) => { | |
| 4687 | 3949 | const { |
| 4688 | 3950 | slaveConfig, |
| 4689 | 3951 | slaveData, |
| ... | ... | @@ -4701,11 +3963,11 @@ class CommonTableRc extends React.Component { |
| 4701 | 3963 | // masterData, |
| 4702 | 3964 | // employeeConfig, |
| 4703 | 3965 | } = this.props; |
| 4704 | - let picArr = ""; | |
| 4705 | - if (commonUtils.isNotEmptyArr(slaveConfig)) { | |
| 4706 | - picArr = slaveConfig.gdsconfigformslave.filter(item => item.sName === sName); | |
| 3966 | + let picArr = '' | |
| 3967 | + if(commonUtils.isNotEmptyArr(slaveConfig)){ | |
| 3968 | + picArr = slaveConfig.gdsconfigformslave.filter(item => (item.sName === sName)); | |
| 4707 | 3969 | } |
| 4708 | - if (commonUtils.isNotEmptyArr(myConfigArr)) { | |
| 3970 | + if(commonUtils.isNotEmptyArr(myConfigArr)) { | |
| 4709 | 3971 | picArr = myConfigArr; |
| 4710 | 3972 | } |
| 4711 | 3973 | if (picArr.length > 0) { |
| ... | ... | @@ -4714,60 +3976,59 @@ class CommonTableRc extends React.Component { |
| 4714 | 3976 | const iIndex = index; |
| 4715 | 3977 | const [{ sActiveId }] = picArr; |
| 4716 | 3978 | let [{ sActiveKey }] = picArr; |
| 4717 | - const sFormId = sActiveId === "1" ? (commonUtils.isEmpty(tableDataRow.sFormId) ? tableDataRow.sSrcFormId : tableDataRow.sFormId) : sActiveId; | |
| 4718 | - if (commonUtils.isNotEmptyObject(sActiveKey) && sActiveKey.includes(".")) { | |
| 4719 | - /* 接口按钮跳转 如果有slave.对应字段 则需要取出对应字段 */ | |
| 4720 | - const index = sActiveKey.lastIndexOf("."); | |
| 3979 | + const sFormId = sActiveId === '1' ? commonUtils.isEmpty(tableDataRow.sFormId) ? tableDataRow.sSrcFormId : tableDataRow.sFormId : sActiveId; | |
| 3980 | + if (commonUtils.isNotEmptyObject(sActiveKey) && sActiveKey.includes('.')) { /* 接口按钮跳转 如果有slave.对应字段 则需要取出对应字段 */ | |
| 3981 | + const index = sActiveKey.lastIndexOf('.'); | |
| 4721 | 3982 | sActiveKey = sActiveKey.substring(index + 1, sActiveKey.length); |
| 4722 | 3983 | } |
| 4723 | 3984 | const sNameUrl = `${commonConfig.server_host}gdsmodule/getGdsmoduleById/${sFormId}?sModelsId=${sFormId}&sName=${formRoute}`; |
| 4724 | 3985 | const filterCondition = []; |
| 4725 | 3986 | const conditionValues = this.props.getSqlCondition(picArr[0], name, tableDataRow); |
| 4726 | 3987 | if (!commonUtils.isEmpty(conditionValues)) { |
| 4727 | - Object.keys(conditionValues).forEach(item => { | |
| 4728 | - if (item === "tStartDate_pro" || item.substring(0, 1) === "p") { | |
| 3988 | + Object.keys(conditionValues).forEach((item) => { | |
| 3989 | + if ((item === 'tStartDate_pro' || item.substring(0, 1) === 'p')) { | |
| 4729 | 3990 | if (!commonUtils.isEmpty(conditionValues[item]) && conditionValues[item].length >= 2) { |
| 4730 | 3991 | const tStartDate = moment(conditionValues[item][0]).format(this.sDateFormat); |
| 4731 | - const tEndDate = moment(conditionValues[item][1]).add(1, "days").format(this.sDateFormat); | |
| 3992 | + const tEndDate = moment(conditionValues[item][1]).add(1, 'days').format(this.sDateFormat); | |
| 4732 | 3993 | filterCondition.push({ |
| 4733 | 3994 | bFilterName: item, |
| 4734 | - bFilterCondition: "=", | |
| 3995 | + bFilterCondition: '=', | |
| 4735 | 3996 | bFilterValue: `${tStartDate},${tEndDate}`, |
| 4736 | 3997 | }); |
| 4737 | 3998 | } |
| 4738 | - } else if (item === "mStartDate_pro" || item.substring(0, 1) === "m") { | |
| 3999 | + } else if ((item === 'mStartDate_pro' || item.substring(0, 1) === 'm')) { | |
| 4739 | 4000 | if (!commonUtils.isEmpty(conditionValues[item])) { |
| 4740 | - const tStartDate = moment(conditionValues[item]).startOf("month").format(this.sDateFormat); | |
| 4741 | - const tEndDate = moment(conditionValues[item]).endOf("month").add(1, "days").format(this.sDateFormat); | |
| 4001 | + const tStartDate = moment(conditionValues[item]).startOf('month').format(this.sDateFormat); | |
| 4002 | + const tEndDate = moment(conditionValues[item]).endOf('month').add(1, 'days').format(this.sDateFormat); | |
| 4742 | 4003 | filterCondition.push({ |
| 4743 | 4004 | bFilterName: `t${item.substring(1, item.length)}`, |
| 4744 | - bFilterCondition: "=", | |
| 4005 | + bFilterCondition: '=', | |
| 4745 | 4006 | bFilterValue: `${tStartDate},${tEndDate}`, |
| 4746 | 4007 | }); |
| 4747 | 4008 | } |
| 4748 | - } else if (item.substring(0, 1) === "t") { | |
| 4009 | + } else if (item.substring(0, 1) === 't') { | |
| 4749 | 4010 | filterCondition.push({ |
| 4750 | 4011 | bFilterName: item, |
| 4751 | - bFilterCondition: "=", | |
| 4012 | + bFilterCondition: '=', | |
| 4752 | 4013 | bFilterValue: moment(conditionValues[item]).format(this.sDateFormat), |
| 4753 | 4014 | }); |
| 4754 | 4015 | } else { |
| 4755 | 4016 | filterCondition.push({ |
| 4756 | 4017 | bFilterName: item, |
| 4757 | - bFilterCondition: "=", | |
| 4018 | + bFilterCondition: '=', | |
| 4758 | 4019 | bFilterValue: conditionValues[item], |
| 4759 | 4020 | }); |
| 4760 | 4021 | } |
| 4761 | 4022 | }); |
| 4762 | 4023 | } |
| 4763 | 4024 | this.props.dispatch({ |
| 4764 | - type: "content/onRouter", | |
| 4025 | + type: 'content/onRouter', | |
| 4765 | 4026 | payload: { |
| 4766 | 4027 | url: sNameUrl, |
| 4767 | - refresh: getConfig.bind(this, name, sModelsId) /* 刷新方法 */, | |
| 4028 | + refresh: getConfig.bind(this, name, sModelsId), /* 刷新方法 */ | |
| 4768 | 4029 | sTabId: commonUtils.createSid(), |
| 4769 | 4030 | // sParentId: this.state.sTabId, |
| 4770 | - urlDataType: "newPane", | |
| 4031 | + urlDataType: 'newPane', | |
| 4771 | 4032 | checkedId: myConfigArr[0].sId, |
| 4772 | 4033 | sName: myConfigArr[0].sName, |
| 4773 | 4034 | bFilter: slaveFilterCondition, |
| ... | ... | @@ -4784,28 +4045,26 @@ class CommonTableRc extends React.Component { |
| 4784 | 4045 | }; |
| 4785 | 4046 | |
| 4786 | 4047 | /* 文件下载 */ |
| 4787 | - handleFileDownload = fileUrl => { | |
| 4788 | - const fileList = fileUrl.split(","); | |
| 4048 | + handleFileDownload = (fileUrl) => { | |
| 4049 | + const fileList = fileUrl.split(','); | |
| 4789 | 4050 | fileList.forEach(item => { |
| 4790 | - let fileName = item.substring(item.lastIndexOf("/") + 1); | |
| 4791 | - fileName = fileName.substring(fileName.indexOf("_") + 1); | |
| 4792 | - const filepath = `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(item)}&sModelsId=100&token=${encodeURIComponent( | |
| 4793 | - this.props.app.token | |
| 4794 | - )}`; | |
| 4051 | + let fileName = item.substring(item.lastIndexOf('/') + 1); | |
| 4052 | + fileName = fileName.substring(fileName.indexOf('_') + 1); | |
| 4053 | + const filepath = `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(item)}&sModelsId=100&token=${encodeURIComponent(this.props.app.token)}`; | |
| 4795 | 4054 | const xhr = new XMLHttpRequest(); |
| 4796 | - xhr.open("get", filepath); | |
| 4797 | - xhr.responseType = "blob"; | |
| 4055 | + xhr.open('get', filepath); | |
| 4056 | + xhr.responseType = 'blob'; | |
| 4798 | 4057 | xhr.send(); |
| 4799 | 4058 | xhr.onload = function () { |
| 4800 | 4059 | if (this.status === 200 || this.status === 304) { |
| 4801 | 4060 | // 如果是IE10及以上,不支持download属性,采用msSaveOrOpenBlob方法,但是IE10以下也不支持msSaveOrOpenBlob |
| 4802 | - if ("msSaveOrOpenBlob" in navigator) { | |
| 4061 | + if ('msSaveOrOpenBlob' in navigator) { | |
| 4803 | 4062 | navigator.msSaveOrOpenBlob(this.response, fileName); |
| 4804 | 4063 | return; |
| 4805 | 4064 | } |
| 4806 | 4065 | const url = URL.createObjectURL(this.response); |
| 4807 | - const a = document.createElement("a"); | |
| 4808 | - a.style.display = "none"; | |
| 4066 | + const a = document.createElement('a'); | |
| 4067 | + a.style.display = 'none'; | |
| 4809 | 4068 | a.href = url; |
| 4810 | 4069 | a.download = fileName; |
| 4811 | 4070 | document.body.appendChild(a); |
| ... | ... | @@ -4814,15 +4073,15 @@ class CommonTableRc extends React.Component { |
| 4814 | 4073 | URL.revokeObjectURL(url); |
| 4815 | 4074 | } |
| 4816 | 4075 | }; |
| 4817 | - }); | |
| 4818 | - }; | |
| 4076 | + }) | |
| 4077 | + }; | |
| 4819 | 4078 | |
| 4820 | 4079 | /* 所有备注非编辑状态下点击链接可以弹出备注窗体 */ |
| 4821 | 4080 | handleMemoShow = (name, sName, record, index, showConfig) => { |
| 4822 | 4081 | if (commonUtils.isNotEmptyObject(record)) { |
| 4823 | 4082 | const sMemo = showConfig.sName; |
| 4824 | 4083 | const title = showConfig.showName; |
| 4825 | - if (sName.includes("sTemplateFullMemo")) { | |
| 4084 | + if (sName.includes('sTemplateFullMemo')) { | |
| 4826 | 4085 | return this.setState({ simpleModalVisible: true, simpleModalWord: record[sName] }); |
| 4827 | 4086 | } |
| 4828 | 4087 | const sCurrMemoProps = { |
| ... | ... | @@ -4837,31 +4096,31 @@ class CommonTableRc extends React.Component { |
| 4837 | 4096 | }; |
| 4838 | 4097 | this.props.onSaveState({ sCurrMemoProps }); |
| 4839 | 4098 | } |
| 4840 | - }; | |
| 4841 | - handleViewChoose = (name, sName, record, index) => { | |
| 4099 | + } | |
| 4100 | + handleViewChoose= (name, sName, record, index) => { | |
| 4842 | 4101 | this.props.onViewChoose(name, sName, record, index); |
| 4843 | - }; | |
| 4102 | + } | |
| 4844 | 4103 | /* 弹出通用窗体 */ |
| 4845 | - handlePopupModal = (showConfig, name) => { | |
| 4104 | + handlePopupModal= (showConfig, name) => { | |
| 4846 | 4105 | this.setState({ |
| 4847 | - commonPopupVisible: true, | |
| 4848 | - commonPopupTbName: name, | |
| 4849 | - commonPopupShowConfig: showConfig, | |
| 4106 | + commonPopupVisible:true, | |
| 4107 | + commonPopupTbName:name, | |
| 4108 | + commonPopupShowConfig:showConfig, | |
| 4850 | 4109 | }); |
| 4851 | - }; | |
| 4110 | + } | |
| 4852 | 4111 | |
| 4853 | 4112 | /* 字段弹窗 */ |
| 4854 | - handleFieldPopupModal = (showConfig, name, record) => { | |
| 4113 | + handleFieldPopupModal= (showConfig, name, record) => { | |
| 4855 | 4114 | this.setState({ |
| 4856 | - commonFieldPopupVisible: true, | |
| 4857 | - commonFieldPopupTbName: name, | |
| 4858 | - commonFieldPopupShowConfig: showConfig, | |
| 4115 | + commonFieldPopupVisible:true, | |
| 4116 | + commonFieldPopupTbName:name, | |
| 4117 | + commonFieldPopupShowConfig:showConfig, | |
| 4859 | 4118 | commonFieldPopupShowRecord: record, |
| 4860 | 4119 | }); |
| 4861 | - }; | |
| 4120 | + } | |
| 4862 | 4121 | |
| 4863 | 4122 | /* 蓝色链接弹出通用窗体 */ |
| 4864 | - handleTabModalClick = (name, sName, record, index, showConfig, configName) => { | |
| 4123 | + handleTabModalClick= (name, sName, record, index, showConfig, configName) => { | |
| 4865 | 4124 | // const { sourceAllData:data } = this.props; |
| 4866 | 4125 | // let commonModalData = []; |
| 4867 | 4126 | // if(sName === 'dSumCompleteAvailableStockQty' && commonUtils.isNotEmptyArr(data)) { |
| ... | ... | @@ -4870,14 +4129,14 @@ class CommonTableRc extends React.Component { |
| 4870 | 4129 | // item.bSecondMainMaterials); |
| 4871 | 4130 | // } |
| 4872 | 4131 | this.setState({ |
| 4873 | - commonModalVisible: true, | |
| 4874 | - commonModalTbName: name, | |
| 4875 | - commonModalShowConfig: showConfig, | |
| 4876 | - commonModalRecord: record, | |
| 4877 | - commonModalConfigName: configName, | |
| 4132 | + commonModalVisible:true, | |
| 4133 | + commonModalTbName:name, | |
| 4134 | + commonModalShowConfig:showConfig, | |
| 4135 | + commonModalRecord:record, | |
| 4136 | + commonModalConfigName:configName, | |
| 4878 | 4137 | // commonModalData, |
| 4879 | 4138 | }); |
| 4880 | - }; | |
| 4139 | + } | |
| 4881 | 4140 | |
| 4882 | 4141 | handleCellClick = (record) => { |
| 4883 | 4142 | const { enabled } = this.props; |
| ... | ... | @@ -4940,19 +4199,17 @@ class CommonTableRc extends React.Component { |
| 4940 | 4199 | } |
| 4941 | 4200 | |
| 4942 | 4201 | /* 点击图片预览 */ |
| 4943 | - handlePreviewImage = (e, dataUrlArr) => { | |
| 4944 | - e.stopPropagation(); /* 阻止父级穿透 */ | |
| 4202 | + handlePreviewImage= (e, dataUrlArr) => { | |
| 4203 | + e.stopPropagation(); /* 阻止父级穿透 */ | |
| 4945 | 4204 | if (commonUtils.isNotEmptyObject(dataUrlArr)) { |
| 4946 | 4205 | const { token } = this.props.app; |
| 4947 | 4206 | const previewImageArr = []; |
| 4948 | - dataUrlArr.forEach((item = "") => { | |
| 4949 | - const dataPreviewUrl = item.includes("xlyerpfiles") | |
| 4950 | - ? `${commonConfig.file_host}file/download?savePathStr=${item}&sModelsId=100&token=${token}` | |
| 4951 | - : item; /* 预览 */ | |
| 4207 | + dataUrlArr.forEach((item = '') => { | |
| 4208 | + const dataPreviewUrl = item.includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${item}&sModelsId=100&token=${token}` : item; /* 预览 */ | |
| 4952 | 4209 | previewImageArr.push(dataPreviewUrl); |
| 4953 | 4210 | }); |
| 4954 | 4211 | this.setState({ |
| 4955 | - previewImage: previewImageArr, | |
| 4212 | + previewImage:previewImageArr, | |
| 4956 | 4213 | previewVisible: true, |
| 4957 | 4214 | showimgs: true, |
| 4958 | 4215 | firstIndex: 0, |
| ... | ... | @@ -4961,14 +4218,14 @@ class CommonTableRc extends React.Component { |
| 4961 | 4218 | }; |
| 4962 | 4219 | |
| 4963 | 4220 | // office文件预览 |
| 4964 | - handlePreviewOffice = dataUrlArr => { | |
| 4221 | + handlePreviewOffice = (dataUrlArr) => { | |
| 4965 | 4222 | this.setState({ |
| 4966 | 4223 | officePreviewVisible: true, |
| 4967 | - officeFileUrl: dataUrlArr, | |
| 4224 | + officeFileUrl: dataUrlArr | |
| 4968 | 4225 | }); |
| 4969 | 4226 | }; |
| 4970 | 4227 | |
| 4971 | - handleDropdownVisibleChange = open => { | |
| 4228 | + handleDropdownVisibleChange = (open) => { | |
| 4972 | 4229 | // this.beSelectDropdownOpen = open; |
| 4973 | 4230 | }; |
| 4974 | 4231 | /* 生产排程工艺流程字段弹窗 - 生产进度详情 */ |
| ... | ... | @@ -4986,49 +4243,46 @@ class CommonTableRc extends React.Component { |
| 4986 | 4243 | handleOpenWin = (name, sName, record, index, showConfig) => { |
| 4987 | 4244 | const sBtnName = sName; |
| 4988 | 4245 | const sBtnContent = record[sName]; |
| 4989 | - const sFormId = commonUtils.isNotEmptyObject(record.sId) ? record.sId : ""; | |
| 4990 | - const sBtnControlName = commonUtils.isNotEmptyObject(showConfig.sControlName) ? showConfig.sControlName : ""; | |
| 4991 | - console.log("sFormId:", sFormId); | |
| 4992 | - if (commonUtils.isNotEmptyObject(sBtnContent)) { | |
| 4246 | + const sFormId = commonUtils.isNotEmptyObject(record.sId) ? record.sId : ''; | |
| 4247 | + const sBtnControlName = commonUtils.isNotEmptyObject(showConfig.sControlName) ? showConfig.sControlName : '' ; | |
| 4248 | + console.log('sFormId:', sFormId); | |
| 4249 | + if(commonUtils.isNotEmptyObject(sBtnContent)) { | |
| 4993 | 4250 | const urlPrint = `${commonConfig.server_host}template/getSql/${sBtnName}/?sBtnContent=${sBtnContent}&sBtnControlName=${sBtnControlName}&sFormId=${sFormId}`; |
| 4994 | - const w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | |
| 4995 | - const h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; | |
| 4251 | + const w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | |
| 4252 | + const h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; | |
| 4996 | 4253 | //const newWin = window.open('','_blank'); |
| 4997 | - const features = | |
| 4998 | - "width=" + (w + 350) + ",height=" + (h + 300) + ", top=0, left=0, toolbar=no, menubar=no,scrollbars=no,resizable=no, location =no, status=no"; | |
| 4254 | + const features = "width="+(w+350)+",height="+(h+300)+", top=0, left=0, toolbar=no, menubar=no,scrollbars=no,resizable=no, location =no, status=no"; | |
| 4999 | 4255 | const newWin = window.open("", "SQL查看器", features); |
| 5000 | - newWin.document.write( | |
| 5001 | - '<body scroll="no" style="margin: 0px;padding: 0px;border:0px;overflow:hidden;"><iframe style="margin: 0px;padding: 0px;border: 0px;width:100%;height:100%" src="' + | |
| 5002 | - urlPrint + | |
| 5003 | - '"></iframe></body>' | |
| 5004 | - ); | |
| 4256 | + newWin.document.write('<body scroll="no" style="margin: 0px;padding: 0px;border:0px;overflow:hidden;"><iframe style="margin: 0px;padding: 0px;border: 0px;width:100%;height:100%" src="'+urlPrint+'"></iframe></body>'); | |
| 5005 | 4257 | // window.open(urlPrint); |
| 5006 | 4258 | } else { |
| 5007 | - message.error("未找到对应过程名"); | |
| 4259 | + message.error('未找到对应过程名'); | |
| 5008 | 4260 | } |
| 5009 | 4261 | }; |
| 5010 | 4262 | |
| 5011 | 4263 | /* 右箭头点击 */ |
| 5012 | 4264 | handleRightArrow = (name, sName, record, index, showConfig) => { |
| 5013 | - if (this.props.onRightArrow) { | |
| 4265 | + if(this.props.onRightArrow) { | |
| 5014 | 4266 | this.props.onRightArrow(name, sName, record, index, showConfig); |
| 5015 | 4267 | } |
| 5016 | - }; | |
| 4268 | + | |
| 4269 | + } | |
| 5017 | 4270 | |
| 5018 | 4271 | /* 确定按钮:复制多行 */ |
| 5019 | 4272 | handleOperateMoreOk = () => { |
| 5020 | - const sNumber = document.getElementById("iNumber").value; | |
| 5021 | - console.log("sNumber", sNumber); | |
| 5022 | - if (commonUtils.isNotEmptyObject(iNumber) && Number(sNumber) > 0) { | |
| 5023 | - const iNumber = Number(sNumber); | |
| 5024 | - for (let i = 0; i < iNumber; i++) { | |
| 4273 | + const sNumber = document.getElementById('iNumber').value; | |
| 4274 | + console.log('sNumber', sNumber); | |
| 4275 | + if(commonUtils.isNotEmptyObject(iNumber) && Number(sNumber) > 0 ) { | |
| 4276 | + const iNumber = Number(sNumber); | |
| 4277 | + for(let i = 0; i< iNumber ; i++) { | |
| 5025 | 4278 | this.handleCopyRow(0); |
| 5026 | 4279 | } |
| 5027 | 4280 | } |
| 5028 | - this.setState({ bOperateMoreVisible: false }); | |
| 5029 | - }; | |
| 4281 | + this.setState({ bOperateMoreVisible: false }) | |
| 4282 | + } | |
| 4283 | + | |
| 5030 | 4284 | |
| 5031 | - showimg = i => { | |
| 4285 | + showimg = (i) => { | |
| 5032 | 4286 | this.setState({ showimgs: true, firstIndex: i }); |
| 5033 | 4287 | }; |
| 5034 | 4288 | toggleshow = () => { |
| ... | ... | @@ -5039,7 +4293,7 @@ class CommonTableRc extends React.Component { |
| 5039 | 4293 | previewVisible: false, |
| 5040 | 4294 | }); |
| 5041 | 4295 | }; |
| 5042 | - handleCancelModal = modelVisible => { | |
| 4296 | + handleCancelModal = (modelVisible) => { | |
| 5043 | 4297 | this.props.onSaveState({ |
| 5044 | 4298 | [modelVisible]: false, |
| 5045 | 4299 | }); |
| ... | ... | @@ -5054,135 +4308,123 @@ class CommonTableRc extends React.Component { |
| 5054 | 4308 | if (size.width === column.width) { |
| 5055 | 4309 | return; |
| 5056 | 4310 | } |
| 5057 | - this.setState( | |
| 5058 | - ({ tableColumn, tableInfoColumn }) => { | |
| 5059 | - let nextColumns; | |
| 5060 | - if (isSlaveInfo) { | |
| 5061 | - nextColumns = [...tableInfoColumn]; | |
| 5062 | - } else { | |
| 5063 | - nextColumns = [...tableColumn]; | |
| 5064 | - } | |
| 4311 | + this.setState(({ tableColumn, tableInfoColumn }) => { | |
| 4312 | + let nextColumns; | |
| 4313 | + if (isSlaveInfo) { | |
| 4314 | + nextColumns = [...tableInfoColumn]; | |
| 4315 | + } else { | |
| 4316 | + nextColumns = [...tableColumn]; | |
| 4317 | + } | |
| 5065 | 4318 | |
| 5066 | - let iIndexList = []; | |
| 5067 | - let iWidth = 0; | |
| 5068 | - let offset = 0; | |
| 5069 | - const iIndex = nextColumns.findIndex(item => item.dataIndex === column.dataIndex); | |
| 5070 | - if (iIndex !== -1) { | |
| 5071 | - // 单层表头 | |
| 5072 | - iIndexList = [iIndex, -1]; | |
| 5073 | - iWidth = nextColumns[iIndex].width === undefined ? this.countOperate() : nextColumns[iIndex].width; | |
| 5074 | - offset = size.width - iWidth; | |
| 5075 | - nextColumns[iIndex].width = size.width; | |
| 5076 | - } else { | |
| 5077 | - // 双层表头 | |
| 5078 | - for (let i = 0; i < nextColumns.length; i++) { | |
| 5079 | - const item = nextColumns[i]; | |
| 5080 | - const { children } = item; | |
| 5081 | - if (commonUtils.isNotEmptyArr(children)) { | |
| 5082 | - const childIndex = children.findIndex(child => child.dataIndex === column.dataIndex); | |
| 5083 | - if (childIndex !== -1) { | |
| 5084 | - iIndexList = [i, childIndex]; | |
| 5085 | - iWidth = nextColumns[i].children[childIndex].width === undefined ? this.countOperate() : nextColumns[i].children[childIndex].width; | |
| 5086 | - offset = size.width - iWidth; | |
| 5087 | - // const iWidthTemp = nextColumns[i].width === undefined ? this.countOperate() : nextColumns[i].width; | |
| 5088 | - // nextColumns[i].width = iWidthTemp + offset; | |
| 5089 | - nextColumns[i].children[childIndex].width = size.width; | |
| 5090 | - break; | |
| 5091 | - } | |
| 4319 | + let iIndexList = []; | |
| 4320 | + let iWidth = 0; | |
| 4321 | + let offset = 0; | |
| 4322 | + const iIndex = nextColumns.findIndex(item => item.dataIndex === column.dataIndex); | |
| 4323 | + if (iIndex !== -1) { // 单层表头 | |
| 4324 | + iIndexList = [iIndex, -1]; | |
| 4325 | + iWidth = nextColumns[iIndex].width === undefined ? this.countOperate() : nextColumns[iIndex].width; | |
| 4326 | + offset = size.width - iWidth; | |
| 4327 | + nextColumns[iIndex].width = size.width; | |
| 4328 | + } else { // 双层表头 | |
| 4329 | + for (let i = 0; i < nextColumns.length; i++) { | |
| 4330 | + const item = nextColumns[i]; | |
| 4331 | + const { children } = item; | |
| 4332 | + if (commonUtils.isNotEmptyArr(children)) { | |
| 4333 | + const childIndex = children.findIndex(child => child.dataIndex === column.dataIndex); | |
| 4334 | + if (childIndex !== -1) { | |
| 4335 | + iIndexList = [i, childIndex]; | |
| 4336 | + iWidth = nextColumns[i].children[childIndex].width === undefined ? this.countOperate() : nextColumns[i].children[childIndex].width; | |
| 4337 | + offset = size.width - iWidth; | |
| 4338 | + // const iWidthTemp = nextColumns[i].width === undefined ? this.countOperate() : nextColumns[i].width; | |
| 4339 | + // nextColumns[i].width = iWidthTemp + offset; | |
| 4340 | + nextColumns[i].children[childIndex].width = size.width; | |
| 4341 | + break; | |
| 5092 | 4342 | } |
| 5093 | 4343 | } |
| 5094 | 4344 | } |
| 4345 | + } | |
| 5095 | 4346 | |
| 5096 | - if (commonUtils.isNotEmptyArr(iIndexList)) { | |
| 5097 | - let lastIndexList = []; | |
| 5098 | - let lastIndex = nextColumns.findIndex(item => item.dataIndex === "tableLastEmpty") - 1; | |
| 5099 | - if (lastIndex < -1) { | |
| 5100 | - lastIndexList = [nextColumns.length - 1, -1]; | |
| 5101 | - } else if (commonUtils.isNotEmptyArr(nextColumns[lastIndex].children)) { | |
| 5102 | - lastIndexList = [lastIndex, nextColumns[lastIndex].children.length - 1]; | |
| 5103 | - } else { | |
| 5104 | - lastIndexList = [lastIndex, -1]; | |
| 5105 | - } | |
| 5106 | - const oBody = this.mydiv.querySelector(".ant-table-body"); | |
| 5107 | - const { scrollWidth, clientWidth, scrollLeft } = oBody; | |
| 5108 | - const scrollRight = scrollWidth - clientWidth - scrollLeft; | |
| 5109 | - | |
| 5110 | - // 判断当前拖动列是否在最后一列前面 | |
| 5111 | - if (iIndexList[0] < lastIndexList[0] || (iIndexList[0] === lastIndexList[0] && iIndexList[1] < lastIndexList[1])) { | |
| 5112 | - const lastColumn = lastIndexList[1] === -1 ? nextColumns[lastIndexList[0]] : nextColumns[lastIndexList[0]].children[lastIndexList[1]]; | |
| 5113 | - const iWidthExtra = lastColumn.widthExtra || 0; // 最后一列额外的宽度 | |
| 5114 | - if (offset > 0) { | |
| 5115 | - // 向右拉伸 | |
| 5116 | - if (iWidthExtra) { | |
| 5117 | - //有额外宽度 | |
| 5118 | - if (iWidthExtra >= offset) { | |
| 5119 | - lastColumn.width -= offset; | |
| 5120 | - lastColumn.widthExtra -= offset; | |
| 5121 | - offset = 0; | |
| 5122 | - } else { | |
| 5123 | - const diffWidth = offset - iWidthExtra; | |
| 5124 | - lastColumn.width -= iWidthExtra; | |
| 5125 | - lastColumn.widthExtra = 0; | |
| 5126 | - offset = diffWidth; | |
| 5127 | - } | |
| 5128 | - } else if (!iWidthExtra && lastColumn.width - offset > 150) { | |
| 5129 | - // 没有额外宽度,但是减去位移后宽度大于150 | |
| 4347 | + if (commonUtils.isNotEmptyArr(iIndexList)) { | |
| 4348 | + let lastIndexList = []; | |
| 4349 | + let lastIndex = nextColumns.findIndex(item => item.dataIndex === 'tableLastEmpty') - 1; | |
| 4350 | + if (lastIndex < -1) { | |
| 4351 | + lastIndexList = [nextColumns.length - 1, -1]; | |
| 4352 | + } else if (commonUtils.isNotEmptyArr(nextColumns[lastIndex].children)) { | |
| 4353 | + lastIndexList = [lastIndex, nextColumns[lastIndex].children.length - 1]; | |
| 4354 | + } else { | |
| 4355 | + lastIndexList = [lastIndex, -1]; | |
| 4356 | + } | |
| 4357 | + const oBody = this.mydiv.querySelector('.ant-table-body'); | |
| 4358 | + const { scrollWidth, clientWidth, scrollLeft } = oBody; | |
| 4359 | + const scrollRight = scrollWidth - clientWidth - scrollLeft; | |
| 4360 | + | |
| 4361 | + // 判断当前拖动列是否在最后一列前面 | |
| 4362 | + if (iIndexList[0] < lastIndexList[0] || (iIndexList[0] === lastIndexList[0] && iIndexList[1] < lastIndexList[1])) { | |
| 4363 | + const lastColumn = lastIndexList[1] === -1 ? nextColumns[lastIndexList[0]] : nextColumns[lastIndexList[0]].children[lastIndexList[1]]; | |
| 4364 | + const iWidthExtra = lastColumn.widthExtra || 0; // 最后一列额外的宽度 | |
| 4365 | + if (offset > 0) { // 向右拉伸 | |
| 4366 | + if (iWidthExtra) { //有额外宽度 | |
| 4367 | + if (iWidthExtra >= offset) { | |
| 5130 | 4368 | lastColumn.width -= offset; |
| 4369 | + lastColumn.widthExtra -= offset; | |
| 5131 | 4370 | offset = 0; |
| 4371 | + } else { | |
| 4372 | + const diffWidth = offset - iWidthExtra; | |
| 4373 | + lastColumn.width -= iWidthExtra; | |
| 4374 | + lastColumn.widthExtra = 0; | |
| 4375 | + offset = diffWidth; | |
| 5132 | 4376 | } |
| 5133 | - } else if (offset < 0) { | |
| 5134 | - // 向左拉伸 | |
| 5135 | - if (scrollRight < -offset) { | |
| 5136 | - // 滚动条距离表格右边距离小于拉伸距离 | |
| 5137 | - const diffWidth = -offset - scrollRight; | |
| 5138 | - lastColumn.width += diffWidth; | |
| 5139 | - lastColumn.widthExtra ? (lastColumn.widthExtra += diffWidth) : (lastColumn.widthExtra = diffWidth); | |
| 5140 | - offset = -diffWidth; | |
| 5141 | - } | |
| 4377 | + } else if (!iWidthExtra && lastColumn.width - offset > 150) { // 没有额外宽度,但是减去位移后宽度大于150 | |
| 4378 | + lastColumn.width -= offset; | |
| 4379 | + offset = 0; | |
| 5142 | 4380 | } |
| 5143 | - | |
| 5144 | - // 处理拖动幅度太大时,空白列会显示问题 | |
| 5145 | - const oCol = this.mydiv.querySelector("colgroup"); | |
| 5146 | - const oCols = oCol ? oCol.childNodes : []; | |
| 5147 | - const oColsWithList = Array.from(oCols) | |
| 5148 | - .filter(item => !item.className) | |
| 5149 | - .map(item => parseInt(item.style.width)); | |
| 5150 | - if (!oColsWithList.includes(0)) { | |
| 5151 | - lastColumn.width += oColsWithList[lastIndex + 1]; | |
| 4381 | + } else if (offset < 0) { // 向左拉伸 | |
| 4382 | + if (scrollRight < -offset) { // 滚动条距离表格右边距离小于拉伸距离 | |
| 4383 | + const diffWidth = -offset - scrollRight; | |
| 4384 | + lastColumn.width += diffWidth; | |
| 4385 | + lastColumn.widthExtra ? (lastColumn.widthExtra += diffWidth) : (lastColumn.widthExtra = diffWidth); | |
| 4386 | + offset = -diffWidth; | |
| 5152 | 4387 | } |
| 5153 | 4388 | } |
| 5154 | - } | |
| 5155 | 4389 | |
| 5156 | - if (isSlaveInfo) { | |
| 5157 | - if (this.scrollInfoX) { | |
| 5158 | - this.scrollInfoX += offset; | |
| 5159 | - } else { | |
| 5160 | - this.scrollInfoX = 0; | |
| 5161 | - this.scrollInfoX = this.countScrollX(nextColumns, true); | |
| 4390 | + // 处理拖动幅度太大时,空白列会显示问题 | |
| 4391 | + const oCol = this.mydiv.querySelector('colgroup'); | |
| 4392 | + const oCols = oCol ? oCol.childNodes : []; | |
| 4393 | + const oColsWithList = Array.from(oCols).filter(item => !item.className).map(item => parseInt(item.style.width)); | |
| 4394 | + if (!oColsWithList.includes(0)) { | |
| 4395 | + lastColumn.width += oColsWithList[lastIndex + 1]; | |
| 5162 | 4396 | } |
| 5163 | - return { tableInfoColumn: nextColumns }; | |
| 4397 | + } | |
| 4398 | + } | |
| 4399 | + | |
| 4400 | + if (isSlaveInfo) { | |
| 4401 | + if (this.scrollInfoX) { | |
| 4402 | + this.scrollInfoX += offset; | |
| 5164 | 4403 | } else { |
| 5165 | - if (this.scrollX) { | |
| 5166 | - this.scrollX += offset; | |
| 5167 | - } else { | |
| 5168 | - this.scrollX = 0; | |
| 5169 | - this.scrollX = this.countScrollX(nextColumns); | |
| 5170 | - } | |
| 5171 | - return { tableColumn: nextColumns }; | |
| 4404 | + this.scrollInfoX = 0; | |
| 4405 | + this.scrollInfoX = this.countScrollX(nextColumns, true); | |
| 5172 | 4406 | } |
| 5173 | - }, | |
| 5174 | - () => { | |
| 5175 | - this.resize = false; | |
| 5176 | - this.initColumn = null; | |
| 5177 | - if (isSlaveInfo) { | |
| 5178 | - sessionStorage.setItem(`${this.props.formId}_${this.props.config.sId}_info`, JSON.stringify(this.state.tableInfoColumn)); | |
| 4407 | + return { tableInfoColumn: nextColumns }; | |
| 4408 | + } else { | |
| 4409 | + if (this.scrollX) { | |
| 4410 | + this.scrollX += offset; | |
| 5179 | 4411 | } else { |
| 5180 | - sessionStorage.setItem(`${this.props.formId}_${this.props.config.sId}`, JSON.stringify(this.state.tableColumn)); | |
| 4412 | + this.scrollX = 0; | |
| 4413 | + this.scrollX = this.countScrollX(nextColumns); | |
| 5181 | 4414 | } |
| 4415 | + return { tableColumn: nextColumns }; | |
| 5182 | 4416 | } |
| 5183 | - ); | |
| 4417 | + }, () => { | |
| 4418 | + this.resize = false; | |
| 4419 | + this.initColumn = null; | |
| 4420 | + if (isSlaveInfo) { | |
| 4421 | + sessionStorage.setItem(`${this.props.formId}_${this.props.config.sId}_info`, JSON.stringify(this.state.tableInfoColumn)); | |
| 4422 | + } else { | |
| 4423 | + sessionStorage.setItem(`${this.props.formId}_${this.props.config.sId}`, JSON.stringify(this.state.tableColumn)); | |
| 4424 | + } | |
| 4425 | + }); | |
| 5184 | 4426 | }; |
| 5185 | - }; | |
| 4427 | + } | |
| 5186 | 4428 | |
| 5187 | 4429 | genFooter= () => { |
| 5188 | 4430 | const { tableColumn, totalData: totalData0, totalDataNew, sumGroup = {}, totalData1 } = this.state; |
| ... | ... | @@ -5193,23 +4435,23 @@ class CommonTableRc extends React.Component { |
| 5193 | 4435 | |
| 5194 | 4436 | let colSpan = 0; |
| 5195 | 4437 | if ((!totalData.length && !totalData1.length) || this.props.footer !== undefined) { |
| 5196 | - return <></>; | |
| 4438 | + return (<></>); | |
| 5197 | 4439 | } |
| 5198 | - if (this.props.tableProps.rowSelection !== null && !(this.props.config && !this.props.config.bisMutiSelect)) { | |
| 4440 | + if(this.props.tableProps.rowSelection !== null && !(this.props.config && !this.props.config.bisMutiSelect)) { | |
| 5199 | 4441 | colSpan = colSpan + 1; |
| 5200 | 4442 | } |
| 5201 | - if (this.props.slaveInfo) { | |
| 4443 | + if(this.props.slaveInfo) { | |
| 5202 | 4444 | colSpan = colSpan + 1; |
| 5203 | 4445 | } |
| 5204 | - if (this.props.dragHandle) { | |
| 4446 | + if(this.props.dragHandle) { | |
| 5205 | 4447 | // colSpan = colSpan + 1; // 临时处理标准精准报价单据工序信息表合计错位问题 |
| 5206 | 4448 | } |
| 5207 | 4449 | const cells = []; |
| 5208 | 4450 | const cells1 = []; |
| 5209 | 4451 | if (totalData.length) { |
| 5210 | - let summaryCellTotal = ""; | |
| 4452 | + let summaryCellTotal = ''; | |
| 5211 | 4453 | summaryCellTotal = ( |
| 5212 | - <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan : 1} index={0}> | |
| 4454 | + <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan: 1} index={0}> | |
| 5213 | 4455 | <span className={styles.summaryCellTotal}>{sumset}</span> |
| 5214 | 4456 | </Table.Summary.Cell> |
| 5215 | 4457 | ); |
| ... | ... | @@ -5229,66 +4471,51 @@ class CommonTableRc extends React.Component { |
| 5229 | 4471 | |
| 5230 | 4472 | cells.push(summaryCellTotal); |
| 5231 | 4473 | tableColumn.forEach((item, index) => { |
| 5232 | - if (colSpan === 0 && index === 0) { | |
| 4474 | + if(colSpan === 0 && index === 0) { | |
| 5233 | 4475 | return; |
| 5234 | 4476 | } |
| 5235 | 4477 | let iTag = index + colSpan; |
| 5236 | - if (tableColumn[index].children !== undefined && tableColumn[index].children.length > 0) { | |
| 5237 | - /* 循环嵌套标题行 */ | |
| 4478 | + if (tableColumn[index].children !== undefined && tableColumn[index].children.length > 0) { /* 循环嵌套标题行 */ | |
| 5238 | 4479 | tableColumn[index].children.forEach((itemChild, i) => { |
| 5239 | 4480 | /* 合计 格式化单价、金额 */ |
| 5240 | 4481 | let sValue = totalData[0][itemChild.dataIndex]; |
| 5241 | 4482 | const columnConfig = this.props.config.gdsconfigformslave.find(item => item.sName === itemChild.dataIndex); |
| 5242 | - if ( | |
| 5243 | - commonUtils.isNotEmptyObject(itemChild.dataIndex) && | |
| 5244 | - itemChild.dataIndex.substring(0, 1) === "d" && | |
| 5245 | - columnConfig?.sDateFormat === "decimalPoint" && | |
| 5246 | - columnConfig?.sFieldValidation | |
| 5247 | - ) { | |
| 4483 | + if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.substring(0, 1) === 'd' && columnConfig?.sDateFormat === 'decimalPoint' && columnConfig?.sFieldValidation) { | |
| 5248 | 4484 | /* 取小数点位数 */ |
| 5249 | - const point = columnConfig.sFieldValidation.split(",")[1] || 2; | |
| 5250 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4485 | + const point = columnConfig.sFieldValidation.split(',')[1] || 2; | |
| 4486 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5251 | 4487 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 5252 | - if (!isNaN(dConfigResult)) { | |
| 4488 | + if(!isNaN(dConfigResult)) { | |
| 5253 | 4489 | sValue = dConfigResult; |
| 5254 | 4490 | } |
| 5255 | 4491 | } |
| 5256 | - } else if ( | |
| 5257 | - (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf("commonList")) || | |
| 5258 | - (sModelsType && sModelsType.indexOf("commonMultiList") > -1) | |
| 5259 | - ) { | |
| 4492 | + } else if( commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('commonList') || (sModelsType && sModelsType.indexOf('commonMultiList') > -1)) { | |
| 5260 | 4493 | /* 有配置以配置为主 否则以系统设定为主 */ |
| 5261 | - if ( | |
| 5262 | - commonUtils.isNotEmptyObject(itemChild.dataIndex) && | |
| 5263 | - itemChild.dataIndex.substring(0, 1) === "d" && | |
| 5264 | - commonUtils.isNotEmptyObject(itemChild.sDateFormat) | |
| 5265 | - ) { | |
| 4494 | + if(commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.substring(0, 1) === 'd' && commonUtils.isNotEmptyObject(itemChild.sDateFormat)) { | |
| 5266 | 4495 | /* 取小数点位数 */ |
| 5267 | 4496 | let point = 0; |
| 5268 | - let strIndex = itemChild.sDateFormat.indexOf("."); | |
| 5269 | - if (strIndex > -1 && itemChild.sDateFormat.length > 1) { | |
| 4497 | + let strIndex = itemChild.sDateFormat.indexOf('.'); | |
| 4498 | + if(strIndex > -1 && itemChild.sDateFormat.length > 1) { | |
| 5270 | 4499 | point = itemChild.sDateFormat.substring(strIndex + 1, itemChild.sDateFormat.length).length; |
| 5271 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4500 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5272 | 4501 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 5273 | - if (!isNaN(dConfigResult)) { | |
| 4502 | + if(!isNaN(dConfigResult)) { | |
| 5274 | 4503 | sValue = dConfigResult; |
| 5275 | 4504 | } |
| 5276 | 4505 | } |
| 5277 | 4506 | } |
| 5278 | 4507 | } else { |
| 5279 | - if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith("price")) { | |
| 5280 | - /* 列表单价格式化显示1 */ | |
| 5281 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4508 | + if ( commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith('price')) { /* 列表单价格式化显示1 */ | |
| 4509 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5282 | 4510 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice).toFixed(dNetPrice); |
| 5283 | - if (!isNaN(dResult)) { | |
| 4511 | + if(!isNaN(dResult)) { | |
| 5284 | 4512 | sValue = dResult; |
| 5285 | 4513 | } |
| 5286 | 4514 | } |
| 5287 | - } else if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith("money")) { | |
| 5288 | - /* 列表金额格式化显示 */ | |
| 5289 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4515 | + } else if (commonUtils.isNotEmptyObject(itemChild.dataIndex) && itemChild.dataIndex.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ | |
| 4516 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5290 | 4517 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney).toFixed(dNetMoney); |
| 5291 | - if (!isNaN(dResult)) { | |
| 4518 | + if(!isNaN(dResult)) { | |
| 5292 | 4519 | sValue = dResult; |
| 5293 | 4520 | } |
| 5294 | 4521 | } |
| ... | ... | @@ -5297,42 +4524,33 @@ class CommonTableRc extends React.Component { |
| 5297 | 4524 | } |
| 5298 | 4525 | const cellChild = ( |
| 5299 | 4526 | <Table.Summary.Cell key={itemChild.dataIndex} index={iTag + i}> |
| 5300 | - <Tooltip title={sValue}> | |
| 5301 | - <span className={styles.summaryCell}>{sValue}</span> | |
| 5302 | - </Tooltip> | |
| 4527 | + <Tooltip title={sValue}><span | |
| 4528 | + className={styles.summaryCell} | |
| 4529 | + >{sValue}</span></Tooltip> | |
| 5303 | 4530 | </Table.Summary.Cell> |
| 5304 | 4531 | ); |
| 5305 | 4532 | cells.push(cellChild); |
| 5306 | 4533 | }); |
| 5307 | - } else { | |
| 5308 | - /* 正常单层标题行 */ | |
| 5309 | - let cell = ""; | |
| 4534 | + } else { /* 正常单层标题行 */ | |
| 4535 | + let cell = ''; | |
| 5310 | 4536 | /* commonList 格式化单价、金额 */ |
| 5311 | 4537 | let sValue = totalData[0][item.dataIndex]; |
| 5312 | - if ( | |
| 5313 | - (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf("commonList")) || | |
| 5314 | - (sModelsType && sModelsType.indexOf("commonMultiList") > -1) | |
| 5315 | - ) { | |
| 4538 | + if( commonUtils.isNotEmptyObject(location.pathname) && location.pathname.toLowerCase().indexOf('commonList') || (sModelsType && sModelsType.indexOf('commonMultiList') > -1)) { | |
| 5316 | 4539 | /* 有配置以配置为主 否则以系统设定为主 */ |
| 5317 | 4540 | const columnConfig = this.props.config.gdsconfigformslave.find(item1 => item1.sName === item.dataIndex); |
| 5318 | - if ( | |
| 5319 | - commonUtils.isNotEmptyObject(item.dataIndex) && | |
| 5320 | - item.dataIndex.substring(0, 1) === "d" && | |
| 5321 | - columnConfig?.sDateFormat === "decimalPoint" && | |
| 5322 | - columnConfig?.sFieldValidation | |
| 5323 | - ) { | |
| 4541 | + if (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.substring(0, 1) === 'd' && columnConfig?.sDateFormat === 'decimalPoint' && columnConfig?.sFieldValidation) { | |
| 5324 | 4542 | /* 取小数点位数 */ |
| 5325 | - const point = columnConfig.sFieldValidation.split(",")[1] || 2; | |
| 5326 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 4543 | + const point = columnConfig.sFieldValidation.split(',')[1] || 2; | |
| 4544 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5327 | 4545 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 5328 | - if (!isNaN(dConfigResult)) { | |
| 4546 | + if(!isNaN(dConfigResult)) { | |
| 5329 | 4547 | sValue = dConfigResult; |
| 5330 | 4548 | } |
| 5331 | 4549 | } |
| 5332 | - } else if (commonUtils.isNotEmptyObject(item.sDateFormat)) { | |
| 4550 | + } else if ( commonUtils.isNotEmptyObject(item.sDateFormat)) { | |
| 5333 | 4551 | /* 取小数点位数 */ |
| 5334 | 4552 | let point = 0; |
| 5335 | - let strIndex = item.sDateFormat.indexOf("."); | |
| 4553 | + let strIndex = item.sDateFormat.indexOf('.'); | |
| 5336 | 4554 | if (strIndex > -1 && item.sDateFormat.length > 1) { |
| 5337 | 4555 | point = item.sDateFormat.substring(strIndex + 1, item.sDateFormat.length).length; |
| 5338 | 4556 | if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { |
| ... | ... | @@ -5343,16 +4561,14 @@ class CommonTableRc extends React.Component { |
| 5343 | 4561 | } |
| 5344 | 4562 | } |
| 5345 | 4563 | } else { |
| 5346 | - if (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.toLowerCase().endsWith("price")) { | |
| 5347 | - /* 列表单价格式化显示1 */ | |
| 4564 | + if (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.toLowerCase().endsWith('price')) { /* 列表单价格式化显示1 */ | |
| 5348 | 4565 | if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { |
| 5349 | 4566 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice); |
| 5350 | 4567 | if (!isNaN(dResult)) { |
| 5351 | 4568 | sValue = dResult; |
| 5352 | 4569 | } |
| 5353 | 4570 | } |
| 5354 | - } else if (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.toLowerCase().endsWith("money")) { | |
| 5355 | - /* 列表金额格式化显示 */ | |
| 4571 | + } else if (commonUtils.isNotEmptyObject(item.dataIndex) && item.dataIndex.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ | |
| 5356 | 4572 | if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { |
| 5357 | 4573 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney); |
| 5358 | 4574 | if (!isNaN(dResult)) { |
| ... | ... | @@ -5364,9 +4580,9 @@ class CommonTableRc extends React.Component { |
| 5364 | 4580 | } |
| 5365 | 4581 | cell = ( |
| 5366 | 4582 | <Table.Summary.Cell key={item.dataIndex} index={iTag}> |
| 5367 | - <Tooltip title={sValue}> | |
| 5368 | - <span className={styles.summaryCell}>{sValue}</span> | |
| 5369 | - </Tooltip> | |
| 4583 | + <Tooltip title={sValue}><span | |
| 4584 | + className={styles.summaryCell} | |
| 4585 | + >{sValue}</span></Tooltip> | |
| 5370 | 4586 | </Table.Summary.Cell> |
| 5371 | 4587 | ); |
| 5372 | 4588 | cells.push(cell); |
| ... | ... | @@ -5375,42 +4591,40 @@ class CommonTableRc extends React.Component { |
| 5375 | 4591 | } |
| 5376 | 4592 | |
| 5377 | 4593 | if (totalData1.length) { |
| 5378 | - let summaryCellTotal1 = ""; | |
| 4594 | + let summaryCellTotal1 = ''; | |
| 5379 | 4595 | summaryCellTotal1 = ( |
| 5380 | - <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan : 1} index={0}> | |
| 4596 | + <Table.Summary.Cell key={0} colSpan={colSpan ? colSpan: 1} index={0}> | |
| 5381 | 4597 | <span className={styles.summaryCellTotal}>总计</span> |
| 5382 | 4598 | </Table.Summary.Cell> |
| 5383 | 4599 | ); |
| 5384 | 4600 | cells1.push(summaryCellTotal1); |
| 5385 | 4601 | tableColumn.forEach((item, index) => { |
| 5386 | - if (colSpan === 0 && index === 0) { | |
| 4602 | + if(colSpan === 0 && index === 0) { | |
| 5387 | 4603 | return; |
| 5388 | 4604 | } |
| 5389 | 4605 | let iTag = index + colSpan; |
| 5390 | - if (tableColumn[index].children !== undefined && tableColumn[index].children.length > 0) { | |
| 5391 | - /* 循环嵌套标题行 */ | |
| 4606 | + if (tableColumn[index].children !== undefined && tableColumn[index].children.length > 0) { /* 循环嵌套标题行 */ | |
| 5392 | 4607 | tableColumn[index].children.forEach((itemChild, i) => { |
| 5393 | 4608 | /* 合计 格式化单价、金额 */ |
| 5394 | 4609 | let sValue = totalData1[0][itemChild.dataIndex]; |
| 5395 | 4610 | const cellChild = ( |
| 5396 | 4611 | <Table.Summary.Cell key={itemChild.dataIndex} index={iTag + i}> |
| 5397 | - <Tooltip title={sValue}> | |
| 5398 | - <span className={styles.summaryCell}>{sValue}</span> | |
| 5399 | - </Tooltip> | |
| 4612 | + <Tooltip title={sValue}><span | |
| 4613 | + className={styles.summaryCell} | |
| 4614 | + >{sValue}</span></Tooltip> | |
| 5400 | 4615 | </Table.Summary.Cell> |
| 5401 | 4616 | ); |
| 5402 | 4617 | cells1.push(cellChild); |
| 5403 | 4618 | }); |
| 5404 | - } else { | |
| 5405 | - /* 正常单层标题行 */ | |
| 5406 | - let cell = ""; | |
| 4619 | + } else { /* 正常单层标题行 */ | |
| 4620 | + let cell = ''; | |
| 5407 | 4621 | /* commonList 格式化单价、金额 */ |
| 5408 | 4622 | let sValue = totalData1[0][item.dataIndex]; |
| 5409 | 4623 | cell = ( |
| 5410 | 4624 | <Table.Summary.Cell key={item.dataIndex} index={iTag}> |
| 5411 | - <Tooltip title={sValue}> | |
| 5412 | - <span className={styles.summaryCell}>{sValue}</span> | |
| 5413 | - </Tooltip> | |
| 4625 | + <Tooltip title={sValue}><span | |
| 4626 | + className={styles.summaryCell} | |
| 4627 | + >{sValue}</span></Tooltip> | |
| 5414 | 4628 | </Table.Summary.Cell> |
| 5415 | 4629 | ); |
| 5416 | 4630 | cells1.push(cell); |
| ... | ... | @@ -5419,11 +4633,23 @@ class CommonTableRc extends React.Component { |
| 5419 | 4633 | } |
| 5420 | 4634 | return ( |
| 5421 | 4635 | <Table.Summary fixed> |
| 5422 | - {totalData.length ? <Table.Summary.Row>{cells}</Table.Summary.Row> : ""} | |
| 5423 | - {totalData1.length ? <Table.Summary.Row>{cells1}</Table.Summary.Row> : ""} | |
| 4636 | + { | |
| 4637 | + totalData.length ? ( | |
| 4638 | + <Table.Summary.Row> | |
| 4639 | + {cells} | |
| 4640 | + </Table.Summary.Row> | |
| 4641 | + ) : '' | |
| 4642 | + } | |
| 4643 | + { | |
| 4644 | + totalData1.length ? ( | |
| 4645 | + <Table.Summary.Row> | |
| 4646 | + {cells1} | |
| 4647 | + </Table.Summary.Row> | |
| 4648 | + ) : '' | |
| 4649 | + } | |
| 5424 | 4650 | </Table.Summary> |
| 5425 | 4651 | ); |
| 5426 | - }; | |
| 4652 | + } | |
| 5427 | 4653 | |
| 5428 | 4654 | handleSearch = (selectedKeys, confirm, searchColumnName, clearFilters) => { |
| 5429 | 4655 | confirm(); |
| ... | ... | @@ -5441,131 +4667,119 @@ class CommonTableRc extends React.Component { |
| 5441 | 4667 | handleReset = (clearFilters, confirm) => { |
| 5442 | 4668 | clearFilters(); |
| 5443 | 4669 | if (this.mounted) { |
| 5444 | - this.setState({ searchText: "" }, () => { | |
| 4670 | + this.setState({ searchText: '' }, () => { | |
| 5445 | 4671 | // 重置搜索条件 |
| 5446 | 4672 | confirm(); |
| 5447 | 4673 | }); |
| 5448 | 4674 | } |
| 5449 | 4675 | }; |
| 5450 | 4676 | |
| 4677 | + | |
| 5451 | 4678 | /** 求和所有列 */ |
| 5452 | 4679 | handleSumAllColumn = (config, dataSource) => { |
| 5453 | 4680 | const tableDataTotal = {}; |
| 5454 | - const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== "" && item.bVisible && item.bSum); | |
| 4681 | + const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== '' && item.bVisible && item.bSum); | |
| 5455 | 4682 | if (commonUtils.isNotEmptyArr(sumConfig)) { |
| 5456 | 4683 | if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource)) { |
| 5457 | - dataSource.forEach(tableDataRow => { | |
| 5458 | - sumConfig.forEach(sumItem => { | |
| 5459 | - if (tableDataRow.handleType !== "del") { | |
| 5460 | - if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === "Price".toLowerCase()) { | |
| 5461 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5462 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5463 | - this.props.getFloatNum(sumItem.sName) | |
| 5464 | - ); | |
| 4684 | + dataSource.forEach((tableDataRow) => { | |
| 4685 | + sumConfig.forEach((sumItem) => { | |
| 4686 | + if (tableDataRow.handleType !== 'del') { | |
| 4687 | + if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === 'Price'.toLowerCase()) { | |
| 4688 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4689 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5465 | 4690 | } else { |
| 5466 | 4691 | /* 如果设置格式 按照设置格式来,否则按照系统设定 */ |
| 5467 | 4692 | const sFieldConfigArr = config.gdsconfigformslave.filter(item => item.sName === sumItem.sName && item.bVisible); |
| 5468 | - if (commonUtils.isNotEmptyArr(sFieldConfigArr)) { | |
| 4693 | + if(commonUtils.isNotEmptyArr(sFieldConfigArr)) { | |
| 5469 | 4694 | const { sFieldValidation: sFieldValidationOld, sName } = sFieldConfigArr[0]; |
| 5470 | - if (commonUtils.isNotEmptyObject(sFieldValidationOld)) { | |
| 5471 | - const [length1, length2] = sFieldValidationOld.split(","); | |
| 5472 | - if (commonUtils.isNotEmptyNumber(length2)) { | |
| 5473 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5474 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5475 | - this.props.getFloatNum(length2) | |
| 5476 | - ); | |
| 4695 | + if(commonUtils.isNotEmptyObject(sFieldValidationOld)) { | |
| 4696 | + const [length1, length2] = sFieldValidationOld.split(','); | |
| 4697 | + if(commonUtils.isNotEmptyNumber(length2)) { | |
| 4698 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4699 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(length2)); | |
| 5477 | 4700 | } |
| 5478 | - } else { | |
| 5479 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5480 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5481 | - this.props.getFloatNum(sumItem.sName) | |
| 5482 | - ); | |
| 4701 | + }else { | |
| 4702 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4703 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5483 | 4704 | } |
| 5484 | 4705 | } |
| 4706 | + | |
| 5485 | 4707 | } |
| 5486 | 4708 | } |
| 5487 | 4709 | }); |
| 5488 | 4710 | }); |
| 5489 | 4711 | } else { |
| 5490 | - sumConfig.forEach(sumItem => { | |
| 4712 | + sumConfig.forEach((sumItem) => { | |
| 5491 | 4713 | tableDataTotal[sumItem.sName] = 0; |
| 5492 | 4714 | }); |
| 5493 | 4715 | } |
| 5494 | 4716 | tableDataTotal.bSum = true; |
| 5495 | - tableDataTotal.key = "0000"; | |
| 4717 | + tableDataTotal.key = '0000'; | |
| 5496 | 4718 | |
| 5497 | 4719 | if (this.mounted) { |
| 5498 | 4720 | this.setState({ totalData: [tableDataTotal] }); |
| 5499 | 4721 | } |
| 5500 | 4722 | } |
| 5501 | - }; | |
| 4723 | + } | |
| 5502 | 4724 | |
| 5503 | 4725 | handleSumOtherColumn = (config, dataSource) => { |
| 5504 | 4726 | const tableDataTotal = {}; |
| 5505 | - const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== "" && item.bVisible && item.bSum); | |
| 4727 | + const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== '' && item.bVisible && item.bSum); | |
| 5506 | 4728 | if (commonUtils.isNotEmptyArr(sumConfig)) { |
| 5507 | 4729 | if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource)) { |
| 5508 | - const { selectedRowKeys } = this.state; | |
| 4730 | + const { selectedRowKeys } =this.state; | |
| 5509 | 4731 | /* 生产排程对选中行进行汇总 */ |
| 5510 | - if (commonUtils.isNotEmptyArr(selectedRowKeys)) { | |
| 4732 | + if(commonUtils.isNotEmptyArr(selectedRowKeys)) { | |
| 5511 | 4733 | const selectedData = dataSource.filter(item => selectedRowKeys.includes(item.sSlaveId)); |
| 5512 | - if (commonUtils.isNotEmptyArr(selectedData)) { | |
| 5513 | - selectedData.forEach(tableDataRow => { | |
| 5514 | - sumConfig.forEach(sumItem => { | |
| 5515 | - if (tableDataRow.handleType !== "del") { | |
| 5516 | - if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === "Price".toLowerCase()) { | |
| 5517 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5518 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5519 | - this.props.getFloatNum(sumItem.sName) | |
| 5520 | - ); | |
| 4734 | + if(commonUtils.isNotEmptyArr(selectedData)) { | |
| 4735 | + selectedData.forEach((tableDataRow) => { | |
| 4736 | + sumConfig.forEach((sumItem) => { | |
| 4737 | + if (tableDataRow.handleType !== 'del') { | |
| 4738 | + if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === 'Price'.toLowerCase()) { | |
| 4739 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4740 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5521 | 4741 | } else { |
| 5522 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5523 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5524 | - this.props.getFloatNum(sumItem.sName) | |
| 5525 | - ); | |
| 4742 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4743 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5526 | 4744 | } |
| 5527 | 4745 | } |
| 5528 | 4746 | }); |
| 5529 | 4747 | }); |
| 5530 | 4748 | } |
| 5531 | 4749 | } else { |
| 5532 | - dataSource.forEach(tableDataRow => { | |
| 5533 | - sumConfig.forEach(sumItem => { | |
| 5534 | - if (tableDataRow.handleType !== "del") { | |
| 5535 | - if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === "Price".toLowerCase()) { | |
| 5536 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5537 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5538 | - this.props.getFloatNum(sumItem.sName) | |
| 5539 | - ); | |
| 4750 | + dataSource.forEach((tableDataRow) => { | |
| 4751 | + sumConfig.forEach((sumItem) => { | |
| 4752 | + if (tableDataRow.handleType !== 'del') { | |
| 4753 | + if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === 'Price'.toLowerCase()) { | |
| 4754 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4755 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5540 | 4756 | } else { |
| 5541 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5542 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5543 | - this.props.getFloatNum(sumItem.sName) | |
| 5544 | - ); | |
| 4757 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4758 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5545 | 4759 | } |
| 5546 | 4760 | } |
| 5547 | 4761 | }); |
| 5548 | 4762 | }); |
| 5549 | 4763 | } |
| 5550 | 4764 | } else { |
| 5551 | - sumConfig.forEach(sumItem => { | |
| 4765 | + sumConfig.forEach((sumItem) => { | |
| 5552 | 4766 | tableDataTotal[sumItem.sName] = 0; |
| 5553 | 4767 | }); |
| 5554 | 4768 | } |
| 5555 | 4769 | tableDataTotal.bSum = true; |
| 5556 | - tableDataTotal.key = "0000"; | |
| 4770 | + tableDataTotal.key = '0000'; | |
| 5557 | 4771 | if (this.mounted) { |
| 5558 | 4772 | this.setState({ totalData: [tableDataTotal] }); |
| 5559 | 4773 | } |
| 5560 | 4774 | } |
| 5561 | - }; | |
| 4775 | + } | |
| 5562 | 4776 | |
| 5563 | 4777 | handleSumChildColumn = (config, dataSource) => { |
| 5564 | 4778 | const tableDataTotal = {}; |
| 5565 | - const { filteredValue } = this.state; | |
| 5566 | - const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== "" && item.bVisible && item.bSum); | |
| 4779 | + const { filteredValue } =this.state; | |
| 4780 | + const sumConfig = config.gdsconfigformslave.filter(item => item.sName !== '' && item.bVisible && item.bSum); | |
| 5567 | 4781 | if (commonUtils.isNotEmptyArr(sumConfig)) { |
| 5568 | - if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource) && commonUtils.isNotEmptyArr(filteredValue)) { | |
| 4782 | + if (commonUtils.isNotEmptyObject(config) && commonUtils.isNotEmptyArr(dataSource) && commonUtils.isNotEmptyArr(filteredValue)) { | |
| 5569 | 4783 | /* 序号根据sSqlConditonId分组 序号重排 */ |
| 5570 | 4784 | const groupedData = commonUtils.groupBy(dataSource, item => item.sSqlConditionId); |
| 5571 | 4785 | let selectedData = []; |
| ... | ... | @@ -5575,47 +4789,43 @@ class CommonTableRc extends React.Component { |
| 5575 | 4789 | if (commonUtils.isNotEmptyArr(eachData)) { |
| 5576 | 4790 | /* 看当前选中在哪个组里 */ |
| 5577 | 4791 | const iIndex = eachData.findIndex(item => filteredValue.includes(item.sSqlConditionId)); |
| 5578 | - if (iIndex > -1) { | |
| 4792 | + if(iIndex > -1){ | |
| 5579 | 4793 | selectedData = eachData; |
| 5580 | 4794 | } |
| 5581 | 4795 | } |
| 5582 | 4796 | } |
| 5583 | 4797 | } |
| 5584 | 4798 | |
| 5585 | - if (commonUtils.isNotEmptyArr(selectedData)) { | |
| 5586 | - selectedData.forEach(tableDataRow => { | |
| 5587 | - sumConfig.forEach(sumItem => { | |
| 5588 | - if (tableDataRow.handleType !== "del") { | |
| 5589 | - if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === "Price".toLowerCase()) { | |
| 5590 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5591 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5592 | - this.props.getFloatNum(sumItem.sName) | |
| 5593 | - ); | |
| 4799 | + if(commonUtils.isNotEmptyArr(selectedData)) { | |
| 4800 | + selectedData.forEach((tableDataRow) => { | |
| 4801 | + sumConfig.forEach((sumItem) => { | |
| 4802 | + if (tableDataRow.handleType !== 'del') { | |
| 4803 | + if (sumItem.sName.substring(sumItem.sName.length - 5, sumItem.sName.length).toLowerCase() === 'Price'.toLowerCase()) { | |
| 4804 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4805 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5594 | 4806 | } else { |
| 5595 | - tableDataTotal[sumItem.sName] = commonUtils.convertFixNum( | |
| 5596 | - commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + commonUtils.convertToNum(tableDataRow[sumItem.sName]), | |
| 5597 | - this.props.getFloatNum(sumItem.sName) | |
| 5598 | - ); | |
| 4807 | + tableDataTotal[sumItem.sName] = commonUtils.convertFixNum(commonUtils.convertToNum(tableDataTotal[sumItem.sName]) + | |
| 4808 | + commonUtils.convertToNum(tableDataRow[sumItem.sName]), this.props.getFloatNum(sumItem.sName)); | |
| 5599 | 4809 | } |
| 5600 | 4810 | } |
| 5601 | 4811 | }); |
| 5602 | 4812 | }); |
| 5603 | 4813 | } |
| 5604 | 4814 | } else { |
| 5605 | - sumConfig.forEach(sumItem => { | |
| 4815 | + sumConfig.forEach((sumItem) => { | |
| 5606 | 4816 | tableDataTotal[sumItem.sName] = 0; |
| 5607 | 4817 | }); |
| 5608 | 4818 | } |
| 5609 | 4819 | tableDataTotal.bSum = true; |
| 5610 | - tableDataTotal.key = "0000"; | |
| 4820 | + tableDataTotal.key = '0000'; | |
| 5611 | 4821 | if (this.mounted) { |
| 5612 | 4822 | this.setState({ totalData: [tableDataTotal] }); |
| 5613 | 4823 | } |
| 5614 | 4824 | } |
| 5615 | - }; | |
| 4825 | + } | |
| 5616 | 4826 | // 表格按钮点击后调用指令集 |
| 5617 | 4827 | handleInstruct = (btnName, callback) => { |
| 5618 | - const { sInstruct: sInstructStr } = this.props.config; | |
| 4828 | + const { sInstruct:sInstructStr } = this.props.config; | |
| 5619 | 4829 | const sInstruct = commonUtils.convertStrToObj(sInstructStr, {}); |
| 5620 | 4830 | const { data = [] } = sInstruct; |
| 5621 | 4831 | |
| ... | ... | @@ -5638,60 +4848,61 @@ class CommonTableRc extends React.Component { |
| 5638 | 4848 | } else { |
| 5639 | 4849 | callback && callback(); |
| 5640 | 4850 | } |
| 5641 | - }; | |
| 4851 | + } | |
| 5642 | 4852 | |
| 5643 | 4853 | /** 查看行 */ |
| 5644 | 4854 | handleLookRow = () => { |
| 5645 | 4855 | this.props.onLookRow(this.props.name); |
| 5646 | 4856 | }; |
| 5647 | 4857 | /** 材料备注行 */ |
| 5648 | - handleModalRemarkRow = index => { | |
| 4858 | + handleModalRemarkRow = (index) => { | |
| 5649 | 4859 | this.props.onModalRow(index); |
| 5650 | 4860 | }; |
| 5651 | 4861 | /** modal行 */ |
| 5652 | 4862 | handleModalRow = (recordIndex, tableName) => { |
| 5653 | 4863 | if (commonUtils.isNotEmptyObject(this.props.tableProps.chooseMaterialsConfigRow)) { |
| 5654 | - this.handleInstruct("BtnChooseMaterials", () => { | |
| 4864 | + this.handleInstruct('BtnChooseMaterials', () => { | |
| 5655 | 4865 | const iIndex = this.props.tableProps.chooseMaterialsConfigRow; |
| 5656 | - this.props.onBtnChoose("materials", "BtnChooseMaterials", iIndex, recordIndex, tableName); // recordIndex选中行的索引 | |
| 4866 | + this.props.onBtnChoose('materials', 'BtnChooseMaterials', iIndex, recordIndex, tableName); // recordIndex选中行的索引 | |
| 5657 | 4867 | }); |
| 5658 | 4868 | } |
| 5659 | 4869 | }; |
| 5660 | - handleChooseProcessRow = record => { | |
| 4870 | + handleChooseProcessRow = (record) => { | |
| 5661 | 4871 | if (commonUtils.isNotEmptyObject(this.props.tableProps.chooseProcessConfigRow)) { |
| 5662 | - this.handleInstruct("BtnChooseProcess", () => { | |
| 4872 | + this.handleInstruct('BtnChooseProcess', () => { | |
| 5663 | 4873 | const iIndex = this.props.tableProps.chooseProcessConfigRow; |
| 5664 | - if (this.props.name === "slave0Child1") { | |
| 5665 | - const { name } = this.props; | |
| 5666 | - let btnPupopConfig = this.props.tableProps.chooseProcessConfigRow; | |
| 5667 | - this.setState({ | |
| 5668 | - commonPopupVisible: true, | |
| 5669 | - commonPopupTbName: name, | |
| 5670 | - commonPopupShowConfig: btnPupopConfig, | |
| 5671 | - commonPopupRecord: record, | |
| 5672 | - }); | |
| 5673 | - } else { | |
| 5674 | - this.props.onBtnChoose("process", "BtnChooseProcess", iIndex); | |
| 5675 | - } | |
| 4874 | + if(this.props.name === 'slave0Child1') { | |
| 4875 | + const { name } = this.props; | |
| 4876 | + let btnPupopConfig = this.props.tableProps.chooseProcessConfigRow; | |
| 4877 | + this.setState({ | |
| 4878 | + commonPopupVisible: true, | |
| 4879 | + commonPopupTbName: name, | |
| 4880 | + commonPopupShowConfig: btnPupopConfig, | |
| 4881 | + commonPopupRecord: record, | |
| 4882 | + }); | |
| 4883 | + | |
| 4884 | + } else { | |
| 4885 | + this.props.onBtnChoose('process', 'BtnChooseProcess', iIndex); | |
| 4886 | + } | |
| 5676 | 4887 | }); |
| 5677 | 4888 | } |
| 5678 | 4889 | }; |
| 5679 | 4890 | |
| 5680 | 4891 | /* 成品工序弹窗 */ |
| 5681 | - handleChooseProductProcessRow = recordIndex => { | |
| 4892 | + handleChooseProductProcessRow = (recordIndex) => { | |
| 5682 | 4893 | /* recordIndex 为选中行下标 */ |
| 5683 | 4894 | if (commonUtils.isNotEmptyObject(this.props.tableProps.chooseProductProcessConfigRow)) { |
| 5684 | 4895 | const btnConfig = this.props.tableProps.chooseProductProcessConfigRow; |
| 5685 | - this.props.onBtnChoose("productProcess", "BtnChooseProductProcess", btnConfig, recordIndex); | |
| 4896 | + this.props.onBtnChoose('productProcess', 'BtnChooseProductProcess', btnConfig, recordIndex); | |
| 5686 | 4897 | } |
| 5687 | 4898 | }; |
| 5688 | 4899 | |
| 5689 | 4900 | /* 成品材料弹窗 */ |
| 5690 | - handleChooseProductMaterialsRow = recordIndex => { | |
| 4901 | + handleChooseProductMaterialsRow = (recordIndex) => { | |
| 5691 | 4902 | /* recordIndex 为选中行下标 */ |
| 5692 | 4903 | if (commonUtils.isNotEmptyObject(this.props.tableProps.chooseProductMaterialsConfigRow)) { |
| 5693 | 4904 | const btnConfig = this.props.tableProps.chooseProductMaterialsConfigRow; |
| 5694 | - this.props.onBtnChoose("productMaterials", "BtnChooseProductMaterials", btnConfig, recordIndex); | |
| 4905 | + this.props.onBtnChoose('productMaterials', 'BtnChooseProductMaterials', btnConfig, recordIndex); | |
| 5695 | 4906 | } |
| 5696 | 4907 | }; |
| 5697 | 4908 | |
| ... | ... | @@ -5699,61 +4910,61 @@ class CommonTableRc extends React.Component { |
| 5699 | 4910 | handleAddRow = (index, bModalAdd) => { |
| 5700 | 4911 | this.stopRowClick = true; |
| 5701 | 4912 | /* 多表树形删除 */ |
| 5702 | - if (this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 4913 | + if(this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 5703 | 4914 | this.handleAddInfoRow(index); |
| 5704 | 4915 | return; |
| 5705 | 4916 | } |
| 5706 | 4917 | setTimeout(() => { |
| 5707 | 4918 | if (this.props.onAddRow) { |
| 5708 | - this.handleInstruct("BtnAdd", () => { | |
| 4919 | + this.handleInstruct('BtnAdd', () => { | |
| 5709 | 4920 | this.props.onAddRow(this.props.name, null, index, this.props.bFinished, bModalAdd); |
| 5710 | 4921 | }); |
| 5711 | 4922 | } |
| 5712 | - }, 0); | |
| 4923 | + }, 0) | |
| 5713 | 4924 | }; |
| 5714 | - handleAddInfoRow = index => { | |
| 4925 | + handleAddInfoRow = (index) => { | |
| 5715 | 4926 | const tableInfoName = this.props.slaveInfo.name; |
| 5716 | 4927 | setTimeout(() => { |
| 5717 | 4928 | if (this.props.onAddRow) { |
| 5718 | - this.handleInstruct("BtnAdd", () => { | |
| 4929 | + this.handleInstruct('BtnAdd', () => { | |
| 5719 | 4930 | this.props.onAddRow(tableInfoName, null, index, false, false); |
| 5720 | 4931 | }); |
| 5721 | 4932 | } |
| 5722 | - }, 0); | |
| 4933 | + }, 0) | |
| 5723 | 4934 | }; |
| 5724 | 4935 | |
| 5725 | 4936 | handleTreeAdd = () => { |
| 5726 | 4937 | setTimeout(() => { |
| 5727 | - this.handleInstruct("BtnAdd", () => { | |
| 4938 | + this.handleInstruct('BtnAdd', () => { | |
| 5728 | 4939 | if (this.props.onTreeAdd) { |
| 5729 | - this.props.onTreeAdd(this.props.name, true, "sameNode"); | |
| 4940 | + this.props.onTreeAdd(this.props.name, true, 'sameNode'); | |
| 5730 | 4941 | } |
| 5731 | 4942 | }); |
| 5732 | - }, 0); | |
| 4943 | + }, 0) | |
| 5733 | 4944 | }; |
| 5734 | 4945 | handleTreeAddChild = () => { |
| 5735 | 4946 | setTimeout(() => { |
| 5736 | - this.handleInstruct("BtnAddChildNode", () => { | |
| 4947 | + this.handleInstruct('BtnAddChildNode', () => { | |
| 5737 | 4948 | if (this.props.onTreeAddChild) { |
| 5738 | - this.props.onTreeAddChild(this.props.name, true, "childNode"); | |
| 4949 | + this.props.onTreeAddChild(this.props.name, true, 'childNode'); | |
| 5739 | 4950 | } |
| 5740 | 4951 | }); |
| 5741 | - }, 0); | |
| 4952 | + }, 0) | |
| 5742 | 4953 | }; |
| 5743 | 4954 | handleTreeCopyAll = () => { |
| 5744 | 4955 | setTimeout(() => { |
| 5745 | - this.handleInstruct("BtnCopyAll", () => { | |
| 4956 | + this.handleInstruct('BtnCopyAll', () => { | |
| 5746 | 4957 | if (this.props.onTreeCopyAll) { |
| 5747 | - this.props.onTreeCopyAll(this.props.name, false, "isChild"); | |
| 4958 | + this.props.onTreeCopyAll(this.props.name, false, 'isChild'); | |
| 5748 | 4959 | } |
| 5749 | 4960 | }); |
| 5750 | - }, 0); | |
| 4961 | + }, 0) | |
| 5751 | 4962 | }; |
| 5752 | 4963 | handleTreeDel = (index, record) => { |
| 5753 | - if (this.props.name === "control") { | |
| 5754 | - const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, "SureDel") : "确认要删除吗?"; | |
| 5755 | - const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, "BtnSure") : "确定?"; | |
| 5756 | - const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, "BtnCancel") : "确定?"; | |
| 4964 | + if(this.props.name === 'control') { | |
| 4965 | + const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'SureDel') : '确认要删除吗?' ; | |
| 4966 | + const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?' ; | |
| 4967 | + const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?' ; | |
| 5757 | 4968 | const _this = this; |
| 5758 | 4969 | confirm({ |
| 5759 | 4970 | title: sureDel, |
| ... | ... | @@ -5764,7 +4975,7 @@ class CommonTableRc extends React.Component { |
| 5764 | 4975 | return false; |
| 5765 | 4976 | }, |
| 5766 | 4977 | okText: BtnSure, |
| 5767 | - cancelText: BtnCancel, | |
| 4978 | + cancelText: BtnCancel | |
| 5768 | 4979 | }); |
| 5769 | 4980 | } else { |
| 5770 | 4981 | this.handleTreeDelOk(index, record); |
| ... | ... | @@ -5772,39 +4983,39 @@ class CommonTableRc extends React.Component { |
| 5772 | 4983 | }; |
| 5773 | 4984 | handleTreeDelOk = () => { |
| 5774 | 4985 | setTimeout(() => { |
| 5775 | - this.handleInstruct("BtnDel", () => { | |
| 4986 | + this.handleInstruct('BtnDel', () => { | |
| 5776 | 4987 | if (this.props.onTreeDel) { |
| 5777 | - this.props.onTreeDel(this.props.name, true, ""); | |
| 4988 | + this.props.onTreeDel(this.props.name, true, ''); | |
| 5778 | 4989 | } |
| 5779 | 4990 | }); |
| 5780 | - }, 0); | |
| 4991 | + },0); | |
| 5781 | 4992 | }; |
| 5782 | 4993 | /** 复制 */ |
| 5783 | - handleCopyRow = index => { | |
| 4994 | + handleCopyRow = (index) => { | |
| 5784 | 4995 | setTimeout(() => { |
| 5785 | - this.handleInstruct("BtnCopy", () => { | |
| 4996 | + this.handleInstruct('BtnCopy', () => { | |
| 5786 | 4997 | if (this.props.onCopyRow) { |
| 5787 | 4998 | this.props.onCopyRow(this.props.name, undefined, undefined, index); |
| 5788 | 4999 | } |
| 5789 | 5000 | }); |
| 5790 | - }, 0); | |
| 5001 | + },0) | |
| 5791 | 5002 | }; |
| 5792 | 5003 | /** 复制全部 */ |
| 5793 | 5004 | handleCopyAllRow = () => { |
| 5794 | 5005 | setTimeout(() => { |
| 5795 | - this.handleInstruct("BtnCopyAll", () => { | |
| 5006 | + this.handleInstruct('BtnCopyAll', () => { | |
| 5796 | 5007 | if (this.props.onCopyAllRow) { |
| 5797 | 5008 | this.props.onCopyAllRow(this.props.name); |
| 5798 | 5009 | } |
| 5799 | 5010 | }); |
| 5800 | - }, 0); | |
| 5011 | + }, 0) | |
| 5801 | 5012 | }; |
| 5802 | 5013 | /** 删除行 */ |
| 5803 | 5014 | handleDelRow = (index, record) => { |
| 5804 | - if (this.props.name !== "slaveFilter") { | |
| 5805 | - const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, "SureDel") : "确认要删除吗?"; | |
| 5806 | - const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, "BtnSure") : "确定?"; | |
| 5807 | - const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, "BtnCancel") : "确定?"; | |
| 5015 | + if(this.props.name !== 'slaveFilter') { | |
| 5016 | + const sureDel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'SureDel') : '确认要删除吗?' ; | |
| 5017 | + const BtnSure = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnSure') : '确定?' ; | |
| 5018 | + const BtnCancel = commonUtils.isNotEmptyObject(this.props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'BtnCancel') : '确定?' ; | |
| 5808 | 5019 | const _this = this; |
| 5809 | 5020 | confirm({ |
| 5810 | 5021 | title: sureDel, |
| ... | ... | @@ -5815,7 +5026,7 @@ class CommonTableRc extends React.Component { |
| 5815 | 5026 | return false; |
| 5816 | 5027 | }, |
| 5817 | 5028 | okText: BtnSure, |
| 5818 | - cancelText: BtnCancel, | |
| 5029 | + cancelText: BtnCancel | |
| 5819 | 5030 | }); |
| 5820 | 5031 | } else { |
| 5821 | 5032 | this.handleDelOkRow(index, record); |
| ... | ... | @@ -5825,18 +5036,18 @@ class CommonTableRc extends React.Component { |
| 5825 | 5036 | /** 删除行 */ |
| 5826 | 5037 | handleDelOkRow = (index, record) => { |
| 5827 | 5038 | const tableSelectedRowKeys = []; |
| 5828 | - if (this.props?.formId === "12710101117043535363530") { | |
| 5039 | + if(this.props?.formId === '12710101117043535363530') { | |
| 5829 | 5040 | tableSelectedRowKeys.push(record[this.rowKey]); |
| 5830 | 5041 | } else { |
| 5831 | 5042 | tableSelectedRowKeys.push(record.sId); |
| 5832 | 5043 | } |
| 5833 | 5044 | /* 多表树形删除 */ |
| 5834 | - if (this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 5045 | + if(this.props && this.props.slaveInfo && this.props.slaveInfo.tableProps && this.props.slaveInfo.tableProps.bSlaveInfo) { | |
| 5835 | 5046 | this.handleDelInfoRow(index, record); |
| 5836 | 5047 | return; |
| 5837 | 5048 | } |
| 5838 | 5049 | setTimeout(() => { |
| 5839 | - this.handleInstruct("BtnDel", () => { | |
| 5050 | + this.handleInstruct('BtnDel', () => { | |
| 5840 | 5051 | if (this.props.onDelRow(this.props.name, false, tableSelectedRowKeys, undefined, index)) { |
| 5841 | 5052 | this.handleSumAllColumn(this.props.config, this.state.dataSource); |
| 5842 | 5053 | } |
| ... | ... | @@ -5855,15 +5066,15 @@ class CommonTableRc extends React.Component { |
| 5855 | 5066 | tableSelectedRowKeys.push(record.sId); |
| 5856 | 5067 | const tableInfoName = this.props.slaveInfo.name; |
| 5857 | 5068 | setTimeout(() => { |
| 5858 | - this.handleInstruct("BtnDel", () => { | |
| 5859 | - this.props.onDelRow(tableInfoName, false, tableSelectedRowKeys); | |
| 5069 | + this.handleInstruct('BtnDel', () => { | |
| 5070 | + this.props.onDelRow(tableInfoName, false, tableSelectedRowKeys) | |
| 5860 | 5071 | }); |
| 5861 | 5072 | }, 0); |
| 5862 | 5073 | }; |
| 5863 | 5074 | |
| 5864 | 5075 | /** 复制 */ |
| 5865 | - handleCopyMoreRow = index => { | |
| 5866 | - this.setState({ bOperateMoreVisible: true }); | |
| 5076 | + handleCopyMoreRow = (index) => { | |
| 5077 | + this.setState({ bOperateMoreVisible : true}); | |
| 5867 | 5078 | }; |
| 5868 | 5079 | |
| 5869 | 5080 | /** 提取数据 */ |
| ... | ... | @@ -5886,28 +5097,25 @@ class CommonTableRc extends React.Component { |
| 5886 | 5097 | const { name, config } = this.props; |
| 5887 | 5098 | let btnPupopConfig = {}; |
| 5888 | 5099 | if (commonUtils.isNotEmptyArr(config) && commonUtils.isNotEmptyArr(config.gdsconfigformslave)) { |
| 5889 | - let controlConfig = config.gdsconfigformslave.filter( | |
| 5890 | - item => | |
| 5891 | - commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes("BtnPopup") || item.sControlName.includes("BtnHeadPopup")) | |
| 5892 | - ); | |
| 5893 | - if (btnName && typeof btnName === "string") { | |
| 5894 | - controlConfig = config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName === btnName); | |
| 5100 | + let controlConfig = config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup'))); | |
| 5101 | + if(btnName && typeof btnName === 'string') { | |
| 5102 | + controlConfig = config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName === btnName); | |
| 5895 | 5103 | } |
| 5896 | 5104 | if (commonUtils.isNotEmptyArr(controlConfig)) { |
| 5897 | - if (controlConfig[0].bVisible && controlConfig[0].sDropDownType === "popup") { | |
| 5105 | + if (controlConfig[0].bVisible && controlConfig[0].sDropDownType === 'popup') { | |
| 5898 | 5106 | btnPupopConfig = controlConfig[0]; |
| 5899 | 5107 | const conditionValue = this.props.getSqlCondition(btnPupopConfig); |
| 5900 | - if (commonUtils.isNotEmptyObject(conditionValue)) { | |
| 5901 | - if (commonUtils.isNotEmptyObject(conditionValue.warning)) { | |
| 5108 | + if(commonUtils.isNotEmptyObject(conditionValue)) { | |
| 5109 | + if(commonUtils.isNotEmptyObject(conditionValue.warning)) { | |
| 5902 | 5110 | message.warn(conditionValue.warning); |
| 5903 | 5111 | return; |
| 5904 | 5112 | } |
| 5905 | 5113 | } |
| 5906 | 5114 | this.setState({ |
| 5907 | - commonPopupVisible: true, | |
| 5908 | - commonPopupTbName: name, | |
| 5909 | - commonPopupShowConfig: btnPupopConfig, | |
| 5910 | - commonPopupRecord: record, | |
| 5115 | + commonPopupVisible:true, | |
| 5116 | + commonPopupTbName:name, | |
| 5117 | + commonPopupShowConfig:btnPupopConfig, | |
| 5118 | + commonPopupRecord:record, | |
| 5911 | 5119 | }); |
| 5912 | 5120 | } |
| 5913 | 5121 | } |
| ... | ... | @@ -5926,12 +5134,8 @@ class CommonTableRc extends React.Component { |
| 5926 | 5134 | const { token } = isSlaveInfo ? this.props.slaveInfo.app : this.props.app; |
| 5927 | 5135 | const sActiveId = isSlaveInfo ? this.props.slaveInfo.app.currentPane.formId : this.props.app.currentPane.formId; |
| 5928 | 5136 | const url = `${commonConfig.server_host}configform/sHandleConfigform?sModelsId=${sActiveId}&sName=${formSrcRoute}`; |
| 5929 | - const headerArr = isSlaveInfo | |
| 5930 | - ? this.props.slaveInfo.headerColumn.map(item => item.dataIndex) | |
| 5931 | - : this.props.headerColumn.map(item => item.dataIndex); | |
| 5932 | - const handleData = isSlaveInfo | |
| 5933 | - ? this.props.slaveInfo.config.gdsconfigformslave.filter(item => headerArr.indexOf(item.sName) !== -1) | |
| 5934 | - : this.props.config.gdsconfigformslave.filter(item => headerArr.indexOf(item.sName) !== -1); | |
| 5137 | + const headerArr = isSlaveInfo ? this.props.slaveInfo.headerColumn.map(item => item.dataIndex) : this.props.headerColumn.map(item => item.dataIndex); | |
| 5138 | + const handleData = isSlaveInfo ? this.props.slaveInfo.config.gdsconfigformslave.filter(item => headerArr.indexOf(item.sName) !== -1) : this.props.config.gdsconfigformslave.filter(item => headerArr.indexOf(item.sName) !== -1); | |
| 5935 | 5139 | let sortIndexFirst = 0; |
| 5936 | 5140 | let sortIndexLast = 0; |
| 5937 | 5141 | |
| ... | ... | @@ -5948,41 +5152,37 @@ class CommonTableRc extends React.Component { |
| 5948 | 5152 | handleData[sortIndexFirst].iOrder = handleData[sortIndexLast].iOrder; |
| 5949 | 5153 | handleData[sortIndexLast].iOrder = tempOrder; |
| 5950 | 5154 | |
| 5951 | - const postData = isSlaveInfo | |
| 5952 | - ? { | |
| 5953 | - [this.props.slaveInfo.config.sId]: handleData, | |
| 5954 | - } | |
| 5955 | - : { | |
| 5956 | - [this.props.config.sId]: handleData, | |
| 5957 | - }; | |
| 5155 | + const postData = isSlaveInfo ? { | |
| 5156 | + [this.props.slaveInfo.config.sId]: handleData, | |
| 5157 | + } : { | |
| 5158 | + [this.props.config.sId]: handleData, | |
| 5159 | + }; | |
| 5958 | 5160 | // console.log(postData, 'postData'); |
| 5959 | 5161 | // console.log(sortItems, 'sortItems'); |
| 5960 | 5162 | |
| 5961 | 5163 | const value = { |
| 5962 | - handleType: "group", | |
| 5963 | - sJurisdictionClassifyId: "", | |
| 5164 | + handleType: 'group', | |
| 5165 | + sJurisdictionClassifyId: '', | |
| 5964 | 5166 | bDefault: true, |
| 5965 | 5167 | handleData: postData, |
| 5966 | 5168 | }; |
| 5967 | 5169 | |
| 5968 | 5170 | const options = { |
| 5969 | - method: "POST", | |
| 5171 | + method: 'POST', | |
| 5970 | 5172 | headers: { |
| 5971 | - "Content-Type": "application/json", | |
| 5173 | + 'Content-Type': 'application/json', | |
| 5972 | 5174 | authorization: token, |
| 5973 | 5175 | }, |
| 5974 | 5176 | body: JSON.stringify(value), |
| 5975 | 5177 | }; |
| 5976 | 5178 | const { dispatch } = this.props; |
| 5977 | - fetch(url, options) | |
| 5978 | - .then(response => response.json()) | |
| 5979 | - .then(json => { | |
| 5980 | - if (json.code === 1) { | |
| 5981 | - this.forceUpdate(); | |
| 5982 | - } else if (json.code === -2) { | |
| 5983 | - dispatch({ type: "app/throwError", payload: json }); | |
| 5984 | - } | |
| 5985 | - }); | |
| 5179 | + fetch(url, options).then(response => response.json()).then((json) => { | |
| 5180 | + if (json.code === 1) { | |
| 5181 | + this.forceUpdate(); | |
| 5182 | + } else if (json.code === -2) { | |
| 5183 | + dispatch({ type: 'app/throwError', payload: json }); | |
| 5184 | + } | |
| 5185 | + }); | |
| 5986 | 5186 | }; |
| 5987 | 5187 | |
| 5988 | 5188 | /** 查找控件名是否存在 */ |
| ... | ... | @@ -5999,10 +5199,10 @@ class CommonTableRc extends React.Component { |
| 5999 | 5199 | // case 'BtnAdd': |
| 6000 | 5200 | // propsIcon = props.tableProps.setAdd; |
| 6001 | 5201 | // break; |
| 6002 | - case "BtnChooseMaterials": | |
| 5202 | + case 'BtnChooseMaterials': | |
| 6003 | 5203 | propsIcon = props.tableProps.setMaterial; |
| 6004 | 5204 | break; |
| 6005 | - case "BtnChooseProcess": | |
| 5205 | + case 'BtnChooseProcess': | |
| 6006 | 5206 | propsIcon = props.tableProps.setProcess; |
| 6007 | 5207 | break; |
| 6008 | 5208 | // case 'BtnCopy': |
| ... | ... | @@ -6021,13 +5221,9 @@ class CommonTableRc extends React.Component { |
| 6021 | 5221 | /* 返回值声明 */ |
| 6022 | 5222 | let ret = false; |
| 6023 | 5223 | /* 查询控件名是否存在 */ |
| 6024 | - if ( | |
| 6025 | - commonUtils.isNotEmptyArr(props.config) && | |
| 6026 | - commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && | |
| 6027 | - commonUtils.isNotEmptyStr(controlName) | |
| 6028 | - ) { | |
| 5224 | + if (commonUtils.isNotEmptyArr(props.config) && commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr(controlName)) { | |
| 6029 | 5225 | const controlConfig = props.config.gdsconfigformslave.filter(item => item.sControlName === controlName); |
| 6030 | - ret = commonUtils.isEmptyArr(controlConfig) ? (propsIcon ? true : false) : commonUtils.converStrToBoolean(controlConfig[0].bVisible); | |
| 5226 | + ret = commonUtils.isEmptyArr(controlConfig) ? ( propsIcon ? true : false ) : commonUtils.converStrToBoolean(controlConfig[0].bVisible); | |
| 6031 | 5227 | } |
| 6032 | 5228 | /* 返回值 */ |
| 6033 | 5229 | return ret; |
| ... | ... | @@ -6040,14 +5236,10 @@ class CommonTableRc extends React.Component { |
| 6040 | 5236 | /* 返回值声明 */ |
| 6041 | 5237 | let ret = false; |
| 6042 | 5238 | /* 查询控件名是否存在 */ |
| 6043 | - if ( | |
| 6044 | - commonUtils.isNotEmptyArr(props.config) && | |
| 6045 | - commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && | |
| 6046 | - commonUtils.isNotEmptyStr(controlName) | |
| 6047 | - ) { | |
| 5239 | + if (commonUtils.isNotEmptyArr(props.config) && commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr(controlName)) { | |
| 6048 | 5240 | const controlConfig = props.config.gdsconfigformslave.filter(item => item.sControlName === controlName); |
| 6049 | 5241 | ret = commonUtils.isNotEmptyArr(controlConfig) && commonUtils.converStrToBoolean(controlConfig[0].iTag === 3); |
| 6050 | - if (ret && controlName === "BtnUpload" && Array.isArray(controlConfig)) { | |
| 5242 | + if(ret && controlName === 'BtnUpload' && Array.isArray(controlConfig)) { | |
| 6051 | 5243 | this.BtnUploadDivPropsAttr.current = controlConfig[0]; |
| 6052 | 5244 | } |
| 6053 | 5245 | } |
| ... | ... | @@ -6060,11 +5252,7 @@ class CommonTableRc extends React.Component { |
| 6060 | 5252 | /* 返回值声明 */ |
| 6061 | 5253 | let ret = false; |
| 6062 | 5254 | /* 查询控件名是否存在 */ |
| 6063 | - if ( | |
| 6064 | - commonUtils.isNotEmptyArr(props.config) && | |
| 6065 | - commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && | |
| 6066 | - commonUtils.isNotEmptyStr(controlName) | |
| 6067 | - ) { | |
| 5255 | + if (commonUtils.isNotEmptyArr(props.config) && commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr(controlName)) { | |
| 6068 | 5256 | const controlConfig = props.config.gdsconfigformslave.filter(item => item.sControlName === controlName); |
| 6069 | 5257 | ret = commonUtils.isNotEmptyArr(controlConfig) && commonUtils.converStrToBoolean(controlConfig[0].bVisible); |
| 6070 | 5258 | } |
| ... | ... | @@ -6076,16 +5264,10 @@ class CommonTableRc extends React.Component { |
| 6076 | 5264 | /* 返回值声明 */ |
| 6077 | 5265 | let ret = false; |
| 6078 | 5266 | /* 查询控件名是否存在 */ |
| 6079 | - if ( | |
| 6080 | - commonUtils.isNotEmptyArr(props.config) && | |
| 6081 | - commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && | |
| 6082 | - commonUtils.isNotEmptyStr(controlName) | |
| 6083 | - ) { | |
| 6084 | - const controlConfig = props.config.gdsconfigformslave.filter( | |
| 6085 | - item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.includes(controlName) && !item.sControlName.includes(".") | |
| 6086 | - ); | |
| 5267 | + if (commonUtils.isNotEmptyArr(props.config) && commonUtils.isNotEmptyArr(props.config.gdsconfigformslave) && commonUtils.isNotEmptyStr(controlName)) { | |
| 5268 | + const controlConfig = props.config.gdsconfigformslave.filter(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.includes(controlName) && !item.sControlName.includes('.')); | |
| 6087 | 5269 | if (commonUtils.isNotEmptyArr(controlConfig)) { |
| 6088 | - if (controlConfig[0].bVisible && controlConfig[0].sDropDownType === "popup") { | |
| 5270 | + if (controlConfig[0].bVisible && controlConfig[0].sDropDownType === 'popup') { | |
| 6089 | 5271 | ret = true; |
| 6090 | 5272 | } |
| 6091 | 5273 | } |
| ... | ... | @@ -6096,175 +5278,131 @@ class CommonTableRc extends React.Component { |
| 6096 | 5278 | |
| 6097 | 5279 | handleGetRjRes = (res, index, sName) => { |
| 6098 | 5280 | const { masterData = {}, formId, enabled } = this.props; |
| 6099 | - if (enabled && formId === "12710101117225611571970" && masterData.sTeamName?.includes("质检") && sName === "sInspectionCode") { | |
| 5281 | + if (enabled && formId === "12710101117225611571970" && masterData.sTeamName?.includes('质检') && sName === "sInspectionCode") { | |
| 6100 | 5282 | return ( |
| 6101 | 5283 | <> |
| 6102 | 5284 | {res} |
| 6103 | 5285 | <Button |
| 6104 | - type="link" | |
| 6105 | - icon={<CaretUpOutlined style={{ fontSize: 16 }} />} | |
| 6106 | - size="large" | |
| 6107 | - style={{ | |
| 6108 | - position: "absolute", | |
| 6109 | - display: "flex", | |
| 6110 | - alignItems: "center", | |
| 6111 | - justifyContent: "center", | |
| 6112 | - top: 0, | |
| 6113 | - right: 0, | |
| 6114 | - height: 15, | |
| 6115 | - }} | |
| 6116 | - onClick={this.props.onMoveLine.bind(this, { | |
| 6117 | - index, | |
| 6118 | - direction: "up", | |
| 6119 | - })} | |
| 6120 | - /> | |
| 6121 | - <Button | |
| 6122 | - type="link" | |
| 6123 | - icon={<CaretDownOutlined style={{ fontSize: 16 }} />} | |
| 6124 | - size="large" | |
| 6125 | - style={{ | |
| 6126 | - position: "absolute", | |
| 6127 | - display: "flex", | |
| 6128 | - alignItems: "center", | |
| 6129 | - justifyContent: "center", | |
| 6130 | - bottom: 0, | |
| 6131 | - right: 0, | |
| 6132 | - height: 15, | |
| 6133 | - }} | |
| 6134 | - onClick={this.props.onMoveLine.bind(this, { | |
| 6135 | - index, | |
| 6136 | - direction: "down", | |
| 6137 | - })} | |
| 6138 | - /> | |
| 6139 | - </> | |
| 6140 | - ); | |
| 5286 | + type="link" | |
| 5287 | + icon={<CaretUpOutlined style={{ fontSize: 16 }} />} | |
| 5288 | + size="large" | |
| 5289 | + style={{ | |
| 5290 | + position: "absolute", | |
| 5291 | + display: "flex", | |
| 5292 | + alignItems: "center", | |
| 5293 | + justifyContent: "center", | |
| 5294 | + top: 0, | |
| 5295 | + right: 0, | |
| 5296 | + height: 15 | |
| 5297 | + }} | |
| 5298 | + onClick={this.props.onMoveLine.bind(this, { | |
| 5299 | + index, | |
| 5300 | + direction: "up" | |
| 5301 | + })} | |
| 5302 | + /> | |
| 5303 | + <Button | |
| 5304 | + type="link" | |
| 5305 | + icon={<CaretDownOutlined style={{ fontSize: 16 }} />} | |
| 5306 | + size="large" | |
| 5307 | + style={{ | |
| 5308 | + position: "absolute", | |
| 5309 | + display: "flex", | |
| 5310 | + alignItems: "center", | |
| 5311 | + justifyContent: "center", | |
| 5312 | + bottom: 0, | |
| 5313 | + right: 0, | |
| 5314 | + height: 15 | |
| 5315 | + }} | |
| 5316 | + onClick={this.props.onMoveLine.bind(this, { | |
| 5317 | + index, | |
| 5318 | + direction: "down" | |
| 5319 | + })} | |
| 5320 | + /> | |
| 5321 | + </>); | |
| 6141 | 5322 | } else { |
| 6142 | 5323 | return res; |
| 6143 | 5324 | } |
| 6144 | - }; | |
| 5325 | + } | |
| 6145 | 5326 | |
| 6146 | 5327 | /** 绑定showType控件 */ |
| 6147 | 5328 | bindShowType = (props, text, record, sName, index, isSlaveInfo) => { |
| 6148 | 5329 | record.iRowNum = index + 1; |
| 6149 | 5330 | /* 如果从表没有数据就返回一个默认的input text,不返回showType了 */ |
| 6150 | - let res = ""; | |
| 5331 | + let res = ''; | |
| 6151 | 5332 | const idx = index; |
| 6152 | 5333 | const inputProps = { |
| 6153 | 5334 | disabled: true, |
| 6154 | 5335 | value: record[sName], |
| 6155 | 5336 | }; |
| 6156 | - if (sName === "tableLastEmpty") { | |
| 6157 | - return ""; | |
| 5337 | + if (sName === 'tableLastEmpty') { | |
| 5338 | + return ''; | |
| 6158 | 5339 | } |
| 6159 | 5340 | const showConfigObj = this.getShowConfig(props, sName, isSlaveInfo); |
| 6160 | - const { dNetMoney, dNetPrice } = props.app.decimals; | |
| 6161 | - let bShow = ""; | |
| 5341 | + const { dNetMoney, dNetPrice } = props.app.decimals; | |
| 5342 | + let bShow = ''; | |
| 6162 | 5343 | /* 如果是布尔类型 ,加checkbox */ |
| 6163 | - if (commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === "b") { | |
| 5344 | + if (commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') { | |
| 6164 | 5345 | if (props.enabled) { |
| 6165 | - bShow = ( | |
| 6166 | - <span | |
| 6167 | - style={{ border: "none", outline: "none" }} | |
| 6168 | - onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 6169 | - suppressContentEditableWarning | |
| 6170 | - contentEditable="true" | |
| 6171 | - > | |
| 6172 | - {" "} | |
| 6173 | - <Checkbox checked={record[sName]} /> | |
| 6174 | - </span> | |
| 6175 | - ); | |
| 5346 | + bShow = <span style={{ border: 'none', outline: 'none' }} onKeyDown={e => this.onKeyDownDiv(e, sName)} suppressContentEditableWarning contentEditable="true"> <Checkbox checked={record[sName]} /></span>; | |
| 6176 | 5347 | } else { |
| 6177 | - bShow = ( | |
| 6178 | - <span | |
| 6179 | - style={{ border: "none", outline: "none" }} | |
| 6180 | - onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 6181 | - suppressContentEditableWarning | |
| 6182 | - contentEditable="true" | |
| 6183 | - > | |
| 6184 | - {" "} | |
| 6185 | - <Checkbox checked={record[sName]} disabled /> | |
| 6186 | - </span> | |
| 6187 | - ); | |
| 5348 | + bShow = <span style={{ border: 'none', outline: 'none' }} onKeyDown={e => this.onKeyDownDiv(e, sName)} suppressContentEditableWarning contentEditable="true"> <Checkbox checked={record[sName]} disabled /></span>; | |
| 6188 | 5349 | } |
| 6189 | 5350 | } |
| 6190 | 5351 | /* 如果是图片类型 ,加载图片 */ |
| 6191 | - let imgBox = ""; | |
| 6192 | - if (commonUtils.isNotEmptyObject(sName) && sName.indexOf("picture") > -1) { | |
| 6193 | - const picAddr = commonUtils.isNotEmptyObject(record[sName]) ? record[sName].split(",") : ""; | |
| 5352 | + let imgBox = ''; | |
| 5353 | + if (commonUtils.isNotEmptyObject(sName) && sName.indexOf('picture') > -1) { | |
| 5354 | + const picAddr = commonUtils.isNotEmptyObject(record[sName]) ? record[sName].split(',') : ''; | |
| 6194 | 5355 | if (commonUtils.isNotEmptyObject(picAddr)) { |
| 6195 | 5356 | const { token } = props.app; |
| 6196 | - const dataUrl = picAddr[0].includes("xlyerpfiles") | |
| 6197 | - ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` | |
| 6198 | - : picAddr[0]; /* 缩略图 */ | |
| 6199 | - const officeFileTypeList = ["PDF", "DOCX", "XLSX", "MP4", "WEBM", "OGG"]; | |
| 6200 | - const imgTypeList = ["PNG", "SVG", "JPG", "JPEG", "GIF", "BMP", "TIFF", "ICO"]; | |
| 6201 | - const officeFileType = picAddr[0].split(".").pop().toUpperCase(); | |
| 6202 | - let fileIcon = <FilePdfOutlined />; | |
| 6203 | - if (officeFileType === "DOCX") { | |
| 5357 | + const dataUrl = picAddr[0].includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${picAddr[0]}&scale=0.1&sModelsId=100&token=${token}` : picAddr[0]; /* 缩略图 */ | |
| 5358 | + const officeFileTypeList = ['PDF', 'DOCX', 'XLSX', 'MP4', 'WEBM', 'OGG']; | |
| 5359 | + const imgTypeList = ['PNG', 'SVG', 'JPG', 'JPEG', 'GIF', 'BMP', 'TIFF', 'ICO']; | |
| 5360 | + const officeFileType = picAddr[0].split('.').pop().toUpperCase(); | |
| 5361 | + let fileIcon = <FilePdfOutlined/>; | |
| 5362 | + if (officeFileType === 'DOCX') { | |
| 6204 | 5363 | fileIcon = <FileWordOutlined />; |
| 6205 | - } else if (officeFileType === "XLSX") { | |
| 5364 | + } else if (officeFileType === 'XLSX') { | |
| 6206 | 5365 | fileIcon = <FileExcelOutlined />; |
| 6207 | - } else if (["MP4", "WEBM", "OGG"].includes(officeFileType)) { | |
| 5366 | + } else if (['MP4', 'WEBM', 'OGG'].includes(officeFileType)) { | |
| 6208 | 5367 | fileIcon = <PlaySquareOutlined />; |
| 6209 | 5368 | } |
| 6210 | 5369 | if (officeFileTypeList.includes(officeFileType)) { |
| 6211 | - imgBox = ( | |
| 6212 | - <span | |
| 6213 | - style={{ cursor: "pointer" }} | |
| 6214 | - onClick={() => { | |
| 6215 | - this.setState({ | |
| 6216 | - officePreviewVisible: true, | |
| 6217 | - officeFileUrl: picAddr[0], | |
| 6218 | - }); | |
| 6219 | - }} | |
| 6220 | - > | |
| 6221 | - {fileIcon} | |
| 6222 | - </span> | |
| 6223 | - ); | |
| 5370 | + imgBox = <span | |
| 5371 | + style={{ cursor: 'pointer' }} | |
| 5372 | + onClick={() => { | |
| 5373 | + this.setState({ | |
| 5374 | + officePreviewVisible: true, | |
| 5375 | + officeFileUrl: picAddr[0] | |
| 5376 | + }) | |
| 5377 | + }}>{fileIcon}</span> | |
| 6224 | 5378 | } else if (imgTypeList.includes(officeFileType)) { |
| 6225 | - imgBox = ( | |
| 6226 | - <span style={{ cursor: "pointer" }}> | |
| 6227 | - {" "} | |
| 6228 | - <img | |
| 6229 | - src={dataUrl} | |
| 6230 | - alt="img" | |
| 6231 | - onFocus={() => 0} | |
| 6232 | - onClick={e => this.handlePreviewImage(e, picAddr)} | |
| 6233 | - style={{ width: "30px", height: "20px" }} | |
| 6234 | - /> | |
| 6235 | - </span> | |
| 6236 | - ); | |
| 5379 | + imgBox = <span style={{ cursor: 'pointer' }}> <img src={dataUrl} alt="img" onFocus={() => 0} onClick={e => this.handlePreviewImage(e, picAddr)} style={{ width: '30px', height: '20px' }} /></span>; | |
| 6237 | 5380 | } else { |
| 6238 | - imgBox = ( | |
| 6239 | - <span> | |
| 6240 | - <FileOutlined /> | |
| 6241 | - </span> | |
| 6242 | - ); | |
| 5381 | + imgBox = <span><FileOutlined /></span> | |
| 6243 | 5382 | } |
| 6244 | 5383 | } |
| 6245 | 5384 | } |
| 6246 | 5385 | /* 变量设置 显示字段名 */ |
| 6247 | - let specialTitle = ""; | |
| 5386 | + let specialTitle =''; | |
| 6248 | 5387 | let bSpecialTitle = false; |
| 6249 | - if (sName !== "" && sName.includes("sValue")) { | |
| 6250 | - specialTitle = `R${idx}_${sName}`; | |
| 6251 | - } else if (location.pathname?.includes("production") && (sName === "sStateName" || sName === "sProcessState")) { | |
| 6252 | - if (commonUtils.isNotEmptyObject(record?.sState) || commonUtils.isNotEmptyObject(record?.sStateName)) { | |
| 6253 | - specialTitle = commonUtils.isNotEmptyObject(record.sWorkOrderChangeMemo) ? record.sWorkOrderChangeMemo : ""; | |
| 5388 | + if(sName!=='' && sName.includes('sValue')){ | |
| 5389 | + specialTitle =`R${idx}_${sName}`; | |
| 5390 | + }else if(location.pathname?.includes('production') && (sName === 'sStateName' || sName==='sProcessState')) { | |
| 5391 | + if(commonUtils.isNotEmptyObject(record?.sState) || commonUtils.isNotEmptyObject(record?.sStateName)) { | |
| 5392 | + specialTitle = commonUtils.isNotEmptyObject(record.sWorkOrderChangeMemo)? record.sWorkOrderChangeMemo : ''; | |
| 6254 | 5393 | bSpecialTitle = true; |
| 6255 | 5394 | } |
| 6256 | 5395 | } |
| 6257 | - if (record.bSum && commonConfig.hasSum) { | |
| 6258 | - /* 从表无数据 */ | |
| 6259 | - res = <Input {...inputProps} />; | |
| 5396 | + if (record.bSum && commonConfig.hasSum) { /* 从表无数据 */ | |
| 5397 | + res = (<Input {...inputProps} />); | |
| 6260 | 5398 | const cell = this.mergeTableCell(res, idx, sName, isSlaveInfo); |
| 6261 | 5399 | return cell; |
| 6262 | - } else if (props.tableBelone === "list" || (commonUtils.isNotEmptyObject(props.slaveInfo) && props.slaveInfo.tableBelone === "list")) { | |
| 5400 | + } else if (props.tableBelone === 'list' || ((commonUtils.isNotEmptyObject(props.slaveInfo) && props.slaveInfo.tableBelone === 'list'))) { | |
| 6263 | 5401 | /* CommonList列表加下划线 */ |
| 6264 | 5402 | const showConfig = this.getShowConfig(props, sName) || {}; |
| 6265 | 5403 | /* 获取单元格颜色配置 */ |
| 6266 | - let cellColor = ""; | |
| 6267 | - let backgroundColor = ""; | |
| 5404 | + let cellColor = ''; | |
| 5405 | + let backgroundColor = ''; | |
| 6268 | 5406 | if (commonUtils.isNotEmptyArr(showConfig)) { |
| 6269 | 5407 | const cellStyle = this.getCellColorConfig(text, record, sName); |
| 6270 | 5408 | if (commonUtils.isNotEmptyObject(cellStyle)) { |
| ... | ... | @@ -6273,33 +5411,29 @@ class CommonTableRc extends React.Component { |
| 6273 | 5411 | } |
| 6274 | 5412 | } |
| 6275 | 5413 | let sValue = record[sName]; |
| 6276 | - let linkStyle = ""; | |
| 6277 | - let displayAlign = "left"; | |
| 6278 | - if (commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === "d") { | |
| 5414 | + let linkStyle = ''; | |
| 5415 | + let displayAlign = 'left'; | |
| 5416 | + if (commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'd') { | |
| 6279 | 5417 | const { dNumAlign } = props.app.decimals; |
| 6280 | - displayAlign = dNumAlign === "1" ? "right" : "left"; /* 判断如果是数字格式,对齐方式根据系统设定s */ | |
| 6281 | - } | |
| 6282 | - const firstDataIndex = commonUtils.isNotEmptyObject(sName) ? sName.substring(0, 1) : ""; /* 控件首字母(数据格式:字符串) */ | |
| 6283 | - if ( | |
| 6284 | - (showConfig.sDropDownType === "picArr" || showConfig.sDropDownType === "picArrModal") && | |
| 6285 | - !commonUtils.isEmpty(showConfig.sActiveId) && | |
| 6286 | - commonUtils.isEmptyArr(props.sGroupByList) | |
| 6287 | - ) { | |
| 6288 | - linkStyle = "linksActiveIdStyle"; /* 列表加弹窗,如果有分组,则不加弹窗 */ | |
| 6289 | - if (sName === "sDetailMemoview") { | |
| 5418 | + displayAlign = dNumAlign === '1' ? 'right' : 'left'; /* 判断如果是数字格式,对齐方式根据系统设定s */ | |
| 5419 | + } | |
| 5420 | + const firstDataIndex = commonUtils.isNotEmptyObject(sName) ? sName.substring(0, 1) : ''; /* 控件首字母(数据格式:字符串) */ | |
| 5421 | + if ((showConfig.sDropDownType === 'picArr' || showConfig.sDropDownType === 'picArrModal') && !commonUtils.isEmpty(showConfig.sActiveId) && commonUtils.isEmptyArr(props.sGroupByList)) { | |
| 5422 | + linkStyle = 'linksActiveIdStyle'; /* 列表加弹窗,如果有分组,则不加弹窗 */ | |
| 5423 | + if (sName === 'sDetailMemoview') { | |
| 6290 | 5424 | // record.sDetailMemotemp = sValue; /* 存放值字段 */ |
| 6291 | - sValue = sValue !== undefined ? "查看操作日志" : sValue; | |
| 5425 | + sValue = sValue !== undefined ? '查看操作日志' : sValue; | |
| 6292 | 5426 | } |
| 6293 | - } else if (showConfig.sDropDownType === "const") { | |
| 5427 | + } else if (showConfig.sDropDownType === 'const') { | |
| 6294 | 5428 | let showDropDown = []; |
| 6295 | - if (typeof showConfig.showDropDown === "object") { | |
| 5429 | + if (typeof showConfig.showDropDown === 'object') { | |
| 6296 | 5430 | showDropDown = showConfig.showDropDown; |
| 6297 | 5431 | } else { |
| 6298 | 5432 | showDropDown = commonUtils.objectToArr(commonUtils.convertStrToObj(showConfig.showDropDown)); |
| 6299 | 5433 | } |
| 6300 | 5434 | const iIndex = commonUtils.isEmpty(record[sName]) ? -1 : showDropDown.findIndex(item => item.sId === record[sName].toString()); |
| 6301 | - sValue = iIndex > -1 ? showDropDown[iIndex].value : ""; | |
| 6302 | - } else if (firstDataIndex === "t" || firstDataIndex === "p" || firstDataIndex === "m") { | |
| 5435 | + sValue = iIndex > -1 ? showDropDown[iIndex].value : ''; | |
| 5436 | + } else if (firstDataIndex === 't' || firstDataIndex === 'p' || firstDataIndex === 'm') { | |
| 6303 | 5437 | const { sDateFormat } = showConfig; |
| 6304 | 5438 | if (!commonUtils.isEmpty(sValue)) { |
| 6305 | 5439 | if (commonUtils.isNotEmptyStr(sDateFormat)) { |
| ... | ... | @@ -6308,36 +5442,34 @@ class CommonTableRc extends React.Component { |
| 6308 | 5442 | sValue = moment(sValue).format(props.getDateFormat()); |
| 6309 | 5443 | } |
| 6310 | 5444 | } |
| 6311 | - } else if (firstDataIndex === "d") { | |
| 5445 | + } else if (firstDataIndex === 'd') { | |
| 6312 | 5446 | const { sDateFormat } = showConfig; |
| 6313 | 5447 | /* 如果配置时间格式中设置了0.0000则以配置为准,没有设置时间格式 则以系统设定为主 */ |
| 6314 | 5448 | if (commonUtils.isNotEmptyObject(sDateFormat)) { |
| 6315 | 5449 | /* 取小数点位数 */ |
| 6316 | 5450 | let point = 0; |
| 6317 | - let strIndex = sDateFormat.indexOf("."); | |
| 6318 | - if (strIndex > -1 && sDateFormat.length > 1) { | |
| 5451 | + let strIndex = sDateFormat.indexOf('.'); | |
| 5452 | + if(strIndex > -1 && sDateFormat.length > 1) { | |
| 6319 | 5453 | point = sDateFormat.substring(strIndex + 1, sDateFormat.length).length; |
| 6320 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5454 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 6321 | 5455 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 6322 | - if (!isNaN(dConfigResult)) { | |
| 5456 | + if(!isNaN(dConfigResult)) { | |
| 6323 | 5457 | sValue = dConfigResult; |
| 6324 | 5458 | } |
| 6325 | 5459 | } |
| 6326 | 5460 | } |
| 6327 | 5461 | } else { |
| 6328 | - if (firstDataIndex === "d" && sName.toLowerCase().endsWith("price")) { | |
| 6329 | - /* 列表单价格式化显示 */ | |
| 6330 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5462 | + if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('price')) { /* 列表单价格式化显示 */ | |
| 5463 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 6331 | 5464 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice).toFixed(dNetPrice); |
| 6332 | - if (!isNaN(dResult)) { | |
| 5465 | + if(!isNaN(dResult)) { | |
| 6333 | 5466 | sValue = dResult; |
| 6334 | 5467 | } |
| 6335 | 5468 | } |
| 6336 | - } else if (firstDataIndex === "d" && sName.toLowerCase().endsWith("money")) { | |
| 6337 | - /* 列表金额格式化显示 */ | |
| 6338 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5469 | + } else if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ | |
| 5470 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 6339 | 5471 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney).toFixed(dNetMoney); |
| 6340 | - if (!isNaN(dResult)) { | |
| 5472 | + if(!isNaN(dResult)) { | |
| 6341 | 5473 | sValue = dResult; |
| 6342 | 5474 | } |
| 6343 | 5475 | } |
| ... | ... | @@ -6346,14 +5478,14 @@ class CommonTableRc extends React.Component { |
| 6346 | 5478 | } |
| 6347 | 5479 | |
| 6348 | 5480 | /* 如果列表行包含sDivRow并且sDivRow有值 则代表该行行不渲染数据 只做分割作用 */ |
| 6349 | - if (commonUtils.isNotEmptyObject(record.sDivRow) && record.bInsert) { | |
| 6350 | - bShow = ""; | |
| 6351 | - if (sName !== "sDivRow") { | |
| 6352 | - sValue = ""; | |
| 5481 | + if(commonUtils.isNotEmptyObject(record.sDivRow) && record.bInsert) { | |
| 5482 | + bShow = ''; | |
| 5483 | + if(sName !=='sDivRow') { | |
| 5484 | + sValue = ''; | |
| 6353 | 5485 | } |
| 6354 | 5486 | } |
| 6355 | - if (commonUtils.isNotEmptyObject(sName) && sName === "sColorSerialMemo") { | |
| 6356 | - if (sName === "sColorSerialMemo") { | |
| 5487 | + if (commonUtils.isNotEmptyObject(sName) && sName === 'sColorSerialMemo') { | |
| 5488 | + if (sName === 'sColorSerialMemo') { | |
| 6357 | 5489 | let JsonData = []; |
| 6358 | 5490 | if (commonUtils.isNotEmptyObject(sValue)) { |
| 6359 | 5491 | try { |
| ... | ... | @@ -6363,164 +5495,106 @@ class CommonTableRc extends React.Component { |
| 6363 | 5495 | } |
| 6364 | 5496 | } |
| 6365 | 5497 | /* 将色序json解析成需要的字符串形式 */ |
| 6366 | - let sMemo = ""; | |
| 5498 | + let sMemo = ''; | |
| 6367 | 5499 | if (commonUtils.isNotEmptyArr(JsonData)) { |
| 6368 | - JsonData.forEach(item => { | |
| 5500 | + JsonData.forEach((item) => { | |
| 6369 | 5501 | sMemo += `${item.sName}+`; |
| 6370 | 5502 | }); |
| 6371 | - sMemo = commonUtils.isNotEmptyObject(sMemo) ? sMemo.substr(0, sMemo.length - 1) : ""; | |
| 5503 | + sMemo = commonUtils.isNotEmptyObject(sMemo) ? sMemo.substr(0, sMemo.length - 1) : ''; | |
| 6372 | 5504 | sValue = sMemo; |
| 6373 | 5505 | } |
| 6374 | 5506 | } |
| 6375 | 5507 | } |
| 6376 | 5508 | |
| 6377 | - if (cellColor && sName !== "sState") { | |
| 6378 | - res = ( | |
| 6379 | - <div | |
| 6380 | - className="listDiv" | |
| 6381 | - style={{ | |
| 6382 | - position: "absolute", | |
| 6383 | - width: "100%", | |
| 6384 | - left: 0, | |
| 6385 | - top: 0, | |
| 6386 | - bottom: 0, | |
| 6387 | - overflow: "hidden", | |
| 6388 | - textOverflow: "ellipsis", | |
| 6389 | - whiteSpace: "nowrap", | |
| 6390 | - textAlign: `${displayAlign}`, | |
| 6391 | - backgroundColor: `${backgroundColor}`, | |
| 6392 | - color: `${cellColor}`, | |
| 6393 | - }} | |
| 6394 | - > | |
| 6395 | - {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === "b") || imgBox !== "" ? ( | |
| 6396 | - "" | |
| 6397 | - ) : ( | |
| 6398 | - <div | |
| 6399 | - className={linkStyle} | |
| 6400 | - title={sValue} | |
| 6401 | - style={{ | |
| 6402 | - padding: "4px", | |
| 6403 | - paddingTop: "6px", | |
| 6404 | - backgroundColor: `${backgroundColor}`, | |
| 6405 | - color: `${cellColor}`, | |
| 6406 | - width: "100%", | |
| 6407 | - height: "100%", | |
| 6408 | - }} | |
| 6409 | - onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 6410 | - onCut={e => e.preventDefault()} | |
| 6411 | - onPaste={e => e.preventDefault()} | |
| 6412 | - suppressContentEditableWarning | |
| 6413 | - contentEditable="true" | |
| 6414 | - onClick={ | |
| 6415 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 6416 | - ? this.handleViewClick.bind(this, isSlaveInfo ? "slaveInfo" : this.props.name, showConfig.sName, record, index, showConfig) | |
| 6417 | - : null | |
| 6418 | - } | |
| 6419 | - > | |
| 6420 | - {" "} | |
| 6421 | - {sValue} | |
| 6422 | - </div> | |
| 6423 | - )} | |
| 6424 | - {bShow} | |
| 6425 | - {imgBox} | |
| 6426 | - </div> | |
| 6427 | - ); | |
| 5509 | + if (cellColor && sName !=='sState') { | |
| 5510 | + res = (<div | |
| 5511 | + className='listDiv' | |
| 5512 | + style={{ | |
| 5513 | + position: 'absolute', width:'100%', left: 0, top:0, bottom:0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', textAlign:`${displayAlign}`, backgroundColor: `${backgroundColor}`, color: `${cellColor}` | |
| 5514 | + }} | |
| 5515 | + > | |
| 5516 | + {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') || (imgBox !== '') ? '' : | |
| 5517 | + <div | |
| 5518 | + className={linkStyle} | |
| 5519 | + title={sValue} | |
| 5520 | + style={{ padding: '4px', paddingTop:'6px', backgroundColor: `${backgroundColor}`, color: `${cellColor}`, width: '100%', height: '100%' }} | |
| 5521 | + onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 5522 | + onCut={e => e.preventDefault()} | |
| 5523 | + onPaste={e => e.preventDefault()} | |
| 5524 | + suppressContentEditableWarning | |
| 5525 | + contentEditable="true" | |
| 5526 | + onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, isSlaveInfo ? 'slaveInfo' : this.props.name, showConfig.sName, record, index, showConfig) : null} | |
| 5527 | + > { sValue}</div>} | |
| 5528 | + {bShow}{imgBox} | |
| 5529 | + </div>); | |
| 6428 | 5530 | } else { |
| 6429 | - res = ( | |
| 6430 | - <div | |
| 6431 | - className={`${styles.tdCell} listDiv`} | |
| 6432 | - style={{ | |
| 6433 | - position: "relative", | |
| 6434 | - overflow: "hidden", | |
| 6435 | - textOverflow: "ellipsis", | |
| 6436 | - whiteSpace: "nowrap", | |
| 6437 | - color: `${cellColor}`, | |
| 6438 | - backgroundColor: `${backgroundColor}`, | |
| 6439 | - textAlign: `${displayAlign}`, | |
| 6440 | - }} | |
| 6441 | - > | |
| 6442 | - {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === "b") || imgBox !== "" ? ( | |
| 6443 | - "" | |
| 6444 | - ) : ( | |
| 6445 | - <Tooltip | |
| 6446 | - arrow={false} | |
| 6447 | - placement="bottomLeft" | |
| 6448 | - overlayClassName="commonTitle" | |
| 6449 | - mouseEnterDelay={0.8} | |
| 6450 | - title={<span style={{ fontSize: 16 }}>{sValue}</span>} | |
| 6451 | - > | |
| 6452 | - <span | |
| 6453 | - className={linkStyle} | |
| 6454 | - style={{ border: "none", outline: "none" }} | |
| 6455 | - onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 6456 | - onCut={e => e.preventDefault()} | |
| 6457 | - onPaste={e => e.preventDefault()} | |
| 6458 | - suppressContentEditableWarning | |
| 6459 | - contentEditable="true" | |
| 6460 | - onClick={ | |
| 6461 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 6462 | - ? this.handleViewClick.bind(this, isSlaveInfo ? "slaveInfo" : this.props.name, showConfig.sName, record, index, showConfig) | |
| 6463 | - : null | |
| 6464 | - } | |
| 6465 | - > | |
| 6466 | - {" "} | |
| 6467 | - {sValue} | |
| 6468 | - </span> | |
| 6469 | - </Tooltip> | |
| 6470 | - )} | |
| 6471 | - {bShow} | |
| 6472 | - {imgBox} | |
| 6473 | - {this.handleGetFastSearchBtn({ record, sName, isSlaveInfo })} | |
| 6474 | - </div> | |
| 6475 | - ); | |
| 5531 | + res = (<div | |
| 5532 | + className={`${styles.tdCell} listDiv`} | |
| 5533 | + style={{ | |
| 5534 | + position: 'relative', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', color: `${cellColor}`, backgroundColor: `${backgroundColor}`, textAlign:`${displayAlign}`, | |
| 5535 | + }} | |
| 5536 | + data-name={showConfig.sName} | |
| 5537 | + data-control-name={showConfig.sControlName} | |
| 5538 | + > | |
| 5539 | + {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') || (imgBox !== '') ? '' : | |
| 5540 | + <Tooltip | |
| 5541 | + arrow={false} | |
| 5542 | + placement='bottomLeft' | |
| 5543 | + overlayClassName="commonTitle" | |
| 5544 | + mouseEnterDelay={0.8} | |
| 5545 | + title={<span style={{ fontSize: 16 }}>{sValue}</span>} | |
| 5546 | + > | |
| 5547 | + <span | |
| 5548 | + className={linkStyle} | |
| 5549 | + style={{border: 'none', outline: 'none'}} | |
| 5550 | + onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 5551 | + onCut={e => e.preventDefault()} | |
| 5552 | + onPaste={e => e.preventDefault()} | |
| 5553 | + suppressContentEditableWarning | |
| 5554 | + contentEditable="true" | |
| 5555 | + onClick={commonUtils.isNotEmptyObject(linkStyle) ? this.handleViewClick.bind(this, isSlaveInfo ? 'slaveInfo' : this.props.name, showConfig.sName, record, index, showConfig) : null} | |
| 5556 | + > {sValue}</span> | |
| 5557 | + </Tooltip> | |
| 5558 | + } | |
| 5559 | + {bShow}{imgBox}{this.handleGetFastSearchBtn({record, sName, isSlaveInfo})} | |
| 5560 | + </div>); | |
| 6476 | 5561 | } |
| 6477 | 5562 | const cell = this.mergeTableCell(res, idx, sName, isSlaveInfo); |
| 6478 | 5563 | return cell; |
| 6479 | - } else if ( | |
| 6480 | - (commonUtils.isNotEmptyObject(showConfigObj) && | |
| 6481 | - !showConfigObj.bReadonly && | |
| 6482 | - (props.enabled || showConfigObj.iTag === 3) && | |
| 6483 | - commonUtils.isEmptyObject(record.sDivRowNew) && | |
| 6484 | - ((commonUtils.isNotEmptyArr(props.selectedRowKeys) && props.selectedRowKeys.toString().includes(record.sId)) || | |
| 6485 | - props.name === "sParam" || | |
| 6486 | - (props.name === "slaveInfo" && | |
| 6487 | - commonUtils.isNotEmptyArr(props.selectedRowKeys) && | |
| 6488 | - props.selectedRowKeys.toString().includes(record.sSlaveId) && | |
| 6489 | - showConfigObj.iTag === 3))) || | |
| 6490 | - (this.getShowTypeProps(props, text, record, sName)?.enabled && record.sId === this.state.currentHoverSid) || | |
| 6491 | - (false && | |
| 6492 | - location.pathname.includes("productionScheduleTree") && | |
| 6493 | - this.getShowTypeProps(props, text, record, sName)?.enabled && | |
| 6494 | - record.sId === props.rowHoverSid) || | |
| 6495 | - (props.rootType === "list" && props.selectedRowKeys.toString().includes(record.sSlaveId)) | |
| 6496 | - ) { | |
| 6497 | - res = <ShowTypeNew {...this.getShowTypeProps(props, text, record, sName)} />; | |
| 5564 | + } else if ( commonUtils.isNotEmptyObject(showConfigObj) && !showConfigObj.bReadonly && (props.enabled || showConfigObj.iTag === 3 ) | |
| 5565 | + && commonUtils.isEmptyObject(record.sDivRowNew) && (commonUtils.isNotEmptyArr(props.selectedRowKeys) | |
| 5566 | + && props.selectedRowKeys.toString().includes(record.sId) || props.name === 'sParam' | |
| 5567 | + || ( props.name ==='slaveInfo' && commonUtils.isNotEmptyArr(props.selectedRowKeys) && props.selectedRowKeys.toString().includes(record.sSlaveId) && showConfigObj.iTag === 3 )) | |
| 5568 | + || (this.getShowTypeProps(props, text, record, sName)?.enabled && record.sId === this.state.currentHoverSid) | |
| 5569 | + || (false && location.pathname.includes('productionScheduleTree') && this.getShowTypeProps(props, text, record, sName)?.enabled && record.sId === props.rowHoverSid) | |
| 5570 | + || (props.rootType === 'list' && props.selectedRowKeys.toString().includes(record.sSlaveId))) { | |
| 5571 | + res = (<ShowTypeNew {...this.getShowTypeProps(props, text, record, sName)} />); | |
| 6498 | 5572 | // 人检-质检代码特殊处理 |
| 6499 | 5573 | res = this.handleGetRjRes(res, index, sName); |
| 6500 | 5574 | const cell = this.mergeTableCell(res, idx, sName, isSlaveInfo); |
| 6501 | 5575 | return cell; |
| 6502 | - } else if (props.bSParamTable && sName === "sParamValue" && commonUtils.isNotEmptyObject(record.sDropDownData)) { | |
| 5576 | + } else if (props.bSParamTable && sName === 'sParamValue' && commonUtils.isNotEmptyObject(record.sDropDownData)) { | |
| 6503 | 5577 | const showTypeProps = this.getShowTypeProps(props, text, record, sName); |
| 6504 | 5578 | const sDropDownDataStr = commonUtils.convertObjToStr(record.sDropDownData); |
| 6505 | 5579 | if (sDropDownDataStr) { |
| 6506 | - showTypeProps.showConfig.sDropDownType = "const"; | |
| 5580 | + showTypeProps.showConfig.sDropDownType = 'const'; | |
| 6507 | 5581 | showTypeProps.showConfig.showDropDown = sDropDownDataStr; |
| 6508 | 5582 | showTypeProps.onChange = (...args) => { |
| 6509 | 5583 | props.onDataChange(...args, record); |
| 6510 | - }; | |
| 5584 | + } | |
| 6511 | 5585 | } |
| 6512 | - res = <ShowTypeNew {...showTypeProps} />; | |
| 5586 | + res = (<ShowTypeNew {...showTypeProps} />); | |
| 6513 | 5587 | const cell = this.mergeTableCell(res, idx, sName, isSlaveInfo); |
| 6514 | 5588 | return cell; |
| 6515 | 5589 | } else { |
| 6516 | 5590 | const showConfig = this.getShowConfig(props, sName); |
| 6517 | 5591 | |
| 6518 | 5592 | /* 获取单元格颜色配置 */ |
| 6519 | - let cellColor = ""; | |
| 6520 | - let backgroundColor = ""; | |
| 5593 | + let cellColor = ''; | |
| 5594 | + let backgroundColor = ''; | |
| 6521 | 5595 | if (commonUtils.isNotEmptyArr(showConfig)) { |
| 6522 | 5596 | const cellStyle = this.getCellColorConfig(text, record, sName); |
| 6523 | - if (commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotal) || commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotalB)) { | |
| 5597 | + if (commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotal) || commonUtils.isNotEmptyObject(cellStyle.styleColorArrTotalB) ) { | |
| 6524 | 5598 | cellColor = cellStyle.styleColorArrTotal; |
| 6525 | 5599 | backgroundColor = cellStyle.styleColorArrTotalB; |
| 6526 | 5600 | } |
| ... | ... | @@ -6528,8 +5602,8 @@ class CommonTableRc extends React.Component { |
| 6528 | 5602 | |
| 6529 | 5603 | let sValue = record[sName]; |
| 6530 | 5604 | /* 判断如果是日期格式,则根据配置进行时间格式format转化 */ |
| 6531 | - const firstDataIndex = commonUtils.isNotEmptyObject(sName) ? sName.substring(0, 1) : ""; /* 控件首字母(数据格式:字符串) */ | |
| 6532 | - if (firstDataIndex === "t" || firstDataIndex === "p" || firstDataIndex === "m") { | |
| 5605 | + const firstDataIndex = commonUtils.isNotEmptyObject(sName) ? sName.substring(0, 1) : ''; /* 控件首字母(数据格式:字符串) */ | |
| 5606 | + if (firstDataIndex === 't' || firstDataIndex === 'p' || firstDataIndex === 'm') { | |
| 6533 | 5607 | const { sDateFormat } = showConfig; |
| 6534 | 5608 | if (!commonUtils.isEmpty(sValue)) { |
| 6535 | 5609 | if (commonUtils.isNotEmptyStr(sDateFormat)) { |
| ... | ... | @@ -6538,36 +5612,34 @@ class CommonTableRc extends React.Component { |
| 6538 | 5612 | sValue = moment(sValue).format(props.getDateFormat()); |
| 6539 | 5613 | } |
| 6540 | 5614 | } |
| 6541 | - } else if (firstDataIndex === "d" && !props.enabled) { | |
| 5615 | + } else if (firstDataIndex === 'd' && !props.enabled) { | |
| 6542 | 5616 | const { sDateFormat } = showConfig; |
| 6543 | 5617 | /* 如果配置时间格式中设置了0.0000则以配置为准,没有设置时间格式 则以系统设定为主 */ |
| 6544 | 5618 | if (commonUtils.isNotEmptyObject(sDateFormat)) { |
| 6545 | 5619 | /* 取小数点位数 */ |
| 6546 | 5620 | let point = 0; |
| 6547 | - let strIndex = sDateFormat.indexOf("."); | |
| 6548 | - if (strIndex > -1 && sDateFormat.length > 1) { | |
| 5621 | + let strIndex = sDateFormat.indexOf('.'); | |
| 5622 | + if(strIndex > -1 && sDateFormat.length > 1) { | |
| 6549 | 5623 | point = sDateFormat.substring(strIndex + 1, sDateFormat.length).length; |
| 6550 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5624 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 6551 | 5625 | const dConfigResult = commonUtils.convertFixNum(Number(sValue), point).toFixed(point); |
| 6552 | - if (!isNaN(dConfigResult)) { | |
| 5626 | + if(!isNaN(dConfigResult)) { | |
| 6553 | 5627 | sValue = dConfigResult; |
| 6554 | 5628 | } |
| 6555 | 5629 | } |
| 6556 | 5630 | } |
| 6557 | 5631 | } else { |
| 6558 | - if (firstDataIndex === "d" && sName.toLowerCase().endsWith("price")) { | |
| 6559 | - /* 列表单价格式化显示 */ | |
| 6560 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5632 | + if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('price')) { /* 列表单价格式化显示 */ | |
| 5633 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 6561 | 5634 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetPrice).toFixed(dNetPrice); |
| 6562 | - if (!isNaN(dResult)) { | |
| 5635 | + if(!isNaN(dResult)) { | |
| 6563 | 5636 | sValue = dResult; |
| 6564 | 5637 | } |
| 6565 | 5638 | } |
| 6566 | - } else if (firstDataIndex === "d" && sName.toLowerCase().endsWith("money")) { | |
| 6567 | - /* 列表金额格式化显示 */ | |
| 6568 | - if (commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 5639 | + } else if (firstDataIndex === 'd' && sName.toLowerCase().endsWith('money')) { /* 列表金额格式化显示 */ | |
| 5640 | + if(commonUtils.isNotEmptyNumber(sValue) && sValue !== null) { | |
| 6569 | 5641 | const dResult = commonUtils.convertFixNum(Number(sValue), dNetMoney).toFixed(dNetMoney); |
| 6570 | - if (!isNaN(dResult)) { | |
| 5642 | + if(!isNaN(dResult)) { | |
| 6571 | 5643 | sValue = dResult; |
| 6572 | 5644 | } |
| 6573 | 5645 | } |
| ... | ... | @@ -6575,58 +5647,36 @@ class CommonTableRc extends React.Component { |
| 6575 | 5647 | } |
| 6576 | 5648 | } |
| 6577 | 5649 | |
| 6578 | - let linkStyle = ""; /* 设置当从表表格没被选中时的弹窗样式 */ | |
| 6579 | - if ( | |
| 6580 | - showConfig.sDropDownType !== "popup" && | |
| 6581 | - !commonUtils.isEmpty(showConfig.sActiveId) && | |
| 6582 | - !commonUtils.isEmpty(showConfig.sActiveKey) && | |
| 6583 | - (commonUtils.isNotEmptyObject(sValue) || commonUtils.isNotEmptyNumber(sValue)) | |
| 6584 | - ) { | |
| 6585 | - linkStyle = "linksActiveIdStyle"; | |
| 5650 | + let linkStyle = ''; /* 设置当从表表格没被选中时的弹窗样式 */ | |
| 5651 | + if (showConfig.sDropDownType !== 'popup' && !commonUtils.isEmpty(showConfig.sActiveId) && !commonUtils.isEmpty(showConfig.sActiveKey) && (commonUtils.isNotEmptyObject(sValue) || commonUtils.isNotEmptyNumber(sValue))) { | |
| 5652 | + linkStyle = 'linksActiveIdStyle'; | |
| 6586 | 5653 | } |
| 6587 | - if (showConfig.sDropDownType === "const") { | |
| 5654 | + if (showConfig.sDropDownType === 'const') { | |
| 6588 | 5655 | let showDropDown = []; |
| 6589 | - if (typeof showConfig.showDropDown === "object") { | |
| 5656 | + if (typeof showConfig.showDropDown === 'object') { | |
| 6590 | 5657 | showDropDown = showConfig.showDropDown; |
| 6591 | 5658 | } else { |
| 6592 | - if (commonUtils.isJSON(showConfig.showDropDown)) { | |
| 5659 | + if(commonUtils.isJSON(showConfig.showDropDown)) { | |
| 6593 | 5660 | showDropDown = commonUtils.objectToArr(commonUtils.convertStrToObj(showConfig.showDropDown)); |
| 6594 | 5661 | } |
| 6595 | 5662 | } |
| 6596 | 5663 | let iIndex = commonUtils.isEmpty(record[sName]) ? -1 : showDropDown.findIndex(item => item.sId === record[sName].toString()); |
| 6597 | - if (iIndex === -1 && record[sName] === "") { | |
| 6598 | - iIndex = showDropDown.findIndex(item => item.sId === ""); | |
| 5664 | + if (iIndex === -1 && record[sName] === '') { | |
| 5665 | + iIndex = showDropDown.findIndex(item => item.sId === ''); | |
| 6599 | 5666 | } |
| 6600 | 5667 | sValue = iIndex > -1 ? showDropDown[iIndex].value : record[sName]; |
| 6601 | 5668 | } |
| 6602 | - let clickEvent = ""; | |
| 5669 | + let clickEvent = ''; | |
| 6603 | 5670 | /* 选择合版产品弹窗 */ |
| 6604 | - const sModelsType = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? props.app.currentPane.sModelsType : ""; | |
| 6605 | - const combinedInfo = | |
| 6606 | - commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) | |
| 6607 | - ? commonFunc.showMessage(props.app.commonConst, "CombinedInfo") | |
| 6608 | - : "合版信息"; | |
| 6609 | - | |
| 6610 | - const pleaseSelect = | |
| 6611 | - commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) | |
| 6612 | - ? commonFunc.showMessage(this.props.app.commonConst, "pleaseSelect") | |
| 6613 | - : "请选择"; | |
| 6614 | - | |
| 6615 | - if ( | |
| 6616 | - commonUtils.isNotEmptyObject(sName) && | |
| 6617 | - (sName === "sCombinedMemo" || | |
| 6618 | - sName === "sCombineProductNameNew" || | |
| 6619 | - sName === "sColorSerialMemo" || | |
| 6620 | - sName === "sPositiveColor" || | |
| 6621 | - sName === "sOppositeColor" || | |
| 6622 | - sName === "sParams" || | |
| 6623 | - sName === "sParamsNew" || | |
| 6624 | - sName === "sQuoParams" || | |
| 6625 | - (commonUtils.isNotEmptyObject(sModelsType) && !sModelsType.includes("Set") && sName === "sCombinePartsNameNew")) | |
| 6626 | - ) { | |
| 6627 | - linkStyle = "linksActiveIdStyle"; | |
| 6628 | - clickEvent = "onViewChoose"; | |
| 6629 | - if (sName === "sCombinedMemo") { | |
| 5671 | + const sModelsType = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? props.app.currentPane.sModelsType : ''; | |
| 5672 | + const combinedInfo = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(props.app.commonConst, 'CombinedInfo') : '合版信息' ; | |
| 5673 | + | |
| 5674 | + const pleaseSelect = commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.app) ? commonFunc.showMessage(this.props.app.commonConst, 'pleaseSelect') : '请选择' ; | |
| 5675 | + | |
| 5676 | + if (commonUtils.isNotEmptyObject(sName) && ( sName === 'sCombinedMemo' || sName ==='sCombineProductNameNew' || sName === 'sColorSerialMemo' || sName === 'sPositiveColor' || sName === 'sOppositeColor' || sName === 'sParams' || sName === 'sParamsNew'|| sName === 'sQuoParams' || (commonUtils.isNotEmptyObject(sModelsType) && !sModelsType.includes('Set') && sName === 'sCombinePartsNameNew'))) { | |
| 5677 | + linkStyle = 'linksActiveIdStyle'; | |
| 5678 | + clickEvent = 'onViewChoose'; | |
| 5679 | + if (sName === 'sCombinedMemo') { | |
| 6630 | 5680 | let JsonData = []; |
| 6631 | 5681 | if (commonUtils.isNotEmptyObject(sValue)) { |
| 6632 | 5682 | try { |
| ... | ... | @@ -6636,15 +5686,15 @@ class CommonTableRc extends React.Component { |
| 6636 | 5686 | } |
| 6637 | 5687 | } |
| 6638 | 5688 | /* 将合版信息json解析成需要的字符串形式 */ |
| 6639 | - let sCombinedMemo = ""; | |
| 5689 | + let sCombinedMemo = ''; | |
| 6640 | 5690 | if (commonUtils.isNotEmptyArr(JsonData)) { |
| 6641 | - JsonData.forEach(item => { | |
| 5691 | + JsonData.forEach((item) => { | |
| 6642 | 5692 | sCombinedMemo += `${item.sProductNo}:排${item.dCombineQty}个,`; |
| 6643 | 5693 | }); |
| 6644 | - sCombinedMemo = commonUtils.isNotEmptyObject(sCombinedMemo) ? sCombinedMemo.substr(0, sCombinedMemo.length - 1) : ""; | |
| 5694 | + sCombinedMemo = commonUtils.isNotEmptyObject(sCombinedMemo) ? sCombinedMemo.substr(0, sCombinedMemo.length - 1) : ''; | |
| 6645 | 5695 | sValue = sCombinedMemo; |
| 6646 | 5696 | } |
| 6647 | - } else if (sName === "sColorSerialMemo" || sName === "sPositiveColor" || sName === "sOppositeColor") { | |
| 5697 | + } else if (sName === 'sColorSerialMemo' || sName === 'sPositiveColor' || sName === 'sOppositeColor') { | |
| 6648 | 5698 | let JsonData = []; |
| 6649 | 5699 | if (commonUtils.isNotEmptyObject(sValue)) { |
| 6650 | 5700 | try { |
| ... | ... | @@ -6658,15 +5708,15 @@ class CommonTableRc extends React.Component { |
| 6658 | 5708 | } |
| 6659 | 5709 | } |
| 6660 | 5710 | /* 将颜色json解析成需要的字符串形式 */ |
| 6661 | - let sMemo = ""; | |
| 5711 | + let sMemo = ''; | |
| 6662 | 5712 | if (commonUtils.isNotEmptyArr(JsonData)) { |
| 6663 | - JsonData.forEach(item => { | |
| 5713 | + JsonData.forEach((item) => { | |
| 6664 | 5714 | sMemo += `${item.sName}+`; |
| 6665 | 5715 | }); |
| 6666 | - sMemo = commonUtils.isNotEmptyObject(sMemo) ? sMemo.substr(0, sMemo.length - 1) : ""; | |
| 5716 | + sMemo = commonUtils.isNotEmptyObject(sMemo) ? sMemo.substr(0, sMemo.length - 1) : ''; | |
| 6667 | 5717 | sValue = sMemo; |
| 6668 | 5718 | } |
| 6669 | - } else if (sName === "sParams" || sName === "sQuoParams" || sName === "sParamsNew") { | |
| 5719 | + } else if (sName === 'sParams' || sName === 'sQuoParams' || sName === 'sParamsNew' ) { | |
| 6670 | 5720 | if (props.onGetParamsValue) { |
| 6671 | 5721 | // 页面自行处理sparams的sValue |
| 6672 | 5722 | sValue = props.onGetParamsValue({ sName, sValue, record }); |
| ... | ... | @@ -6684,154 +5734,116 @@ class CommonTableRc extends React.Component { |
| 6684 | 5734 | } |
| 6685 | 5735 | } |
| 6686 | 5736 | /* 将sParams的json解析成需要的字符串形式 */ |
| 6687 | - let sParamStr = ""; | |
| 5737 | + let sParamStr = ''; | |
| 6688 | 5738 | if (commonUtils.isNotEmptyArr(JsonData)) { |
| 6689 | - JsonData.forEach(item => { | |
| 6690 | - if (item.bSelfCbx) { | |
| 6691 | - const strValue = commonUtils.isNotEmptyObject(item.sParamValue) ? item.sParamValue : ""; | |
| 5739 | + JsonData.forEach((item) => { | |
| 5740 | + if(item.bSelfCbx) { | |
| 5741 | + const strValue = commonUtils.isNotEmptyObject(item.sParamValue) ? item.sParamValue : ''; | |
| 6692 | 5742 | sParamStr += `${item.sParamName}:${strValue},`; |
| 6693 | 5743 | } |
| 6694 | 5744 | }); |
| 6695 | - sParamStr = commonUtils.isNotEmptyObject(sParamStr) ? sParamStr.substr(0, sParamStr.length - 1) : ""; | |
| 5745 | + sParamStr = commonUtils.isNotEmptyObject(sParamStr) ? sParamStr.substr(0, sParamStr.length - 1) : ''; | |
| 6696 | 5746 | sValue = sParamStr; |
| 6697 | 5747 | } else { |
| 6698 | - sValue = ""; | |
| 5748 | + sValue = ''; | |
| 6699 | 5749 | } |
| 6700 | 5750 | } |
| 6701 | 5751 | } |
| 6702 | - sValue = commonUtils.isEmpty(sValue) ? (sName === "sCombinedMemo" ? combinedInfo : pleaseSelect) : sValue; | |
| 6703 | - } else if (!props.enabled && sName.indexOf("Memo") > -1 && showConfigObj.iTag !== 3) { | |
| 6704 | - linkStyle = "linksActiveIdStyle"; | |
| 6705 | - clickEvent = "onMemoShow"; | |
| 6706 | - sValue = commonUtils.isEmpty(sValue) ? "" : sValue; | |
| 5752 | + sValue = commonUtils.isEmpty(sValue) ? sName === 'sCombinedMemo' ? combinedInfo : pleaseSelect : sValue; | |
| 5753 | + } else if ((!props.enabled) && sName.indexOf('Memo') > -1 && showConfigObj.iTag !== 3 ) { | |
| 5754 | + linkStyle = 'linksActiveIdStyle'; | |
| 5755 | + clickEvent = 'onMemoShow'; | |
| 5756 | + sValue = commonUtils.isEmpty(sValue) ? '' : sValue; | |
| 6707 | 5757 | const regex = /<[^>]*>/g; |
| 6708 | - sValue = sValue.replace(regex, ""); | |
| 6709 | - } else if ( | |
| 6710 | - !props.enabled && | |
| 6711 | - showConfigObj.sControlName && | |
| 6712 | - showConfigObj.sControlName.toLowerCase().indexOf("memo") > -1 && | |
| 6713 | - showConfigObj.iTag !== 3 | |
| 6714 | - ) { | |
| 6715 | - linkStyle = "linksActiveIdStyle"; | |
| 6716 | - clickEvent = "onMemoShow"; | |
| 6717 | - sValue = commonUtils.isEmpty(sValue) ? "" : sValue; | |
| 5758 | + sValue = sValue.replace(regex, ''); | |
| 5759 | + } else if ((!props.enabled) && showConfigObj.sControlName && showConfigObj.sControlName.toLowerCase().indexOf('memo') > -1 && showConfigObj.iTag !== 3 ) { | |
| 5760 | + linkStyle = 'linksActiveIdStyle'; | |
| 5761 | + clickEvent = 'onMemoShow'; | |
| 5762 | + sValue = commonUtils.isEmpty(sValue) ? '' : sValue; | |
| 6718 | 5763 | const regex = /<[^>]*>/g; |
| 6719 | - sValue = sValue.replace(regex, ""); | |
| 6720 | - } else if ( | |
| 6721 | - ["sWorkOrderNo", "sMachineName", "sChangeMeachine"].includes(sName) && | |
| 6722 | - showConfig.sActiveId && | |
| 6723 | - showConfig.sDropDownType === "popup" | |
| 6724 | - ) { | |
| 6725 | - linkStyle = "linksActiveIdStyle"; | |
| 6726 | - clickEvent = "onOpenPopupModal"; | |
| 5764 | + sValue = sValue.replace(regex, ''); | |
| 5765 | + } else if (["sWorkOrderNo", "sMachineName", 'sChangeMeachine'].includes(sName) && showConfig.sActiveId && showConfig.sDropDownType === "popup") { | |
| 5766 | + linkStyle = 'linksActiveIdStyle'; | |
| 5767 | + clickEvent = 'onOpenPopupModal'; | |
| 6727 | 5768 | } |
| 6728 | 5769 | /* 如果列表行包含sDivRow并且sDivRow有值 则代表该行行不渲染数据 只做分割作用 */ |
| 6729 | - if (commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 6730 | - bShow = ""; | |
| 5770 | + if(commonUtils.isNotEmptyObject(record.sDivRowNew) && record.bInsert) { | |
| 5771 | + bShow = ''; | |
| 6731 | 5772 | // linkStyle = 'linksActiveIdStyle'; |
| 6732 | - if (sValue) { | |
| 6733 | - const splitArr = sValue ? sValue.toString().split("F") : []; | |
| 6734 | - if (commonUtils.isNotEmptyArr(splitArr) && splitArr.length > 1) { | |
| 6735 | - sValue = ( | |
| 6736 | - <span className="noInputInsert"> | |
| 6737 | - {splitArr[0]} <span style={{ color: "#ff0000" }}> {splitArr[1]}</span>{" "} | |
| 6738 | - </span> | |
| 6739 | - ); | |
| 5773 | + if(sValue) { | |
| 5774 | + const splitArr = sValue ? sValue.toString().split('F') : []; | |
| 5775 | + if(commonUtils.isNotEmptyArr(splitArr) && splitArr.length > 1) { | |
| 5776 | + sValue = <span className="noInputInsert">{splitArr[0]} <span style={{ color: '#ff0000' }}> {splitArr[1]}</span> </span>; | |
| 6740 | 5777 | } |
| 6741 | 5778 | } |
| 6742 | 5779 | } |
| 6743 | - let showQty = ""; | |
| 6744 | - if (!this.props.enabled && location.pathname.includes("quotationPackTableTree") && this.props.name === "control" && sName === "dSinglePQty") { | |
| 6745 | - showQty = ( | |
| 6746 | - <span | |
| 6747 | - onClick={this.handleViewClick.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} | |
| 6748 | - style={{ position: "absolute", right: "2px" }} | |
| 6749 | - > | |
| 6750 | - <EyeOutlined /> | |
| 6751 | - </span> | |
| 6752 | - ); | |
| 6753 | - } else if (sName === "sSaveProName" || sName === "sDeleteProName" || sName === "sSaveProNameBefore" || sName === "sProcName") { | |
| 5780 | + let showQty=''; | |
| 5781 | + if(!this.props.enabled && location.pathname.includes('quotationPackTableTree') && this.props.name === 'control' && sName === 'dSinglePQty') { | |
| 5782 | + showQty = <span onClick={this.handleViewClick.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><EyeOutlined /></span> | |
| 5783 | + } else if(sName === 'sSaveProName' || sName === 'sDeleteProName' || sName === 'sSaveProNameBefore' || sName === 'sProcName') { | |
| 6754 | 5784 | /* 增删改存业务处理 加查看眼睛 */ |
| 6755 | - sValue = ( | |
| 6756 | - <span> | |
| 6757 | - {" "} | |
| 6758 | - {sValue} | |
| 6759 | - <span | |
| 6760 | - onClick={this.handleOpenWin.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} | |
| 6761 | - style={{ position: "absolute", right: "2px" }} | |
| 6762 | - > | |
| 6763 | - <EyeOutlined /> | |
| 6764 | - </span>{" "} | |
| 6765 | - </span> | |
| 6766 | - ); | |
| 6767 | - } else if (sName === "dNeedAuxiliaryQty" && showConfig.sControlName && showConfig.sControlName !== "slaveInfo") { | |
| 6768 | - /* 净需求 */ | |
| 5785 | + sValue =<span> {sValue}<span onClick={this.handleOpenWin.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><EyeOutlined /></span> </span> | |
| 5786 | + }else if(sName === 'dNeedAuxiliaryQty' && showConfig.sControlName && showConfig.sControlName !=='slaveInfo' ) { /* 净需求 */ | |
| 6769 | 5787 | /* 增删改存业务处理 加查看眼睛 */ |
| 6770 | - sValue = ( | |
| 6771 | - <span> | |
| 6772 | - {" "} | |
| 6773 | - {sValue} | |
| 6774 | - <span | |
| 6775 | - onClick={this.handleRightArrow.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} | |
| 6776 | - style={{ position: "absolute", right: "2px" }} | |
| 6777 | - > | |
| 6778 | - <RightOutlined /> | |
| 6779 | - </span>{" "} | |
| 6780 | - </span> | |
| 6781 | - ); | |
| 5788 | + sValue =<span> {sValue}<span onClick={this.handleRightArrow.bind(this, this.props.name, showConfig.sName, record, index, showConfig)} style={{ position: 'absolute', right: '2px' }}><RightOutlined /></span> </span> | |
| 6782 | 5789 | } |
| 6783 | 5790 | /* 只读字段置灰 */ |
| 6784 | 5791 | const isColorInclude = this.rowColorData.current?.find(i => i && i?.key === record?.[this.rowKey]); |
| 6785 | 5792 | let bReadonlyField = false; |
| 6786 | - if ((showConfig.bReadonly || showConfig.iTag === 1) && commonUtils.isEmptyStr(backgroundColor) && !isColorInclude) { | |
| 6787 | - backgroundColor = "#f1f2f8"; | |
| 5793 | + if((showConfig.bReadonly || showConfig.iTag ===1) && commonUtils.isEmptyStr(backgroundColor) && !isColorInclude) { | |
| 5794 | + backgroundColor = '#f1f2f8'; | |
| 6788 | 5795 | bReadonlyField = true; |
| 6789 | 5796 | } |
| 6790 | - if (backgroundColor && !this.props.slaveInfo) { | |
| 5797 | + if (backgroundColor && !this.props.slaveInfo) { | |
| 6791 | 5798 | this.hasSpanBgColor = true; |
| 6792 | 5799 | } |
| 6793 | 5800 | |
| 6794 | - res = ( | |
| 6795 | - <span | |
| 6796 | - className={`noInput readonlySpanStyle ${bReadonlyField ? "readonlyField" : ""}`} | |
| 6797 | - style={{ color: `${cellColor}`, backgroundColor: `${backgroundColor}` }} | |
| 5801 | + res = (<span className={`noInput readonlySpanStyle ${bReadonlyField ? "readonlyField" : ""}`} style={{ color: `${cellColor}`, backgroundColor: `${backgroundColor}` }} > {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === 'b') || (imgBox !== '') ? '' : | |
| 5802 | + <Tooltip | |
| 5803 | + placement={ bSpecialTitle ? 'right' : 'bottomLeft'} | |
| 5804 | + overlayClassName={ bSpecialTitle ? 'commonSpecialTitle' : 'commonTitle'} | |
| 5805 | + mouseEnterDelay={0.8} | |
| 5806 | + title={<span style={{ fontSize: 16 }}>{commonUtils.isNotEmptyObject(specialTitle) ? specialTitle :sValue}</span>} | |
| 6798 | 5807 | > |
| 6799 | - {" "} | |
| 6800 | - {(commonUtils.isNotEmptyObject(sName) && sName.substring(0, 1) === "b") || imgBox !== "" ? ( | |
| 6801 | - "" | |
| 6802 | - ) : ( | |
| 6803 | - <Tooltip | |
| 6804 | - placement={bSpecialTitle ? "right" : "bottomLeft"} | |
| 6805 | - overlayClassName={bSpecialTitle ? "commonSpecialTitle" : "commonTitle"} | |
| 6806 | - mouseEnterDelay={0.8} | |
| 6807 | - title={<span style={{ fontSize: 16 }}>{commonUtils.isNotEmptyObject(specialTitle) ? specialTitle : sValue}</span>} | |
| 6808 | - > | |
| 6809 | - <span | |
| 6810 | - className={linkStyle} | |
| 6811 | - onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 6812 | - suppressContentEditableWarning | |
| 6813 | - contentEditable="true" | |
| 6814 | - onClick={ | |
| 6815 | - commonUtils.isNotEmptyObject(linkStyle) | |
| 6816 | - ? clickEvent === "onViewChoose" | |
| 6817 | - ? this.handleViewChoose.bind(this, this.props.name, showConfig.sName, record, index) | |
| 6818 | - : clickEvent === "onMemoShow" | |
| 6819 | - ? this.handleMemoShow.bind(this, this.props.name, showConfig.sName, record, index, showConfig) | |
| 6820 | - : clickEvent === "onOpenPopupModal" | |
| 5808 | + <span | |
| 5809 | + className={linkStyle} | |
| 5810 | + onKeyDown={e => this.onKeyDownDiv(e, sName)} | |
| 5811 | + suppressContentEditableWarning | |
| 5812 | + contentEditable="true" | |
| 5813 | + onClick={ | |
| 5814 | + commonUtils.isNotEmptyObject(linkStyle) | |
| 5815 | + ? clickEvent === "onViewChoose" | |
| 5816 | + ? this.handleViewChoose.bind( | |
| 5817 | + this, | |
| 5818 | + this.props.name, | |
| 5819 | + showConfig.sName, | |
| 5820 | + record, | |
| 5821 | + index | |
| 5822 | + ) | |
| 5823 | + : clickEvent === "onMemoShow" | |
| 5824 | + ? this.handleMemoShow.bind( | |
| 5825 | + this, | |
| 5826 | + this.props.name, | |
| 5827 | + showConfig.sName, | |
| 5828 | + record, | |
| 5829 | + index, | |
| 5830 | + showConfig | |
| 5831 | + ) | |
| 5832 | + : clickEvent === "onOpenPopupModal" | |
| 6821 | 5833 | ? this.handleFieldPopupModal.bind(this, showConfig, sName, record) |
| 6822 | - : this.handleViewClick.bind(this, this.props.name, showConfig.sName, record, index, showConfig) | |
| 6823 | - : null | |
| 6824 | - } | |
| 6825 | - > | |
| 6826 | - {" "} | |
| 6827 | - {sValue} | |
| 6828 | - </span> | |
| 6829 | - </Tooltip> | |
| 6830 | - )} | |
| 6831 | - {bShow} | |
| 6832 | - {imgBox} | |
| 6833 | - {showQty} | |
| 6834 | - </span> | |
| 5834 | + : this.handleViewClick.bind( | |
| 5835 | + this, | |
| 5836 | + this.props.name, | |
| 5837 | + showConfig.sName, | |
| 5838 | + record, | |
| 5839 | + index, | |
| 5840 | + showConfig | |
| 5841 | + ) | |
| 5842 | + : null | |
| 5843 | + } | |
| 5844 | + > { sValue}</span> | |
| 5845 | + </Tooltip> | |
| 5846 | + }{bShow}{imgBox}{showQty}</span> | |
| 6835 | 5847 | ); |
| 6836 | 5848 | |
| 6837 | 5849 | // 人检-质检代码特殊处理 |
| ... | ... | @@ -6843,22 +5855,10 @@ class CommonTableRc extends React.Component { |
| 6843 | 5855 | }; |
| 6844 | 5856 | |
| 6845 | 5857 | /** willProps赋值 * */ |
| 6846 | - assignmentWillProps = props => { | |
| 5858 | + assignmentWillProps = (props) => { | |
| 6847 | 5859 | // 重构修改 去除filteredData; |
| 6848 | 5860 | const { |
| 6849 | - dataSource, | |
| 6850 | - totalData, | |
| 6851 | - totalData1, | |
| 6852 | - selectedRowKeys, | |
| 6853 | - enabled, | |
| 6854 | - headerColumn, | |
| 6855 | - previewImage, | |
| 6856 | - previewVisible, | |
| 6857 | - tableColumn, | |
| 6858 | - slaveInfoHeaderColumn, | |
| 6859 | - searchText, | |
| 6860 | - slaveInfoSelectedRowKeys, | |
| 6861 | - expKeys, | |
| 5861 | + dataSource, totalData, totalData1, selectedRowKeys, enabled, headerColumn, previewImage, previewVisible, tableColumn, slaveInfoHeaderColumn, searchText, slaveInfoSelectedRowKeys, expKeys, | |
| 6862 | 5862 | } = this.state; |
| 6863 | 5863 | const stateValue = {}; |
| 6864 | 5864 | this.computedTableHeight(); |
| ... | ... | @@ -6892,22 +5892,22 @@ class CommonTableRc extends React.Component { |
| 6892 | 5892 | const result = item; |
| 6893 | 5893 | if (!item.width) { |
| 6894 | 5894 | item.width = 120; |
| 6895 | - } else if (typeof item.width === "string") { | |
| 5895 | + } else if (typeof item.width === 'string') { | |
| 6896 | 5896 | item.width = parseInt(item.width); |
| 6897 | 5897 | } |
| 6898 | 5898 | return result; |
| 6899 | 5899 | }); |
| 6900 | 5900 | |
| 6901 | 5901 | // 给headerColumn加一个空的列来自适应表格宽度 |
| 6902 | - const hasTableLastEmpty = stateValue.headerColumn.find(item => item.dataIndex === "tableLastEmpty"); | |
| 5902 | + const hasTableLastEmpty = stateValue.headerColumn.find(item => item.dataIndex === 'tableLastEmpty'); | |
| 6903 | 5903 | if (!hasTableLastEmpty) { |
| 6904 | 5904 | stateValue.headerColumn.push({ |
| 6905 | 5905 | with: undefined, |
| 6906 | - title: "", | |
| 6907 | - dataIndex: "tableLastEmpty", | |
| 5906 | + title: '', | |
| 5907 | + dataIndex: 'tableLastEmpty', | |
| 6908 | 5908 | bReadonly: true, |
| 6909 | 5909 | bNotResize: true, |
| 6910 | - }); | |
| 5910 | + }) | |
| 6911 | 5911 | } |
| 6912 | 5912 | |
| 6913 | 5913 | /* showType附加于表格中 */ |
| ... | ... | @@ -6915,8 +5915,7 @@ class CommonTableRc extends React.Component { |
| 6915 | 5915 | child.render = (text, record, index) => this.bindShowType(props, text, record, child.dataIndex, index); |
| 6916 | 5916 | } |
| 6917 | 5917 | } |
| 6918 | - if (!this.props.skipSlaveInfo && props.slaveInfo !== undefined && props.slaveInfo.headerColumn !== undefined && props.config) { | |
| 6919 | - // commonUtils.isNotEmptyArr(props.data) 不能用函数不然新增时置空后不能更新数据 | |
| 5918 | + if (!this.props.skipSlaveInfo && props.slaveInfo !== undefined && props.slaveInfo.headerColumn !== undefined && props.config) { // commonUtils.isNotEmptyArr(props.data) 不能用函数不然新增时置空后不能更新数据 | |
| 6920 | 5919 | // && JSON.stringify(headerColumn) !== JSON.stringify(props.headerColumn) |
| 6921 | 5920 | if (JSON.parse(sessionStorage.getItem(`${props.formId}_${props.config.sId}_info`))) { |
| 6922 | 5921 | const columnArry = JSON.parse(sessionStorage.getItem(`${props.formId}_${props.config.sId}_info`)); |
| ... | ... | @@ -6943,60 +5942,51 @@ class CommonTableRc extends React.Component { |
| 6943 | 5942 | } |
| 6944 | 5943 | } |
| 6945 | 5944 | /* 是否显示上传控件(数据格式:布尔) */ |
| 6946 | - this.isUploadShow = this.findIsExistByControlName(props, "BtnUpload"); | |
| 5945 | + this.isUploadShow = this.findIsExistByControlName(props, 'BtnUpload'); | |
| 6947 | 5946 | /* 是否显示查看控件(数据格式:布尔) */ |
| 6948 | - this.isLookShow = this.findIsExistByControlName(props, "BtnLook"); | |
| 5947 | + this.isLookShow = this.findIsExistByControlName(props, 'BtnLook'); | |
| 6949 | 5948 | /* 是否显示新增控件(数据格式:布尔) */ |
| 6950 | - this.isAddShow = this.findIsExistByControlName(props, "BtnAdd"); | |
| 5949 | + this.isAddShow = this.findIsExistByControlName(props, 'BtnAdd'); | |
| 6951 | 5950 | /* 是否显示modal控件(数据格式:布尔) */ |
| 6952 | - this.isModalShow = this.findIsExistByControlName(props, "BtnChooseMaterials"); | |
| 5951 | + this.isModalShow = this.findIsExistByControlName(props, 'BtnChooseMaterials'); | |
| 6953 | 5952 | /* 是否显示ChooseProcess控件(数据格式:布尔) */ |
| 6954 | - this.isChooseProcessShow = this.findIsExistByControlName(props, "BtnChooseProcess"); | |
| 5953 | + this.isChooseProcessShow = this.findIsExistByControlName(props, 'BtnChooseProcess'); | |
| 6955 | 5954 | /* 是否显示复制控件(数据格式:布尔) */ |
| 6956 | - this.isCopyShow = this.findIsExistByControlName(props, "BtnCopy"); | |
| 5955 | + this.isCopyShow = this.findIsExistByControlName(props, 'BtnCopy'); | |
| 6957 | 5956 | /* 是否显示复制全部控件(数据格式:布尔) */ |
| 6958 | - this.isCopyAllShow = this.findIsExistByControlName(props, "BtnCopyAll"); | |
| 5957 | + this.isCopyAllShow = this.findIsExistByControlName(props, 'BtnCopyAll'); | |
| 6959 | 5958 | /* 是否显示复制全部控件(数据格式:布尔) */ |
| 6960 | - this.isCopyMoreShow = this.findIsExistByControlName(props, "BtnCopyMore"); | |
| 5959 | + this.isCopyMoreShow = this.findIsExistByControlName(props, 'BtnCopyMore'); | |
| 6961 | 5960 | /* 是否显示删除控件(数据格式:布尔) */ |
| 6962 | - this.isDelShow = this.findIsExistByControlName(props, "BtnDel"); | |
| 5961 | + this.isDelShow = this.findIsExistByControlName(props, 'BtnDel'); | |
| 6963 | 5962 | // /* 上传后执行函数(数据格式:函数) */ |
| 6964 | 5963 | // this.onUploadChange = props.onUploadChange; |
| 6965 | 5964 | /* 是否可以进行行移动 */ |
| 6966 | 5965 | // this.isDragAndDrop = false; // props.isDragAndDrop; |
| 6967 | 5966 | this.isDragAndDrop = props.isDragAndDrop; // props.isDragAndDrop; |
| 6968 | 5967 | /* 是否可以弹窗 */ |
| 6969 | - this.isPopupShow = this.findIsExistByControlPopup(props, "BtnPopup"); | |
| 6970 | - this.isParamShow = this.findVisibleControlName(props, "BtnShowParam"); | |
| 5968 | + this.isPopupShow = this.findIsExistByControlPopup(props, 'BtnPopup'); | |
| 5969 | + this.isParamShow = this.findVisibleControlName(props, 'BtnShowParam'); | |
| 6971 | 5970 | |
| 6972 | 5971 | /* 是否可以成品工序 */ |
| 6973 | 5972 | if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductProcess !== undefined) { |
| 6974 | 5973 | this.isChooseProductProcess = props.tableProps.bShowProductProcess; |
| 6975 | 5974 | } |
| 6976 | 5975 | /* 是否可以成品材料 */ |
| 6977 | - if ( | |
| 6978 | - commonUtils.isNotEmptyObject(props) && | |
| 6979 | - commonUtils.isNotEmptyObject(props.tableProps) && | |
| 6980 | - props.tableProps.bShowProductMaterials !== undefined | |
| 6981 | - ) { | |
| 5976 | + if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyObject(props.tableProps) && props.tableProps.bShowProductMaterials !== undefined) { | |
| 6982 | 5977 | this.isChooseProductMaterials = props.tableProps.bShowProductMaterials; |
| 6983 | 5978 | } |
| 6984 | 5979 | /* table表头信息(数据类型:数组对象) */ |
| 6985 | - if (props.headerColumn !== undefined && (commonUtils.isNotEmptyArr(stateValue.headerColumn) || enabled !== props.enabled)) { | |
| 5980 | + if (props.headerColumn !== undefined && (commonUtils.isNotEmptyArr(stateValue.headerColumn) || (enabled !== props.enabled))) { | |
| 6986 | 5981 | if (commonUtils.isNotEmptyArr(stateValue.headerColumn)) { |
| 6987 | - stateValue.tableColumn = this.getTableColumn(stateValue.headerColumn, "filter", props); | |
| 5982 | + stateValue.tableColumn = this.getTableColumn(stateValue.headerColumn, 'filter', props); | |
| 6988 | 5983 | } else { |
| 6989 | - stateValue.tableColumn = this.getTableColumn(headerColumn, "filter", props); | |
| 5984 | + stateValue.tableColumn = this.getTableColumn(headerColumn, 'filter', props); | |
| 6990 | 5985 | } |
| 6991 | 5986 | } |
| 6992 | 5987 | |
| 6993 | 5988 | /* table表头信息(数据类型:数组对象) */ |
| 6994 | - if ( | |
| 6995 | - !this.props.skipSlaveInfo && | |
| 6996 | - props.slaveInfo !== undefined && | |
| 6997 | - props.slaveInfo.headerColumn !== undefined && | |
| 6998 | - (commonUtils.isNotEmptyArr(props.slaveInfo.headerColumn) || enabled !== props.enabled) | |
| 6999 | - ) { | |
| 5989 | + if (!this.props.skipSlaveInfo && props.slaveInfo !== undefined && props.slaveInfo.headerColumn !== undefined && (commonUtils.isNotEmptyArr(props.slaveInfo.headerColumn) || (enabled !== props.enabled))) { | |
| 7000 | 5990 | stateValue.slaveInfoHeaderColumn = props.slaveInfo.headerColumn; |
| 7001 | 5991 | /* showType附加于表格中 */ |
| 7002 | 5992 | for (const child of stateValue.slaveInfoHeaderColumn) { |
| ... | ... | @@ -7004,9 +5994,9 @@ class CommonTableRc extends React.Component { |
| 7004 | 5994 | } |
| 7005 | 5995 | if (commonUtils.isNotEmptyArr(props.slaveInfo.headerColumn)) { |
| 7006 | 5996 | if (commonUtils.isNotEmptyArr(stateValue.slaveInfoHeaderColumn)) { |
| 7007 | - stateValue.tableInfoColumn = this.getTableColumn(stateValue.slaveInfoHeaderColumn, "filter", props.slaveInfo); | |
| 5997 | + stateValue.tableInfoColumn = this.getTableColumn(stateValue.slaveInfoHeaderColumn, 'filter', props.slaveInfo); | |
| 7008 | 5998 | } else { |
| 7009 | - stateValue.tableInfoColumn = this.getTableColumn(slaveInfoHeaderColumn, "filter", props.slaveInfo); | |
| 5999 | + stateValue.tableInfoColumn = this.getTableColumn(slaveInfoHeaderColumn, 'filter', props.slaveInfo); | |
| 7010 | 6000 | } |
| 7011 | 6001 | } |
| 7012 | 6002 | stateValue.slaveInfo = props.slaveInfo; |
| ... | ... | @@ -7029,33 +6019,26 @@ class CommonTableRc extends React.Component { |
| 7029 | 6019 | this.sId = props.sId; |
| 7030 | 6020 | } |
| 7031 | 6021 | |
| 7032 | - if (props.data !== undefined && JSON.stringify(dataSource) !== JSON.stringify(props.data)) { | |
| 7033 | - // commonUtils.isNotEmptyArr(props.data) 不能用函数不然新增时置空后不能更新数据 | |
| 6022 | + if (props.data !== undefined && JSON.stringify(dataSource) !== JSON.stringify(props.data)) { // commonUtils.isNotEmptyArr(props.data) 不能用函数不然新增时置空后不能更新数据 | |
| 7034 | 6023 | stateValue.dataSource = [...props.data]; |
| 7035 | 6024 | } |
| 7036 | 6025 | |
| 7037 | - /* 合计行数据 */ /* 数据(数据格式:数组对象) */ | |
| 7038 | - if (props.totalData !== undefined && JSON.stringify(totalData) !== JSON.stringify(props.totalData) && !this.props.enabled) { | |
| 7039 | - // 要用this. this.props.enabled | |
| 6026 | + /* 合计行数据 *//* 数据(数据格式:数组对象) */ | |
| 6027 | + if (props.totalData !== undefined && JSON.stringify(totalData) !== JSON.stringify(props.totalData) && !this.props.enabled) { // 要用this. this.props.enabled | |
| 7040 | 6028 | if (props.totalData.length > 0) { |
| 7041 | 6029 | stateValue.totalData = [...props.totalData]; |
| 7042 | 6030 | if (commonUtils.isEmptyArr(stateValue.totalData)) { |
| 7043 | 6031 | stateValue.totalData.push({}); |
| 7044 | 6032 | } |
| 7045 | 6033 | stateValue.totalData[0].bSum = true; |
| 7046 | - stateValue.totalData[0].key = "0000"; | |
| 6034 | + stateValue.totalData[0].key = '0000'; | |
| 7047 | 6035 | } else { |
| 7048 | 6036 | stateValue.totalData = []; |
| 7049 | 6037 | } |
| 7050 | 6038 | } |
| 7051 | 6039 | |
| 7052 | 6040 | // 总计 |
| 7053 | - if ( | |
| 7054 | - props.formId === "101111519916710024055720" && | |
| 7055 | - props.totalData1 !== undefined && | |
| 7056 | - JSON.stringify(totalData1) !== JSON.stringify(props.totalData1) && | |
| 7057 | - !this.props.enabled | |
| 7058 | - ) { | |
| 6041 | + if (props.formId === '101111519916710024055720' && props.totalData1 !== undefined && JSON.stringify(totalData1) !== JSON.stringify(props.totalData1) && !this.props.enabled) { | |
| 7059 | 6042 | stateValue.totalData1 = props.totalData1; |
| 7060 | 6043 | } |
| 7061 | 6044 | |
| ... | ... | @@ -7063,12 +6046,8 @@ class CommonTableRc extends React.Component { |
| 7063 | 6046 | stateValue.selectedRowKeys = [...props.selectedRowKeys]; |
| 7064 | 6047 | } |
| 7065 | 6048 | |
| 7066 | - if ( | |
| 7067 | - props.slaveInfo !== undefined && | |
| 7068 | - props.slaveInfo.selectedRowKeys !== undefined && | |
| 7069 | - JSON.stringify(slaveInfoSelectedRowKeys) !== JSON.stringify(props.slaveInfo.selectedRowKeys) | |
| 7070 | - ) { | |
| 7071 | - stateValue.slaveInfoSelectedRowKeys = [...props.slaveInfo.selectedRowKeys]; // [...props.slaveInfo.selectedRowKeys]; | |
| 6049 | + if (props.slaveInfo !== undefined && props.slaveInfo.selectedRowKeys !== undefined && JSON.stringify(slaveInfoSelectedRowKeys) !== JSON.stringify(props.slaveInfo.selectedRowKeys)) { | |
| 6050 | + stateValue.slaveInfoSelectedRowKeys = [...props.slaveInfo.selectedRowKeys];// [...props.slaveInfo.selectedRowKeys]; | |
| 7072 | 6051 | } |
| 7073 | 6052 | |
| 7074 | 6053 | // 重构修改 |
| ... | ... | @@ -7092,20 +6071,16 @@ class CommonTableRc extends React.Component { |
| 7092 | 6071 | if (props.enabled) { |
| 7093 | 6072 | const { config, name, rootType } = this.props; |
| 7094 | 6073 | if (commonUtils.isNotEmptyObject(config)) { |
| 7095 | - const productionRoute = | |
| 7096 | - commonUtils.isNotEmptyObject(props.app.currentPane) && | |
| 7097 | - commonUtils.isNotEmptyObject(props.app.currentPane.route) && | |
| 7098 | - props.app.currentPane.route.includes("productionSchedule"); | |
| 7099 | - if (productionRoute) { | |
| 7100 | - /* 生产排程对选中行进行汇总 */ | |
| 6074 | + const productionRoute = (commonUtils.isNotEmptyObject(props.app.currentPane) && commonUtils.isNotEmptyObject(props.app.currentPane.route) && props.app.currentPane.route.includes('productionSchedule')); | |
| 6075 | + if (productionRoute) { /* 生产排程对选中行进行汇总 */ | |
| 7101 | 6076 | this.handleSumOtherColumn(props.config, props.data); |
| 7102 | - } else if (rootType === "list") { | |
| 7103 | - if (commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyArr(props.totalData)) { | |
| 7104 | - const addState = {}; | |
| 6077 | + } else if(rootType === 'list') { | |
| 6078 | + if(commonUtils.isNotEmptyObject(props) && commonUtils.isNotEmptyArr(props.totalData)) { | |
| 6079 | + const addState ={}; | |
| 7105 | 6080 | addState.totalData = props.totalData; |
| 7106 | - this.setState({ ...addState }); | |
| 6081 | + this.setState({ ...addState }) | |
| 7107 | 6082 | } |
| 7108 | - } else if (name === "slaveChild") { | |
| 6083 | + } else if(name ==='slaveChild'){ | |
| 7109 | 6084 | this.handleSumChildColumn(props.config, props.data); |
| 7110 | 6085 | } else { |
| 7111 | 6086 | this.handleSumAllColumn(props.config, props.data); |
| ... | ... | @@ -7133,11 +6108,7 @@ class CommonTableRc extends React.Component { |
| 7133 | 6108 | if (stateValue.tableColumn[index].children && stateValue.tableColumn[index].children.length) { |
| 7134 | 6109 | const childrenSortArr = []; |
| 7135 | 6110 | const childrenDataIndexArr = []; |
| 7136 | - item.children = item.children | |
| 7137 | - .map(child => { | |
| 7138 | - return { ...child, ...{ sortIndex: sortArr.indexOf(child.dataIndex) } }; | |
| 7139 | - }) | |
| 7140 | - .sort(compare("sortIndex")); | |
| 6111 | + item.children = item.children.map(child => { return {...child, ...{ sortIndex: sortArr.indexOf(child.dataIndex) }}}).sort(compare('sortIndex')); | |
| 7141 | 6112 | item.children.forEach((child, childIndex) => { |
| 7142 | 6113 | const currentSort = sortArr.indexOf(child.dataIndex); |
| 7143 | 6114 | if (childIndex === 0) { |
| ... | ... | @@ -7160,8 +6131,8 @@ class CommonTableRc extends React.Component { |
| 7160 | 6131 | newColumnList[sortArrIndex] = { |
| 7161 | 6132 | ...stateValue.tableColumn[index], |
| 7162 | 6133 | children: stateValue.tableColumn[index].children.filter(child => childrenDataIndexArr[sortArrIndex].includes(child.dataIndex)), |
| 7163 | - sortIndex: Math.min(...sortArrItem), | |
| 7164 | - }; | |
| 6134 | + sortIndex: Math.min(...sortArrItem) | |
| 6135 | + } | |
| 7165 | 6136 | }); |
| 7166 | 6137 | addTableColumn = [...addTableColumn, ...newColumnList]; |
| 7167 | 6138 | stateValue.tableColumn[index].delete = true; |
| ... | ... | @@ -7173,8 +6144,8 @@ class CommonTableRc extends React.Component { |
| 7173 | 6144 | } |
| 7174 | 6145 | }); |
| 7175 | 6146 | stateValue.tableColumn = stateValue.tableColumn.filter(item => !item.delete); // 删除需要分割的双层表头 |
| 7176 | - stateValue.tableColumn = [...stateValue.tableColumn, ...addTableColumn]; // 将分割后的双层表头加回去 | |
| 7177 | - stateValue.tableColumn = stateValue.tableColumn.sort(compare("sortIndex")); | |
| 6147 | + stateValue.tableColumn = [ ...stateValue.tableColumn, ...addTableColumn ]; // 将分割后的双层表头加回去 | |
| 6148 | + stateValue.tableColumn = stateValue.tableColumn.sort(compare('sortIndex')); | |
| 7178 | 6149 | // 合并一级表头相同的相邻的column |
| 7179 | 6150 | stateValue.tableColumn = stateValue.tableColumn.reduce((prev, cur) => { |
| 7180 | 6151 | if (prev.length) { |
| ... | ... | @@ -7193,15 +6164,12 @@ class CommonTableRc extends React.Component { |
| 7193 | 6164 | } |
| 7194 | 6165 | }, []); |
| 7195 | 6166 | } |
| 7196 | - if ( | |
| 7197 | - commonUtils.isJSON(sessionStorage.getItem(`${this.props.formId}_${this.props.config.sId}_info_headerColumns`)) && | |
| 7198 | - stateValue.tableInfoColumn | |
| 7199 | - ) { | |
| 6167 | + if (commonUtils.isJSON(sessionStorage.getItem(`${this.props.formId}_${this.props.config.sId}_info_headerColumns`)) && stateValue.tableInfoColumn) { | |
| 7200 | 6168 | const sortArr = JSON.parse(sessionStorage.getItem(`${this.props.formId}_${this.props.config.sId}_info_headerColumns`)); |
| 7201 | 6169 | stateValue.tableInfoColumn.forEach((item, index) => { |
| 7202 | 6170 | stateValue.tableInfoColumn[index].sortIndex = sortArr.indexOf(item.dataIndex); |
| 7203 | 6171 | }); |
| 7204 | - stateValue.tableInfoColumn = stateValue.tableInfoColumn.sort(compare("sortIndex")); | |
| 6172 | + stateValue.tableInfoColumn = stateValue.tableInfoColumn.sort(compare('sortIndex')); | |
| 7205 | 6173 | } |
| 7206 | 6174 | } |
| 7207 | 6175 | if (this.mounted) { |
| ... | ... | @@ -7222,25 +6190,20 @@ class CommonTableRc extends React.Component { |
| 7222 | 6190 | /** 计算表格高度 * */ |
| 7223 | 6191 | computedTableHeight = () => { |
| 7224 | 6192 | let tableHeaderHeight = this.hasMergeHeader ? 58 : 29; |
| 7225 | - if ( | |
| 7226 | - commonUtils.isNotEmptyArr(this.props.headerColumn) && | |
| 7227 | - this.props.headerColumn && | |
| 7228 | - this.props.headerColumn.find(item => commonUtils.isNotEmptyObject(item.title) && item.title.indexOf("-") != -1) | |
| 7229 | - ) { | |
| 6193 | + if (commonUtils.isNotEmptyArr(this.props.headerColumn) && this.props.headerColumn && this.props.headerColumn.find(item => commonUtils.isNotEmptyObject(item.title) && item.title.indexOf('-') != -1)) { | |
| 7230 | 6194 | tableHeaderHeight = 58; |
| 7231 | 6195 | } |
| 7232 | 6196 | // const footerHeight = (this.state.totalData.length && this.props.footer === undefined) ? 29 : 0; |
| 7233 | 6197 | const footerHeight = commonUtils.isNotEmptyArr(this.state.totalData1) ? 58 : 29; |
| 7234 | 6198 | if (this.props.tableProps.AutoTableHeight) { |
| 7235 | 6199 | this.scrollY = this.props.tableProps.AutoTableHeight; |
| 7236 | - this.tableHeight = | |
| 7237 | - this.props.tableProps.AutoTableHeight == "100%" ? "100%" : this.props.tableProps.AutoTableHeight + tableHeaderHeight + footerHeight; | |
| 6200 | + this.tableHeight = this.props.tableProps.AutoTableHeight == '100%' ? '100%' : this.props.tableProps.AutoTableHeight + tableHeaderHeight + footerHeight; | |
| 7238 | 6201 | return; |
| 7239 | 6202 | } |
| 7240 | 6203 | |
| 7241 | 6204 | const paneKey = this.props.app.currentPane.key; |
| 7242 | 6205 | let searchMainFormDom = document.getElementsByClassName(`searchMainForm_${paneKey || 0}`)[0]; |
| 7243 | - if (searchMainFormDom && location.pathname?.includes("commonCostomTabBill")) { | |
| 6206 | + if (searchMainFormDom && location.pathname?.includes('commonCostomTabBill')) { | |
| 7244 | 6207 | searchMainFormDom = searchMainFormDom.parentNode; |
| 7245 | 6208 | } |
| 7246 | 6209 | const searchComponentDom = document.getElementsByClassName(`searchComponentContainer_${paneKey || 0}`)[0]; |
| ... | ... | @@ -7252,45 +6215,42 @@ class CommonTableRc extends React.Component { |
| 7252 | 6215 | return; |
| 7253 | 6216 | } |
| 7254 | 6217 | // 区分bill页面是否包含tab; |
| 7255 | - if (this.scrollY && !searchMainFormHeight && !searchComponentHeight && !offsetHeight) { | |
| 6218 | + if (this.scrollY && (!searchMainFormHeight && !searchComponentHeight && !offsetHeight)) { | |
| 7256 | 6219 | return; |
| 7257 | 6220 | } |
| 7258 | 6221 | const tabHeight = 89; |
| 7259 | 6222 | const paginationHeight = this.props.tableProps.pagination ? 60 : 0; |
| 7260 | 6223 | let extraHeight = 0; /* 额外的区域 */ |
| 7261 | - if (commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes("commonListTab")) { | |
| 7262 | - /* 带Tab页签的列表 */ | |
| 6224 | + if(commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes('commonListTab')) { /* 带Tab页签的列表 */ | |
| 7263 | 6225 | /* 有从表高度100,没有高度20 */ |
| 7264 | - const hasSlave = document.getElementsByClassName("hasSlave"); | |
| 7265 | - if (commonUtils.isNotEmptyArr(hasSlave)) { | |
| 7266 | - extraHeight = 220; | |
| 7267 | - } else { | |
| 7268 | - extraHeight = 20; | |
| 6226 | + const hasSlave = document.getElementsByClassName('hasSlave'); | |
| 6227 | + if(commonUtils.isNotEmptyArr(hasSlave)) { | |
| 6228 | + extraHeight = 220; | |
| 6229 | + }else { | |
| 6230 | + extraHeight = 20; | |
| 7269 | 6231 | } |
| 7270 | 6232 | } |
| 7271 | 6233 | |
| 7272 | 6234 | if (this.props?.masterConfig?.sTableColorTs) { |
| 7273 | 6235 | extraHeight += this.colorInfo?.getBoundingClientRect()?.height || 80; |
| 7274 | - if (location.pathname?.includes("productionScheduleTree")) { | |
| 6236 | + if(location.pathname?.includes('productionScheduleTree')) { | |
| 7275 | 6237 | extraHeight -= 34; |
| 7276 | 6238 | } |
| 7277 | 6239 | } else { |
| 7278 | 6240 | extraHeight += paginationHeight; |
| 7279 | 6241 | } |
| 7280 | 6242 | |
| 7281 | - const tableHeight = | |
| 7282 | - window.innerHeight - tabHeight - searchMainFormHeight - searchComponentHeight - tableHeaderHeight - footerHeight - offsetHeight - extraHeight; | |
| 6243 | + const tableHeight = window.innerHeight - tabHeight - searchMainFormHeight - searchComponentHeight - tableHeaderHeight - footerHeight - offsetHeight - extraHeight; | |
| 7283 | 6244 | this.scrollY = tableHeight; |
| 7284 | 6245 | this.tableHeight = tableHeight + tableHeaderHeight + footerHeight; |
| 7285 | - }; | |
| 6246 | + } | |
| 7286 | 6247 | |
| 7287 | 6248 | /** 计算th宽度(实现隐藏空td) */ |
| 7288 | - computedTdWidth = refresh => { | |
| 6249 | + computedTdWidth = (refresh) => { | |
| 7289 | 6250 | if (!this.props.formId || !this.props.config) { |
| 7290 | 6251 | return; |
| 7291 | 6252 | } |
| 7292 | - if (!this.mydivFlag || refresh) { | |
| 7293 | - // 表格初始化或屏幕size改变时触发 | |
| 6253 | + if (!this.mydivFlag || refresh) { // 表格初始化或屏幕size改变时触发 | |
| 7294 | 6254 | this.mydivTime = 0; |
| 7295 | 6255 | clearInterval(this.mydivTimer); |
| 7296 | 6256 | this.mydivTimer = null; |
| ... | ... | @@ -7305,12 +6265,10 @@ class CommonTableRc extends React.Component { |
| 7305 | 6265 | const { tableColumn, headerColumn } = this.state; |
| 7306 | 6266 | const sessionColumn = sessionStorage.getItem(`${this.props.formId}_${this.props.config.sId}`); |
| 7307 | 6267 | const column = sessionColumn ? JSON.parse(sessionColumn) : tableColumn; |
| 7308 | - const oCol = this.mydiv.querySelector("colgroup"); | |
| 6268 | + const oCol = this.mydiv.querySelector('colgroup'); | |
| 7309 | 6269 | const oCols = oCol ? oCol.childNodes : []; |
| 7310 | - const oColsWithList = Array.from(oCols) | |
| 7311 | - .filter(item => !item.className) | |
| 7312 | - .map(item => item.style.width); | |
| 7313 | - const tableLastEmptyIndex = column.findIndex(item => item.dataIndex === "tableLastEmpty"); | |
| 6270 | + const oColsWithList = Array.from(oCols).filter(item => !item.className).map(item => item.style.width); | |
| 6271 | + const tableLastEmptyIndex = column.findIndex(item => item.dataIndex === 'tableLastEmpty'); | |
| 7314 | 6272 | if (tableLastEmptyIndex > 0 && oColsWithList[tableLastEmptyIndex]) { |
| 7315 | 6273 | const iIndex = tableLastEmptyIndex - 1; // tableColumn最后一位 |
| 7316 | 6274 | this.mydivFlag = true; |
| ... | ... | @@ -7320,13 +6278,12 @@ class CommonTableRc extends React.Component { |
| 7320 | 6278 | const columnNew = [...column]; |
| 7321 | 6279 | const columnExtraSize = column.reduce((result, cur) => { |
| 7322 | 6280 | if (commonUtils.isNotEmptyArr(cur.children)) { |
| 7323 | - result += cur.children.length - 1; | |
| 6281 | + result += (cur.children.length - 1); | |
| 7324 | 6282 | } |
| 7325 | 6283 | return result; |
| 7326 | - }, 0); | |
| 6284 | + }, 0) | |
| 7327 | 6285 | const widthExtra = parseInt(oColsWithList[tableLastEmptyIndex + columnExtraSize]); |
| 7328 | - if (commonUtils.isNotEmptyArr(columnNew[iIndex].children)) { | |
| 7329 | - // 最后一个是双层表头 | |
| 6286 | + if (commonUtils.isNotEmptyArr(columnNew[iIndex].children)) { // 最后一个是双层表头 | |
| 7330 | 6287 | const lastChildIndex = columnNew[iIndex].children.length - 1; |
| 7331 | 6288 | columnNew[iIndex].children[lastChildIndex].width += widthExtra; |
| 7332 | 6289 | if (!columnNew[iIndex].children[lastChildIndex].widthExtra) { |
| ... | ... | @@ -7339,8 +6296,7 @@ class CommonTableRc extends React.Component { |
| 7339 | 6296 | headerColumnNew[headerIndex].width = columnNew[iIndex].children[lastChildIndex].width; |
| 7340 | 6297 | headerColumnNew[headerIndex].widthExtra = columnNew[iIndex].children[lastChildIndex].widthExtra; |
| 7341 | 6298 | } |
| 7342 | - } else { | |
| 7343 | - // 单表头 | |
| 6299 | + } else { // 单表头 | |
| 7344 | 6300 | columnNew[iIndex].width += widthExtra; |
| 7345 | 6301 | if (!columnNew[iIndex].widthExtra) { |
| 7346 | 6302 | columnNew[iIndex].widthExtra = 0; |
| ... | ... | @@ -7364,7 +6320,7 @@ class CommonTableRc extends React.Component { |
| 7364 | 6320 | } |
| 7365 | 6321 | }, 100); |
| 7366 | 6322 | } |
| 7367 | - }; | |
| 6323 | + } | |
| 7368 | 6324 | |
| 7369 | 6325 | /** 合并表头 */ |
| 7370 | 6326 | mergeTableColumn = (title, column, tableColumn, index, bNotEmpty, styleObj) => { |
| ... | ... | @@ -7375,23 +6331,20 @@ class CommonTableRc extends React.Component { |
| 7375 | 6331 | const childTitleContent = title.substring(index + 1, title.length); |
| 7376 | 6332 | |
| 7377 | 6333 | const renderTitle = () => { |
| 7378 | - const titleCheckBox = this.bCheckBoxColumm({ ...(column || {}), title: childTitleContent }); | |
| 6334 | + | |
| 6335 | + const titleCheckBox = this.bCheckBoxColumm({ ...column || {}, title: childTitleContent }); | |
| 7379 | 6336 | if (titleCheckBox) { |
| 7380 | 6337 | return titleCheckBox; |
| 7381 | 6338 | } |
| 7382 | 6339 | |
| 7383 | - let childTitle = ""; | |
| 6340 | + let childTitle = '' | |
| 7384 | 6341 | if (bNotEmpty) { |
| 7385 | - childTitle = ( | |
| 7386 | - <div style={styleObj}> | |
| 7387 | - <span className="table-title-required">*</span> {childTitleContent} | |
| 7388 | - </div> | |
| 7389 | - ); | |
| 6342 | + childTitle = <div style={styleObj}><span className="table-title-required">*</span> {childTitleContent}</div>; | |
| 7390 | 6343 | } else { |
| 7391 | 6344 | childTitle = <div style={styleObj}>{childTitleContent}</div>; |
| 7392 | 6345 | } |
| 7393 | 6346 | return childTitle; |
| 7394 | - }; | |
| 6347 | + } | |
| 7395 | 6348 | |
| 7396 | 6349 | /* 把原有表头都替换成子表头 */ |
| 7397 | 6350 | column.title = renderTitle(); |
| ... | ... | @@ -7403,17 +6356,15 @@ class CommonTableRc extends React.Component { |
| 7403 | 6356 | // 父表头已添加但是不是连续的 |
| 7404 | 6357 | const bPrevObj = commonUtils.isNotEmptyObject(lastParentObj) && lastTableColumn.title != lastParentObj.title; |
| 7405 | 6358 | /* [{title:1-1},{title:1-2}]变成[{title:1,children:[{title:1},{title:2}]}] */ |
| 7406 | - if (commonUtils.isEmptyObject(lastParentObj) || bPrevObj) { | |
| 7407 | - /* 父表头未添加 */ | |
| 6359 | + if (commonUtils.isEmptyObject(lastParentObj) || bPrevObj) { /* 父表头未添加 */ | |
| 7408 | 6360 | tableColumn.push({ |
| 7409 | 6361 | title: parentTitle, |
| 7410 | 6362 | children: [column], |
| 7411 | 6363 | }); |
| 7412 | - } else { | |
| 7413 | - /* 父表头已添加 */ | |
| 6364 | + } else { /* 父表头已添加 */ | |
| 7414 | 6365 | lastParentObj.children.push(column); |
| 7415 | 6366 | } |
| 7416 | - }; | |
| 6367 | + } | |
| 7417 | 6368 | |
| 7418 | 6369 | /** 合并单元格 */ |
| 7419 | 6370 | mergeTableCell = (text, index, sName, isSlaveInfo) => { |
| ... | ... | @@ -7423,7 +6374,7 @@ class CommonTableRc extends React.Component { |
| 7423 | 6374 | }; |
| 7424 | 6375 | if (isSlaveInfo) { |
| 7425 | 6376 | if (this.mergeInfoCellStateMap && this.mergeInfoCellListMap && this.mergeInfoCellStateMap[sName] && this.mergeInfoCellListMap[sName]) { |
| 7426 | - this.mergeInfoCellListMap[sName].forEach(item => { | |
| 6377 | + this.mergeInfoCellListMap[sName].forEach((item) => { | |
| 7427 | 6378 | item.forEach((item2, idx) => { |
| 7428 | 6379 | if (idx === 0) { |
| 7429 | 6380 | if (index === item2) { |
| ... | ... | @@ -7439,7 +6390,7 @@ class CommonTableRc extends React.Component { |
| 7439 | 6390 | }); |
| 7440 | 6391 | } |
| 7441 | 6392 | } else if (this.mergeCellStateMap && this.mergeCellListMap && this.mergeCellStateMap[sName] && this.mergeCellListMap[sName]) { |
| 7442 | - this.mergeCellListMap[sName].forEach(item => { | |
| 6393 | + this.mergeCellListMap[sName].forEach((item) => { | |
| 7443 | 6394 | item.forEach((item2, idx) => { |
| 7444 | 6395 | if (idx === 0) { |
| 7445 | 6396 | if (index === item2) { |
| ... | ... | @@ -7447,18 +6398,18 @@ class CommonTableRc extends React.Component { |
| 7447 | 6398 | } |
| 7448 | 6399 | } else if (index === item2) { |
| 7449 | 6400 | obj.props.rowSpan = item.length + 1 - idx; |
| 7450 | - obj.props.className = "vlist-td-display vlist-td-display1 " + obj.props.rowSpan; | |
| 6401 | + obj.props.className = 'vlist-td-display vlist-td-display1 ' + obj.props.rowSpan; | |
| 7451 | 6402 | } |
| 7452 | 6403 | if (index === item[item.length - 1] + 1) { |
| 7453 | 6404 | obj.props.rowSpan = 1; |
| 7454 | - obj.props.className = "vlist-td-display vlist-td-display2 " + obj.props.rowSpan; | |
| 6405 | + obj.props.className = 'vlist-td-display vlist-td-display2 ' + obj.props.rowSpan; | |
| 7455 | 6406 | } |
| 7456 | 6407 | }); |
| 7457 | 6408 | }); |
| 7458 | 6409 | } |
| 7459 | 6410 | obj.props.className = `${obj.props.className || ''}${this.handleGetSumStyle(sName, index)}`; |
| 7460 | 6411 | return obj; |
| 7461 | - }; | |
| 6412 | + } | |
| 7462 | 6413 | |
| 7463 | 6414 | /** 处理选择行发生改变 */ |
| 7464 | 6415 | handleSelectRowChange = (name, selectedRowKeys, bCheckBoxClick) => { |
| ... | ... | @@ -7480,7 +6431,7 @@ class CommonTableRc extends React.Component { |
| 7480 | 6431 | } |
| 7481 | 6432 | /* 初始值为37(那个checkbox的宽度) */ |
| 7482 | 6433 | const rowSelection = isInfo ? this.props.slaveInfo.tableProps.rowSelection : this.props.tableProps.rowSelection; |
| 7483 | - let scrollX = rowSelection === null || rowSelection == undefined ? 0 : 37; | |
| 6434 | + let scrollX = (rowSelection === null || rowSelection == undefined) ? 0 : 37; | |
| 7484 | 6435 | /* 遍历每一个表头配置 */ |
| 7485 | 6436 | for (const each of headerColumn) { |
| 7486 | 6437 | /* 没给宽度的默认120宽度 */ |
| ... | ... | @@ -7488,7 +6439,7 @@ class CommonTableRc extends React.Component { |
| 7488 | 6439 | let iWidth = 120; |
| 7489 | 6440 | if (each.width) { |
| 7490 | 6441 | iWidth = parseFloat(each.width); |
| 7491 | - } else if (each.dataIndex === "tableLastEmpty") { | |
| 6442 | + } else if (each.dataIndex === 'tableLastEmpty') { | |
| 7492 | 6443 | iWidth = 0; |
| 7493 | 6444 | } |
| 7494 | 6445 | /* 累加宽度 */ |
| ... | ... | @@ -7504,7 +6455,7 @@ class CommonTableRc extends React.Component { |
| 7504 | 6455 | /* 计算操作行宽度 */ |
| 7505 | 6456 | countOperate = () => { |
| 7506 | 6457 | let operateWidth = 0; |
| 7507 | - if (this.props.setOpterationColumn === "Y") { | |
| 6458 | + if (this.props.setOpterationColumn === 'Y') { | |
| 7508 | 6459 | const setNoCommonOperate = this.props.tableProps.setNoCommonOperate; /* 没有默认的增加删除按钮 */ |
| 7509 | 6460 | if (this.isAddShow) { |
| 7510 | 6461 | operateWidth += 40; |
| ... | ... | @@ -7532,22 +6483,22 @@ class CommonTableRc extends React.Component { |
| 7532 | 6483 | } |
| 7533 | 6484 | } |
| 7534 | 6485 | return operateWidth; |
| 7535 | - }; | |
| 6486 | + } | |
| 7536 | 6487 | /** 关闭弹窗 */ |
| 7537 | - handleModalCancel = modelVisible => { | |
| 6488 | + handleModalCancel = (modelVisible) => { | |
| 7538 | 6489 | this.setState({ |
| 7539 | 6490 | [modelVisible]: false, |
| 7540 | 6491 | }); |
| 7541 | 6492 | // this.props.onModalCancel(); |
| 7542 | 6493 | }; |
| 7543 | 6494 | // 获取进度条颜色 |
| 7544 | - handleGetStrokeColor = percent => { | |
| 6495 | + handleGetStrokeColor = (percent) => { | |
| 7545 | 6496 | if (percent < 30) { |
| 7546 | - return "#F50"; | |
| 6497 | + return '#F50'; | |
| 7547 | 6498 | } else if (percent >= 30 && percent < 90) { |
| 7548 | - return "#FF9900"; | |
| 6499 | + return '#FF9900'; | |
| 7549 | 6500 | } else { |
| 7550 | - return "#87D068"; | |
| 6501 | + return '#87D068'; | |
| 7551 | 6502 | } |
| 7552 | 6503 | }; |
| 7553 | 6504 | /** 上传文件改变时的状态 */ |
| ... | ... | @@ -7555,31 +6506,33 @@ class CommonTableRc extends React.Component { |
| 7555 | 6506 | const { status, percent } = info.file; |
| 7556 | 6507 | if (status === undefined) return; |
| 7557 | 6508 | const percentNew = Number(percent.toFixed(2)); |
| 7558 | - if (["done", "error"].includes(status)) { | |
| 6509 | + if (['done', 'error'].includes(status)) { | |
| 7559 | 6510 | message.open({ |
| 7560 | - type: status === "done" ? "success" : "error", | |
| 7561 | - content: status === "done" ? "文件上传成功" : "文件上传失败", | |
| 7562 | - duration: 3, | |
| 6511 | + type: status === 'done' ? 'success' : 'error', | |
| 6512 | + content: status === 'done' ? '文件上传成功' : '文件上传失败', | |
| 6513 | + duration: 3 | |
| 7563 | 6514 | }); |
| 7564 | 6515 | } else { |
| 7565 | 6516 | message.open({ |
| 7566 | - key: "xlyupload", | |
| 7567 | - type: percent === 100 ? "success" : "loading", | |
| 6517 | + key: 'xlyupload', | |
| 6518 | + type: percent === 100 ? 'success' : 'loading', | |
| 7568 | 6519 | content: ( |
| 7569 | 6520 | <> |
| 7570 | 6521 | <span>上传进度:</span> |
| 7571 | - <span style={{ display: "inline-block", width: 200, padding: "0 25px 3px 14px" }}> | |
| 6522 | + <span | |
| 6523 | + style={{ display: 'inline-block', width: 200, padding: '0 25px 3px 14px' }} | |
| 6524 | + > | |
| 7572 | 6525 | <Progress percent={percentNew} strokeColor={this.handleGetStrokeColor(percentNew)} /> |
| 7573 | 6526 | </span> |
| 7574 | 6527 | </> |
| 7575 | 6528 | ), |
| 7576 | - duration: percent === 100 ? 3 : 0, | |
| 6529 | + duration: percent === 100 ? 3 : 0 | |
| 7577 | 6530 | }); |
| 7578 | 6531 | } |
| 7579 | 6532 | onUploadChange(info, this.props.name); |
| 7580 | 6533 | }; |
| 7581 | 6534 | /** 上传前的校验 */ |
| 7582 | - handleBeforeUpload = file => { | |
| 6535 | + handleBeforeUpload = (file) => { | |
| 7583 | 6536 | if (this.props.uploadFileTypeVerification) { |
| 7584 | 6537 | return this.props.onBeforeUpload(file); |
| 7585 | 6538 | } else { |
| ... | ... | @@ -7587,68 +6540,66 @@ class CommonTableRc extends React.Component { |
| 7587 | 6540 | } |
| 7588 | 6541 | }; |
| 7589 | 6542 | // 通过右键粘贴板导入文件 |
| 7590 | - handleUploadByClipboard = event => { | |
| 6543 | + handleUploadByClipboard = (event) => { | |
| 7591 | 6544 | const files = event.clipboardData.files; |
| 7592 | - this.uploadRef.setAttribute("contenteditable", "false"); | |
| 7593 | - this.uploadRef1.setAttribute("contenteditable", "false"); | |
| 6545 | + this.uploadRef.setAttribute('contenteditable', "false"); | |
| 6546 | + this.uploadRef1.setAttribute('contenteditable', "false"); | |
| 7594 | 6547 | if (commonUtils.isNotEmptyArr(files)) { |
| 7595 | 6548 | const file = files[0]; |
| 7596 | 6549 | const formData = new FormData(); |
| 7597 | - formData.append("file", file); | |
| 6550 | + formData.append('file', file); | |
| 7598 | 6551 | |
| 7599 | 6552 | const { formId } = this.props; |
| 7600 | 6553 | const { token } = this.props.app; |
| 7601 | 6554 | const url = `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`; |
| 7602 | 6555 | fetch(url, { |
| 7603 | - method: "POST", | |
| 6556 | + method: 'POST', | |
| 7604 | 6557 | body: formData, |
| 6558 | + }).then(res => res.json()).then(response => { | |
| 6559 | + const info = { file: { name: file.name, size: file.size, type: file.type, response } }; | |
| 6560 | + this.handleUploadChange(info); | |
| 7605 | 6561 | }) |
| 7606 | - .then(res => res.json()) | |
| 7607 | - .then(response => { | |
| 7608 | - const info = { file: { name: file.name, size: file.size, type: file.type, response } }; | |
| 7609 | - this.handleUploadChange(info); | |
| 7610 | - }); | |
| 7611 | 6562 | } else { |
| 7612 | - message.warning("请确认复制的内容是文件类型!"); | |
| 6563 | + message.warning('请确认复制的内容是文件类型!'); | |
| 7613 | 6564 | } |
| 7614 | 6565 | }; |
| 7615 | - handleGetFastSearchBtn = ({ record, sName, isSlaveInfo }) => { | |
| 7616 | - if (isSlaveInfo || !sName.startsWith("s") || this.props.name !== "slave") { | |
| 7617 | - return ""; | |
| 6566 | + handleGetFastSearchBtn = ({record, sName, isSlaveInfo}) => { | |
| 6567 | + if (isSlaveInfo || !sName.startsWith('s') || this.props.name !== 'slave') { | |
| 6568 | + return ''; | |
| 7618 | 6569 | } |
| 7619 | 6570 | const iIndex = this.props.config.gdsconfigformslave.findIndex(item => item.sName === sName); |
| 7620 | 6571 | if (iIndex === -1) { |
| 7621 | - return ""; | |
| 6572 | + return ''; | |
| 7622 | 6573 | } |
| 7623 | 6574 | |
| 7624 | 6575 | const config = this.props.config.gdsconfigformslave[iIndex]; |
| 7625 | 6576 | if (!config.bFind) { |
| 7626 | - return ""; | |
| 6577 | + return ''; | |
| 7627 | 6578 | } |
| 7628 | 6579 | |
| 7629 | 6580 | const { masterData, searchRowKeys } = this.props; |
| 7630 | 6581 | if (commonUtils.isEmptyObject(masterData) || commonUtils.isEmptyArr(searchRowKeys)) { |
| 7631 | - return ""; | |
| 6582 | + return ''; | |
| 7632 | 6583 | } |
| 7633 | 6584 | const masterDataKeys = Object.keys(masterData); |
| 7634 | 6585 | let bInSearch = false; |
| 7635 | - let oldKey = ""; | |
| 6586 | + let oldKey = ''; | |
| 7636 | 6587 | if (commonUtils.isNotEmptyArr(searchRowKeys)) { |
| 7637 | 6588 | for (let i = 0; i < masterDataKeys.length; i++) { |
| 7638 | 6589 | const keyName = masterDataKeys[i]; |
| 7639 | - if (!keyName.startsWith("sFirst-")) { | |
| 6590 | + if (!keyName.startsWith('sFirst-')) { | |
| 7640 | 6591 | continue; |
| 7641 | 6592 | } |
| 7642 | 6593 | const sFirstValue = masterData[keyName]; |
| 7643 | 6594 | if (sFirstValue !== sName) { |
| 7644 | 6595 | continue; |
| 7645 | 6596 | } |
| 7646 | - const key = keyName.substring("sFirst-".length, keyName.length); | |
| 6597 | + const key = keyName.substring('sFirst-'.length, keyName.length); | |
| 7647 | 6598 | if (!searchRowKeys.includes(key)) { |
| 7648 | 6599 | continue; |
| 7649 | 6600 | } |
| 7650 | 6601 | oldKey = key; |
| 7651 | - const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? "s" : sFirstValue.substring(0, 1); | |
| 6602 | + const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1); | |
| 7652 | 6603 | const sThirdName = `${firstDataIndex}Third-${key}`; |
| 7653 | 6604 | const sThirdValue = masterData[sThirdName]; |
| 7654 | 6605 | if (sThirdValue === record[sName]) { |
| ... | ... | @@ -7673,28 +6624,24 @@ class CommonTableRc extends React.Component { |
| 7673 | 6624 | {bInSearch ? <ClearOutlined /> : <FileSearchOutlined />} |
| 7674 | 6625 | </div> |
| 7675 | 6626 | ); |
| 7676 | - }; | |
| 7677 | - handleFastSearch = params => { | |
| 6627 | + } | |
| 6628 | + handleFastSearch = (params) => { | |
| 7678 | 6629 | const { sName, record, oldKey } = params; |
| 7679 | 6630 | const { config, searchRowKeys = [], onBtnSearch } = this.props; |
| 7680 | 6631 | |
| 7681 | 6632 | const newKey = oldKey || commonUtils.createSid(); |
| 7682 | 6633 | const sFirstFieldName = `sFirst-${newKey}`; |
| 7683 | 6634 | |
| 7684 | - const { masterData } = this.props.onChange("master", sFirstFieldName, { [sFirstFieldName]: sName }, null, null, true); | |
| 6635 | + const { masterData } = this.props.onChange('master', sFirstFieldName, { [sFirstFieldName]: sName }, null, null, true); | |
| 7685 | 6636 | const sFirstValue = masterData[sFirstFieldName]; |
| 7686 | 6637 | |
| 7687 | - const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? "s" : sFirstValue.substring(0, 1); | |
| 7688 | - const sSecondConditionPro = firstDataIndex === "s" && sFirstValue.endsWith("_pro"); | |
| 6638 | + const firstDataIndex = commonUtils.isEmpty(sFirstValue) ? 's' : sFirstValue.substring(0, 1); | |
| 6639 | + const sSecondConditionPro = firstDataIndex === 's' && sFirstValue.endsWith('_pro'); | |
| 7689 | 6640 | const iIndex = config.gdsconfigformslave.findIndex(item => item.sName === sFirstValue); |
| 7690 | - masterData[`sSecond-${newKey}`] = | |
| 7691 | - sSecondConditionPro && iIndex > -1 && config.gdsconfigformslave[iIndex].sDropDownType === "sql" | |
| 7692 | - ? commonConfig.seaJudge.s_proDropDown[0].sId | |
| 7693 | - : sSecondConditionPro | |
| 7694 | - ? commonConfig.seaJudge.s_pro[0].sId | |
| 7695 | - : commonConfig.seaJudge[firstDataIndex][0].sId; | |
| 7696 | - masterData[`${firstDataIndex}Third-${newKey}`] = | |
| 7697 | - firstDataIndex === "b" ? false : firstDataIndex === "t" ? moment().format("YYYY-MM-DD") : masterData[`${firstDataIndex}Third-${newKey}`]; | |
| 6641 | + masterData[`sSecond-${newKey}`] = sSecondConditionPro && iIndex > -1 && config.gdsconfigformslave[iIndex].sDropDownType === 'sql' ? | |
| 6642 | + commonConfig.seaJudge.s_proDropDown[0].sId : sSecondConditionPro ? | |
| 6643 | + commonConfig.seaJudge.s_pro[0].sId : commonConfig.seaJudge[firstDataIndex][0].sId; | |
| 6644 | + masterData[`${firstDataIndex}Third-${newKey}`] = firstDataIndex === 'b' ? false : firstDataIndex === 't' ? moment().format('YYYY-MM-DD') : masterData[`${firstDataIndex}Third-${newKey}`]; | |
| 7698 | 6645 | |
| 7699 | 6646 | const sThirdName = `${firstDataIndex}Third-${newKey}`; |
| 7700 | 6647 | masterData[`${sThirdName}`] = record[sName]; |
| ... | ... | @@ -7707,7 +6654,7 @@ class CommonTableRc extends React.Component { |
| 7707 | 6654 | onBtnSearch(); |
| 7708 | 6655 | }); |
| 7709 | 6656 | }; |
| 7710 | - handleClearFastSearch = oldKey => { | |
| 6657 | + handleClearFastSearch = (oldKey) => { | |
| 7711 | 6658 | const { searchRowKeys = [], onBtnSearch, masterData = {} } = this.props; |
| 7712 | 6659 | if (searchRowKeys.length > 1) { |
| 7713 | 6660 | const searchRowKeysNew = searchRowKeys.filter(item => item !== oldKey); |
| ... | ... | @@ -7717,22 +6664,22 @@ class CommonTableRc extends React.Component { |
| 7717 | 6664 | } else if (searchRowKeys.length === 1) { |
| 7718 | 6665 | const sThirdName = Object.keys(masterData).find(key => key.indexOf(`Third-${oldKey}`) !== -1); |
| 7719 | 6666 | if (sThirdName) { |
| 7720 | - masterData[sThirdName] = ""; | |
| 6667 | + masterData[sThirdName] = ''; | |
| 7721 | 6668 | this.props.onSaveState({ masterData }, () => { |
| 7722 | 6669 | onBtnSearch(); |
| 7723 | 6670 | }); |
| 7724 | 6671 | } |
| 7725 | 6672 | } |
| 7726 | - }; | |
| 6673 | + } | |
| 7727 | 6674 | // 进行拖动排序,数据展现必须按照iOrder 进行排序展现,必须进行选择才能拖动(废弃) |
| 7728 | 6675 | moveRowOld = (dragIndex, hoverIndex) => { |
| 7729 | 6676 | const { name } = this.props; |
| 7730 | 6677 | const { selectedRowKeys } = this.state; |
| 7731 | 6678 | if (commonUtils.isEmptyArr(selectedRowKeys)) { |
| 7732 | - message.warning("请选择后进行拖动"); | |
| 6679 | + message.warning('请选择后进行拖动'); | |
| 7733 | 6680 | } else { |
| 7734 | 6681 | // let mHoverIndex = hoverIndex; |
| 7735 | - selectedRowKeys.forEach(item => { | |
| 6682 | + selectedRowKeys.forEach((item) => { | |
| 7736 | 6683 | const { dataSource } = this.state; |
| 7737 | 6684 | const iIndex = dataSource.findIndex(newItem => item === newItem[this.rowKey]); |
| 7738 | 6685 | const dragRow = dataSource[iIndex]; |
| ... | ... | @@ -7740,10 +6687,7 @@ class CommonTableRc extends React.Component { |
| 7740 | 6687 | |
| 7741 | 6688 | const newState = update(this.state, { |
| 7742 | 6689 | dataSource: { |
| 7743 | - $splice: [ | |
| 7744 | - [iIndex, 1], | |
| 7745 | - [hoverIndex, 0, dragRow], | |
| 7746 | - ], | |
| 6690 | + $splice: [[iIndex, 1], [hoverIndex, 0, dragRow]], | |
| 7747 | 6691 | }, |
| 7748 | 6692 | }); |
| 7749 | 6693 | this.setState(newState); |
| ... | ... | @@ -7752,37 +6696,37 @@ class CommonTableRc extends React.Component { |
| 7752 | 6696 | const { dataSource } = this.state; |
| 7753 | 6697 | dataSource.forEach((item, index) => { |
| 7754 | 6698 | if (commonUtils.isEmpty(item.handleType)) { |
| 7755 | - item.handleType = "update"; | |
| 6699 | + item.handleType = 'update'; | |
| 7756 | 6700 | } |
| 7757 | 6701 | item.iOrder = index + 1; |
| 7758 | 6702 | }); |
| 7759 | 6703 | this.setState(dataSource); |
| 7760 | 6704 | this.props.onRowMove({ [`${name}Data`]: dataSource }); |
| 7761 | 6705 | } |
| 7762 | - }; | |
| 6706 | + } | |
| 7763 | 6707 | /* 拖拽改变对应层级 */ |
| 7764 | - moveRow = (dragIndex, hoverIndex, dragKey, hoverKey) => { | |
| 7765 | - if (this.props.onMoveRow) { | |
| 7766 | - this.props.onMoveRow(dragIndex, hoverIndex, dragKey, hoverKey, this.props); | |
| 6708 | + moveRow = (dragIndex, hoverIndex,dragKey,hoverKey) => { | |
| 6709 | + if(this.props.onMoveRow) { | |
| 6710 | + this.props.onMoveRow(dragIndex, hoverIndex,dragKey,hoverKey); | |
| 7767 | 6711 | } |
| 7768 | 6712 | }; |
| 7769 | 6713 | |
| 7770 | 6714 | BtnUploadDivProps = () => { |
| 7771 | 6715 | return { |
| 7772 | - accept: this.BtnUploadDivPropsAttr.current?.sActiveKey || "*/*", | |
| 7773 | - beforeUpload: file => { | |
| 6716 | + accept: this.BtnUploadDivPropsAttr.current?.sActiveKey || '*/*', | |
| 6717 | + beforeUpload: (file) => { | |
| 7774 | 6718 | const config = this.BtnUploadDivPropsAttr.current; |
| 7775 | - if (config?.sActiveKey && typeof config?.sActiveKey === "string") { | |
| 7776 | - const isAllow = config?.sActiveKey?.split(",").includes(file.type); | |
| 6719 | + if (config?.sActiveKey && typeof config?.sActiveKey === 'string') { | |
| 6720 | + const isAllow = config?.sActiveKey?.split(',').includes(file.type); | |
| 7777 | 6721 | if (!isAllow) { |
| 7778 | - message.error(`请选择正确的文件类型,包含${config?.sActiveKey || ""}`); | |
| 6722 | + message.error(`请选择正确的文件类型,包含${config?.sActiveKey || ''}`); | |
| 7779 | 6723 | } |
| 7780 | 6724 | return isAllow; |
| 7781 | 6725 | } |
| 7782 | 6726 | return true; |
| 7783 | - }, | |
| 7784 | - }; | |
| 7785 | - }; | |
| 6727 | + } | |
| 6728 | + } | |
| 6729 | + } | |
| 7786 | 6730 | |
| 7787 | 6731 | /** 渲染 */ |
| 7788 | 6732 | render() { |
| ... | ... | @@ -7818,7 +6762,7 @@ class CommonTableRc extends React.Component { |
| 7818 | 6762 | if (commonUtils.isNotEmptyObject(previewImage)) { |
| 7819 | 6763 | if (commonUtils.isNotEmptyArr(this.props.data)) { |
| 7820 | 6764 | if (this.props.data[0].sPicturePath) { |
| 7821 | - for (const item of this.props.data) { | |
| 6765 | + for(const item of this.props.data) { | |
| 7822 | 6766 | const dataUrl = `${commonConfig.file_host}file/download?savePathStr=${item.sPicturePath}&sModelsId=100&token=${token}`; /* 缩略图 */ |
| 7823 | 6767 | data.push(dataUrl); |
| 7824 | 6768 | } |
| ... | ... | @@ -7833,9 +6777,9 @@ class CommonTableRc extends React.Component { |
| 7833 | 6777 | const divProps = { |
| 7834 | 6778 | action: `${commonConfig.file_host}file/upload?sModelsId=${formId}&token=${token}`, |
| 7835 | 6779 | onChange: this.handleUploadChange, |
| 7836 | - accept: "*/*", | |
| 6780 | + accept: '*/*', | |
| 7837 | 6781 | showUploadList: false, |
| 7838 | - multiple: true, | |
| 6782 | + multiple:true, | |
| 7839 | 6783 | beforeUpload: this.handleBeforeUpload, |
| 7840 | 6784 | }; |
| 7841 | 6785 | /* 获取look的props */ |
| ... | ... | @@ -7869,7 +6813,7 @@ class CommonTableRc extends React.Component { |
| 7869 | 6813 | |
| 7870 | 6814 | /* 通用弹窗功能 */ |
| 7871 | 6815 | let commonPopupProps = {}; |
| 7872 | - let commonPopupTitle = "选择弹窗"; | |
| 6816 | + let commonPopupTitle = '选择弹窗'; | |
| 7873 | 6817 | let bCommonPopup = false; /* 多列弹出窗11 */ |
| 7874 | 6818 | let bCommonPopup1 = false; /* 单列弹出窗 */ |
| 7875 | 6819 | let bCommonPopupTree = false; /* 树形列弹出窗 */ |
| ... | ... | @@ -7878,59 +6822,35 @@ class CommonTableRc extends React.Component { |
| 7878 | 6822 | let commonPopupConfig = {}; |
| 7879 | 6823 | const { config, sModelsId, app, selectedRowKeys } = this.props; |
| 7880 | 6824 | if (commonUtils.isNotEmptyObject(config)) { |
| 7881 | - const iIndex = config.gdsconfigformslave.findIndex( | |
| 7882 | - item => | |
| 7883 | - commonUtils.isNotEmptyObject(item.sControlName) && | |
| 7884 | - (item.sControlName.includes("BtnPopup") || item.sControlName.includes("BtnHeadPopup")) && | |
| 7885 | - item.bVisible && | |
| 7886 | - item.sDropDownType === "popup" | |
| 7887 | - ); | |
| 6825 | + const iIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup')) && item.bVisible && item.sDropDownType === 'popup'); | |
| 7888 | 6826 | if (iIndex > -1) { |
| 7889 | 6827 | commonPopupConfig = config.gdsconfigformslave[iIndex]; |
| 7890 | - if (commonPopupShowConfig?.sControlName === "BtnPopupsAlumiteBomBillNo" || commonPopupShowConfig?.sControlName === "BtnChooseProcess") { | |
| 6828 | + if(commonPopupShowConfig?.sControlName === 'BtnPopupsAlumiteBomBillNo' || commonPopupShowConfig?.sControlName === 'BtnChooseProcess') { | |
| 7891 | 6829 | commonPopupConfig = commonPopupShowConfig; |
| 7892 | - if (commonPopupShowConfig?.sControlName === "BtnChooseProcess") { | |
| 6830 | + if(commonPopupShowConfig?.sControlName === 'BtnChooseProcess') { | |
| 7893 | 6831 | bCommonPopupProcess = true; |
| 7894 | 6832 | } |
| 7895 | 6833 | } |
| 7896 | - commonPopupTitle = | |
| 7897 | - commonUtils.isNotEmptyObject(commonPopupConfig) && commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName) | |
| 7898 | - ? commonPopupConfig.sActiveName | |
| 7899 | - : commonPopupTitle; | |
| 7900 | - commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupRecord) | |
| 7901 | - ? commonPopupConfig.sActiveId === "1" | |
| 7902 | - ? commonUtils.isEmpty(commonPopupRecord.sSrcFormName) | |
| 7903 | - ? commonPopupTitle | |
| 7904 | - : commonPopupRecord.sSrcFormName | |
| 7905 | - : commonPopupTitle | |
| 7906 | - : commonPopupTitle; | |
| 7907 | - const sFormId = commonUtils.isNotEmptyObject(commonPopupRecord) | |
| 7908 | - ? commonPopupConfig.sActiveId === "1" | |
| 7909 | - ? commonUtils.isEmpty(commonPopupRecord.sFormId) | |
| 7910 | - ? commonPopupRecord.sSrcFormId | |
| 7911 | - : commonPopupRecord.sFormId | |
| 7912 | - : commonPopupConfig.sActiveId | |
| 7913 | - : commonPopupConfig.sActiveId; | |
| 6834 | + commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupConfig) && commonUtils.isNotEmptyObject(commonPopupConfig.sActiveName) ? commonPopupConfig.sActiveName : commonPopupTitle; | |
| 6835 | + commonPopupTitle = commonUtils.isNotEmptyObject(commonPopupRecord) ? ( commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sSrcFormName) ? commonPopupTitle : commonPopupRecord.sSrcFormName : commonPopupTitle ) : commonPopupTitle; | |
| 6836 | + const sFormId = commonUtils.isNotEmptyObject(commonPopupRecord) ? ( commonPopupConfig.sActiveId === '1' ? commonUtils.isEmpty(commonPopupRecord.sFormId) ? commonPopupRecord.sSrcFormId : commonPopupRecord.sFormId : commonPopupConfig.sActiveId ) : commonPopupConfig.sActiveId; | |
| 7914 | 6837 | |
| 7915 | 6838 | commonPopupProps = { |
| 7916 | 6839 | app: { |
| 7917 | 6840 | ...this.props.app, |
| 7918 | 6841 | currentPane: { |
| 7919 | - name: "commonPopup", | |
| 7920 | - bEdit: | |
| 7921 | - commonUtils.isNotEmptyObject(app.currentPane) && | |
| 7922 | - commonUtils.isNotEmptyObject(app.currentPane.route) && | |
| 7923 | - app.currentPane.route.includes("commonBillDeliver"), | |
| 6842 | + name: 'commonPopup', | |
| 6843 | + bEdit: (commonUtils.isNotEmptyObject(app.currentPane) && commonUtils.isNotEmptyObject(app.currentPane.route) && app.currentPane.route.includes('commonBillDeliver')), | |
| 7924 | 6844 | config: commonPopupConfig, |
| 7925 | 6845 | conditonValues: this.props.getSqlCondition(commonPopupConfig), |
| 7926 | - title: commonPopupTitle, | |
| 7927 | - route: "/indexPage/commonList", | |
| 7928 | - formRoute: "/indexPage/commonList", | |
| 6846 | + title:commonPopupTitle, | |
| 6847 | + route: '/indexPage/commonList', | |
| 6848 | + formRoute: '/indexPage/commonList', | |
| 7929 | 6849 | formId: sFormId, |
| 7930 | 6850 | key: sModelsId + commonPopupConfig.sId, |
| 7931 | - sModelsType: bCommonPopupProcess ? "search/commonProcess" : "search/commonPopup", | |
| 7932 | - select: this.handleSelectCommonPopup, | |
| 7933 | - selectCancel: this.handleSelectCancel.bind(this, "commonPopupVisible"), | |
| 6851 | + sModelsType: bCommonPopupProcess ? 'search/commonProcess' : 'search/commonPopup', | |
| 6852 | + select:this.handleSelectCommonPopup, | |
| 6853 | + selectCancel: this.handleSelectCancel.bind(this, 'commonPopupVisible'), | |
| 7934 | 6854 | }, |
| 7935 | 6855 | }, |
| 7936 | 6856 | dispatch: this.props.dispatch, |
| ... | ... | @@ -7938,57 +6858,38 @@ class CommonTableRc extends React.Component { |
| 7938 | 6858 | id: randomId, |
| 7939 | 6859 | onOpenNewTab: this.onOpenNewTab, |
| 7940 | 6860 | outerMasterData: this.props.masterData, |
| 7941 | - realizeHeight: this.props.realizeHeight /* 拖动偏移高度 */, | |
| 6861 | + realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */ | |
| 7942 | 6862 | }; |
| 7943 | 6863 | } |
| 7944 | 6864 | |
| 7945 | 6865 | /* 多列弹出窗 */ |
| 7946 | - const commonPopupIndex = config.gdsconfigformslave.findIndex( | |
| 7947 | - item => | |
| 7948 | - commonUtils.isNotEmptyObject(item.sControlName) && | |
| 7949 | - (item.sControlName.includes("BtnPopup") || item.sControlName.includes("BtnHeadPopup")) && | |
| 7950 | - !["BtnPopup1"].includes(item.sControlName) && | |
| 7951 | - !item.sControlName.startsWith("BtnPopupEdit") && | |
| 7952 | - item.bVisible && | |
| 7953 | - item.sDropDownType === "popup" | |
| 7954 | - ); | |
| 6866 | + const commonPopupIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && (item.sControlName.includes('BtnPopup') || item.sControlName.includes('BtnHeadPopup') ) && !['BtnPopup1'].includes(item.sControlName) && !item.sControlName.startsWith('BtnPopupEdit') && item.bVisible && item.sDropDownType === 'popup'); | |
| 7955 | 6867 | if (commonPopupIndex > -1) { |
| 7956 | 6868 | bCommonPopup = true; |
| 7957 | 6869 | } |
| 7958 | 6870 | |
| 7959 | 6871 | /* 单列弹出窗 */ |
| 7960 | - const commonPopupIndex1 = config.gdsconfigformslave.findIndex( | |
| 7961 | - item => | |
| 7962 | - commonUtils.isNotEmptyObject(item.sControlName) && | |
| 7963 | - item.sControlName.includes("BtnPopup1") && | |
| 7964 | - item.bVisible && | |
| 7965 | - item.sDropDownType === "popup" | |
| 7966 | - ); | |
| 6872 | + const commonPopupIndex1 = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName.includes('BtnPopup1') && item.bVisible && item.sDropDownType === 'popup'); | |
| 7967 | 6873 | if (commonPopupIndex1 > -1) { |
| 7968 | 6874 | bCommonPopup1 = true; |
| 7969 | 6875 | bCommonPopup = false; |
| 7970 | 6876 | } |
| 7971 | 6877 | |
| 7972 | 6878 | /* commonListTree弹出窗 */ |
| 7973 | - const commonPopupIndexTree = config.gdsconfigformslave.findIndex( | |
| 7974 | - item => | |
| 7975 | - commonUtils.isNotEmptyObject(item.sControlName) && | |
| 7976 | - item.sControlName === "BtnPopupListTree" && | |
| 7977 | - item.bVisible && | |
| 7978 | - item.sDropDownType === "popup" | |
| 7979 | - ); | |
| 6879 | + const commonPopupIndexTree = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sControlName) && item.sControlName === 'BtnPopupListTree' && item.bVisible && item.sDropDownType === 'popup'); | |
| 7980 | 6880 | if (commonPopupIndexTree > -1) { |
| 7981 | 6881 | bCommonPopupTree = true; |
| 7982 | 6882 | } |
| 6883 | + | |
| 7983 | 6884 | } |
| 7984 | 6885 | } |
| 7985 | 6886 | |
| 7986 | 6887 | /* 字段弹窗功能 */ |
| 7987 | 6888 | let commonFieldPopupProps = {}; |
| 7988 | 6889 | let bFieldPopup = true; /* 多列弹出窗 */ |
| 7989 | - let commonFieldPopupTitle = "选择弹窗"; | |
| 7990 | - const commonFileDownloadTitle = "附件列表弹窗"; | |
| 7991 | - const isBtnPopupEdit = this.state.commonFieldPopupShowConfig?.sControlName?.startsWith("BtnPopupEdit"); | |
| 6890 | + let commonFieldPopupTitle = '选择弹窗'; | |
| 6891 | + const commonFileDownloadTitle = '附件列表弹窗'; | |
| 6892 | + const isBtnPopupEdit = this.state.commonFieldPopupShowConfig?.sControlName?.startsWith('BtnPopupEdit'); | |
| 7992 | 6893 | if (commonUtils.isNotEmptyObject(this.props)) { |
| 7993 | 6894 | let commonFieldPopupConfig = {}; |
| 7994 | 6895 | const { config, sModelsId } = this.props; |
| ... | ... | @@ -7998,37 +6899,31 @@ class CommonTableRc extends React.Component { |
| 7998 | 6899 | iIndex = 0; |
| 7999 | 6900 | commonFieldPopupConfig = commonFieldPopupShowConfig; |
| 8000 | 6901 | } else { |
| 8001 | - iIndex = config.gdsconfigformslave.findIndex( | |
| 8002 | - item => commonUtils.isNotEmptyObject(item.sName) && (item.sDropDownType === "popup" || item.sDropDownType === "popupSingle") | |
| 8003 | - ); | |
| 6902 | + iIndex = config.gdsconfigformslave.findIndex(item => commonUtils.isNotEmptyObject(item.sName) && (item.sDropDownType === 'popup' || item.sDropDownType === 'popupSingle')); | |
| 8004 | 6903 | if (iIndex > -1) { |
| 8005 | 6904 | commonFieldPopupConfig = config.gdsconfigformslave[iIndex]; |
| 8006 | 6905 | } |
| 8007 | 6906 | } |
| 8008 | 6907 | |
| 8009 | 6908 | if (iIndex > -1) { |
| 8010 | - if (commonFieldPopupConfig.sDropDownType === "popupSingle") { | |
| 8011 | - /* 如果下拉类型是单列弹出窗 则为单列 */ | |
| 6909 | + if(commonFieldPopupConfig.sDropDownType === 'popupSingle') { /* 如果下拉类型是单列弹出窗 则为单列 */ | |
| 8012 | 6910 | bFieldPopup = false; |
| 8013 | 6911 | } |
| 8014 | - commonFieldPopupTitle = | |
| 8015 | - commonUtils.isNotEmptyObject(commonFieldPopupConfig) && commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName) | |
| 8016 | - ? commonFieldPopupConfig.sActiveName | |
| 8017 | - : commonFieldPopupTitle; | |
| 6912 | + commonFieldPopupTitle = commonUtils.isNotEmptyObject(commonFieldPopupConfig) && commonUtils.isNotEmptyObject(commonFieldPopupConfig.sActiveName) ? commonFieldPopupConfig.sActiveName : commonFieldPopupTitle; | |
| 8018 | 6913 | commonFieldPopupProps = { |
| 8019 | 6914 | app: { |
| 8020 | 6915 | ...this.props.app, |
| 8021 | 6916 | currentPane: { |
| 8022 | - name: "commonPopup", | |
| 6917 | + name: 'commonPopup', | |
| 8023 | 6918 | config: commonFieldPopupConfig, |
| 8024 | - title: commonFieldPopupTitle, | |
| 8025 | - route: "/indexPage/commonList", | |
| 8026 | - formRoute: "/indexPage/commonList", | |
| 6919 | + title:commonFieldPopupTitle, | |
| 6920 | + route: '/indexPage/commonList', | |
| 6921 | + formRoute: '/indexPage/commonList', | |
| 8027 | 6922 | formId: commonFieldPopupConfig.sActiveId, |
| 8028 | 6923 | key: sModelsId + commonFieldPopupConfig.sId, |
| 8029 | - sModelsType: "search/commonPopup", | |
| 8030 | - select: this.handleSelectCommonFieldPopup, | |
| 8031 | - selectCancel: this.handleSelectCancel.bind(this, "commonFieldPopupVisible"), | |
| 6924 | + sModelsType: 'search/commonPopup', | |
| 6925 | + select:this.handleSelectCommonFieldPopup, | |
| 6926 | + selectCancel: this.handleSelectCancel.bind(this, 'commonFieldPopupVisible'), | |
| 8032 | 6927 | }, |
| 8033 | 6928 | }, |
| 8034 | 6929 | dispatch: this.props.dispatch, |
| ... | ... | @@ -8036,20 +6931,16 @@ class CommonTableRc extends React.Component { |
| 8036 | 6931 | id: randomId, |
| 8037 | 6932 | onOpenNewTab: this.onOpenNewTab, |
| 8038 | 6933 | outerMasterData: this.props.masterData, |
| 8039 | - realizeHeight: this.props.realizeHeight /* 拖动偏移高度 */, | |
| 6934 | + realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */ | |
| 8040 | 6935 | }; |
| 8041 | - if (this.props.enabled && commonFieldPopupConfig?.sControlName?.includes("popupSingle_edit")) { | |
| 8042 | - commonFieldPopupProps.app.currentPane.conditonValues = this.props.getSqlCondition( | |
| 8043 | - commonFieldPopupConfig, | |
| 8044 | - this.props.name, | |
| 8045 | - commonFieldPopupShowRecord | |
| 8046 | - ); | |
| 6936 | + if (this.props.enabled && commonFieldPopupConfig?.sControlName?.includes('popupSingle_edit')) { | |
| 6937 | + commonFieldPopupProps.app.currentPane.conditonValues = this.props.getSqlCondition(commonFieldPopupConfig, this.props.name, commonFieldPopupShowRecord); | |
| 8047 | 6938 | } else { |
| 8048 | 6939 | commonFieldPopupProps.app.currentPane.conditonValues = this.props.getSqlCondition(commonFieldPopupConfig); |
| 8049 | 6940 | } |
| 8050 | 6941 | if (isBtnPopupEdit) { |
| 8051 | 6942 | const selectData = tableProps.dataSource[this.rowClickRef.current] || {}; |
| 8052 | - const sMemoData = selectData?.[this.state.commonFieldPopupShowConfig?.sActiveKey] || "[]"; | |
| 6943 | + const sMemoData = selectData?.[this.state.commonFieldPopupShowConfig?.sActiveKey] || '[]'; | |
| 8053 | 6944 | commonFieldPopupProps.app.sMemoData = JSON.parse(sMemoData); |
| 8054 | 6945 | commonFieldPopupProps.app.originSlaveData = selectData; |
| 8055 | 6946 | commonFieldPopupProps.app.currentPane.bEdit = isBtnPopupEdit; |
| ... | ... | @@ -8059,42 +6950,33 @@ class CommonTableRc extends React.Component { |
| 8059 | 6950 | } |
| 8060 | 6951 | } |
| 8061 | 6952 | |
| 6953 | + | |
| 8062 | 6954 | /* 蓝色链接弹Modal窗功能 */ |
| 8063 | 6955 | let commonModalProps = {}; |
| 8064 | - let commonModalTitle = "查看"; | |
| 6956 | + let commonModalTitle = '查看'; | |
| 8065 | 6957 | if (commonUtils.isNotEmptyObject(this.props)) { |
| 8066 | 6958 | const { config, sModelsId, app, selectedRowKeys, enabled } = this.props; |
| 8067 | 6959 | if (commonUtils.isNotEmptyObject(config)) { |
| 8068 | - commonModalTitle = | |
| 8069 | - commonUtils.isNotEmptyObject(commonModalShowConfig) && commonUtils.isNotEmptyObject(commonModalShowConfig.sActiveName) | |
| 8070 | - ? commonModalShowConfig.sActiveName | |
| 8071 | - : commonModalTitle; | |
| 8072 | - const sFormId = | |
| 8073 | - commonUtils.isNotEmptyObject(commonModalRecord) && commonUtils.isNotEmptyObject(commonModalShowConfig) | |
| 8074 | - ? commonModalShowConfig.sActiveId === "1" | |
| 8075 | - ? commonUtils.isEmpty(commonModalRecord.sFormId) | |
| 8076 | - ? commonModalRecord.sSrcFormId | |
| 8077 | - : commonModalRecord.sFormId | |
| 8078 | - : commonModalShowConfig.sActiveId | |
| 8079 | - : commonModalShowConfig?.sActiveId; | |
| 6960 | + commonModalTitle = commonUtils.isNotEmptyObject(commonModalShowConfig) && commonUtils.isNotEmptyObject(commonModalShowConfig.sActiveName) ? commonModalShowConfig.sActiveName : commonModalTitle; | |
| 6961 | + const sFormId = commonUtils.isNotEmptyObject(commonModalRecord) && commonUtils.isNotEmptyObject(commonModalShowConfig) ? ( commonModalShowConfig.sActiveId === '1' ? commonUtils.isEmpty(commonModalRecord.sFormId) ? commonModalRecord.sSrcFormId : commonModalRecord.sFormId : commonModalShowConfig.sActiveId ) : commonModalShowConfig?.sActiveId; | |
| 8080 | 6962 | |
| 8081 | 6963 | commonModalProps = { |
| 8082 | 6964 | app: { |
| 8083 | 6965 | ...this.props.app, |
| 8084 | 6966 | currentPane: { |
| 8085 | - name: "commonModal", | |
| 8086 | - bEdit: commonModalShowConfig?.sName === "dStockAuxiliaryQty" ? enabled : false, | |
| 6967 | + name: 'commonModal', | |
| 6968 | + bEdit: commonModalShowConfig?.sName === 'dStockAuxiliaryQty'? enabled:false, | |
| 8087 | 6969 | config: commonModalShowConfig, |
| 8088 | - conditonValues: commonModalShowConfig ? this.props.getSqlCondition(commonModalShowConfig, this.props.name, commonModalRecord) : {}, | |
| 8089 | - title: commonModalTitle, | |
| 8090 | - route: "/indexPage/commonList", | |
| 8091 | - formRoute: "/indexPage/commonList", | |
| 6970 | + conditonValues: commonModalShowConfig ? this.props.getSqlCondition(commonModalShowConfig, this.props.name, commonModalRecord) :{}, | |
| 6971 | + title:commonModalTitle, | |
| 6972 | + route: '/indexPage/commonList', | |
| 6973 | + formRoute: '/indexPage/commonList', | |
| 8092 | 6974 | formId: sFormId, |
| 8093 | 6975 | key: sModelsId + commonModalShowConfig?.sId, |
| 8094 | - sModelsType: "search/commonPopup", | |
| 8095 | - select: this.handleSelectCommonPopup, | |
| 8096 | - selectCancel: this.handleSelectCancel.bind(this, "commonModalVisible"), | |
| 8097 | - slaveDataSource: commonModalShowConfig?.sName === "dStockAuxiliaryQty" ? [commonModalRecord] : [], | |
| 6976 | + sModelsType: 'search/commonPopup', | |
| 6977 | + select:this.handleSelectCommonPopup, | |
| 6978 | + selectCancel: this.handleSelectCancel.bind(this, 'commonModalVisible'), | |
| 6979 | + slaveDataSource :commonModalShowConfig?.sName === 'dStockAuxiliaryQty'? [commonModalRecord]: [], | |
| 8098 | 6980 | }, |
| 8099 | 6981 | }, |
| 8100 | 6982 | dispatch: this.props.dispatch, |
| ... | ... | @@ -8102,29 +6984,30 @@ class CommonTableRc extends React.Component { |
| 8102 | 6984 | id: randomId, |
| 8103 | 6985 | onOpenNewTab: this.onOpenNewTab, |
| 8104 | 6986 | outerMasterData: this.props.masterData, |
| 8105 | - realizeHeight: this.props.realizeHeight /* 拖动偏移高度 */, | |
| 8106 | - bEdit: commonModalShowConfig?.sName === "dAvailableAuxiliaryQty" ? enabled : false, | |
| 6987 | + realizeHeight: this.props.realizeHeight, /* 拖动偏移高度 */ | |
| 6988 | + bEdit:commonModalShowConfig?.sName === 'dAvailableAuxiliaryQty'? enabled:false | |
| 8107 | 6989 | }; |
| 8108 | 6990 | // if(commonModalShowConfig?.sName === 'dSumCompleteAvailableStockQty' ){ |
| 8109 | 6991 | // commonModalProps.data = commonModalData; |
| 8110 | 6992 | // } |
| 6993 | + | |
| 8111 | 6994 | } |
| 8112 | 6995 | } |
| 8113 | 6996 | |
| 6997 | + | |
| 8114 | 6998 | /* 表格可展开明细 */ |
| 8115 | - let slaveTableProps = ""; | |
| 8116 | - let expandedRow = ""; | |
| 8117 | - if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === "Y") { | |
| 6999 | + let slaveTableProps = ''; | |
| 7000 | + let expandedRow = ''; | |
| 7001 | + if (this.props.setExpandedRowRender !== undefined && this.props.setExpandedRowRender.toString() === 'Y') { | |
| 8118 | 7002 | slaveTableProps = this.getSlaveTableProps(); |
| 8119 | - expandedRow = record => { | |
| 7003 | + expandedRow = (record) => { | |
| 8120 | 7004 | let filterData = 0; |
| 8121 | - let columns = ""; | |
| 7005 | + let columns = ''; | |
| 8122 | 7006 | let planLoading = false; |
| 8123 | - if (this.props.name === "slave" || location.pathname === "/indexPage/commonCostomTabBill") { | |
| 8124 | - /* 过滤嵌套表 */ | |
| 7007 | + if (this.props.name === 'slave' || location.pathname === '/indexPage/commonCostomTabBill') { /* 过滤嵌套表 */ | |
| 8125 | 7008 | /* 获取loading 加载状态 */ |
| 8126 | 7009 | const planLoadingSate = this.props.slaveInfo.tableProps.planLoadingSate; |
| 8127 | - const planCurrentId = commonUtils.isNotEmptyObject(planLoadingSate) ? planLoadingSate.sId : ""; | |
| 7010 | + const planCurrentId = commonUtils.isNotEmptyObject(planLoadingSate) ? planLoadingSate.sId : ''; | |
| 8128 | 7011 | if (record[this.rowKey] === planCurrentId) { |
| 8129 | 7012 | planLoading = planLoadingSate.planLoading; |
| 8130 | 7013 | } |
| ... | ... | @@ -8133,32 +7016,26 @@ class CommonTableRc extends React.Component { |
| 8133 | 7016 | columns = this.state.tableInfoColumn; |
| 8134 | 7017 | const GetChildFilterData = this.props.onTableFilterData; |
| 8135 | 7018 | if (GetChildFilterData !== undefined) { |
| 8136 | - const slaveInfoData = this.props.onTableFilterData("slave", AllData, record); | |
| 7019 | + const slaveInfoData = this.props.onTableFilterData('slave', AllData, record); | |
| 8137 | 7020 | if (commonUtils.isNotEmptyArr(slaveInfoData) && slaveInfoData.length > 0) { |
| 8138 | 7021 | filterData = slaveInfoData; |
| 8139 | 7022 | } |
| 8140 | 7023 | } |
| 8141 | 7024 | } |
| 8142 | 7025 | return ( |
| 8143 | - <div id="staticEditTable" style={{ height: "100%" }}> | |
| 8144 | - <Spin spinning={planLoading} style={{ height: "100%" }}> | |
| 8145 | - <div | |
| 8146 | - className="topTable" | |
| 8147 | - style={{ height: isSmall ? "calc(100% - 44px)" : "" }} | |
| 8148 | - ref={ref => { | |
| 8149 | - this.myInfoDiv = ref; | |
| 8150 | - }} | |
| 8151 | - > | |
| 7026 | + <div id="staticEditTable" style={{ height: '100%' }}> | |
| 7027 | + <Spin spinning={planLoading} style={{ height: '100%' }}> | |
| 7028 | + <div className="topTable" style={{ height: isSmall ? 'calc(100% - 44px)' : '' }} ref={(ref) => { this.myInfoDiv = ref; }}> | |
| 8152 | 7029 | <Table |
| 8153 | 7030 | {...slaveTableProps} |
| 8154 | 7031 | id="expandTable" |
| 8155 | 7032 | columns={columns} |
| 8156 | 7033 | dataSource={filterData} |
| 8157 | 7034 | pagination={false} |
| 8158 | - style={{ height: "100%" }} | |
| 7035 | + style={{ height: '100%' }} | |
| 8159 | 7036 | addRow={addProps} |
| 8160 | 7037 | delProps={delProps} |
| 8161 | - scroll={{ x: this.scrollInfoX, y: "100%" }} | |
| 7038 | + scroll={{ x: this.scrollInfoX, y: '100%' }} | |
| 8162 | 7039 | size="small" |
| 8163 | 7040 | /> |
| 8164 | 7041 | </div> |
| ... | ... | @@ -8170,7 +7047,7 @@ class CommonTableRc extends React.Component { |
| 8170 | 7047 | |
| 8171 | 7048 | if (commonUtils.isNotEmptyArr(tableProps.columns)) { |
| 8172 | 7049 | const lastColumn = tableProps.columns[tableProps.columns.length - 1]; |
| 8173 | - if (lastColumn.title && typeof lastColumn.title === "string" && lastColumn.title.indexOf("-") === -1) { | |
| 7050 | + if (lastColumn.title && typeof lastColumn.title === 'string' && lastColumn.title.indexOf('-') === -1) { | |
| 8174 | 7051 | lastColumn.width && delete lastColumn.width; |
| 8175 | 7052 | } |
| 8176 | 7053 | } |
| ... | ... | @@ -8183,7 +7060,7 @@ class CommonTableRc extends React.Component { |
| 8183 | 7060 | bFullUrl: false, |
| 8184 | 7061 | onCancel: () => { |
| 8185 | 7062 | this.setState({ officePreviewVisible: false }); |
| 8186 | - }, | |
| 7063 | + } | |
| 8187 | 7064 | }; |
| 8188 | 7065 | |
| 8189 | 7066 | let layoutScrollY; |
| ... | ... | @@ -8196,335 +7073,260 @@ class CommonTableRc extends React.Component { |
| 8196 | 7073 | layoutScrollY = this.props.fixedHeight; |
| 8197 | 7074 | } |
| 8198 | 7075 | let bShowBtnUpload = true; |
| 8199 | - if (commonUtils.isNotEmptyObject(this.props.masterData) && commonUtils.isNotEmptyObject(this.props.masterData.sZczlxShowName)) { | |
| 8200 | - bShowBtnUpload = this.props.masterData.sZczlxShowName !== "删除" && this.props.masterData.sZczlxShowName !== "恢复"; | |
| 7076 | + if(commonUtils.isNotEmptyObject(this.props.masterData) && commonUtils.isNotEmptyObject(this.props.masterData.sZczlxShowName)) { | |
| 7077 | + bShowBtnUpload = this.props.masterData.sZczlxShowName !== '删除' && this.props.masterData.sZczlxShowName !== '恢复'; | |
| 8201 | 7078 | } |
| 8202 | 7079 | |
| 8203 | 7080 | const hasColorInfo = this.props?.masterConfig?.sTableColorTs; |
| 8204 | 7081 | const BtnUpload = commonFunc.showLocalMessage(this.props, "BtnUpload", "上传"); |
| 8205 | - // 强制转换iorder | |
| 8206 | - // tableProps.dataSource = tableProps.dataSource.sort((a, b) => { | |
| 8207 | - // const hasA = a.hasOwnProperty("sName") && a.sName != null; | |
| 8208 | - // const hasB = b.hasOwnProperty("sName") && b.sName != null; | |
| 8209 | - // if (hasA && !hasB) return -1; | |
| 8210 | - // if (!hasA && hasB) return 1; | |
| 8211 | - | |
| 8212 | - // // 2. bVisible 为 true 的在前 | |
| 8213 | - // const visA = a.bVisible === true; | |
| 8214 | - // const visB = b.bVisible === true; | |
| 8215 | - // if (visA && !visB) return -1; | |
| 8216 | - // if (!visA && visB) return 1; | |
| 8217 | - | |
| 8218 | - // // 3. 最后按 iOrder 升序 | |
| 8219 | - // return a.iOrder - b.iOrder; | |
| 8220 | - // }); | |
| 8221 | - const list = tableProps.dataSource?.filter(x => x.sName); | |
| 8222 | - | |
| 8223 | - list.forEach((item, index) => { | |
| 8224 | - if (item.iOrders === undefined || item.iOrders === null) { | |
| 8225 | - // item.iOrder = (index + 1) * 10; | |
| 8226 | - item.iOrders = item.iOrder; | |
| 8227 | - item.isSettingFunctions = true; | |
| 8228 | - } | |
| 8229 | - }); | |
| 8230 | - let newTableProps = cloneDeep(tableProps); | |
| 8231 | - // 强制转换展示iOrder | |
| 8232 | - if (this.props.isSettingFunctions) { | |
| 8233 | - newTableProps.dataSource = newTableProps.dataSource.map((item, index) => { | |
| 8234 | - item.iOrder = (index + 1) * 10; | |
| 8235 | - item.iOrders = tableProps.dataSource[index].iOrder; | |
| 8236 | - item.isSettingFunctions = true; | |
| 8237 | - return item; | |
| 8238 | - }); | |
| 8239 | - } | |
| 8240 | - // 排序 | |
| 8241 | 7082 | |
| 8242 | 7083 | return ( |
| 8243 | - <FormItem className={styles.subForm} style={{ height: "100%" }}> | |
| 7084 | + <FormItem className={styles.subForm} style={{ height: '100%' }}> | |
| 8244 | 7085 | <div className={styles.extraAction} onselectstart="return false"> |
| 8245 | - {this.props.name === "picFile" || | |
| 8246 | - (commonUtils.isNotEmptyObject(this.props.name) && this.props.name.indexOf("file") > -1) || | |
| 8247 | - (this.props.name.startsWith("slave") && this.findIsUpdByControlName(this.props, "BtnUpload") && bShowBtnUpload) ? ( | |
| 8248 | - <Upload {...divProps} {...this.BtnUploadDivProps()}> | |
| 8249 | - <Button | |
| 8250 | - {...uploadProps} | |
| 8251 | - style={{ "caret-color": "transparent" }} | |
| 8252 | - contenteditable="true" | |
| 8253 | - ref={ref => { | |
| 8254 | - this.uploadRef = ref; | |
| 8255 | - }} | |
| 8256 | - onPaste={this.handleUploadByClipboard} | |
| 8257 | - onMouseOver={() => { | |
| 8258 | - this.uploadRef.setAttribute("contenteditable", "true"); | |
| 8259 | - }} | |
| 8260 | - onKeyDown={() => { | |
| 8261 | - this.uploadRef.setAttribute("contenteditable", "false"); | |
| 8262 | - }} | |
| 8263 | - onKeyUp={() => { | |
| 8264 | - this.uploadRef.setAttribute("contenteditable", "true"); | |
| 8265 | - }} | |
| 8266 | - > | |
| 8267 | - <UploadOutlined /> {BtnUpload} | |
| 8268 | - </Button> | |
| 8269 | - </Upload> | |
| 8270 | - ) : null} | |
| 7086 | + { | |
| 7087 | + this.props.name === 'picFile' || (commonUtils.isNotEmptyObject(this.props.name) && this.props.name.indexOf('file') > -1) || | |
| 7088 | + (this.props.name.startsWith('slave') && this.findIsUpdByControlName(this.props, 'BtnUpload') && bShowBtnUpload ) ? | |
| 7089 | + <Upload {...divProps} {...this.BtnUploadDivProps()}> | |
| 7090 | + <Button {...uploadProps} | |
| 7091 | + style={{ 'caret-color': 'transparent' }} | |
| 7092 | + contenteditable="true" ref={(ref) => {this.uploadRef = ref;}} | |
| 7093 | + onPaste={this.handleUploadByClipboard} | |
| 7094 | + onMouseOver={() => { | |
| 7095 | + this.uploadRef.setAttribute('contenteditable', "true"); | |
| 7096 | + }} | |
| 7097 | + onKeyDown={() => { | |
| 7098 | + this.uploadRef.setAttribute('contenteditable', "false"); | |
| 7099 | + }} | |
| 7100 | + onKeyUp={() => { | |
| 7101 | + this.uploadRef.setAttribute('contenteditable', "true"); | |
| 7102 | + }} | |
| 7103 | + > | |
| 7104 | + <UploadOutlined /> {BtnUpload} | |
| 7105 | + </Button> | |
| 7106 | + </Upload> | |
| 7107 | + : null } | |
| 8271 | 7108 | </div> |
| 8272 | 7109 | <div |
| 8273 | - className={`xlyCommonTable ${tableClassName} ${this.hasSpanBgColor ? "tableNoPadding" : ""} ${this.props.enabled ? "tableEnabled" : ""}`} | |
| 8274 | - style={{ height: isSmall ? "calc(100% - 44px)" : "" }} | |
| 8275 | - ref={ref => { | |
| 7110 | + className={`xlyCommonTable ${tableClassName} ${this.hasSpanBgColor ? 'tableNoPadding' : ''} ${this.props.enabled ? 'tableEnabled' : ''}` } | |
| 7111 | + style={{ height: isSmall ? 'calc(100% - 44px)' : '' }} ref={(ref) => { | |
| 8276 | 7112 | this.mydiv = ref; |
| 8277 | 7113 | if (this.mydiv) { |
| 8278 | 7114 | this.computedTdWidth(); |
| 8279 | - if (false && commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes("commonListTab")) { | |
| 8280 | - this.mydiv.getElementsByClassName("ant-table-body")[0].style.height = this.tableHeight ? this.tableHeight + "px" : 80 + "px"; | |
| 7115 | + if (false && commonUtils.isNotEmptyObject(location.pathname) && location.pathname.includes('commonListTab')) { | |
| 7116 | + this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = this.tableHeight ? this.tableHeight + 'px': 80 + 'px'; | |
| 8281 | 7117 | } |
| 8282 | 7118 | if (layoutScrollY) { |
| 8283 | - this.mydiv.getElementsByClassName("ant-table-body")[0].style.height = | |
| 8284 | - typeof layoutScrollY === "number" ? layoutScrollY + "px" : layoutScrollY; | |
| 7119 | + this.mydiv.getElementsByClassName('ant-table-body')[0].style.height = typeof layoutScrollY === 'number' ? layoutScrollY + 'px' : layoutScrollY; | |
| 8285 | 7120 | } |
| 8286 | 7121 | } |
| 8287 | 7122 | }} |
| 8288 | 7123 | id={`table_${this.props.formId}_${this.props.config?.sId}`} |
| 8289 | 7124 | > |
| 8290 | - {this.isDragAndDrop ? ( | |
| 8291 | - <DndProvider backend={HTML5Backend}> | |
| 8292 | - <Table | |
| 8293 | - {...newTableProps} | |
| 8294 | - pagination={!hasColorInfo && tableProps.pagination} | |
| 8295 | - addRow={addProps} | |
| 8296 | - delProps={delProps} | |
| 8297 | - tableLayout="fixed" | |
| 8298 | - expandable={{ | |
| 8299 | - expandedRowRender: this.props.setExpandedRowRender === "Y" ? expandedRow : null, | |
| 8300 | - defaultExpandAllRows: this.props.defaultExpandAllRows || null, | |
| 8301 | - }} | |
| 8302 | - scroll={{ | |
| 8303 | - x: this.scrollX, | |
| 8304 | - y: commonUtils.isNotEmptyObject(autoHeight) | |
| 8305 | - ? autoHeight | |
| 8306 | - : this.props.tableProps.dragTableHeight | |
| 8307 | - ? this.props.tableProps.dragTableHeight | |
| 8308 | - : 544, | |
| 8309 | - }} | |
| 8310 | - summary={this.genFooter} | |
| 8311 | - size="small" | |
| 8312 | - sticky={this.sticky} | |
| 8313 | - showSorterTooltip={false} | |
| 8314 | - /> | |
| 8315 | - </DndProvider> | |
| 8316 | - ) : ( | |
| 8317 | - <div> | |
| 8318 | - <Table | |
| 8319 | - {...tableProps} | |
| 8320 | - pagination={!hasColorInfo && tableProps.pagination} | |
| 8321 | - addRow={addProps} | |
| 8322 | - delProps={delProps} | |
| 8323 | - tableLayout="fixed" | |
| 8324 | - expandable={{ | |
| 8325 | - expandedRowRender: this.props.setExpandedRowRender === "Y" ? expandedRow : null, | |
| 8326 | - defaultExpandAllRows: this.props.defaultExpandAllRows || null, | |
| 8327 | - }} | |
| 8328 | - scroll={{ x: this.scrollX, y: !layoutScrollY ? this.scrollY : layoutScrollY }} | |
| 8329 | - summary={this.genFooter} | |
| 8330 | - size="small" | |
| 8331 | - sticky={this.sticky} | |
| 8332 | - showSorterTooltip={false} | |
| 8333 | - /> | |
| 8334 | - </div> | |
| 8335 | - )} | |
| 7125 | + { | |
| 7126 | + this.isDragAndDrop ? | |
| 7127 | + <DndProvider backend={HTML5Backend} > | |
| 7128 | + <Table | |
| 7129 | + {...tableProps} | |
| 7130 | + pagination={ !hasColorInfo && tableProps.pagination } | |
| 7131 | + addRow={addProps} | |
| 7132 | + delProps={delProps} | |
| 7133 | + tableLayout="fixed" | |
| 7134 | + expandable={{ | |
| 7135 | + expandedRowRender: this.props.setExpandedRowRender === 'Y' ? expandedRow : null, | |
| 7136 | + defaultExpandAllRows: this.props.defaultExpandAllRows || null, | |
| 7137 | + }} | |
| 7138 | + scroll={{ x: this.scrollX, y: commonUtils.isNotEmptyObject(autoHeight) ? autoHeight : 544 }} | |
| 7139 | + summary={this.genFooter} | |
| 7140 | + size="small" | |
| 7141 | + sticky={this.sticky} | |
| 7142 | + showSorterTooltip={false} | |
| 7143 | + /> | |
| 7144 | + </DndProvider> : | |
| 7145 | + <div> | |
| 7146 | + <Table | |
| 7147 | + {...tableProps} | |
| 7148 | + pagination={ !hasColorInfo && tableProps.pagination } | |
| 7149 | + addRow={addProps} | |
| 7150 | + delProps={delProps} | |
| 7151 | + tableLayout="fixed" | |
| 7152 | + expandable={{ | |
| 7153 | + expandedRowRender: this.props.setExpandedRowRender === 'Y' ? expandedRow : null, | |
| 7154 | + defaultExpandAllRows: this.props.defaultExpandAllRows || null, | |
| 7155 | + }} | |
| 7156 | + scroll={{ x: this.scrollX, y: !layoutScrollY ? this.scrollY : layoutScrollY}} | |
| 7157 | + summary={this.genFooter} | |
| 7158 | + size="small" | |
| 7159 | + sticky={this.sticky} | |
| 7160 | + showSorterTooltip={false} | |
| 7161 | + /> | |
| 7162 | + </div> | |
| 7163 | + } | |
| 8336 | 7164 | |
| 8337 | - {hasColorInfo && ( | |
| 8338 | - <Row style={{ paddingTop: 10, paddingBottom: 10 }} wrap={false} ref={e => (this.colorInfo = e)}> | |
| 8339 | - <Col span={14}> | |
| 8340 | - <ColorInfo {...this.props} /> | |
| 8341 | - </Col> | |
| 7165 | + { hasColorInfo && | |
| 7166 | + <Row style={{ paddingTop: 10, paddingBottom: 10 }} wrap={false} ref={e => this.colorInfo = e}> | |
| 7167 | + <Col span={14}><ColorInfo { ...this.props } /></Col> | |
| 8342 | 7168 | <Col span={10}> |
| 8343 | - {tableProps.pagination && ( | |
| 8344 | - <Pagination | |
| 8345 | - {...tableProps.pagination} | |
| 8346 | - showLessItems | |
| 8347 | - size="small" | |
| 8348 | - onChange={(page, pageSize) => { | |
| 8349 | - this.onChange({ current: page, pageSize }); | |
| 8350 | - }} | |
| 8351 | - /> | |
| 8352 | - )} | |
| 7169 | + { tableProps.pagination && <Pagination | |
| 7170 | + { ...tableProps.pagination } | |
| 7171 | + showLessItems | |
| 7172 | + size='small' | |
| 7173 | + onChange={(page, pageSize) => {this.onChange({ current: page, pageSize })}} | |
| 7174 | + /> } | |
| 8353 | 7175 | </Col> |
| 8354 | 7176 | </Row> |
| 8355 | - )} | |
| 7177 | + } | |
| 7178 | + | |
| 8356 | 7179 | </div> |
| 8357 | - {previewVisible ? ( | |
| 8358 | - <AntdDraggableDiv draggableDivClassName={ShowImgStyle.draggableImage}> | |
| 8359 | - <div className={ShowImgStyle.custcontent}> | |
| 8360 | - {/* 图片正常的列表显示 */} | |
| 8361 | - <div className="showimg"> | |
| 8362 | - {commonUtils.isNotEmptyArr(data) | |
| 8363 | - ? data.map((item, i) => { | |
| 8364 | - return ( | |
| 8365 | - // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions | |
| 8366 | - <img alt="example" style={{ width: "400px", height: "200px" }} src={item} onClick={() => this.showimg(i)} key={item} /> | |
| 8367 | - ); | |
| 8368 | - }) | |
| 8369 | - : ""} | |
| 7180 | + { | |
| 7181 | + previewVisible ? | |
| 7182 | + <AntdDraggableDiv draggableDivClassName={ShowImgStyle.draggableImage}> | |
| 7183 | + <div className={ShowImgStyle.custcontent}> | |
| 7184 | + {/* 图片正常的列表显示 */} | |
| 7185 | + <div className="showimg"> | |
| 7186 | + {commonUtils.isNotEmptyArr(data) ? data.map((item, i) => { | |
| 7187 | + return ( | |
| 7188 | + // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions | |
| 7189 | + <img | |
| 7190 | + alt="example" | |
| 7191 | + style={{ width: '400px', height: '200px' }} | |
| 7192 | + src={item} | |
| 7193 | + onClick={() => this.showimg(i)} | |
| 7194 | + key={item} | |
| 7195 | + /> | |
| 7196 | + ); | |
| 7197 | + }) : ''} | |
| 7198 | + </div> | |
| 7199 | + {/* 引入的image组件s */} | |
| 7200 | + <ShowImg | |
| 7201 | + data={data} | |
| 7202 | + firstIndex={firstIndex} | |
| 7203 | + showimgs={showimgs} | |
| 7204 | + toggleshow={this.toggleshow} | |
| 7205 | + /> | |
| 8370 | 7206 | </div> |
| 8371 | - {/* 引入的image组件s */} | |
| 8372 | - <ShowImg data={data} firstIndex={firstIndex} showimgs={showimgs} toggleshow={this.toggleshow} /> | |
| 8373 | - </div> | |
| 8374 | - </AntdDraggableDiv> | |
| 8375 | - ) : ( | |
| 8376 | - "" | |
| 8377 | - )} | |
| 8378 | - {commonPopupVisible ? ( | |
| 7207 | + </AntdDraggableDiv> | |
| 7208 | + : '' | |
| 7209 | + }{ | |
| 7210 | + commonPopupVisible ? | |
| 8379 | 7211 | <AntdDraggableModal |
| 8380 | 7212 | width={1300} |
| 8381 | 7213 | zIndex={1000} |
| 8382 | 7214 | title={commonPopupTitle} |
| 8383 | 7215 | visible={commonPopupVisible} |
| 8384 | - onCancel={this.handleSelectCancel.bind(this, "commonPopupVisible")} | |
| 7216 | + onCancel={this.handleSelectCancel.bind(this, 'commonPopupVisible')} | |
| 8385 | 7217 | footer={null} |
| 8386 | 7218 | onSaveState={this.props.onSaveState} |
| 8387 | 7219 | className={`${randomId}-CommonListSelectTree`} |
| 8388 | 7220 | > |
| 8389 | - {bCommonPopup ? ( | |
| 7221 | + {bCommonPopup ? | |
| 8390 | 7222 | <CommonListSelectTree {...commonPopupProps} /> |
| 8391 | - ) : bCommonPopup1 ? ( | |
| 8392 | - <CommonListSelect {...commonPopupProps} /> | |
| 8393 | - ) : bCommonPopupTree ? ( | |
| 8394 | - <CommonListTreeSelect {...commonPopupProps} /> | |
| 8395 | - ) : ( | |
| 8396 | - "" | |
| 8397 | - )} | |
| 7223 | + : bCommonPopup1 ? | |
| 7224 | + <CommonListSelect {...commonPopupProps} /> | |
| 7225 | + : bCommonPopupTree ? | |
| 7226 | + <CommonListTreeSelect {...commonPopupProps} /> : '' | |
| 7227 | + } | |
| 8398 | 7228 | </AntdDraggableModal> |
| 8399 | - ) : ( | |
| 8400 | - "" | |
| 8401 | - )} | |
| 8402 | - {commonFieldPopupVisible ? ( | |
| 8403 | - <AntdDraggableModal | |
| 8404 | - width={1300} | |
| 8405 | - zIndex={1000} | |
| 8406 | - title={commonFieldPopupTitle} | |
| 8407 | - visible={commonFieldPopupVisible} | |
| 8408 | - onCancel={this.handleSelectCancel.bind(this, "commonFieldPopupVisible")} | |
| 8409 | - footer={null} | |
| 8410 | - onSaveState={this.props.onSaveState} | |
| 8411 | - className={`${randomId}-CommonListSelectTree`} | |
| 8412 | - > | |
| 8413 | - {[""].map(() => { | |
| 8414 | - if (commonFieldPopupShowConfig.sControlName?.includes("popupSingle")) { | |
| 8415 | - if (this.props.enabled && commonFieldPopupShowConfig.sControlName?.includes("edit")) { | |
| 8416 | - commonFieldPopupProps.editable = true; | |
| 7229 | + : '' | |
| 7230 | + } | |
| 7231 | + { | |
| 7232 | + commonFieldPopupVisible ? | |
| 7233 | + <AntdDraggableModal | |
| 7234 | + width={1300} | |
| 7235 | + zIndex={1000} | |
| 7236 | + title={commonFieldPopupTitle} | |
| 7237 | + visible={commonFieldPopupVisible} | |
| 7238 | + onCancel={this.handleSelectCancel.bind(this, 'commonFieldPopupVisible')} | |
| 7239 | + footer={null} | |
| 7240 | + onSaveState={this.props.onSaveState} | |
| 7241 | + className={`${randomId}-CommonListSelectTree`} | |
| 7242 | + > | |
| 7243 | + {[''].map(() => { | |
| 7244 | + if (commonFieldPopupShowConfig.sControlName?.includes("popupSingle")) { | |
| 7245 | + if (this.props.enabled && commonFieldPopupShowConfig.sControlName?.includes("edit")) { | |
| 7246 | + commonFieldPopupProps.editable = true; | |
| 7247 | + } | |
| 7248 | + return <CommonListSelect {...commonFieldPopupProps} />; | |
| 7249 | + } else { | |
| 7250 | + return isBtnPopupEdit ? <EditTableCommonListSelectFlex {...commonFieldPopupProps} /> : bFieldPopup ? <CommonListSelectTree {...commonFieldPopupProps} /> : <CommonListSelect {...commonPopupProps} />; | |
| 8417 | 7251 | } |
| 8418 | - return <CommonListSelect {...commonFieldPopupProps} />; | |
| 8419 | - } else { | |
| 8420 | - return isBtnPopupEdit ? ( | |
| 8421 | - <EditTableCommonListSelectFlex {...commonFieldPopupProps} /> | |
| 8422 | - ) : bFieldPopup ? ( | |
| 8423 | - <CommonListSelectTree {...commonFieldPopupProps} /> | |
| 8424 | - ) : ( | |
| 8425 | - <CommonListSelect {...commonPopupProps} /> | |
| 8426 | - ); | |
| 8427 | - } | |
| 8428 | - })} | |
| 8429 | - </AntdDraggableModal> | |
| 8430 | - ) : ( | |
| 8431 | - "" | |
| 8432 | - )} | |
| 7252 | + })} | |
| 7253 | + </AntdDraggableModal> | |
| 7254 | + : '' | |
| 7255 | + } | |
| 8433 | 7256 | |
| 8434 | - {commonModalVisible ? ( | |
| 8435 | - <AntdDraggableModal | |
| 8436 | - width={1300} | |
| 8437 | - zIndex={1000} | |
| 8438 | - title={commonModalTitle} | |
| 8439 | - visible={commonModalVisible} | |
| 8440 | - onCancel={this.handleSelectCancel.bind(this, "commonModalVisible")} | |
| 8441 | - footer={null} | |
| 8442 | - onSaveState={this.props.onSaveState} | |
| 8443 | - className={`${randomId}-CommonListSelectTree`} | |
| 8444 | - > | |
| 8445 | - <CommonListSelect {...commonModalProps} /> | |
| 8446 | - </AntdDraggableModal> | |
| 8447 | - ) : ( | |
| 8448 | - "" | |
| 8449 | - )} | |
| 7257 | + { | |
| 7258 | + commonModalVisible ? | |
| 7259 | + <AntdDraggableModal | |
| 7260 | + width={1300} | |
| 7261 | + zIndex={1000} | |
| 7262 | + title={commonModalTitle} | |
| 7263 | + visible={commonModalVisible} | |
| 7264 | + onCancel={this.handleSelectCancel.bind(this, 'commonModalVisible')} | |
| 7265 | + footer={null} | |
| 7266 | + onSaveState={this.props.onSaveState} | |
| 7267 | + className={`${randomId}-CommonListSelectTree`} | |
| 7268 | + > | |
| 7269 | + <CommonListSelect {...commonModalProps} /> | |
| 7270 | + </AntdDraggableModal> | |
| 7271 | + : '' | |
| 7272 | + } | |
| 8450 | 7273 | |
| 8451 | - {commonFileDownloadVisible ? ( | |
| 8452 | - <AntdDraggableModal | |
| 8453 | - width={500} | |
| 8454 | - zIndex={1000} | |
| 8455 | - title={commonFileDownloadTitle} | |
| 8456 | - visible={commonFileDownloadVisible} | |
| 8457 | - onCancel={this.handleSelectCancel.bind(this, "commonFileDownloadVisible")} | |
| 8458 | - footer={[ | |
| 8459 | - <Button | |
| 8460 | - key="selectedAll" | |
| 8461 | - type="primary" | |
| 8462 | - ghost | |
| 8463 | - onClick={() => { | |
| 8464 | - const newList = [...commonFileDownloadList]; | |
| 8465 | - const checkState = newList.find(item => !item.checked); | |
| 8466 | - newList.forEach(item => (item.checked = checkState)); | |
| 8467 | - this.setState({ | |
| 8468 | - commonFileDownloadList: newList, | |
| 8469 | - }); | |
| 8470 | - }} | |
| 8471 | - > | |
| 8472 | - 全选/取消全选 | |
| 8473 | - </Button>, | |
| 8474 | - <Button | |
| 8475 | - key="downloadSelected" | |
| 8476 | - type="primary" | |
| 8477 | - onClick={() => { | |
| 8478 | - const checkedObj = commonFileDownloadList.filter(item => item.checked); | |
| 8479 | - if (commonUtils.isNotEmptyArrNew(checkedObj)) { | |
| 8480 | - const fileUrl = checkedObj.map(item => item.url).toString(); | |
| 8481 | - this.handleFileDownload(fileUrl); | |
| 7274 | + { | |
| 7275 | + commonFileDownloadVisible ? | |
| 7276 | + <AntdDraggableModal | |
| 7277 | + width={500} | |
| 7278 | + zIndex={1000} | |
| 7279 | + title={commonFileDownloadTitle} | |
| 7280 | + visible={commonFileDownloadVisible} | |
| 7281 | + onCancel={this.handleSelectCancel.bind(this, 'commonFileDownloadVisible')} | |
| 7282 | + footer={[ | |
| 7283 | + <Button key="selectedAll" type="primary" ghost onClick={ | |
| 7284 | + ()=>{ | |
| 7285 | + const newList = [...commonFileDownloadList]; | |
| 7286 | + const checkState = newList.find(item => !item.checked); | |
| 7287 | + newList.forEach(item => item.checked = checkState); | |
| 7288 | + this.setState({ | |
| 7289 | + commonFileDownloadList: newList | |
| 7290 | + }) | |
| 8482 | 7291 | } |
| 8483 | - }} | |
| 8484 | - > | |
| 8485 | - 下载选中 | |
| 8486 | - </Button>, | |
| 8487 | - <Button key="close" onClick={this.handleSelectCancel.bind(this, "commonFileDownloadVisible")}> | |
| 8488 | - 关闭 | |
| 8489 | - </Button>, | |
| 8490 | - ]} | |
| 8491 | - > | |
| 8492 | - <div style={{ width: "100%", height: "300px", overflow: "auto" }}> | |
| 8493 | - {commonFileDownloadList.map(item => { | |
| 8494 | - const { url, checked } = item; | |
| 8495 | - const fileName = url.split("/").pop().split("_").pop(); | |
| 8496 | - const fileType = fileName.split(".").pop().toLowerCase(); | |
| 8497 | - const previewFileList = ["jpg", "png", "jepg", "webp", "svg", "bmp", "apng", "pdf"]; | |
| 8498 | - return ( | |
| 8499 | - <Row> | |
| 8500 | - <div | |
| 8501 | - style={{ | |
| 8502 | - width: "100%", | |
| 8503 | - height: "35px", | |
| 8504 | - margin: "0 10px 0 10px", | |
| 8505 | - "line-height": "35px", | |
| 8506 | - "border-bottom": "1px solid #9e9e9e70", | |
| 8507 | - }} | |
| 8508 | - > | |
| 8509 | - <Checkbox | |
| 8510 | - checked={checked} | |
| 8511 | - onChange={e => { | |
| 8512 | - if (sessionStorage.previewFlag) { | |
| 8513 | - sessionStorage.removeItem("previewFlag"); | |
| 8514 | - } else { | |
| 8515 | - const newList = [...commonFileDownloadList]; | |
| 8516 | - newList.find(item => item.url === url).checked = e.target.checked; | |
| 8517 | - this.setState({ | |
| 8518 | - commonFileDownloadList: newList, | |
| 8519 | - }); | |
| 8520 | - } | |
| 8521 | - }} | |
| 8522 | - > | |
| 8523 | - <a | |
| 8524 | - style={!previewFileList.includes(fileType) ? { visibility: "hidden" } : {}} | |
| 8525 | - onClick={e => { | |
| 7292 | + }>全选/取消全选</Button>, | |
| 7293 | + <Button key="downloadSelected" type="primary" onClick={ | |
| 7294 | + () => { | |
| 7295 | + const checkedObj = commonFileDownloadList.filter(item => item.checked); | |
| 7296 | + if (commonUtils.isNotEmptyArrNew(checkedObj)) { | |
| 7297 | + const fileUrl = checkedObj.map(item => item.url).toString(); | |
| 7298 | + this.handleFileDownload(fileUrl); | |
| 7299 | + } | |
| 7300 | + } | |
| 7301 | + }>下载选中</Button>, | |
| 7302 | + <Button key="close" onClick={this.handleSelectCancel.bind(this, 'commonFileDownloadVisible')}>关闭</Button>, | |
| 7303 | + ]} | |
| 7304 | + > | |
| 7305 | + <div style={{ width: '100%', height: '300px', overflow: 'auto' }}>{ | |
| 7306 | + commonFileDownloadList.map(item => { | |
| 7307 | + const { url, checked } = item; | |
| 7308 | + const fileName = url.split('/').pop().split('_').pop(); | |
| 7309 | + const fileType = fileName.split('.').pop().toLowerCase(); | |
| 7310 | + const previewFileList = ['jpg', 'png', 'jepg', 'webp', 'svg', 'bmp', 'apng', 'pdf']; | |
| 7311 | + return ( | |
| 7312 | + <Row> | |
| 7313 | + <div style={{ width: '100%', height: '35px', margin: '0 10px 0 10px', 'line-height': '35px', 'border-bottom': '1px solid #9e9e9e70' }}> | |
| 7314 | + <Checkbox checked={checked} | |
| 7315 | + onChange={(e) => { | |
| 7316 | + if (sessionStorage.previewFlag) { | |
| 7317 | + sessionStorage.removeItem('previewFlag'); | |
| 7318 | + } else { | |
| 7319 | + const newList = [...commonFileDownloadList]; | |
| 7320 | + newList.find(item => item.url === url).checked = e.target.checked; | |
| 7321 | + this.setState({ | |
| 7322 | + commonFileDownloadList: newList | |
| 7323 | + }) | |
| 7324 | + } | |
| 7325 | + }} | |
| 7326 | + > | |
| 7327 | + <a style={!previewFileList.includes(fileType) ? { visibility: 'hidden' } : {}} onClick={e => { | |
| 8526 | 7328 | sessionStorage.previewFlag = 1; |
| 8527 | - if (fileType === "pdf") { | |
| 7329 | + if (fileType === 'pdf') { | |
| 8528 | 7330 | this.setState({ |
| 8529 | 7331 | pdfFileVisible: true, |
| 8530 | 7332 | pdfFileUrl: url, |
| ... | ... | @@ -8532,95 +7334,80 @@ class CommonTableRc extends React.Component { |
| 8532 | 7334 | } else { |
| 8533 | 7335 | this.handlePreviewImage(e, [url]); |
| 8534 | 7336 | } |
| 8535 | - }} | |
| 8536 | - title="预览" | |
| 8537 | - > | |
| 8538 | - <SearchOutlined /> | |
| 8539 | - </a> | |
| 8540 | - <span style={{ "font-size": "14px" }}>{fileName}</span> | |
| 8541 | - </Checkbox> | |
| 8542 | - </div> | |
| 8543 | - </Row> | |
| 8544 | - ); | |
| 8545 | - })} | |
| 8546 | - </div> | |
| 8547 | - </AntdDraggableModal> | |
| 8548 | - ) : ( | |
| 8549 | - "" | |
| 8550 | - )} | |
| 8551 | - {pdfFileVisible ? ( | |
| 8552 | - <AntdDraggableModal | |
| 8553 | - title={pdfFileUrl.split("/").pop().split("_").pop()} | |
| 8554 | - visible={pdfFileVisible} | |
| 8555 | - width="100%" | |
| 8556 | - height="calc(100% - 50px)" | |
| 8557 | - style={{ top: 0 }} | |
| 8558 | - footer={null} | |
| 8559 | - onCancel={() => { | |
| 8560 | - this.setState({ | |
| 8561 | - pdfFileVisible: false, | |
| 8562 | - }); | |
| 8563 | - }} | |
| 8564 | - > | |
| 8565 | - <div style={{ width: "100%", height: "calc(100vh - 67px)", overflow: "auto" }}> | |
| 8566 | - <PrintPdf | |
| 8567 | - style={{ height: "100%" }} | |
| 8568 | - bFitWidth={true} | |
| 8569 | - previewUrl={ | |
| 8570 | - pdfFileUrl.includes("xlyerpfiles") | |
| 8571 | - ? `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(pdfFileUrl)}&sModelsId=100&token=${ | |
| 8572 | - this.props.app.token | |
| 8573 | - }` | |
| 8574 | - : pdfFileUrl | |
| 8575 | - } | |
| 8576 | - /> | |
| 8577 | - </div> | |
| 8578 | - </AntdDraggableModal> | |
| 8579 | - ) : ( | |
| 8580 | - "" | |
| 8581 | - )} | |
| 8582 | - {bOperateMoreVisible ? ( | |
| 8583 | - <AntdDraggableModal | |
| 8584 | - title="复制多行" | |
| 8585 | - visible={bOperateMoreVisible} | |
| 8586 | - onOk={this.handleOperateMoreOk} | |
| 8587 | - onCancel={() => { | |
| 8588 | - this.setState({ | |
| 8589 | - bOperateMoreVisible: false, | |
| 8590 | - }); | |
| 8591 | - }} | |
| 8592 | - > | |
| 8593 | - <div style={{ width: "100%", height: "30px" }}> | |
| 8594 | - <Input id="iNumber" addonBefore="行数" defaultValue={1} /> | |
| 8595 | - </div> | |
| 8596 | - </AntdDraggableModal> | |
| 8597 | - ) : ( | |
| 8598 | - "" | |
| 8599 | - )} | |
| 7337 | + }} title="预览"><SearchOutlined /></a> | |
| 7338 | + <span style={{ 'font-size': '14px' }}>{fileName}</span> | |
| 7339 | + </Checkbox> | |
| 7340 | + </div> | |
| 7341 | + </Row> | |
| 7342 | + ) | |
| 7343 | + }) | |
| 7344 | + }</div> | |
| 7345 | + </AntdDraggableModal> | |
| 7346 | + : '' | |
| 7347 | + } | |
| 7348 | + { | |
| 7349 | + pdfFileVisible ? | |
| 7350 | + <AntdDraggableModal | |
| 7351 | + title={pdfFileUrl.split('/').pop().split('_').pop()} | |
| 7352 | + visible={pdfFileVisible} | |
| 7353 | + width="100%" | |
| 7354 | + height="calc(100% - 50px)" | |
| 7355 | + style={{ top: 0 }} | |
| 7356 | + footer={null} | |
| 7357 | + onCancel={() => { | |
| 7358 | + this.setState({ | |
| 7359 | + pdfFileVisible: false | |
| 7360 | + }); | |
| 7361 | + }} | |
| 7362 | + > | |
| 7363 | + <div style={{ width: '100%', height: 'calc(100vh - 67px)', overflow: 'auto' }}> | |
| 7364 | + <PrintPdf | |
| 7365 | + style={{ height: '100%' }} | |
| 7366 | + bFitWidth={true} | |
| 7367 | + previewUrl={pdfFileUrl.includes('xlyerpfiles') ? `${commonConfig.file_host}file/download?savePathStr=${encodeURIComponent(pdfFileUrl)}&sModelsId=100&token=${this.props.app.token}` : pdfFileUrl} | |
| 7368 | + /> | |
| 7369 | + </div> | |
| 7370 | + </AntdDraggableModal> : '' | |
| 7371 | + } | |
| 7372 | + { | |
| 7373 | + bOperateMoreVisible ? | |
| 7374 | + <AntdDraggableModal | |
| 7375 | + title='复制多行' | |
| 7376 | + visible={bOperateMoreVisible} | |
| 7377 | + onOk={this.handleOperateMoreOk} | |
| 7378 | + onCancel={() => { | |
| 7379 | + this.setState({ | |
| 7380 | + bOperateMoreVisible: false | |
| 7381 | + }); | |
| 7382 | + }} | |
| 7383 | + > | |
| 7384 | + <div style={{ width: '100%', height: '30px' }}> | |
| 7385 | + <Input id="iNumber" addonBefore='行数' defaultValue={1} /> | |
| 7386 | + </div> | |
| 7387 | + </AntdDraggableModal> : '' | |
| 7388 | + } | |
| 8600 | 7389 | <SlaveMemo {...this.props} /> |
| 8601 | 7390 | {officePreviewVisible && <OfficePreview {...officePreviewProps} />} |
| 8602 | 7391 | {/* 简单对话框 */} |
| 8603 | - {this.state.simpleModalVisible && ( | |
| 8604 | - <Modal | |
| 8605 | - title="详细" | |
| 8606 | - footer={null} | |
| 8607 | - focusTriggerAfterClose={false} | |
| 8608 | - visible={this.state.simpleModalVisible} | |
| 8609 | - onCancel={() => this.setState({ simpleModalVisible: false, simpleModalWord: "" })} | |
| 8610 | - > | |
| 8611 | - <div ref={this.simpleModalRef} style={{ maxHeight: "50vh", overflowY: "auto" }} /> | |
| 8612 | - </Modal> | |
| 8613 | - )} | |
| 7392 | + { this.state.simpleModalVisible && <Modal | |
| 7393 | + title='详细' | |
| 7394 | + footer={null} | |
| 7395 | + focusTriggerAfterClose={false} | |
| 7396 | + visible={this.state.simpleModalVisible} | |
| 7397 | + onCancel={()=>this.setState({ simpleModalVisible: false, simpleModalWord: '' })} | |
| 7398 | + > | |
| 7399 | + <div ref={this.simpleModalRef} style={{ maxHeight: '50vh', overflowY: 'auto' }} /> | |
| 7400 | + </Modal> } | |
| 8614 | 7401 | </FormItem> |
| 8615 | 7402 | ); |
| 8616 | 7403 | } |
| 8617 | 7404 | } |
| 8618 | 7405 | |
| 8619 | -const CommonTable = props => { | |
| 7406 | +const CommonTable = (props) => { | |
| 8620 | 7407 | const { name, data = [] } = props; |
| 8621 | 7408 | const [headerColumn, setHeaderColumn] = useState([]); |
| 8622 | 7409 | const addState = {}; |
| 8623 | - if (name !== "master") { | |
| 7410 | + if (name !== 'master') { | |
| 8624 | 7411 | const config = props.onMergeSlaveConfig && props.onMergeSlaveConfig(props.config); |
| 8625 | 7412 | if (commonUtils.isNotEmptyObject(config)) { |
| 8626 | 7413 | addState.config = config; |
| ... | ... | @@ -8641,7 +7428,7 @@ const CommonTable = props => { |
| 8641 | 7428 | }, [JSON.stringify(data)]); |
| 8642 | 7429 | |
| 8643 | 7430 | if (props.defaultExpandAllRows !== undefined && props.data === undefined) { |
| 8644 | - return ""; | |
| 7431 | + return ''; | |
| 8645 | 7432 | } |
| 8646 | 7433 | |
| 8647 | 7434 | const handleMoveLine = ({ index, direction }) => { |
| ... | ... | @@ -8660,11 +7447,11 @@ const CommonTable = props => { |
| 8660 | 7447 | data[indexNew].iOrder = iOrder1; |
| 8661 | 7448 | |
| 8662 | 7449 | const tempItem = data[index]; |
| 8663 | - data[index] = { ...data[indexNew], handleType: data[indexNew].handleType || "update" }; | |
| 8664 | - data[indexNew] = { ...tempItem, handleType: tempItem.handleType || "update" }; | |
| 7450 | + data[index] = {...data[indexNew], handleType: data[indexNew].handleType || "update"}; | |
| 7451 | + data[indexNew] = {...tempItem, handleType: tempItem.handleType || "update"}; | |
| 8665 | 7452 | |
| 8666 | 7453 | props.onSaveState({ |
| 8667 | - [`${props.name}Data`]: data, | |
| 7454 | + [`${props.name}Data`]: data | |
| 8668 | 7455 | }); |
| 8669 | 7456 | }; |
| 8670 | 7457 | |
| ... | ... | @@ -8676,15 +7463,15 @@ const CommonTable = props => { |
| 8676 | 7463 | delete props.tableProps.AutoTableHeight; |
| 8677 | 7464 | } |
| 8678 | 7465 | } |
| 8679 | - const setTempFixedHeight = height => { | |
| 7466 | + const setTempFixedHeight = (height) => { | |
| 8680 | 7467 | sessionStorage.setItem(`${props.formId}_${props.config.sId}_tableHeight`, height); |
| 8681 | 7468 | window.vlistNewSearh = true; |
| 8682 | 7469 | setUpdateRowNumTime(pre => pre + 1); |
| 8683 | - }; | |
| 7470 | + } | |
| 8684 | 7471 | const uniqueTableId = `table_${props.formId}_${props.config?.sId}`; |
| 8685 | 7472 | |
| 8686 | 7473 | return ( |
| 8687 | - <Tooltip title={props.name} placement="topLeft" visible={props.showTableName}> | |
| 7474 | + <Tooltip title={props.name} placement='topLeft' visible={props.showTableName}> | |
| 8688 | 7475 | <CommonTableRc {...props} {...addState} setHeaderColumn={setHeaderColumn} /> |
| 8689 | 7476 | <MoveLineComponent setTempFixedHeight={setTempFixedHeight} uniqueTableId={uniqueTableId} /> |
| 8690 | 7477 | </Tooltip> |
| ... | ... | @@ -8694,12 +7481,12 @@ const CommonTable = props => { |
| 8694 | 7481 | const handleSetIRowNum = (data, props) => { |
| 8695 | 7482 | data.forEach((item, index) => { |
| 8696 | 7483 | item.iRowNum = index + 1; |
| 8697 | - if (["12710101117007068710620"].includes(props?.app?.currentPane?.formId)) { | |
| 7484 | + if (['12710101117007068710620'].includes(props?.app?.currentPane?.formId)) { | |
| 8698 | 7485 | item.sVersionNum = item.iRowNum.toString().padStart(2, 0); |
| 8699 | 7486 | } |
| 8700 | 7487 | |
| 8701 | 7488 | // 排除成品盘点、材料盘点(数据太多,循环页面卡死) |
| 8702 | - if (props.name === "slaveChild" && !["192116810113315264733417750", "192116810113315228128521360"].includes(props?.app?.currentPane?.formId)) { | |
| 7489 | + if (props.name === 'slaveChild' && !['192116810113315264733417750', '192116810113315228128521360'].includes(props?.app?.currentPane?.formId)) { | |
| 8703 | 7490 | /* 序号根据sSqlConditonId分组 序号重排 */ |
| 8704 | 7491 | const groupedData = commonUtils.groupBy(data, item => item.sSqlConditionId); |
| 8705 | 7492 | if (commonUtils.isNotEmptyObject(groupedData)) { |
| ... | ... | @@ -8708,26 +7495,28 @@ const handleSetIRowNum = (data, props) => { |
| 8708 | 7495 | if (commonUtils.isNotEmptyArr(eachData)) { |
| 8709 | 7496 | eachData.forEach((item, index) => { |
| 8710 | 7497 | /* 采购 */ |
| 8711 | - item.iRowNum = index + 1; | |
| 7498 | + item.iRowNum = index +1; | |
| 8712 | 7499 | const iIndex = data.findIndex(row => row.sId === item.sId); |
| 8713 | - if (iIndex > -1) { | |
| 8714 | - data[iIndex] = { ...data[iIndex], iRowNum: index + 1 }; | |
| 7500 | + if(iIndex > -1) { | |
| 7501 | + data[iIndex] ={...data[iIndex], iRowNum: index +1} | |
| 8715 | 7502 | } |
| 7503 | + | |
| 8716 | 7504 | }); |
| 8717 | 7505 | } |
| 8718 | 7506 | } |
| 8719 | 7507 | } |
| 8720 | 7508 | } |
| 8721 | - if (location.pathname !== "/indexPage/commonClassify") { | |
| 7509 | + if(location.pathname !== '/indexPage/commonClassify'){ | |
| 8722 | 7510 | if (commonUtils.isNotEmptyArr(item.children)) { |
| 8723 | 7511 | handleSetIRowNum(item.children, props); |
| 8724 | 7512 | } |
| 8725 | 7513 | } |
| 8726 | 7514 | }); |
| 8727 | -}; | |
| 7515 | +} | |
| 8728 | 7516 | |
| 8729 | -const MoveLineComponent = props => { | |
| 8730 | - if (!location.pathname.includes("commonSubBill")) { | |
| 7517 | +const MoveLineComponent = (props) => { | |
| 7518 | + | |
| 7519 | + if (!location.pathname.includes('commonSubBill')) { | |
| 8731 | 7520 | return ""; |
| 8732 | 7521 | } |
| 8733 | 7522 | |
| ... | ... | @@ -8742,28 +7531,28 @@ const MoveLineComponent = props => { |
| 8742 | 7531 | const initialBottom = position.bottom; |
| 8743 | 7532 | const initialY = e.clientY; |
| 8744 | 7533 | |
| 8745 | - const moveHandler = moveEvent => { | |
| 7534 | + const moveHandler = (moveEvent) => { | |
| 8746 | 7535 | const newY = moveEvent.clientY; |
| 8747 | 7536 | const newBottom = initialBottom - (newY - initialY); |
| 8748 | 7537 | setPosition({ bottom: newBottom }); |
| 8749 | 7538 | }; |
| 8750 | 7539 | |
| 8751 | 7540 | const upHandler = () => { |
| 8752 | - const preHeight = document.querySelector(`#${props.uniqueTableId}`).querySelector(".ant-table-body").getBoundingClientRect().height; | |
| 7541 | + const preHeight = document.querySelector(`#${props.uniqueTableId}`).querySelector('.ant-table-body').getBoundingClientRect().height; | |
| 8753 | 7542 | props.setTempFixedHeight(Math.max(preHeight - positionRef.current.bottom, 37)); |
| 8754 | 7543 | setPosition({ bottom: 0 }); |
| 8755 | 7544 | document.body.onselectstart = () => true; |
| 8756 | - document.removeEventListener("mousemove", moveHandler); | |
| 8757 | - document.removeEventListener("mouseup", upHandler); | |
| 7545 | + document.removeEventListener('mousemove', moveHandler); | |
| 7546 | + document.removeEventListener('mouseup', upHandler); | |
| 8758 | 7547 | }; |
| 8759 | 7548 | |
| 8760 | 7549 | document.body.onselectstart = () => false; |
| 8761 | - document.addEventListener("mousemove", moveHandler); | |
| 8762 | - document.addEventListener("mouseup", upHandler); | |
| 8763 | - }, | |
| 7550 | + document.addEventListener('mousemove', moveHandler); | |
| 7551 | + document.addEventListener('mouseup', upHandler); | |
| 7552 | + } | |
| 8764 | 7553 | }; |
| 8765 | 7554 | |
| 8766 | 7555 | return <div {...divProps} />; |
| 8767 | -}; | |
| 7556 | +} | |
| 8768 | 7557 | |
| 8769 | 7558 | export default CommonTable; | ... | ... |