@steedos-widgets/sortable 6.3.0-beta.7 → 6.3.0-beta.9

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.
@@ -54141,10 +54141,23 @@ function getNameTpl(field, ctx){
54141
54141
  if(ctx && ctx.isLookup){
54142
54142
  linkTarget = "target='_blank'";
54143
54143
  }
54144
+ let nameLabel = field.name;
54145
+ //若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
54146
+ if (field.type == "lookup") {
54147
+ if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
54148
+ if(!field.isTableField){
54149
+ nameLabel = `\${${field.name}__label}`;
54150
+ }
54151
+ } else {
54152
+ nameLabel = `\${_display.${field.name}.label}`;
54153
+ }
54154
+ } else {
54155
+ nameLabel = `\${_display.${field.name} || ${field.name}}`;
54156
+ }
54144
54157
  if(ctx.isRelated && window.innerWidth >= 768){
54145
- return `<a href="${href}" ${linkTarget} onclick="return false;">\${${field.name} | raw}</a>`
54158
+ return `<a href="${href}" ${linkTarget} onclick="return false;">\${${nameLabel} | raw}</a>`
54146
54159
  }else {
54147
- return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
54160
+ return `<a href="${href}" ${linkTarget}>\${${nameLabel} | raw}</a>`
54148
54161
  }
54149
54162
  }
54150
54163
 
@@ -54269,7 +54282,7 @@ function getLocationTpl(field){
54269
54282
  }
54270
54283
 
54271
54284
  async function getFieldTpl (field, options){
54272
- if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel){
54285
+ if((field.is_name || field.name === options.labelFieldName) && !options.onlyDisplayLookLabel && field.multiple !== true){
54273
54286
  return getNameTpl(field, options)
54274
54287
  }
54275
54288
  switch (field.type) {
@@ -55510,7 +55523,7 @@ async function getTableColumns(object, fields, options){
55510
55523
  var file_id = data.versions && data.versions[0] && data.versions[0]._id;
55511
55524
  window.previewFile && window.previewFile({file_name, file_id});
55512
55525
  `;
55513
- columnItem = {
55526
+ columnItem = Object.assign({}, {
55514
55527
  "type": "button",
55515
55528
  "label": `<%=data.versions ? data.name : "${field.label}"%>`,
55516
55529
  className,
@@ -55542,7 +55555,7 @@ async function getTableColumns(object, fields, options){
55542
55555
  ]
55543
55556
  }
55544
55557
  }
55545
- };
55558
+ }, fieldAmis);
55546
55559
  }else if(field.type === 'toggle'){
55547
55560
  columnItem = Object.assign({}, {
55548
55561
  type: "switch",
@@ -55658,7 +55671,7 @@ async function getTableColumns(object, fields, options){
55658
55671
  "title": "&nbsp;",
55659
55672
  "headerClassName": "hidden",
55660
55673
  "size": "lg",
55661
- "bodyClassName": "p-0 m-0",
55674
+ "bodyClassName": "p-0 m-0 bg-gray-100",
55662
55675
  "closeOnEsc": true,
55663
55676
  "closeOnOutside": true,
55664
55677
  "resizable": true,
@@ -59716,7 +59729,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
59716
59729
  // 如果当前元素不是数组,则处理该元素
59717
59730
  // 下面正则用于匹配amis公式\${}
59718
59731
  if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
59719
- arr[i] = currentAmis.evaluate(arr[i], api.data.$);
59732
+ arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
59720
59733
  }
59721
59734
  }
59722
59735
  }
@@ -60133,7 +60146,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
60133
60146
  // 如果当前元素不是数组,则处理该元素
60134
60147
  // 下面正则用于匹配amis公式\${}
60135
60148
  if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
60136
- arr[i] = currentAmis.evaluate(arr[i], api.data.$);
60149
+ arr[i] = currentAmis.evaluate(arr[i], api.data.$self);
60137
60150
  }
60138
60151
  }
60139
60152
  }