Commit f144019f by zhaochengxiang

资产详情增加取消

parent 0bfe4bc5
......@@ -114,6 +114,11 @@ const AssetAction = (props) => {
})
}
const onCancelButtonClick = () => {
setCurrentAction('detail');
getAsset();
}
const onActionButtonClick = () => {
if (currentAction === 'detail') {
setCurrentAction('edit');
......@@ -246,8 +251,10 @@ const AssetAction = (props) => {
>
<div style={{ color: 'rgba(0,0,0,0.75)' }}>资产详情</div>
<Space>
{
(currentAction!=='detail') && <Button onClick={onCancelButtonClick} >取消</Button>
}
<Button loading={confirmLoading} onClick={onActionButtonClick}>{ currentAction==='detail'?'编辑':'保存'}</Button>
<Button onClick={onFullScreenClick}>全屏</Button>
</Space>
</div>
......
import React, { useEffect, useState } from 'react';
import { useMount } from 'ahooks';
import { useMount, useUnmount } from 'ahooks';
import {Card, Spin, Tooltip, Tree, Input, Dropdown, Menu, Modal} from 'antd';
import { PlusOutlined, ImportOutlined,EditOutlined,DeleteOutlined,ExportOutlined,ReloadOutlined, SettingOutlined, ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons';
import classNames from 'classnames';
......@@ -38,10 +38,10 @@ const AssetTree = (props) => {
useMount(() => {
window?.addEventListener("storage", storageChange);
})
return () => {
window?.removeEventListener("storage", storageChange);
}
useUnmount(() => {
window?.removeEventListener("storage", storageChange);
})
useEffect(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment