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

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",