Skip to content

Commit

Permalink
[Bug]: 点击相关表记录名称,右侧弹出的页面没有识别为该对象配置的记录类型微页面
Browse files Browse the repository at this point in the history
  • Loading branch information
yinlianghui committed May 16, 2024
1 parent 1406c7b commit 468e9d1
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getAmisFileReadonlySchema } from './file'
import { Router } from '../../../router'
import { i18next } from '../../../../i18n'
import { getBowserType } from '../util';
import { getPage } from '../../../../lib/page';

function getOperation(fields){
const controls = [];
Expand Down Expand Up @@ -675,19 +676,25 @@ export async function getTableColumns(object, fields, options){
}

if(window.innerWidth >= 768 && ((field.is_name || field.name === options.labelFieldName) || ((field.type == 'lookup' || field.type == 'master_detail') && _.isString(field.reference_to) && field.multiple != true)) && options.isRelated){

const drawerRecordDetailSchema = {
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
"recordId": `\${${options.idFieldName}}`,
"data": {
...recordPage.schema.data,
"_inDrawer": true, // 用于判断是否在抽屉中
"recordLoaded": false, // 重置数据加载状态
}
}) : {
"type": "steedos-record-detail",
"objectApiName": "${objectName}",
"recordId": `\${${options.idFieldName}}`,
"showBackButton": false,
"showButtons": true,
"data": {
"_inDrawer": true, // 用于判断是否在抽屉中
"recordLoaded": false, // 重置数据加载状态
"_inDrawer": true, // 用于判断是否在抽屉中
"recordLoaded": false, // 重置数据加载状态
}
};

}

if(!(field.is_name || field.name === options.labelFieldName)){
drawerRecordDetailSchema.objectApiName = field.reference_to
Expand Down

0 comments on commit 468e9d1

Please sign in to comment.