@steedos-widgets/amis-object 1.2.43 → 1.3.0-beta.10

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.
@@ -3928,7 +3928,7 @@ function getScriptForRemoveUrlPrefixForImgFields(fields){
3928
3928
  if(imgFields[item].multiple){
3929
3929
  if(imgFieldValue instanceof Array){
3930
3930
  formData[item] = imgFieldValue.map((value)=>{
3931
- let itemValue = value?.split('/');
3931
+ let itemValue = value && value.split('/');
3932
3932
  return itemValue[itemValue.length - 1];
3933
3933
  });
3934
3934
  }
@@ -4155,6 +4155,7 @@ var frontend_listview_control_rename_title$1 = "Rename List View";
4155
4155
  var frontend_listview_control_share$1 = "Sharing Settings";
4156
4156
  var frontend_listview_control_sort$1 = "Default sorting rule";
4157
4157
  var frontend_export_excel$1 = "Export Excel";
4158
+ var frontend_export_excel_toast$1 = "Exporting, please wait";
4158
4159
  var frontend_operation$1 = "Operation";
4159
4160
  var frontend_import_data$1 = "Import data";
4160
4161
  var frontend_import_data_object_name$1 = "Import object";
@@ -4239,6 +4240,7 @@ var en_us = {
4239
4240
  frontend_listview_control_share: frontend_listview_control_share$1,
4240
4241
  frontend_listview_control_sort: frontend_listview_control_sort$1,
4241
4242
  frontend_export_excel: frontend_export_excel$1,
4243
+ frontend_export_excel_toast: frontend_export_excel_toast$1,
4242
4244
  frontend_operation: frontend_operation$1,
4243
4245
  frontend_import_data: frontend_import_data$1,
4244
4246
  frontend_import_data_object_name: frontend_import_data_object_name$1,
@@ -4325,6 +4327,7 @@ var frontend_listview_control_rename_title = "重命名 列表视图";
4325
4327
  var frontend_listview_control_share = "共享设置";
4326
4328
  var frontend_listview_control_sort = "默认排序规则";
4327
4329
  var frontend_export_excel = "导出";
4330
+ var frontend_export_excel_toast = "正在导出,请稍后...";
4328
4331
  var frontend_operation = "操作";
4329
4332
  var frontend_import_data = "导入数据";
4330
4333
  var frontend_import_data_object_name = "导入对象";
@@ -4410,6 +4413,7 @@ var zh_cn = {
4410
4413
  frontend_listview_control_share: frontend_listview_control_share,
4411
4414
  frontend_listview_control_sort: frontend_listview_control_sort,
4412
4415
  frontend_export_excel: frontend_export_excel,
4416
+ frontend_export_excel_toast: frontend_export_excel_toast,
4413
4417
  frontend_operation: frontend_operation,
4414
4418
  frontend_import_data: frontend_import_data,
4415
4419
  frontend_import_data_object_name: frontend_import_data_object_name,
@@ -5399,7 +5403,7 @@ const getSchema$2 = (uiSchema) => {
5399
5403
  "Bearer ${context.tenantId},${context.authToken}",
5400
5404
  },
5401
5405
  requestAdaptor:
5402
- "\n const selfData = JSON.parse(JSON.stringify(api.data.$self));\n var filters = [];\n var pageSize = api.data.pageSize || 10;\n var pageNo = api.data.pageNo || 1;\n var skip = (pageNo - 1) * pageSize;\n var orderBy = api.data.orderBy || '';\n var orderDir = api.data.orderDir || '';\n var sort = orderBy + ' ' + orderDir;\n var allowSearchFields = [\"description\"];\n if(api.data.$term){\n filters = [[\"name\", \"contains\", \"'+ api.data.$term +'\"]];\n }else if(selfData.op === 'loadOptions' && selfData.value){\n if(selfData.value?.indexOf(',') > 0){\n filters = [[\"_id\", \"=\", selfData.value.split(',')]];\n }else{\n filters = [[\"_id\", \"=\", selfData.value]];\n }\n }\n if(allowSearchFields){\n allowSearchFields.forEach(function(key){\n const keyValue = selfData[key];\n if(keyValue){\n filters.push([key, \"contains\", keyValue]);\n }\n })\n }\n\n const filtersFunction = function(filters, values){return ['object_name', '=', values.object_name]};\n\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data.$self.__super.__super);\n if(_filters && _filters.length > 0){\n filters.push(_filters);\n }\n }\n\n api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', pageSize).replace('{__skip}', skip).replace('{__sort}', sort.trim());\n return api;\n ",
5406
+ "\n const selfData = JSON.parse(JSON.stringify(api.data.$self));\n var filters = [];\n var pageSize = api.data.pageSize || 10;\n var pageNo = api.data.pageNo || 1;\n var skip = (pageNo - 1) * pageSize;\n var orderBy = api.data.orderBy || '';\n var orderDir = api.data.orderDir || '';\n var sort = orderBy + ' ' + orderDir;\n var allowSearchFields = [\"description\"];\n if(api.data.$term){\n filters = [[\"name\", \"contains\", \"'+ api.data.$term +'\"]];\n }else if(selfData.op === 'loadOptions' && selfData.value){\n if(selfData.value && selfData.value.indexOf(',') > 0){\n filters = [[\"_id\", \"=\", selfData.value.split(',')]];\n }else{\n filters = [[\"_id\", \"=\", selfData.value]];\n }\n }\n if(allowSearchFields){\n allowSearchFields.forEach(function(key){\n const keyValue = selfData[key];\n if(keyValue){\n filters.push([key, \"contains\", keyValue]);\n }\n })\n }\n\n const filtersFunction = function(filters, values){return ['object_name', '=', values.object_name]};\n\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data.$self.__super.__super);\n if(_filters && _filters.length > 0){\n filters.push(_filters);\n }\n }\n\n api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', pageSize).replace('{__skip}', skip).replace('{__sort}', sort.trim());\n return api;\n ",
5403
5407
  adaptor:
5404
5408
  "\n const enable_tree = undefined;\n if(enable_tree){\n const records = payload.data.rows;\n const treeRecords = [];\n const getChildren = (records, childrenIds)=>{\n if(!childrenIds){\n return;\n }\n const children = _.filter(records, (record)=>{\n return _.includes(childrenIds, record._id)\n });\n _.each(children, (item)=>{\n if(item.children){\n item.children = getChildren(records, item.children)\n }\n })\n return children;\n }\n\n _.each(records, (record)=>{\n if(!record.parent){\n treeRecords.push(Object.assign({}, record, {children: getChildren(records, record.children)}));\n }\n });\n payload.data.rows = treeRecords;\n }\n return payload;\n ",
5405
5409
  },
@@ -5578,7 +5582,7 @@ const getSchema$2 = (uiSchema) => {
5578
5582
  * @Author: baozhoutao@steedos.com
5579
5583
  * @Date: 2022-11-07 17:00:38
5580
5584
  * @LastEditors: baozhoutao@steedos.com
5581
- * @LastEditTime: 2022-11-07 17:12:20
5585
+ * @LastEditTime: 2023-08-24 16:44:42
5582
5586
  * @Description:
5583
5587
  */
5584
5588
 
@@ -5598,7 +5602,7 @@ const getSchema$1 = (uiSchema)=>{
5598
5602
  "componentId": "",
5599
5603
  "args": {
5600
5604
  "blank": false,
5601
- "url": "/app/${app_id}/${objectName}/view/${_id}"
5605
+ "url": "/app/${app_id}/${objectName}/view/${_id}?side_object=${objectName}&side_listview_id=${listName}"
5602
5606
  },
5603
5607
  "actionType": "link"
5604
5608
  }
@@ -5615,90 +5619,69 @@ const getSchema$1 = (uiSchema)=>{
5615
5619
  };
5616
5620
 
5617
5621
  const getSchema$6 = async (uiSchema, ctx) => {
5618
- const requestAdaptor = `
5619
- // 获取列表视图的属性
5620
- let uiSchema = api.body.uiSchema;
5621
- let list_views = uiSchema.list_views;
5622
- let list_views_name = api.body.listName;
5623
- let col = list_views[list_views_name].columns;
5624
- let sort_test = list_views[list_views_name].sort;
5625
-
5626
- // 获取下载字段
5627
- let select = [];
5628
- _.each(col, (col) => {
5629
- if (col.field == undefined)
5630
- select.push(col);
5631
- else select.push(col.field);
5632
- });
5633
-
5634
- // 获取排序字段
5635
-
5636
- let sort = [];
5637
- _.forEach(sort_test, (sortField) => {
5638
- if (sortField.field_name == undefined)
5639
- sort.push(sortField);
5640
- else sort.push([sortField.field_name, sortField.order]);
5641
- })
5642
-
5643
- let orders = [];
5644
- _.map(sort, (value) => {
5645
- let order_tmp = [];
5646
- if (value[1] == "desc")
5647
- order_tmp = value[0] + ' desc';
5648
- else
5649
- order_tmp = value[0];
5650
- orders.push(order_tmp);
5651
- });
5652
- let order = orders.join(',');
5653
-
5654
- let filename = uiSchema.label + "-" + list_views[list_views_name].label;
5655
-
5656
- url_tmp = api.url.split('?')[0];
5657
- api.url = url_tmp + "?$select=" + encodeURIComponent(select.toString()) + "&filename=" + encodeURIComponent(filename);
5658
-
5659
- // 判断sort 和 filters
5660
- if (sort.length > 0) {
5661
- api.url += "&$orderby=" + encodeURIComponent(order);
5662
- }
5663
- let filters = list_views[list_views_name].filters;
5664
- if (filters && filters.length > 0) {
5665
- api.url = api.url + "&filters=" + encodeURIComponent(JSON.stringify(filters));
5666
- }
5667
- return api;
5668
- `;
5622
+ const requestAdaptor = function () {
5623
+ let uiSchema = api.body.uiSchema;
5624
+ let list_views_name = api.body.listName;
5625
+ let list_views = uiSchema.list_views;
5626
+ const listViewPropsStoreKey = location.pathname + "/crud/query";
5627
+ const query = JSON.parse(sessionStorage.getItem(listViewPropsStoreKey));
5628
+ const { filters, sort, fields: select } = query;
5629
+ let filename = uiSchema.label + "-" + list_views[list_views_name].label;
5630
+
5631
+ var url_tmp = api.url.split('?')[0];
5632
+ api.url = url_tmp + "?$select=" + encodeURIComponent(select.toString()) + "&filename=" + encodeURIComponent(filename);
5633
+ // 判断sort filters
5634
+ if (sort.length > 0) {
5635
+ api.url += "&$orderby=" + encodeURIComponent(sort);
5636
+ }
5637
+ if (filters && filters.length > 0) {
5638
+ api.url = api.url + "&filters=" + encodeURIComponent(JSON.stringify(filters));
5639
+ }
5640
+ return api;
5641
+ };
5669
5642
  return {
5670
5643
  "type": "service",
5671
- "body": [{
5672
- "type": "button",
5673
- "label": instance.t('frontend_export_excel'),
5674
- "id": "u:standard_export_excel",
5675
- "level": "default",
5676
- "onEvent": {
5677
- "click": {
5678
- "weight": 0,
5679
- "actions": [
5680
- {
5681
- "args": {
5682
- "api": {
5683
- "url": "${context.rootUrl}/api/record/export/${objectName}",
5684
- "method": "get",
5685
- "messages": {},
5686
- "requestAdaptor": requestAdaptor,
5687
- "data": {
5688
- "uiSchema": "${uiSchema}",
5689
- "listName": "${listName}"
5690
- },
5691
- "headers": {
5692
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
5644
+ "body": [
5645
+ {
5646
+ "type": "button",
5647
+ "label": instance.t('frontend_export_excel'),
5648
+ "id": "u:standard_export_excel",
5649
+ "level": "default",
5650
+ "disabledTip": instance.t('frontend_export_excel_toast'),
5651
+ "onEvent": {
5652
+ "click": {
5653
+ "weight": 0,
5654
+ "actions": [{
5655
+ "componentId": "u:standard_export_excel",
5656
+ "actionType": "disabled"
5657
+ },
5658
+ {
5659
+ "args": {
5660
+ "api": {
5661
+ "url": "${context.rootUrl}/api/record/export/${objectName}",
5662
+ "method": "get",
5663
+ "messages": {},
5664
+ "requestAdaptor": requestAdaptor.toString().match(/function[^{]+\{([\s\S]*)\}$/)[1],
5665
+ "data": {
5666
+ "uiSchema": "${uiSchema}",
5667
+ "listName": "${listName}"
5668
+ },
5669
+ "headers": {
5670
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
5671
+ }
5693
5672
  }
5694
- }
5673
+ },
5674
+ "actionType": "download"
5695
5675
  },
5696
- "actionType": "download"
5697
- }
5698
- ]
5676
+ {
5677
+ "componentId": "u:standard_export_excel",
5678
+ "actionType": "enabled"
5679
+ }
5680
+ ]
5681
+ }
5699
5682
  }
5700
5683
  }
5701
- }]
5684
+ ]
5702
5685
  }
5703
5686
  };
5704
5687
 
@@ -6781,7 +6764,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
6781
6764
  const selfData = api.body.$self;
6782
6765
  const uiSchema = selfData.uiSchema;
6783
6766
  const fields = uiSchema.fields;
6784
- const options = (payload.data?.options || []).filter(function(item){
6767
+ const options = ((payload.data && payload.data.options) || []).filter(function(item){
6785
6768
  let field = fields[item.value];
6786
6769
  // TODO: 暂时禁用location类型字段的列表搜索
6787
6770
  return !!field && window.isFieldTypeSearchable(field.type) && field.type !== 'location'
@@ -7184,7 +7167,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
7184
7167
  "actions": [
7185
7168
  {
7186
7169
  "actionType": "custom",
7187
- "script": "Steedos.goBack()"
7170
+ "script": "window.goBack()"
7188
7171
  }
7189
7172
  ]
7190
7173
  }
@@ -8060,10 +8043,10 @@ function apiRequestAdaptor$1(){
8060
8043
  const recordId_tmp = api.body.recordId;
8061
8044
 
8062
8045
  if (typeof formData_tmp.columns == 'string') {
8063
- formData_tmp.columns = formData_tmp.columns?.split(',');
8046
+ formData_tmp.columns = formData_tmp.columns && formData_tmp.columns.split(',');
8064
8047
  }
8065
8048
  if (typeof formData_tmp.mobile_columns == 'string') {
8066
- formData_tmp.mobile_columns = formData_tmp.mobile_columns?.split(',');
8049
+ formData_tmp.mobile_columns = formData_tmp.mobile_columns && formData_tmp.mobile_columns.split(',');
8067
8050
  }
8068
8051
 
8069
8052
  // 数据格式转换
@@ -8196,7 +8179,7 @@ function apiRequestAdaptor(){
8196
8179
  const recordId = api.body.recordId;
8197
8180
  //数据格式转换
8198
8181
  if (typeof formData.sort == 'string') {
8199
- formData.sort = formData.sort?.split(',');
8182
+ formData.sort = formData.sort && formData.sort.split(',');
8200
8183
  }
8201
8184
  formData.sort = lodash.map(formData.sort, (item) => {
8202
8185
  const arr = item.split(':');
@@ -8386,7 +8369,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8386
8369
 
8387
8370
  function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords" } = {}){
8388
8371
  const searchableFieldsLabel = [];
8389
- _.each(fields, function (field) {
8372
+ _.each(mainObject.fields, function (field) {
8390
8373
  if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
8391
8374
  searchableFieldsLabel.push(field.label);
8392
8375
  }
@@ -8578,8 +8561,14 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
8578
8561
 
8579
8562
  function getObjectFooterToolbar(mainObject, formFactor, options) {
8580
8563
  if (formFactor === 'SMALL') {
8564
+ // return [
8565
+ // "load-more",
8566
+ // ]
8581
8567
  return [
8582
- "load-more",
8568
+ {
8569
+ "type": "pagination",
8570
+ "maxButtons": 5
8571
+ }
8583
8572
  ]
8584
8573
  }
8585
8574
  else {
@@ -8978,13 +8967,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
8978
8967
  })){
8979
8968
  i++;
8980
8969
  tableFields.push(field);
8981
- if(isFieldQuickSearchable(field, refObjectConfig.NAME_FIELD_KEY)){
8982
- searchableFields.push(field.name);
8983
- }
8984
8970
  }
8985
8971
  }
8986
8972
  });
8987
8973
 
8974
+ ___default.each(refObjectConfig.fields, function (field) {
8975
+ if(isFieldQuickSearchable(field, refObjectConfig.NAME_FIELD_KEY)){
8976
+ searchableFields.push(field.name);
8977
+ }
8978
+ });
8979
+
8988
8980
  const fields = {
8989
8981
  [referenceTo.labelField.name]: referenceTo.labelField,
8990
8982
  [referenceTo.valueField.name]: referenceTo.valueField
@@ -9036,7 +9028,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
9036
9028
  if(api.data.$term){
9037
9029
  filters = [["name", "contains", "'+ api.data.$term +'"]];
9038
9030
  }else if(selfData.op === 'loadOptions' && selfData.value){
9039
- if(selfData.value?.indexOf(',') > 0){
9031
+ if(selfData.value && selfData.value.indexOf(',') > 0){
9040
9032
  fieldValue = selfData.value.split(',');
9041
9033
  filters = [["${referenceTo.valueField.name}", "=", fieldValue]];
9042
9034
  }else{
@@ -9231,7 +9223,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
9231
9223
  {
9232
9224
  "actionType": "custom",
9233
9225
  "script": `
9234
- const masterRecord = event.data._master?.record;
9226
+ const masterRecord = event.data._master && event.data._master.record;
9235
9227
  const fieldConfig = ${JSON.stringify(field)};
9236
9228
  let reference_to = fieldConfig.reference_to;
9237
9229
  let saveValue;
@@ -9614,7 +9606,7 @@ async function getIdsPickerSchema(field, readonly, ctx){
9614
9606
  var pageNo = api.data.pageNo || 1;
9615
9607
  var skip = (pageNo - 1) * pageSize;
9616
9608
  if(selfData.op === 'loadOptions' && selfData.value){
9617
- if(selfData.value?.indexOf(',') > 0){
9609
+ if(selfData.value && selfData.value.indexOf(',') > 0){
9618
9610
  filters = [["${referenceTo.valueField.name}", "=", selfData.value.split(',')]];
9619
9611
  }else{
9620
9612
  filters = [["${referenceTo.valueField.name}", "=", selfData.value]];
@@ -9817,6 +9809,9 @@ function getAmisStaticFieldType(type, readonly, options){
9817
9809
  return type;
9818
9810
  }
9819
9811
  if(___default.includes(['text','image'], type)){
9812
+ if('text' === type && options && options.amis && options.amis.tpl){
9813
+ return 'static';
9814
+ }
9820
9815
  if('image' === type && options && options.multiple){
9821
9816
  return `static-images`;
9822
9817
  }
@@ -10087,7 +10082,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
10087
10082
  // }
10088
10083
  switch (field.type) {
10089
10084
  case 'text':
10090
- convertData.type = getAmisStaticFieldType('text', readonly);
10085
+ convertData.type = getAmisStaticFieldType('text', readonly, field);
10091
10086
  break;
10092
10087
  case 'textarea':
10093
10088
  convertData.type = getAmisStaticFieldType('textarea', readonly);
@@ -10853,7 +10848,7 @@ async function getQuickEditSchema(field, options){
10853
10848
  case "number":
10854
10849
  case "currency":
10855
10850
  TempDisplayField = `
10856
- _display["${field.name}"] = event.data.value?.toFixed(${field.scale});
10851
+ _display["${field.name}"] = event.data.value && event.data.value.toFixed(${field.scale});
10857
10852
  `;
10858
10853
  quickEditSchema.body[0].onEvent["change"] = quickEditOnEvent(TempDisplayField);
10859
10854
 
@@ -11041,13 +11036,15 @@ async function getTableColumns$1(fields, options){
11041
11036
  }
11042
11037
  },
11043
11038
  "actionType": "download",
11044
- "expression": "!!!window?.nw?.require"//浏览器上直接下载
11039
+ // "expression": "!!!window?.nw?.require"//浏览器上直接下载
11040
+ "expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
11045
11041
  },
11046
11042
  {
11047
11043
  "args": {},
11048
11044
  "actionType": "custom",
11049
11045
  "script": previewFileScript,
11050
- "expression": "!!window?.nw?.require" //PC客户端预览附件
11046
+ // "expression": "!!window?.nw?.require" //PC客户端预览附件
11047
+ "expression": "!!!(window && window.nw && window.nw.require)"//PC客户端预览附件
11051
11048
  }
11052
11049
  ]
11053
11050
  }
@@ -11168,7 +11165,7 @@ async function getTableColumns$1(fields, options){
11168
11165
  */
11169
11166
  function getMobileLines(tpls){
11170
11167
  let lines = [];
11171
- let maxLineCount = 2;
11168
+ let maxLineCount = 3;
11172
11169
  let lineChildren = [];
11173
11170
  let isNewLine = false;
11174
11171
  let isLeft = true;
@@ -11186,10 +11183,10 @@ function getMobileLines(tpls){
11186
11183
  }
11187
11184
  if(isLeft){
11188
11185
  // 左侧半行
11189
- lineChildrenClassName = "steedos-listview-item-left two-lines-truncate";
11186
+ lineChildrenClassName = "steedos-listview-item-left truncate";
11190
11187
  if(item.field.is_wide){
11191
- // 左侧全行样式可以单独写
11192
- lineChildrenClassName = "steedos-listview-item-wide truncate";
11188
+ // 左侧全行样式可以单独写,如果需要配置两行省略号效果,可以加样式类 two-lines-truncate
11189
+ lineChildrenClassName = "steedos-listview-item-wide";
11193
11190
  }
11194
11191
  if(lines.length === 0){
11195
11192
  // 第一个字段加粗黑色显示
@@ -11197,7 +11194,7 @@ function getMobileLines(tpls){
11197
11194
  }
11198
11195
  }
11199
11196
  else {
11200
- // 右侧半行
11197
+ // 右侧半行,这里加样式类 flex flex-shrink-0,是为了省略号只显示在左半行,右半行文字一般比较短,如果也加省略号效果的话,左侧文字多的话,右侧没几个字就显示省略号了
11201
11198
  lineChildrenClassName = "steedos-listview-item-right truncate ml-2 flex flex-shrink-0";
11202
11199
  }
11203
11200
  lineChildren.push({
@@ -11251,7 +11248,8 @@ async function getMobileTableColumns(fields, options){
11251
11248
  tpl = await getFieldTpl(field, options);
11252
11249
  }
11253
11250
  if(!tpl){
11254
- tpl = `\${${field.name}}`;
11251
+ //qhd需求简易处理,加上raw以支持审批王名称字段通过颜色区分缓急,若之后手机端列表支持配置amis,则可以去掉
11252
+ tpl = `\${${field.name} | raw}`;
11255
11253
  }
11256
11254
  if(!field.hidden && !field.extra){
11257
11255
  tpls.push({ field, tpl });
@@ -11442,6 +11440,7 @@ async function getTableOperation(ctx){
11442
11440
 
11443
11441
  async function getTableSchema$1(fields, options){
11444
11442
  let isLookup = options && options.isLookup;
11443
+ let hiddenColumnOperation = options && options.hiddenColumnOperation;
11445
11444
  if(!options){
11446
11445
  options = {};
11447
11446
  }
@@ -11451,10 +11450,11 @@ async function getTableSchema$1(fields, options){
11451
11450
  }
11452
11451
  else {
11453
11452
  columns = await getTableColumns$1(fields, options);
11454
- if(!isLookup){
11453
+ if(!isLookup && !hiddenColumnOperation){
11455
11454
  columns.push(await getTableOperation(options));
11456
11455
  }
11457
11456
  }
11457
+
11458
11458
  return {
11459
11459
  mode: "table",
11460
11460
  name: "thelist",
@@ -11502,7 +11502,7 @@ async function getTableApi(mainObject, fields, options){
11502
11502
  baseFilters = filter;
11503
11503
  }
11504
11504
 
11505
- ___default.each(fields, function (field) {
11505
+ ___default.each(mainObject.fields, function (field) {
11506
11506
  if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
11507
11507
  searchableFields.push(field.name);
11508
11508
  }
@@ -11564,7 +11564,9 @@ async function getTableApi(mainObject, fields, options){
11564
11564
  // 如果是第一次加载组件始终让翻页页码从本地存储中取值
11565
11565
  let formFactor = "${options.formFactor}";
11566
11566
  // 移动端不识别本地存储中的翻页页码,否则点击加载更多按钮后无法刷新回第一页
11567
- api.data.pageNo = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
11567
+ // api.data.pageNo = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
11568
+ // 移动端暂时去除加载更多,放开翻页
11569
+ api.data.pageNo = localListViewProps.page || 1;
11568
11570
  }
11569
11571
  }
11570
11572
  }
@@ -11685,7 +11687,17 @@ async function getTableApi(mainObject, fields, options){
11685
11687
  api.data = {
11686
11688
  query: api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', pageSize).replace('{__skip}', skip).replace('{__sort}', sort.trim())
11687
11689
  }
11688
- ${options.requestAdaptor || ''}
11690
+ ${options.requestAdaptor || ''};
11691
+
11692
+ //写入本次存储filters、sort
11693
+ const listViewPropsStoreKey = location.pathname + "/crud/query";
11694
+ sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
11695
+ filters: filters,
11696
+ sort: sort.trim(),
11697
+ pageSize: pageSize,
11698
+ skip: skip,
11699
+ fields: ${JSON.stringify(___default.map(fields, 'name'))}
11700
+ }));
11689
11701
  return api;
11690
11702
  `;
11691
11703
  api.adaptor = `
@@ -11764,7 +11776,8 @@ async function getTableApi(mainObject, fields, options){
11764
11776
  // 如果是第一次加载组件始终让翻页页码从本地存储中取值
11765
11777
  let formFactor = "${options.formFactor}";
11766
11778
  // 移动端不识别本地存储中的翻页页码,否则点击加载更多按钮后无法刷新回第一页
11767
- selfData.page = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
11779
+ // selfData.page = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
11780
+ selfData.page = localListViewProps.page || 1;
11768
11781
  }
11769
11782
  }
11770
11783
  delete selfData.context;
@@ -11782,7 +11795,13 @@ async function getTableApi(mainObject, fields, options){
11782
11795
  const setDataToComponentId = "${setDataToComponentId}";
11783
11796
  if(setDataToComponentId){
11784
11797
  //https://github.com/baidu/amis/pull/6807 .parent的改动是为适应3.2getComponentById的规则改动,不影响2.9
11785
- SteedosUI.getRef(api.body.$self.$scopeId)?.parent?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})
11798
+ var scope = SteedosUI.getRef(api.body.$self.$scopeId);
11799
+ var scopeParent = scope && scope.parent;
11800
+ var setDataToComponent = scopeParent && scopeParent.getComponentById(setDataToComponentId);
11801
+ if(setDataToComponent){
11802
+ setDataToComponent.setData({$count: payload.data.count});
11803
+ }
11804
+ // SteedosUI.getRef(api.body.$self.$scopeId)?.parent?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})
11786
11805
  };
11787
11806
  ${options.adaptor || ''}
11788
11807
  return payload;
@@ -12068,7 +12087,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
12068
12087
  var uiSchema = api.body.uiSchema;
12069
12088
  var defaultData = api.body.defaultData;
12070
12089
  var defaultValues = {};
12071
- _.each(uiSchema?.fields, function(field){
12090
+ _.each(uiSchema && uiSchema.fields, function(field){
12072
12091
  var value = SteedosUI.getFieldDefaultValue(field, api.body.global);
12073
12092
  if(value){
12074
12093
  defaultValues[field.name] = value;
@@ -12287,7 +12306,12 @@ async function getCalendarApi(mainObject, fields, options) {
12287
12306
  window.postMessage(Object.assign({type: "listview.loaded"}), "*");
12288
12307
  const setDataToComponentId = "${setDataToComponentId}";
12289
12308
  if(setDataToComponentId){
12290
- SteedosUI.getRef(api.body.$self.scopeId)?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})
12309
+ var scope = SteedosUI.getRef(api.body.$self.scopeId);
12310
+ var setDataToComponent = scope && scope.getComponentById(setDataToComponentId);
12311
+ if(setDataToComponent){
12312
+ setDataToComponent.setData({$count: payload.data.count});
12313
+ }
12314
+ // SteedosUI.getRef(api.body.$self.scopeId)?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})
12291
12315
  }
12292
12316
  const rows = payload.data.rows || [];
12293
12317
  const selfData = api.data.$self;
@@ -13034,6 +13058,10 @@ async function getObjectCRUD(objectSchema, fields, options){
13034
13058
  }
13035
13059
  }
13036
13060
  `;
13061
+ let autoFillHeight = true;
13062
+ if(options.isRelated || Steedos.isMobile()){
13063
+ autoFillHeight = false;
13064
+ }
13037
13065
 
13038
13066
  body = Object.assign({}, table, {
13039
13067
  type: 'crud',
@@ -13044,7 +13072,7 @@ async function getObjectCRUD(objectSchema, fields, options){
13044
13072
  keepItemSelectionOnPageChange: true,
13045
13073
  api: await getTableApi(objectSchema, fields, options),
13046
13074
  hiddenOn: options.tableHiddenOn,
13047
- autoFillHeight: options.isRelated ? false : true,
13075
+ autoFillHeight,
13048
13076
  className: `flex-auto ${crudClassName || ""}`,
13049
13077
  bodyClassName: "bg-white",
13050
13078
  crudClassName: crudClassName,
@@ -13287,7 +13315,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
13287
13315
  // "blank": false
13288
13316
  // },
13289
13317
  "actionType": "custom",
13290
- "script": "Steedos.goBack()",
13318
+ "script": "window.goBack()",
13291
13319
  "expression": "this.__deletedRecord === true"
13292
13320
  }
13293
13321
  ]
@@ -13750,8 +13778,8 @@ async function getRelatedListSchema(
13750
13778
  /*
13751
13779
  * @Author: baozhoutao@steedos.com
13752
13780
  * @Date: 2022-07-05 15:55:39
13753
- * @LastEditors: baozhoutao@steedos.com
13754
- * @LastEditTime: 2023-08-17 18:03:51
13781
+ * @LastEditors: liaodaxue
13782
+ * @LastEditTime: 2023-08-25 11:55:15
13755
13783
  * @Description:
13756
13784
  */
13757
13785
 
@@ -14016,7 +14044,7 @@ async function getListSchema(
14016
14044
  * 本次存储代码段
14017
14045
  */
14018
14046
  try {
14019
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listViewName || "");
14047
+ const listViewPropsStoreKey = location.pathname + "/crud";
14020
14048
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
14021
14049
  /**
14022
14050
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。
@@ -14038,11 +14066,12 @@ async function getListSchema(
14038
14066
  if(localListViewProps.orderDir){
14039
14067
  listSchema.orderDir = localListViewProps.orderDir;
14040
14068
  }
14041
- // if(localListViewProps.perPage){
14042
- // listSchema.defaultParams = {
14043
- // perPage: localListViewProps.perPage
14044
- // }
14045
- // }
14069
+
14070
+ if(localListViewProps.perPage){
14071
+ listSchema.defaultParams = {
14072
+ perPage: localListViewProps.perPage
14073
+ };
14074
+ }
14046
14075
  defaults.listSchema = defaultsDeep$1({}, listSchema, defaults.listSchema || {});
14047
14076
  }
14048
14077
  }
@@ -15395,7 +15424,7 @@ const getNextStepUsersInput = async (instance) => {
15395
15424
  id: "u:ffff15b76c89",
15396
15425
  className: "b-a b-1x p-xs m-b-none m-l-none m-r-none m-t-sm",
15397
15426
  subFormMode: "",
15398
- hiddenOn: "!!!this.new_next_step || this.new_next_step?.step_type === 'end'"
15427
+ hiddenOn: "!!!this.new_next_step || (this.new_next_step && this.new_next_step.step_type === 'end')"
15399
15428
  };
15400
15429
  };
15401
15430
 
@@ -16315,7 +16344,7 @@ const getFieldReadonlyTpl = async (field, label)=>{
16315
16344
  map[item.value] = item.label;
16316
16345
  });
16317
16346
  tpl.type = 'static';
16318
- tpl.tpl = `<% var options = ${JSON.stringify(map)}; return options?.[data.${field.code}] || ''%>`;
16347
+ tpl.tpl = `<% var options = ${JSON.stringify(map)}; return (options && options[data.${field.code}]) || ''%>`;
16319
16348
  }else if(field.type === 'odata'){
16320
16349
  tpl.type = 'static';
16321
16350
  tpl.tpl = `<div>\${${field.code}['@label']}</div>`;
@@ -16345,7 +16374,7 @@ const getFieldReadonlyTpl = async (field, label)=>{
16345
16374
  if(field.is_multiselect){
16346
16375
  tpl.tpl = `\${_.map(${field.code}, 'name')}`;
16347
16376
  }else {
16348
- tpl.tpl = `\${${field.code}?.name}`;
16377
+ tpl.tpl = `\${${field.code} && ${field.code}.name}`;
16349
16378
  }
16350
16379
  }else if(field.type === 'group'){
16351
16380
  tpl.type = 'static';
@@ -17781,12 +17810,12 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
17781
17810
  }); };
17782
17811
 
17783
17812
  var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
17784
- var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, crudClassName, _d, showDisplayAs, sideSchema, _f, filterVisible, headerToolbarItems, rowClassNameExpr, headerSchema, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, uiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, listViewSchemaProps, serviceData;
17785
- var _g;
17786
- return __generator(this, function (_h) {
17787
- switch (_h.label) {
17813
+ var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, crudClassName, _d, showDisplayAs, sideSchema, _f, filterVisible, headerToolbarItems, rowClassNameExpr, _g, hiddenColumnOperation, headerSchema, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, uiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, listViewSchemaProps, serviceData;
17814
+ var _h;
17815
+ return __generator(this, function (_j) {
17816
+ switch (_j.label) {
17788
17817
  case 0:
17789
- $schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.crud, crud = _b === void 0 ? {} : _b, _c = props.className, className = _c === void 0 ? "" : _c, crudClassName = props.crudClassName, _d = props.showDisplayAs, showDisplayAs = _d === void 0 ? false : _d, sideSchema = props.sideSchema, props.columnsTogglable, _f = props.filterVisible, filterVisible = _f === void 0 ? true : _f, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr;
17818
+ $schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.crud, crud = _b === void 0 ? {} : _b, _c = props.className, className = _c === void 0 ? "" : _c, crudClassName = props.crudClassName, _d = props.showDisplayAs, showDisplayAs = _d === void 0 ? false : _d, sideSchema = props.sideSchema, props.columnsTogglable, _f = props.filterVisible, filterVisible = _f === void 0 ? true : _f, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr, _g = props.hiddenColumnOperation, hiddenColumnOperation = _g === void 0 ? false : _g;
17790
17819
  headerSchema = props.headerSchema;
17791
17820
  ctx = props.ctx;
17792
17821
  listName = (defaultData === null || defaultData === void 0 ? void 0 : defaultData.listName) || (data === null || data === void 0 ? void 0 : data.listName) || (props === null || props === void 0 ? void 0 : props.listName);
@@ -17815,7 +17844,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
17815
17844
  }
17816
17845
  return [4 /*yield*/, getUISchema(objectApiName, false)];
17817
17846
  case 1:
17818
- uiSchema = _h.sent();
17847
+ uiSchema = _j.sent();
17819
17848
  listView = find(uiSchema.list_views, function (listView, name) {
17820
17849
  // 传入listViewName空值则取第一个
17821
17850
  if (!listName) {
@@ -17866,7 +17895,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
17866
17895
  }
17867
17896
  amisSchemaData = Object.assign({}, data, defaultData);
17868
17897
  listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
17869
- listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr });
17898
+ listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr, hiddenColumnOperation: hiddenColumnOperation });
17870
17899
  if (!headerSchema) {
17871
17900
  headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
17872
17901
  }
@@ -17880,7 +17909,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
17880
17909
  if (!has(data, 'uiSchema')) {
17881
17910
  serviceData.uiSchema = uiSchema;
17882
17911
  }
17883
- serviceData.defaultListName = listName ? listName : (_g = first(values(uiSchema.list_views))) === null || _g === void 0 ? void 0 : _g.name;
17912
+ serviceData.defaultListName = listName ? listName : (_h = first(values(uiSchema.list_views))) === null || _h === void 0 ? void 0 : _h.name;
17884
17913
  // console.timeEnd('AmisObjectListView')
17885
17914
  // console.log('serviceData===>', serviceData)
17886
17915
  // console.log('headerSchema===>', headerSchema)
@@ -18326,6 +18355,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
18326
18355
  if (isMobile) {
18327
18356
  dialogSchema = {
18328
18357
  "type": "service",
18358
+ "className": "steedos-apps-service",
18329
18359
  "affixFooter": false,
18330
18360
  "body": [
18331
18361
  {
@@ -18562,7 +18592,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
18562
18592
  ],
18563
18593
  }
18564
18594
  ],
18565
- "className": "",
18595
+ "className": "steedos-apps-service",
18566
18596
  "visibleOn": "",
18567
18597
  "clearValueOnHidden": false,
18568
18598
  "visible": true,
@@ -18696,7 +18726,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
18696
18726
  schemaApi: {
18697
18727
  "method": "get",
18698
18728
  "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
18699
- "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
18729
+ "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
18700
18730
  "headers": {
18701
18731
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
18702
18732
  }
@@ -19211,7 +19241,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
19211
19241
  "actions": [
19212
19242
  {
19213
19243
  "actionType": "custom",
19214
- "script": "Steedos.goBack()"
19244
+ "script": "window.goBack()"
19215
19245
  }
19216
19246
  ]
19217
19247
  }
@@ -19606,7 +19636,7 @@ var getSelectFlowSchema = function (id, props) {
19606
19636
  method: "post",
19607
19637
  url: "${context.rootUrl}/graphql?keywords=${keywords}",
19608
19638
  requestAdaptor: "\n const keywords = api.body.keywords || '';\n const appId = '".concat(data.app_id || "", "';\n api.data = {\n query: `\n {\n options: flows__getList(action: \"").concat(action, "\", keywords: \"${keywords}\", appId: \"${appId}\", distributeInstanceId: \"").concat(distributeInstanceId, "\", distributeStepId: \"").concat(distributeStepId, "\"){\n value:_id\n label:name\n children: flows{\n value: _id,\n label: name\n }\n }\n }\n `\n }\n "),
19609
- adaptor: "\n payload.data.options?.forEach(function(item,index) {\n if(item.value != 'startFlows' && (!item.children || item.children.length == 0)){\n payload.data.options.splice(index,1)\n }\n })\n return payload;\n ",
19639
+ adaptor: "\n var options = payload.data.options;\n if(options){\n options.forEach(function(item,index) {\n if(item.value != 'startFlows' && (!item.children || item.children.length == 0)){\n payload.data.options.splice(index,1)\n }\n })\n }\n return payload;\n ",
19610
19640
  "headers": {
19611
19641
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
19612
19642
  }