Commit 8e4946ef by zhaochengxiang

岗位新增关联关系

parent 8d657bef
...@@ -107,8 +107,8 @@ export function* deletePersonalCustomDirectory(payload) { ...@@ -107,8 +107,8 @@ export function* deletePersonalCustomDirectory(payload) {
export function* existDataAsset(payload) { export function* existDataAsset(payload) {
return yield call(service.existDataAsset, payload); return yield call(service.existDataAsset, payload);
} }
export function* queryAllDirectoryAsTree() { export function* queryAllDirectoryAsTree(payload) {
return yield call(service.queryAllDirectoryAsTree); return yield call(service.queryAllDirectoryAsTree, payload);
} }
export function* queryDirectoryTreeByMetadataId(payload) { export function* queryDirectoryTreeByMetadataId(payload) {
return yield call(service.queryDirectoryTreeByMetadataId, payload); return yield call(service.queryDirectoryTreeByMetadataId, payload);
......
...@@ -136,8 +136,8 @@ export function existDataAsset(payload) { ...@@ -136,8 +136,8 @@ export function existDataAsset(payload) {
return GetJSON("/dataassetmanager/directoryApi/existDataAsset", payload); return GetJSON("/dataassetmanager/directoryApi/existDataAsset", payload);
} }
export function queryAllDirectoryAsTree() { export function queryAllDirectoryAsTree(payload) {
return GetJSON("/dataassetmanager/directoryApi/queryAllDirectoryAsTree"); return GetJSON("/dataassetmanager/directoryApi/queryAllDirectoryAsTree", payload);
} }
export function queryDirectoryTreeByMetadataId(payload) { export function queryDirectoryTreeByMetadataId(payload) {
......
...@@ -124,7 +124,7 @@ export function Get(url, params) { ...@@ -124,7 +124,7 @@ export function Get(url, params) {
const templateType = getTemplateType(); const templateType = getTemplateType();
return textplain.get(url, { return textplain.get(url, {
params: {...params, templateType}, cancelToken params: {templateType, ...params}, cancelToken
}).then( }).then(
callback callback
) )
...@@ -135,7 +135,7 @@ export function GetJSON(url, params) { ...@@ -135,7 +135,7 @@ export function GetJSON(url, params) {
const templateType = getTemplateType(); const templateType = getTemplateType();
return instance.get(url, { return instance.get(url, {
params: {...params, templateType}, cancelToken, params: {templateType, ...params}, cancelToken,
validateStatus: false validateStatus: false
}).then( }).then(
callback callback
...@@ -147,7 +147,7 @@ export const GetJSONRaw = (url, params) => { ...@@ -147,7 +147,7 @@ export const GetJSONRaw = (url, params) => {
const templateType = getTemplateType(); const templateType = getTemplateType();
return instanceRow.get(url, { return instanceRow.get(url, {
params: {...params, templateType}, cancelToken, params: {templateType, ...params}, cancelToken,
validateStatus: false validateStatus: false
}).then( }).then(
callback callback
...@@ -159,7 +159,7 @@ export function Delete(url, params) { ...@@ -159,7 +159,7 @@ export function Delete(url, params) {
const templateType = getTemplateType(); const templateType = getTemplateType();
return instance.delete(url, { return instance.delete(url, {
params: {...params, templateType}, cancelToken, params: {templateType, ...params}, cancelToken,
}).then( }).then(
callback callback
) )
...@@ -171,11 +171,11 @@ export function PostJSON(url, payload) { ...@@ -171,11 +171,11 @@ export function PostJSON(url, payload) {
const templateType = getTemplateType(); const templateType = getTemplateType();
return IsArr(data) ? instance.post(url, data, { return IsArr(data) ? instance.post(url, data, {
params: {...params, templateType}, cancelToken params: {templateType, ...params}, cancelToken
}).then( }).then(
callback callback
) : instance.post(url, null, { ) : instance.post(url, null, {
params: {...params, templateType}, data, cancelToken params: {templateType, ...params}, data, cancelToken
}).then( }).then(
callback callback
) )
...@@ -187,7 +187,7 @@ export function Post(url, payload) { ...@@ -187,7 +187,7 @@ export function Post(url, payload) {
const templateType = getTemplateType(); const templateType = getTemplateType();
return textplain.post(url, null, { return textplain.post(url, null, {
params: {...params, templateType}, data, cancelToken params: {templateType, ...params}, data, cancelToken
}).then( }).then(
callback callback
) )
...@@ -202,7 +202,7 @@ export function PostFile(url, payload) { ...@@ -202,7 +202,7 @@ export function PostFile(url, payload) {
formData.append('file', file); formData.append('file', file);
}); });
return fileplain.post(url, formData, { params: {...params, templateType} } ).then( return fileplain.post(url, formData, { params: {templateType, ...params} } ).then(
callback callback
) )
} }
...@@ -221,7 +221,7 @@ export const callFetchRaw = (method, url, options) => { ...@@ -221,7 +221,7 @@ export const callFetchRaw = (method, url, options) => {
return axios.request({ return axios.request({
method, method,
url, url,
params: {...params, templateType}, params: {templateType, ...params},
...config, ...config,
...reqConfig ...reqConfig
}) })
......
...@@ -401,6 +401,5 @@ export function getDataModelerRole(user) { ...@@ -401,6 +401,5 @@ export function getDataModelerRole(user) {
} }
export function isPostAsset(templateType) { export function isPostAsset(templateType) {
//zcx todo return templateType === 'post'
return false
} }
\ No newline at end of file
...@@ -1335,7 +1335,7 @@ const AssetAction = (props) => { ...@@ -1335,7 +1335,7 @@ const AssetAction = (props) => {
</Spin> </Spin>
{ {
isPostAsset(assets?.templateType) ? <PostRelation /> : <React.Fragment> isPostAsset(assets?.templateType) ? <div className='mt-2'><PostRelation /></div> : <React.Fragment>
<div> <div>
<Divider orientation='left'>字段级资产目录信息</Divider> <Divider orientation='left'>字段级资产目录信息</Divider>
</div> </div>
......
...@@ -4,7 +4,7 @@ import { Drawer, Form } from 'antd'; ...@@ -4,7 +4,7 @@ import { Drawer, Form } from 'antd';
import AssetAction from './AssetAction'; import AssetAction from './AssetAction';
const AssetDetailDrawer = (props) => { const AssetDetailDrawer = (props) => {
const { onCancel, visible, id, dirId, reference } = props; const { onCancel, visible, id, dirId, reference, readonly = false } = props;
const [ form ] = Form.useForm(); const [ form ] = Form.useForm();
...@@ -21,7 +21,7 @@ const AssetDetailDrawer = (props) => { ...@@ -21,7 +21,7 @@ const AssetDetailDrawer = (props) => {
}} }}
> >
{ {
visible && <AssetAction reference={reference} form={form} id={id} dirId={dirId} action='detail' onChange={() => { visible && <AssetAction reference={reference} form={form} id={id} dirId={dirId} action='detail' readonly={readonly} onChange={() => {
onCancel?.(true); onCancel?.(true);
}} /> }} />
} }
......
import React from 'react' import React from 'react'
import { Row, Col, Spin, Tree, Input, Tooltip, Typography, Select, Pagination } from 'antd' import { Row, Col, Spin, Tree, Input, Tooltip, Typography, Select, Pagination, Space, Button } from 'antd'
import produce from 'immer' import produce from 'immer'
import { useDebounceEffect } from "ahooks" import { useDebounceEffect } from "ahooks"
import classnames from 'classnames' import classnames from 'classnames'
...@@ -7,6 +7,7 @@ import classnames from 'classnames' ...@@ -7,6 +7,7 @@ import classnames from 'classnames'
import Table from '../../ResizeableTable' import Table from '../../ResizeableTable'
import { dispatch } from '../../../../model' import { dispatch } from '../../../../model'
import { AssetItem } from './AssetTable' import { AssetItem } from './AssetTable'
import AssetDetailDrawer from "./AssetDetailDrawer";
import './select-asset.less' import './select-asset.less'
...@@ -33,6 +34,11 @@ const FC = (props) => { ...@@ -33,6 +34,11 @@ const FC = (props) => {
const [expandedKeys, setExpandedKeys] = React.useState([]) const [expandedKeys, setExpandedKeys] = React.useState([])
const [autoExpandParent, setAutoExpandParent] = React.useState(false) const [autoExpandParent, setAutoExpandParent] = React.useState(false)
const [users, setUsers] = React.useState() const [users, setUsers] = React.useState()
const [detailParams, setDetailParams] = React.useState({
visible: false,
id: undefined,
dirId: undefined,
})
React.useEffect(() => { React.useEffect(() => {
getUsers() getUsers()
...@@ -81,6 +87,24 @@ const FC = (props) => { ...@@ -81,6 +87,24 @@ const FC = (props) => {
return undefined return undefined
}, [treeData]) }, [treeData])
const actionCol = {
title: '操作',
dataIndex: 'action',
width: 80,
render: (_, record) => {
return (
<Space>
<a onClick={(e) => {
e.stopPropagation();
onDetailClick(record);
}}>
详情
</a>
</Space>
)
}
}
const [columns, tableData, total] = React.useMemo(() => { const [columns, tableData, total] = React.useMemo(() => {
let [newColumns, newTableData] = [[], []] let [newColumns, newTableData] = [[], []]
...@@ -146,7 +170,7 @@ const FC = (props) => { ...@@ -146,7 +170,7 @@ const FC = (props) => {
} }
} }
return [newColumns, newTableData, data?.total??0] return [[...newColumns, actionCol], newTableData, data?.total??0]
}, [elements, data, loadingElements, users]) }, [elements, data, loadingElements, users])
const setArgsByParams = React.useCallback((params) => { const setArgsByParams = React.useCallback((params) => {
...@@ -257,6 +281,14 @@ const FC = (props) => { ...@@ -257,6 +281,14 @@ const FC = (props) => {
setNode(selectedNodes[0]) setNode(selectedNodes[0])
} }
const onDetailClick = (record) => {
setDetailParams({
visible: true,
id: record?.id,
dirId: record?.dirId,
})
}
return ( return (
<div className='post-select-asset'> <div className='post-select-asset'>
<Row> <Row>
...@@ -353,6 +385,17 @@ const FC = (props) => { ...@@ -353,6 +385,17 @@ const FC = (props) => {
} }
</Col> </Col>
</Row> </Row>
<AssetDetailDrawer
{...detailParams}
readonly={true}
onCancel={() => {
setDetailParams({
visible: false,
id: undefined,
dirId: undefined,
})
}}
/>
</div> </div>
) )
} }
......
...@@ -37,10 +37,6 @@ const FC = (props) => { ...@@ -37,10 +37,6 @@ const FC = (props) => {
const [autoExpandParent, setAutoExpandParent] = React.useState(false) const [autoExpandParent, setAutoExpandParent] = React.useState(false)
const [users, setUsers] = React.useState() const [users, setUsers] = React.useState()
const [countMap, setCount] = React.useState() const [countMap, setCount] = React.useState()
const [detailParams, setDetailParams] = React.useState({
visible: false,
id: undefined,
})
const app = React.useContext(AppContext) const app = React.useContext(AppContext)
...@@ -108,12 +104,12 @@ const FC = (props) => { ...@@ -108,12 +104,12 @@ const FC = (props) => {
render: (_, record) => { render: (_, record) => {
return ( return (
<Space> <Space>
<Button type='link' size='small' <a onClick={(e) => {
onClick={() => { onDetailClick(record) }} e.stopPropagation();
style={{ padding: 0 }} onDetailClick(record);
> }}>
详情 详情
</Button> </a>
</Space> </Space>
) )
} }
...@@ -274,10 +270,7 @@ const FC = (props) => { ...@@ -274,10 +270,7 @@ const FC = (props) => {
} }
const onDetailClick = (record) => { const onDetailClick = (record) => {
setDetailParams({ app?.openDetail?.({ service: record, isOnlyEnding: true })
visible: true,
id: record?.id,
})
} }
return ( return (
......
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