@steedos-widgets/amis-lib 6.3.0 → 6.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1206,7 +1206,7 @@ async function getLookupLinkOnClick(field, options) {
1206
1206
  const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
1207
1207
 
1208
1208
  const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
1209
- "recordId": "${value}",
1209
+ "recordId": `\${${field.name}}`,
1210
1210
  "data": {
1211
1211
  ...recordPage.schema.data,
1212
1212
  "_inDrawer": true, // 用于判断是否在抽屉中
@@ -1216,7 +1216,7 @@ async function getLookupLinkOnClick(field, options) {
1216
1216
  }) : {
1217
1217
  "type": "steedos-record-detail",
1218
1218
  "objectApiName": options.objectName,
1219
- "recordId": "${value}",
1219
+ "recordId": `\${${field.name}}`,
1220
1220
  "showBackButton": false,
1221
1221
  "showButtons": true,
1222
1222
  "data": {
@@ -1322,7 +1322,7 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
1322
1322
  labelClassName: "hidden",
1323
1323
  label: false,
1324
1324
  className: 'm-0',
1325
- tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
1325
+ tpl: `<a href="/app/-/cfs_files_filerecord/view/\${${steedosField.name}}" ${lookupATagClick}>\${name}</a>`,
1326
1326
  // tpl: "<%= item.name >",
1327
1327
  // onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
1328
1328
  onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick(steedosField, {
@@ -2332,7 +2332,7 @@ async function getTableColumns(object, fields, options){
2332
2332
  }
2333
2333
  //增加quickEdit属性,实现快速编辑
2334
2334
  const quickEditSchema = allowEdit ? await getQuickEditSchema(object, field, options) : allowEdit;
2335
- let className = "";
2335
+ let className = `steedos-table-${field.type}-field`;
2336
2336
  const bowserType = getBowserType();
2337
2337
  if(bowserType === "Safari"){
2338
2338
  className += " whitespace-nowrap ";
@@ -13719,6 +13719,8 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
13719
13719
  if(gridSub){
13720
13720
  delete gridSub.name;
13721
13721
  delete gridSub.label;
13722
+ //去除重复样式
13723
+ gridSub.className = gridSub.className.replace('border-b', '');
13722
13724
  convertData.items.push(
13723
13725
  Object.assign({}, gridSub, {label: subField.label}, subField.amis, {
13724
13726
  name: subFieldName
@@ -13773,6 +13775,10 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
13773
13775
  }
13774
13776
  // if(ctx.mode === 'edit'){
13775
13777
  let convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, field.amis, {name: baseData.name});
13778
+ // 只读时file字段的外层control层若存在name,内部each组件存在问题
13779
+ if(readonly && field.type == "file") {
13780
+ convertDataResult.name = "";
13781
+ }
13776
13782
  // console.log("convertDataResult:", convertDataResult);
13777
13783
  return convertDataResult;
13778
13784
  // }else{
@@ -13992,13 +13998,17 @@ const getSection = async (formFields, permissionFields, fieldSchemaArray, sectio
13992
13998
  // console.log(`perField.type object ===> field`, field)
13993
13999
  }
13994
14000
  if (field.name.indexOf(".") < 0) {
14001
+ let _field = _.cloneDeep(field);
14002
+ if(field.type === "select" && field.data_type && field.data_type != "text"){
14003
+ _field.type = field.data_type;
14004
+ }
13995
14005
  if(field.type === "steedos-field"){
13996
14006
  // 如果是steedos-field则不需要通过convertSFieldToAmisField函数转换,因为steedos-field组件会转换
13997
- fieldSetBody.push(field);
14007
+ fieldSetBody.push(_field);
13998
14008
  }
13999
14009
  else {
14000
14010
  ctx.__formFields = formFields;
14001
- const amisField = await convertSFieldToAmisField(field, field.readonly, ctx);
14011
+ const amisField = await convertSFieldToAmisField(_field, _field.readonly, ctx);
14002
14012
  // 如果steedos-field稳定了,可以放开下面的代码直接用组件统一渲染字段
14003
14013
  // const amisField = {
14004
14014
  // "type": "steedos-field",