Commit bc4d31842041cea5b30ac87f07e43b3d1d6be5ab
1 parent
291c5919
样式修改
Showing
4 changed files
with
163 additions
and
72 deletions
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -1953,6 +1953,7 @@ export default class CommonComponent extends Component { |
| 1953 | 1953 | const sFontColor = this.props.showConfig.sFontColor; |
| 1954 | 1954 | obj.labelCol.style = { color: sFontColor, fontWeight: 'bold', backgroundColor: '#BFEFFF' }; |
| 1955 | 1955 | } |
| 1956 | + | |
| 1956 | 1957 | /* 返回值 */ |
| 1957 | 1958 | return obj; |
| 1958 | 1959 | }; |
| ... | ... | @@ -1997,6 +1998,7 @@ export default class CommonComponent extends Component { |
| 1997 | 1998 | className: styles.formItemMag10, /* 样式名称 */ |
| 1998 | 1999 | ...this.formItemLayout, /* 主要是rowspan和colspan */ |
| 1999 | 2000 | }; |
| 2001 | + | |
| 2000 | 2002 | } |
| 2001 | 2003 | if (this.props.itemLabel === 'hide') { |
| 2002 | 2004 | delete obj.label; |
| ... | ... | @@ -2974,7 +2976,7 @@ export default class CommonComponent extends Component { |
| 2974 | 2976 | const fieldDecoratorProps = this.getFieldDecoratorProps(); |
| 2975 | 2977 | /* 通用组件(主表存在getFieldDecorator表单验证,而从表则不需要) */ |
| 2976 | 2978 | const commonAssembly = this.props.bNewForm ? innerInput : ( |
| 2977 | - <FormItem {...outFormItemProps}> | |
| 2979 | + <FormItem {...outFormItemProps} > | |
| 2978 | 2980 | {viewInfo} |
| 2979 | 2981 | {speacilNote} |
| 2980 | 2982 | {imgBox} | ... | ... |
src/components/Common/CommonViewTable/index.js
| ... | ... | @@ -301,14 +301,14 @@ class CommonViewTableRc extends Component { |
| 301 | 301 | ) |
| 302 | 302 | : []; |
| 303 | 303 | } |
| 304 | - const formItemLayout = { | |
| 304 | + let formItemLayout = { | |
| 305 | 305 | labelCol: { |
| 306 | - span: 7, | |
| 306 | + span: this.props?.sModelsId !== "17086722220003015078585693314000" ? 7 : 16, | |
| 307 | 307 | style: { color: "rgba(0, 0, 0, 0.65)", backgroundColor: "#BFEFFF" } |
| 308 | 308 | }, |
| 309 | - wrapperCol: { span: 17 } | |
| 309 | + wrapperCol: { span: this.props?.sModelsId !== "17086722220003015078585693314000" ? 17 : 8, } | |
| 310 | 310 | }; |
| 311 | - | |
| 311 | + | |
| 312 | 312 | /* 字段弹窗功能 */ |
| 313 | 313 | let commonFieldPopupProps = {}; |
| 314 | 314 | let commonFieldPopupTitle = "选择弹窗"; | ... | ... |
src/indexNew.less
| ... | ... | @@ -119,8 +119,8 @@ |
| 119 | 119 | |
| 120 | 120 | .ant-form-item-label:not(.skipFlexBasis) { |
| 121 | 121 | background-color: var(--form-label-bgColor, #EEEEEE) !important; |
| 122 | - flex-basis: 160px !important; | |
| 123 | - max-width: 160px !important; | |
| 122 | + // flex-basis: 160px !important; | |
| 123 | + // max-width: 160px !important; | |
| 124 | 124 | height: var(--form-label-height, 40px); |
| 125 | 125 | // .size(160px, var(--form-label-height , 40px)); |
| 126 | 126 | line-height: 27px; | ... | ... |
src/mes/common/commonModelComponent/index.js
| ... | ... | @@ -1650,7 +1650,7 @@ const CommonModelComponent = props => { |
| 1650 | 1650 | tableBtnsConfig, |
| 1651 | 1651 | children = [] |
| 1652 | 1652 | } = config; |
| 1653 | - | |
| 1653 | + | |
| 1654 | 1654 | if (showType === "none") { |
| 1655 | 1655 | if (!children.length) return ""; |
| 1656 | 1656 | const footerComponent = useFooterComponent({ ...props, sTabName }); |
| ... | ... | @@ -1671,7 +1671,7 @@ const CommonModelComponent = props => { |
| 1671 | 1671 | } else if (showType === "costom") { |
| 1672 | 1672 | return <RouterComponent {...props} sModelType={sName} />; |
| 1673 | 1673 | } else { |
| 1674 | - const componentProps = { | |
| 1674 | + let componentProps = { | |
| 1675 | 1675 | ...props, |
| 1676 | 1676 | showType, // 展示类型(表单/表格) |
| 1677 | 1677 | enabled: !bMesBill ? defaultEnabled : enabled, // 是否可编辑 |
| ... | ... | @@ -1701,6 +1701,8 @@ const CommonModelComponent = props => { |
| 1701 | 1701 | extraStyle.flexDirection = 'column'; |
| 1702 | 1702 | extraStyle.paddingTop = 5; |
| 1703 | 1703 | } |
| 1704 | + const { sModelsId } = props; | |
| 1705 | + const isNotTab = sModelsId === '12710101117119423319470' | |
| 1704 | 1706 | |
| 1705 | 1707 | return ( |
| 1706 | 1708 | <> |
| ... | ... | @@ -1786,69 +1788,155 @@ const CommonModelComponent = props => { |
| 1786 | 1788 | {sEntireTabName && ( |
| 1787 | 1789 | <TabTitleComponent {...props} sTabName={sEntireTabNameNew} /> |
| 1788 | 1790 | )} |
| 1789 | - <Tabs | |
| 1790 | - destroyInactiveTabPane | |
| 1791 | - style={{ marginTop: sEntireTabName ? -10 : 0 }} | |
| 1792 | - onChange={() => { | |
| 1793 | - // setTimeout(() => { | |
| 1794 | - // props.onSaveState({ | |
| 1795 | - // xlyTableKey: commonUtils.createSid() | |
| 1796 | - // }); | |
| 1797 | - // }, 0); | |
| 1798 | - if (window.refreshTableList) { | |
| 1799 | - props.onSaveState({ | |
| 1800 | - refreshTableList: window.refreshTableList | |
| 1801 | - }); | |
| 1802 | - window.refreshTableList = null; | |
| 1803 | - } | |
| 1804 | - }} | |
| 1805 | - > | |
| 1806 | - {configList | |
| 1807 | - .filter( | |
| 1808 | - item => | |
| 1809 | - !props.hideTabList || | |
| 1810 | - !props.hideTabList.includes(item.sName) | |
| 1811 | - ) | |
| 1812 | - .map((config, index) => { | |
| 1813 | - const { sName, sEnglishTabName, sBig5TabName, sTabName } = config; | |
| 1814 | - const sTabNewName = sLanguage === 'sEnglish' ? sEnglishTabName : sLanguage === 'sBig5' ? | |
| 1815 | - sBig5TabName : sTabName; | |
| 1816 | - let disabled = false; | |
| 1817 | - | |
| 1818 | - if (sTabName === "拼接列表" && sName === "slaveWypj3") { | |
| 1819 | - // 特殊处理:拼接详情可保存时,拼接列表tab不可点击 | |
| 1820 | - disabled = | |
| 1821 | - props.slaveWypj2Data?.[0]?.bSave === false || | |
| 1822 | - props.slaveWypj2Data?.[0]?.bSave === 0; | |
| 1823 | - } else if ( | |
| 1824 | - (sTabName === "复卷成品检验列表" && | |
| 1825 | - sName === "salveWydm3") || | |
| 1826 | - (sTabName === "卷盘明细" && sName === "salveWydm4") | |
| 1827 | - ) { | |
| 1828 | - // 特殊处理:复卷成品检验详情可保存时,复卷成品检验列表/卷盘明细tab不可点击 | |
| 1829 | - disabled = | |
| 1830 | - props.salveWydm2Data?.[0]?.bSave === false || | |
| 1831 | - props.salveWydm2Data?.[0]?.bSave === 0; | |
| 1832 | - } else if ( | |
| 1833 | - sTabName === "成品批次列表" && | |
| 1834 | - sName === "salveWybz3" | |
| 1835 | - ) { | |
| 1836 | - // 特殊处理:成品批次详情可保存时,成品批次列表列表tab不可点击 | |
| 1837 | - disabled = | |
| 1838 | - props.salveWybz2Data?.[0]?.bSave === false || | |
| 1839 | - props.salveWybz2Data?.[0]?.bSave === 0; | |
| 1791 | + { | |
| 1792 | + !isNotTab ? <Tabs | |
| 1793 | + destroyInactiveTabPane | |
| 1794 | + style={{ marginTop: sEntireTabName ? -10 : 0 }} | |
| 1795 | + onChange={() => { | |
| 1796 | + | |
| 1797 | + if (window.refreshTableList) { | |
| 1798 | + props.onSaveState({ | |
| 1799 | + refreshTableList: window.refreshTableList | |
| 1800 | + }); | |
| 1801 | + window.refreshTableList = null; | |
| 1840 | 1802 | } |
| 1841 | - return ( | |
| 1842 | - <TabPane | |
| 1843 | - tab={sTabNewName} | |
| 1844 | - key={`${sName}_${sTabName}`} | |
| 1845 | - disabled={disabled} | |
| 1846 | - > | |
| 1847 | - {getComponent(config, index)} | |
| 1848 | - </TabPane> | |
| 1849 | - ); | |
| 1850 | - })} | |
| 1851 | - </Tabs> | |
| 1803 | + }} | |
| 1804 | + > | |
| 1805 | + {configList | |
| 1806 | + .filter( | |
| 1807 | + item => | |
| 1808 | + !props.hideTabList || | |
| 1809 | + !props.hideTabList.includes(item.sName) | |
| 1810 | + ) | |
| 1811 | + .map((config, index) => { | |
| 1812 | + const { sName, sEnglishTabName, sBig5TabName, sTabName } = config; | |
| 1813 | + const sTabNewName = sLanguage === 'sEnglish' ? sEnglishTabName : sLanguage === 'sBig5' ? | |
| 1814 | + sBig5TabName : sTabName; | |
| 1815 | + let disabled = false; | |
| 1816 | + | |
| 1817 | + if (sTabName === "拼接列表" && sName === "slaveWypj3") { | |
| 1818 | + // 特殊处理:拼接详情可保存时,拼接列表tab不可点击 | |
| 1819 | + disabled = | |
| 1820 | + props.slaveWypj2Data?.[0]?.bSave === false || | |
| 1821 | + props.slaveWypj2Data?.[0]?.bSave === 0; | |
| 1822 | + } else if ( | |
| 1823 | + (sTabName === "复卷成品检验列表" && | |
| 1824 | + sName === "salveWydm3") || | |
| 1825 | + (sTabName === "卷盘明细" && sName === "salveWydm4") | |
| 1826 | + ) { | |
| 1827 | + // 特殊处理:复卷成品检验详情可保存时,复卷成品检验列表/卷盘明细tab不可点击 | |
| 1828 | + disabled = | |
| 1829 | + props.salveWydm2Data?.[0]?.bSave === false || | |
| 1830 | + props.salveWydm2Data?.[0]?.bSave === 0; | |
| 1831 | + } else if ( | |
| 1832 | + sTabName === "成品批次列表" && | |
| 1833 | + sName === "salveWybz3" | |
| 1834 | + ) { | |
| 1835 | + // 特殊处理:成品批次详情可保存时,成品批次列表列表tab不可点击 | |
| 1836 | + disabled = | |
| 1837 | + props.salveWybz2Data?.[0]?.bSave === false || | |
| 1838 | + props.salveWybz2Data?.[0]?.bSave === 0; | |
| 1839 | + } | |
| 1840 | + return ( | |
| 1841 | + <TabPane | |
| 1842 | + tab={sTabNewName} | |
| 1843 | + key={`${sName}_${sTabName}`} | |
| 1844 | + disabled={disabled} | |
| 1845 | + > | |
| 1846 | + {getComponent(config, index)} | |
| 1847 | + </TabPane> | |
| 1848 | + ); | |
| 1849 | + })} | |
| 1850 | + </Tabs> : <div style={{ width: '100%', height: '100%' }}> | |
| 1851 | + { | |
| 1852 | + (() => { | |
| 1853 | + const visibleConfigs = configList.filter( | |
| 1854 | + item => | |
| 1855 | + !props.hideTabList || | |
| 1856 | + !props.hideTabList.includes(item.sName) | |
| 1857 | + ); | |
| 1858 | + | |
| 1859 | + const first = visibleConfigs[0]; | |
| 1860 | + const secondAndThird = visibleConfigs.slice(1, 3); // 索引 1 和 2 | |
| 1861 | + const rest = visibleConfigs.slice(3); | |
| 1862 | + | |
| 1863 | + return ( | |
| 1864 | + <> | |
| 1865 | + {/* 第一个单独一行 */} | |
| 1866 | + {first && ( | |
| 1867 | + <div style={{ width: '100%', marginBottom: '8px' }}> | |
| 1868 | + {renderConfig(first, 0)} | |
| 1869 | + </div> | |
| 1870 | + )} | |
| 1871 | + | |
| 1872 | + {/* 第二和第三放一行 */} | |
| 1873 | + {secondAndThird.length > 0 && ( | |
| 1874 | + <div | |
| 1875 | + style={{ | |
| 1876 | + display: 'flex', | |
| 1877 | + gap: '8px', | |
| 1878 | + marginBottom: '8px', | |
| 1879 | + width: '100%', | |
| 1880 | + }} | |
| 1881 | + > | |
| 1882 | + {secondAndThird.map((config, idx) => { | |
| 1883 | + const indexInOriginal = idx + 1; // 原始索引:1, 2 | |
| 1884 | + return ( | |
| 1885 | + <div | |
| 1886 | + key={config.sName || indexInOriginal} | |
| 1887 | + style={{ flex: 1, minWidth: 0 }} | |
| 1888 | + > | |
| 1889 | + {renderConfig(config, indexInOriginal)} | |
| 1890 | + </div> | |
| 1891 | + ); | |
| 1892 | + })} | |
| 1893 | + </div> | |
| 1894 | + )} | |
| 1895 | + | |
| 1896 | + {/* 剩下的每个占一行 */} | |
| 1897 | + {rest.map((config, idx) => { | |
| 1898 | + const originalIndex = idx + 3; | |
| 1899 | + return ( | |
| 1900 | + <div | |
| 1901 | + key={config.sName || originalIndex} | |
| 1902 | + style={{ width: '100%', marginBottom: '8px' }} | |
| 1903 | + > | |
| 1904 | + {renderConfig(config, originalIndex)} | |
| 1905 | + </div> | |
| 1906 | + ); | |
| 1907 | + })} | |
| 1908 | + </> | |
| 1909 | + ); | |
| 1910 | + | |
| 1911 | + // 提取公共逻辑,避免重复 | |
| 1912 | + function renderConfig(config, index) { | |
| 1913 | + const { sName, sEnglishTabName, sBig5TabName, sTabName } = config; | |
| 1914 | + let disabled = false; | |
| 1915 | + | |
| 1916 | + if (sTabName === '拼接列表' && sName === 'slaveWypj3') { | |
| 1917 | + disabled = | |
| 1918 | + props.slaveWypj2Data?.[0]?.bSave === false || | |
| 1919 | + props.slaveWypj2Data?.[0]?.bSave === 0; | |
| 1920 | + } else if ( | |
| 1921 | + (sTabName === '复卷成品检验列表' && sName === 'salveWydm3') || | |
| 1922 | + (sTabName === '卷盘明细' && sName === 'salveWydm4') | |
| 1923 | + ) { | |
| 1924 | + disabled = | |
| 1925 | + props.salveWydm2Data?.[0]?.bSave === false || | |
| 1926 | + props.salveWydm2Data?.[0]?.bSave === 0; | |
| 1927 | + } else if (sTabName === '成品批次列表' && sName === 'salveWybz3') { | |
| 1928 | + disabled = | |
| 1929 | + props.salveWybz2Data?.[0]?.bSave === false || | |
| 1930 | + props.salveWybz2Data?.[0]?.bSave === 0; | |
| 1931 | + } | |
| 1932 | + | |
| 1933 | + return getComponent(config, index); | |
| 1934 | + } | |
| 1935 | + })() | |
| 1936 | + } | |
| 1937 | + </div> | |
| 1938 | + } | |
| 1939 | + | |
| 1852 | 1940 | </div> |
| 1853 | 1941 | ); |
| 1854 | 1942 | } |
| ... | ... | @@ -2015,7 +2103,8 @@ const CommonViewTableComponent = props => { |
| 2015 | 2103 | if (commonUtils.isEmptyObject(viewRow)) { |
| 2016 | 2104 | viewProps.enabledNew = false; |
| 2017 | 2105 | } |
| 2018 | - | |
| 2106 | + console.log(viewProps, 'viewProps'); | |
| 2107 | + | |
| 2019 | 2108 | return ( |
| 2020 | 2109 | <> |
| 2021 | 2110 | <TabTitleComponent {...props} sTabName={groupList[index]} /> | ... | ... |