Bläddra i källkod

feat: 项目节第一层不允许进行上下移、升降级操作

lanjianrong 4 år sedan
förälder
incheckning
59d90c5ace

+ 5 - 5
src/pages/Contract/Content/Income/index.tsx

@@ -131,7 +131,7 @@ const Income: React.FC<RouteComponentProps> = (props) => {
                     <Button type="text" icon={<SvgIcon type="xxh-plus" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('add', { id: row.id, bidsectionId: row.bidsectionId, name: '' })} />
                   </Tooltip>
                   {
-                    !row.children?.length && row.depth !== 1 ?
+                    !row.children?.length && row.depth !== 1 && row.depth !== 1 ?
                       <Tooltip title="删除">
                         <Popconfirm
                           title="确定删除"
@@ -146,7 +146,7 @@ const Income: React.FC<RouteComponentProps> = (props) => {
                       : <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-times" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    row.parentId && row.parentId !== contractTreeBaseId ?
+                    row.parentId && row.parentId !== contractTreeBaseId && row.depth !== 1 ?
                       <Tooltip title="升级">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-left" style={{ color: '#007bff', fontSize: 12 }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upDepth' })} />} />
                       </Tooltip>
@@ -154,7 +154,7 @@ const Income: React.FC<RouteComponentProps> = (props) => {
                       <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-left" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    row.elderBrother ?
+                    row.elderBrother && row.depth !== 1 ?
                       <Tooltip title="降级">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-right" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downDepth' })} />
                       </Tooltip>
@@ -162,7 +162,7 @@ const Income: React.FC<RouteComponentProps> = (props) => {
                       <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-right" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    row.elderBrother ?
+                    row.elderBrother && row.depth !== 1 ?
                       <Tooltip title="上移">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-up" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upSerial' })} disabled={!row.elderBrother} />
                       </Tooltip>
@@ -170,7 +170,7 @@ const Income: React.FC<RouteComponentProps> = (props) => {
                       <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-up" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    !row.isEnd ?
+                    !row.isEnd && row.depth !== 1 ?
                       <Tooltip title="下移">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-down" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downSerial' })} disabled={row.isEnd} />
                       </Tooltip>

+ 4 - 4
src/pages/Contract/Content/Spending/index.tsx

@@ -143,7 +143,7 @@ const Expenditure: React.FC<RouteComponentProps> = ({ history }) => {
                       : <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-times" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    row.parentId && row.parentId !== contractTreeBaseId ?
+                    row.parentId && row.parentId !== contractTreeBaseId && row.depth !== 1 ?
                       <Tooltip title="升级">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-left" style={{ color: '#007bff', fontSize: 12 }} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upDepth' })} />} />
                       </Tooltip>
@@ -151,7 +151,7 @@ const Expenditure: React.FC<RouteComponentProps> = ({ history }) => {
                       <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-left" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    row.elderBrother ?
+                    row.elderBrother && row.depth !== 1 ?
                       <Tooltip title="降级">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-right" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('depth', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downDepth' })} />
                       </Tooltip>
@@ -159,7 +159,7 @@ const Expenditure: React.FC<RouteComponentProps> = ({ history }) => {
                       <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-right" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    row.elderBrother ?
+                    row.elderBrother && row.depth !== 1 ?
                       <Tooltip title="上移">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-up" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'upSerial' })} disabled={!row.elderBrother} />
                       </Tooltip>
@@ -167,7 +167,7 @@ const Expenditure: React.FC<RouteComponentProps> = ({ history }) => {
                       <span className="pi-width-32 pi-height-32 pi-pd-tb-4 pi-flex-row-center"><SvgIcon type="xxh-arrow-up" style={{ color: '#9a9a9a', fontSize: 12 }} /></span>
                   }
                   {
-                    !row.isEnd ?
+                    !row.isEnd && row.depth !== 1 ?
                       <Tooltip title="下移">
                         <Button type="text" icon={<SvgIcon type="xxh-arrow-down" style={{ color: '#007bff', fontSize: 12 }} />} onClick={() => treeResfulApiHandler('serial', { id: row.id, bidsectionId: row.bidsectionId, operation: 'downSerial' })} disabled={row.isEnd} />
                       </Tooltip>