@steedos-widgets/sortable 3.6.2-beta.1 → 3.6.2-beta.2

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.
@@ -55504,6 +55504,18 @@ async function getTableColumns(fields, options){
55504
55504
  if(field.type === 'datetime'){
55505
55505
  className += 'datetime-min-w';
55506
55506
  }
55507
+
55508
+ //field上的amis属性里的clssname需要单独判断类型合并
55509
+ if (typeof field.amis?.className == "object") {
55510
+ className = {
55511
+ [className]: "true",
55512
+ ...field.amis.className
55513
+ };
55514
+ } else if (typeof field.amis?.className == "string") {
55515
+ className = `${className} ${field.amis.className} `;
55516
+ }
55517
+ delete field.amis?.className;
55518
+
55507
55519
  if(!field.hidden && !field.extra){
55508
55520
  columnItem = Object.assign({}, {
55509
55521
  name: field.name,
@@ -55600,12 +55612,24 @@ function getMobileLines(tpls){
55600
55612
  // 右侧半行,这里加样式类 flex flex-shrink-0,是为了省略号只显示在左半行,右半行文字一般比较短,如果也加省略号效果的话,左侧文字多的话,右侧没几个字就显示省略号了
55601
55613
  lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0";
55602
55614
  }
55615
+ //支持字段amis属性配置classname,识别classname的类型,与原样式合并
55616
+ var className;
55617
+ if (typeof item.field.amis?.className == "object") {
55618
+ className = {
55619
+ [lineChildrenClassName]: "true",
55620
+ ...item.field.amis.className
55621
+ };
55622
+ } else if (typeof item.field.amis?.className == "string") {
55623
+ className = `${lineChildrenClassName} ${item.field.amis.className} `;
55624
+ } else {
55625
+ className = lineChildrenClassName;
55626
+ }
55603
55627
  lineChildren.push({
55604
55628
  "type": "tpl",
55605
55629
  "tpl": item.tpl,
55606
- "className": lineChildrenClassName
55630
+ className
55607
55631
  });
55608
-
55632
+
55609
55633
  if(item.field.is_wide){
55610
55634
  // 宽字段占整行
55611
55635
  isLeft = true;
@@ -55655,8 +55679,7 @@ async function getMobileTableColumns(fields, options){
55655
55679
  tpl = await getFieldTpl(field, options);
55656
55680
  }
55657
55681
  if(!tpl){
55658
- //qhd需求简易处理,加上raw以支持审批王名称字段通过颜色区分缓急,若之后手机端列表支持配置amis,则可以去掉
55659
- tpl = `\${${field.name} | raw}`;
55682
+ tpl = `\${${field.name}}`;
55660
55683
  }
55661
55684
  if(!field.hidden && !field.extra){
55662
55685
  tpls.push({ field, tpl });
@@ -55669,7 +55692,7 @@ async function getMobileTableColumns(fields, options){
55669
55692
 
55670
55693
  let column = {
55671
55694
  name: nameField.name,
55672
- label: nameField.label,
55695
+ label: options.displayAs == 'split' ? '' : nameField.label,
55673
55696
  sortable: nameField.sortable,
55674
55697
  type: "button",
55675
55698
  level: "link",
@@ -59353,9 +59376,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
59353
59376
  */
59354
59377
  if(enable_tree){
59355
59378
  const rows = _.map(payload.data.rows, (item)=>{
59356
- delete item.children;
59357
- delete item.parent;
59358
- return item;
59379
+ if (!item.children) {
59380
+ return { ...item, children: [] };
59381
+ } else {
59382
+ return item;
59383
+ }
59359
59384
  })
59360
59385
  payload.data.rows = rows;
59361
59386
  }