Commit 62da8f61 by fanyj

tijiao

parent da4a5a83
......@@ -22,6 +22,7 @@ import ImportAction from './view/Manage/Model/Component/ImportAction';
import EditModel from './view/Manage/Model/Component/EditModel';
import EditTemplate from './view/Manage/ModelConfig/Component/EditTemplate';
import AssetTree from './view/Manage/AssetManage/Component/AssetManageTree';
import AssetNewDetail from "./view/Manage/AssetManage/Component/AssetAction"
import { AssetMountReference } from './util/constant';
......@@ -60,13 +61,17 @@ export class App extends React.Component {
const { setGlobalState, onGlobalStateChange } = this.props;
const { hostParams } = this.state;
let message = '', id = '', terms = [];
let message = '', id = '', terms = [],dirId='',templateType='';
if (hostParams) {
message = hostParams.message||'';
id = hostParams.id||'';
terms = hostParams.terms||[];
dirId = hostParams.dirId||'';
templateType = hostParams.templateType||''
}
console.log('dirId',hostParams)
if (message === 'showDataModelDetail') {
return (
<AppContext.Provider value={{
......@@ -106,10 +111,11 @@ export class App extends React.Component {
setGlobalState,
onGlobalStateChange
}}>
<AssetDetail
<AssetNewDetail id={id} dirId={dirId} templateType={templateType} action='detail' />
{/* <AssetDetail
id={id}
terms={terms}
/>
/> */}
</AppContext.Provider>
);
}
......
......@@ -11,8 +11,9 @@ export function* getLogs(payload) {
return yield call(service.getLogs, payload);
}
export function* listElements() {
return yield call(service.listElements);
export function* listElements(payload) {
console.log('params',payload)
return yield call(service.listElements,payload);
}
export function* listElementsAndFillValue(payload) {
......
......@@ -8,8 +8,8 @@ export function getLogs(payload) {
return GetJSON("/dataassetmanager/elementApi/listOperationLogsByPage", payload);
}
export function listElements() {
return PostJSON("/dataassetmanager/elementApi/listElements");
export function listElements(payload) {
return PostJSON("/dataassetmanager/elementApi/listElements",payload);
}
export function listElementsAndFillValue(payload) {
......
......@@ -144,6 +144,15 @@ export function PostJSON(url, payload) {
const { params = null, data = null } = payload||{};
const cancelToken = __source ? __source.token : null;
const env = LocalStorage.get('assetsEnv')??debugEnv;
// let templateType = getTemplateType()
// try {
// if(!templateType){
// templateType = params
// }
// } catch (error) {
// }
console.log(params)
return IsArr(data) ? instance.post(url, data, {
params: {env, templateType: getTemplateType(), ...params}, cancelToken
......
......@@ -27,7 +27,7 @@ import AttributeMaintain from './AttributeMaintain';
import './AssetAction.less';
const AssetAction = (props) => {
const { id, dirId, action, terms, onChange, reference, form, onMetadataChange, onElementsChange, readonly = false, permissionId } = props;
const { id, dirId, action, terms, onChange, reference, form, onMetadataChange, onElementsChange, readonly = false, permissionId ,templateType} = props;
const [ currentAction, setCurrentAction ] = useState(action);
const [ assetParams, setAssetParams ] = useState({ assets: {}, attributes: [], attributesFoldMap: {} });
......@@ -72,6 +72,8 @@ const AssetAction = (props) => {
const app = useContext(AppContext);
const uploadRef = useRef(undefined);
console.log('dirs',dirId)
const columns = [
{
title: '技术ID(英文名称)',
......@@ -334,13 +336,19 @@ const AssetAction = (props) => {
}
const getElements = ( cb = null ) => {
console.log('data',templateType)
dispatch({
type: (currentAction==='add')?'assetmanage.listElementsAndFillValue':'assetmanage.listElements',
payload: (currentAction==='add')?{
params: {
dirId
dirId,
templateType
}
}:undefined,
}:{
params:{
templateType
}
},
callback: data => {
setWholeElements(data||[]);
}
......
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