Commit cddb0f88 by fanyj

tijiao

parent 96b3b9d3
......@@ -63,6 +63,10 @@ module.exports = {
target: proxyurl,
changeOrigin: true,
},
'/data-quality': {
target: proxyurl,
changeOrigin: true,
},
},
// historyApiFallback: true,
// hot: false,
......
......@@ -24,6 +24,7 @@ import DataServiceDetail from './view/Manage/Pdata/Component/ServiceDetail';
import GrantedDataServiceList from './view/Manage/Pdata/Component/GrantedList';
import AssetTask from './view/Manage/AssetTask';
import AssetEvaluate from './view/Manage/AssetEvaluate';
import AssetColumnDetail from './view/Manage/AssetManage/Component/AssetColumnDetail';
import { AssetBrowseReference, AssetDraftReference, AssetMountReference } from './util/constant';
......@@ -66,13 +67,16 @@ export class App extends React.Component {
const { setGlobalState, onGlobalStateChange } = this.props;
const { hostParams } = this.state;
let message = '', id = '', terms = [];
let message = '', id = '', terms = [],type = '';
if (hostParams) {
message = hostParams.message||'';
id = hostParams.id||'';
type=hostParams.type||'';
terms = hostParams.terms||[];
}
console.log(hostParams)
if (message === 'showDataModelDetail') {
return (
<AppContext.Provider value={{
......@@ -101,6 +105,19 @@ export class App extends React.Component {
);
}
if(message==='showAssetColumnDetail'){
return (
<AppContext.Provider value={{
env: hostParams?.env,
user: hostParams?.user,
setGlobalState,
onGlobalStateChange
}}>
<AssetColumnDetail id={id} type={type} />
</AppContext.Provider>
);
}
if (message === 'showAssetTree') {
return (
<AppContext.Provider value={{
......
......@@ -47,6 +47,15 @@ class AssetsActionManageService{
})
}
async getAssetColumnDetail(payload:any,autotip=false){
let result = await request({ url: `${asset}/dataAssetColumnApi/getDataAssetColumnDetail`, method: "post", data:qs.stringify(payload) },autotip).then(data=>{
return data;
}).catch(error=>{
return error
})
return result;
}
}
export default new AssetsActionManageService()
......@@ -28,6 +28,7 @@ import './AssetAction.less';
import MatchMetaInfo from './MatchMetaInfo';
import { useGetModalInfoAndAction } from '@/hooks/common';
import AssetsCompareModal from './AssetsCompareModal';
import TagCell, { TagSelectPopup } from './tag-help'
const AssetAction = React.forwardRef(function (props, ref) {
const { id, dirId, action, terms, onChange, reference, readonly = false, permissionId, catalog, template } = props;
......@@ -69,6 +70,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
const [isStructured, setStructured] = useState();
const [businessElements, setBusinessElements] = useState();
const [businessColumns, setBusinessColumns] = useState();
const [resoureTagMap, setResourceTagMap] = useState()
console.log('refence',reference)
......@@ -92,6 +94,9 @@ const AssetAction = React.forwardRef(function (props, ref) {
console.log(assets)
if(assets?.metadataId)
setSelectData({metadataId:assets.metadataId,metadataPath:assets.metadataPath})
if(assets.length){
getResourceTag()
}
},[assets])
React.useImperativeHandle(ref, () => ({
......@@ -160,6 +165,54 @@ const AssetAction = React.forwardRef(function (props, ref) {
},
];
const tagCol = {
title: '标签',
dataIndex: 'tag',
width: 360,
className: 'table-tag-cell',
render: (_, record) => {
console.log(record)
return(
<div onClick={(e) => e.stopPropagation()}>
<TagCell
id={record.id}
did={record.dirId}
type={record?.columnType}
tags={resoureTagMap?.[record.id]}
onChange={(val) => {
setResourceTagMap((prevResourceTagMap) => {
return produce(prevResourceTagMap||{}, (draft) => {
draft[record.id] = val
})
})
}}
/>
</div>
)
}
}
const getResourceTag = () => {
const ids = (assets??[]).map(item => item._id)
if (ids.length > 0) {
dispatch({
type: 'tag.getResourceTagIn',
payload: {
params: {
resourceIds: ids,
includeAll: true,
includePrivate: true
}
},
callback: data => {
setResourceTagMap(data?.data)
}
});
} else {
setResourceTagMap()
}
}
const businessActionCol = {
title: '操作',
dataIndex: 'action',
......@@ -242,6 +295,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
{ item.name }
</span>,
dataIndex: item.enName,
width:160,
ellipsis: true,
render: (text, record, index) => {
let value = ''
......@@ -311,7 +365,7 @@ const AssetAction = React.forwardRef(function (props, ref) {
newCols.push(businessActionCol)
}
return newCols
return [...newCols,tagCol]
}, [currentAction, isStructured, columns, businessColumns, businessActionCol])
const [tableData, total] = useMemo(() => {
......
import { assetsActionManageService } from "@/services"
import { httpUtil } from "@/utils"
import { useSetState } from "ahooks"
import React, { useEffect } from "react"
import {Descriptions, Spin} from "antd"
const AssetColumnDetail:React.FC<any>=(props)=>{
const {id,type} = props
const [state,setState] = useSetState({
loading:true,
attrs:[]
})
const [open,setOpen] = useSetState({
openshowmore:true,
showmore:true
})
useEffect(()=>{
if(id&&type){
getDetialInfo()
}
},[id,type])
const getDetialInfo=async()=>{
setState({loading:true})
const result:any = await assetsActionManageService.getAssetColumnDetail({columnId:id,columnType:type})
if(httpUtil.checkSuccess(result,1)){
setState({loading:false,attrs:result.data?.columnValueList||[]})
}else{
httpUtil.showError(result,1)
setState({loading:false,attrs:[]})
}
}
return(
<div>
<h2>资产字段信息</h2>
<Spin spinning={state.loading}>
<Descriptions column={2} size="small" bordered={false} >
{
state.attrs.map((item:any,key:number)=>{
if(key<6){
return(
<Descriptions.Item span={1} key={key} label={item?.cnName}>
{item?.value}
</Descriptions.Item>
)
}else{
if(open.openshowmore){
if(open.showmore){
return(
<Descriptions.Item span={1} key={key} label={item?.cnName}>
{item?.value}
</Descriptions.Item>
)
}else{
return null
}
}else{
return(
<Descriptions.Item span={1} key={key} label={item.cnName}>
{item?.value}
</Descriptions.Item>
)
}
}
})
}
</Descriptions>
</Spin>
</div>
)
}
export default AssetColumnDetail
\ No newline at end of file
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