Commit 96600c1b by 放生的三文鱼

完成目录的编辑和预览

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