Commit 96600c1b by 放生的三文鱼

完成目录的编辑和预览

parent 29e4f59d
......@@ -568,4 +568,8 @@ export function* processDetail(payload) {
export function* auditProcess(payload) {
return yield call(service.auditProcess, payload);
}
\ No newline at end of file
}
export function* saveCustomTree(payload) {
return yield call(service.saveCustomTree, payload);
}
......@@ -552,6 +552,10 @@ export function queryCustomTypeRootDirectory() {
return GetJSON("/dataassetmanager/directoryApi/queryCustomTypeRootDirectory");
}
export function saveCustomTree(payload) {
return PostJSON("/dataassetmanager/directoryApi/saveCustomElementTree", payload)
}
export function getPrivilegeByRange(payload) {
return GetJSON("/dataassetmanager/AuthorityApi/listAllowButtonsByRange", payload);
}
......@@ -579,3 +583,5 @@ export function processDetail(payload) {
export function auditProcess(payload) {
return PostJSON("/dataassetmanager/flowApi/auditProcess", payload)
}
......@@ -527,6 +527,11 @@ const AssetManageTree = (props) => {
})
}
const editCustom = ()=>{
setCustomDirectoryAction('edit');
setCustomDirectoryModalVisible(true);
}
const deleteDir = () => {
console.log('currentRightClickDir', currentRightClickDir)
if (currentRightClickDir.nodeId) {
......@@ -970,6 +975,7 @@ const AssetManageTree = (props) => {
checkStrictly
onRightClick={({event, node}) => {
if (reference === AssetManageReference) {
console.log('node',node);
setCurrentRightClickDir(node);
setCurrentDirType(node.type||'');
displayMenu(event);
......@@ -994,6 +1000,7 @@ const AssetManageTree = (props) => {
onCancel={ onCustomDirectoryCancel }
action={ customDirectoryAction }
dirId= { currentDirId }
node={ currentRightClickDir }
/>
<Overview
visible={ customOverview.visible }
......@@ -1025,7 +1032,7 @@ const AssetManageTree = (props) => {
<RcItem id="edit" onClick={previewCustom}>
预览
</RcItem>
<RcItem id="edit" >
<RcItem id="edit" onClick={editCustom}>
编辑
</RcItem>
</React.Fragment>
......
import React, { useEffect, useState, useCallback } from 'react';
import { Modal, Checkbox, Row, Col, Form, Input, Empty, Select } from 'antd';
import { Modal, Checkbox, Row, Col, Form, Input, Empty, Select,Spin } from 'antd';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import update from 'immutability-helper';
......@@ -18,7 +18,7 @@ const resourceTypes = [
]
const CustomDirectoryModal = (props) => {
const { visible, onCancel, action, dirId, reference = AssetManageReference } = props;
const { visible, onCancel, action, dirId, reference = AssetManageReference,node } = props;
const [ keyword, setKeyword ] = useState('');
const [ data, setData ] = useState([]);
......@@ -53,7 +53,9 @@ const CustomDirectoryModal = (props) => {
setData(elements||[]);
setFilterData((elements||[]).filter(item => (item.name||'').indexOf(keyword)!==-1));
if (action === 'edit') {
getCurrentDirectory(elements||[]);
setCheckedValues(node.elementIds||[]);
form.setFieldsValue({ name: node.name||'', desc: node.desc||'' });
onCheckboxChange(node.elementIds||[], elements);
}
}
})
......@@ -158,11 +160,13 @@ const CustomDirectoryModal = (props) => {
params: row
}
let url = 'assetmanage.saveTreeByCustomElements';
if (action === 'edit') {
url = 'assetmanage.saveCustomTree';
payload.params = {...payload.params, dirId};
}
let url = 'assetmanage.saveTreeByCustomElements';
if (reference===AssetManageReference) {
payload.params = {
......@@ -252,7 +256,7 @@ const CustomDirectoryModal = (props) => {
}}
onOk={onOk}
>
<Row gutter={30}>
<Row gutter={30}>
<Col span={8} style={{ borderRight: '1px solid #EFEFEF' }}>
<div className='mb-3'>资产目录要素</div>
<Input
......
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