@steedos-widgets/sortable 3.6.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.
@@ -54943,16 +54943,17 @@ async function getQuickEditSchema(field, options){
54943
54943
  {
54944
54944
  actionType: "custom",
54945
54945
  script: `
54946
+ console.log("asdasd");
54946
54947
  let items = _.cloneDeep(event.data.items);
54947
54948
  let selectedItems = _.cloneDeep(event.data.selectedItems);
54948
54949
  if(event.data.isBatchEdit){
54949
54950
  selectedItems.forEach(function(selectedItem){
54950
54951
  selectedItem._display.${field.name} = event.data._display.${field.name};
54951
- doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: ${options.objectName} + "_display_" + selectedItem._index});
54952
+ doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: "${options.objectName}" + "_display_" + selectedItem._index});
54952
54953
  doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + selectedItem._index});
54953
54954
  })
54954
54955
  }else{
54955
- doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: ${options.objectName} + "_display_" + event.data._index});
54956
+ doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "${options.objectName}" + "_display_" + event.data._index});
54956
54957
  doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
54957
54958
  }
54958
54959
  `
@@ -55503,6 +55504,18 @@ async function getTableColumns(fields, options){
55503
55504
  if(field.type === 'datetime'){
55504
55505
  className += 'datetime-min-w';
55505
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
+
55506
55519
  if(!field.hidden && !field.extra){
55507
55520
  columnItem = Object.assign({}, {
55508
55521
  name: field.name,
@@ -55599,12 +55612,24 @@ function getMobileLines(tpls){
55599
55612
  // 右侧半行,这里加样式类 flex flex-shrink-0,是为了省略号只显示在左半行,右半行文字一般比较短,如果也加省略号效果的话,左侧文字多的话,右侧没几个字就显示省略号了
55600
55613
  lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0";
55601
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
+ }
55602
55627
  lineChildren.push({
55603
55628
  "type": "tpl",
55604
55629
  "tpl": item.tpl,
55605
- "className": lineChildrenClassName
55630
+ className
55606
55631
  });
55607
-
55632
+
55608
55633
  if(item.field.is_wide){
55609
55634
  // 宽字段占整行
55610
55635
  isLeft = true;
@@ -55654,8 +55679,7 @@ async function getMobileTableColumns(fields, options){
55654
55679
  tpl = await getFieldTpl(field, options);
55655
55680
  }
55656
55681
  if(!tpl){
55657
- //qhd需求简易处理,加上raw以支持审批王名称字段通过颜色区分缓急,若之后手机端列表支持配置amis,则可以去掉
55658
- tpl = `\${${field.name} | raw}`;
55682
+ tpl = `\${${field.name}}`;
55659
55683
  }
55660
55684
  if(!field.hidden && !field.extra){
55661
55685
  tpls.push({ field, tpl });
@@ -55668,7 +55692,7 @@ async function getMobileTableColumns(fields, options){
55668
55692
 
55669
55693
  let column = {
55670
55694
  name: nameField.name,
55671
- label: nameField.label,
55695
+ label: options.displayAs == 'split' ? '' : nameField.label,
55672
55696
  sortable: nameField.sortable,
55673
55697
  type: "button",
55674
55698
  level: "link",
@@ -59352,9 +59376,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
59352
59376
  */
59353
59377
  if(enable_tree){
59354
59378
  const rows = _.map(payload.data.rows, (item)=>{
59355
- delete item.children;
59356
- delete item.parent;
59357
- return item;
59379
+ if (!item.children) {
59380
+ return { ...item, children: [] };
59381
+ } else {
59382
+ return item;
59383
+ }
59358
59384
  })
59359
59385
  payload.data.rows = rows;
59360
59386
  }