@steedos-widgets/amis-lib 1.3.22-beta.3 → 3.6.0-beta.3

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
@@ -1798,7 +1798,7 @@ async function getQuickEditSchema(field, options){
1798
1798
  "actions":[
1799
1799
  {
1800
1800
  "actionType": "setValue",
1801
- "componentId": `service_listview_${options.objectName}`,
1801
+ "componentId": quickEditId,
1802
1802
  "args": {
1803
1803
  "value":{
1804
1804
  "quickedit_record_permissions_loading": true
@@ -1823,7 +1823,7 @@ async function getQuickEditSchema(field, options){
1823
1823
  },
1824
1824
  {
1825
1825
  "actionType": "setValue",
1826
- "componentId": `service_listview_${options.objectName}`,
1826
+ "componentId": quickEditId,
1827
1827
  "args": {
1828
1828
  "value":{
1829
1829
  "quickedit_record_permissions_loading": false
@@ -1832,7 +1832,7 @@ async function getQuickEditSchema(field, options){
1832
1832
  },
1833
1833
  {
1834
1834
  "actionType": "setValue",
1835
- "componentId": `service_listview_${options.objectName}`,
1835
+ "componentId": quickEditId,
1836
1836
  "args": {
1837
1837
  "value":{
1838
1838
  "quickedit_record_permissions": "${event.data}"
@@ -2011,8 +2011,6 @@ function getFieldWidth(width){
2011
2011
  async function getTableColumns(fields, options){
2012
2012
  const columns = [];
2013
2013
  if(!options.isLookup && !options.isInputTable){
2014
- //将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
2015
- columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
2016
2014
  if(!options.enable_tree){
2017
2015
  columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
2018
2016
  }
@@ -2557,6 +2555,7 @@ async function getTableSchema$1(fields, options){
2557
2555
  if(!isLookup && !hiddenColumnOperation){
2558
2556
  columns.push(await getTableOperation(options));
2559
2557
  }
2558
+
2560
2559
  }
2561
2560
 
2562
2561
  return {
@@ -3665,6 +3664,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
3665
3664
  "dialog": {
3666
3665
  "type": "dialog",
3667
3666
  "title": title,
3667
+ data,
3668
3668
  "body": [
3669
3669
  {
3670
3670
  "type": "steedos-object-form",
@@ -8337,6 +8337,11 @@ async function getObjectCRUD(objectSchema, fields, options){
8337
8337
  crudModeClassName = `steedos-crud-mode-${body.mode}`;
8338
8338
  }
8339
8339
 
8340
+ if(body.columns && options.formFactor != 'SMALL'){
8341
+ //将_display放入crud的columns的倒数第二列中(最后一列会影响固定列),可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
8342
+ body.columns.splice(body.columns.length - 1, 0, {name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
8343
+ }
8344
+
8340
8345
  if (defaults) {
8341
8346
  const headerSchema = defaults.headerSchema;
8342
8347
  const footerSchema = defaults.footerSchema;
@@ -8361,6 +8366,7 @@ async function getObjectCRUD(objectSchema, fields, options){
8361
8366
  body = wrappedBody;
8362
8367
  }
8363
8368
  }
8369
+
8364
8370
  // console.timeEnd('getObjectCRUD');
8365
8371
  // TODO: data应该只留loaded,其他属性都改为从上层传递下来
8366
8372
  return {
@@ -10563,6 +10569,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
10563
10569
  */
10564
10570
  return payload;
10565
10571
  }
10572
+ if(!payload.data.rows){
10573
+ payload.data.rows = [];
10574
+ }
10566
10575
  if(enable_tree){
10567
10576
  const records = payload.data.rows;
10568
10577
  const treeRecords = [];
@@ -12432,7 +12441,7 @@ async function getFormBody(permissionFields, formFields, ctx){
12432
12441
  * @Author: 殷亮辉 yinlianghui@hotoa.com
12433
12442
  * @Date: 2023-11-15 09:50:22
12434
12443
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
12435
- * @LastEditTime: 2023-12-25 13:13:56
12444
+ * @LastEditTime: 2023-12-27 13:50:26
12436
12445
  */
12437
12446
 
12438
12447
  /**
@@ -12460,20 +12469,22 @@ function getInputTableCell(field, showAsInlineEditMode) {
12460
12469
  name: field.name,
12461
12470
  quickEdit: {
12462
12471
  "type": "steedos-field",
12463
- "config": field,
12464
- hideLabel: true
12472
+ "config": Object.assign({}, field, {
12473
+ label: false
12474
+ })
12465
12475
  }
12466
12476
  }
12467
12477
  }
12468
12478
  else {
12469
12479
  return {
12470
12480
  "type": "steedos-field",
12471
- "config": field,
12481
+ "config": Object.assign({}, field, {
12482
+ label: false
12483
+ }),
12472
12484
  "static": true,
12473
12485
  "readonly": true,
12474
12486
  label: field.label,
12475
- name: field.name,
12476
- hideLabel: true
12487
+ name: field.name
12477
12488
  }
12478
12489
  }
12479
12490
  }
@@ -12719,7 +12730,9 @@ function getFormPaginationWrapper(props, form, mode) {
12719
12730
  let __wrapperServiceId = "${tableServiceId}";
12720
12731
  let wrapperService = scope.getComponentById(__wrapperServiceId);
12721
12732
  let wrapperServiceData = wrapperService.getData();
12722
- let lastestFieldValue = wrapperServiceData["${props.name}"] || [];//这里不可以用event.data["${props.name}"]因为amis input talbe有一层单独的作用域,其值会延迟一拍
12733
+ // 这里不可以用event.data["${props.name}"]因为amis input talbe有一层单独的作用域,其值会延迟一拍
12734
+ // 这里如果不.clone的话,在弹出窗口中显示的子表组件,添加行后点窗口的取消按钮关闭窗口后无法把之前的操作还原,即把之前添加的行自动移除
12735
+ let lastestFieldValue = _.clone(wrapperServiceData["${props.name}"] || []);
12723
12736
  //不可以直接像event.data.__tableItems = lastestFieldValue; 这样整个赋值,否则作用域会断
12724
12737
  let mode = "${mode}";
12725
12738
  if(mode === "new"){
@@ -13311,7 +13324,7 @@ const getAmisInputTableSchema = async (props) => {
13311
13324
  "name": "__op__",
13312
13325
  "type": "operation",
13313
13326
  "buttons": buttonsForColumnOperations,
13314
- "width": buttonsForColumnOperations.length > 1 ? "46px" : "20px"
13327
+ "width": buttonsForColumnOperations.length > 1 ? "60px" : "20px"
13315
13328
  });
13316
13329
  }
13317
13330
  if (showAsInlineEditMode) {