@steedos-widgets/amis-object 1.3.2-beta.3 → 1.3.2-beta.5

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.
@@ -13806,8 +13806,8 @@ async function getRelatedListSchema(
13806
13806
  /*
13807
13807
  * @Author: baozhoutao@steedos.com
13808
13808
  * @Date: 2022-07-05 15:55:39
13809
- * @LastEditors: liaodaxue
13810
- * @LastEditTime: 2023-08-25 11:55:15
13809
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
13810
+ * @LastEditTime: 2023-09-14 11:34:23
13811
13811
  * @Description:
13812
13812
  */
13813
13813
 
@@ -14166,6 +14166,12 @@ async function convertColumnsToTableFields(columns, uiSchema, ctx = {}) {
14166
14166
  if (uiSchema.fields[column]) {
14167
14167
  fields.push(Object.assign({}, uiSchema.fields[column], ctx));
14168
14168
  }
14169
+ else if(ctx.extra){
14170
+ // 配置列表视图extra_columns时允许字段是hidden的,hidden的字段在uiSchema.fields中不存在
14171
+ fields.push({
14172
+ name: column
14173
+ });
14174
+ }
14169
14175
  }
14170
14176
  } else if (_$1.isObject(column)) {
14171
14177
  if (column.field.indexOf('.') > 0) {
@@ -19519,12 +19525,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
19519
19525
  * @Author: baozhoutao@steedos.com
19520
19526
  * @Date: 2023-01-14 16:41:24
19521
19527
  * @LastEditors: baozhoutao@steedos.com
19522
- * @LastEditTime: 2023-09-11 16:48:35
19528
+ * @LastEditTime: 2023-09-14 13:08:43
19523
19529
  * @Description:
19524
19530
  */
19525
19531
  var getSelectFlowSchema = function (id, props) {
19526
19532
  var label = props.label, data = props.data, name = props.name, required = props.required, _a = props.action, action = _a === void 0 ? "query" : _a, _b = props.distributeInstanceId, distributeInstanceId = _b === void 0 ? "" : _b, _c = props.distributeStepId, distributeStepId = _c === void 0 ? "" : _c, _d = props.mode, mode = _d === void 0 ? "input-tree" : _d, className = props.className, onEvent = props.onEvent, _e = props.multiple, multiple = _e === void 0 ? false : _e, delimiter = props.delimiter, joinValues = props.joinValues, extractValue = props.extractValue, searchable = props.searchable, _f = props.showIcon, showIcon = _f === void 0 ? true : _f, _g = props.showRadio, showRadio = _g === void 0 ? false : _g, showOutline = props.showOutline, initiallyOpen = props.initiallyOpen, unfoldedLevel = props.unfoldedLevel, treeContainerClassName = props.treeContainerClassName, _h = props.amis, amis = _h === void 0 ? {} : _h;
19527
19533
  // console.log(`=====onEvent`, onEvent)
19534
+ var allData = props.allData;
19535
+ if (allData != true) {
19536
+ allData = false;
19537
+ }
19528
19538
  return __assign$2({ type: mode, id: id, label: label, name: name, options: [], multiple: multiple, delimiter: delimiter, joinValues: joinValues, extractValue: extractValue, searchable: searchable, showOutline: showOutline, initiallyOpen: initiallyOpen, unfoldedLevel: unfoldedLevel,
19529
19539
  // className: `overflow-y-auto ` + className,
19530
19540
  className: className, required: required, treeContainerClassName: treeContainerClassName, heightAuto: true, menuTpl: mode === 'input-tree' ? {
@@ -19666,7 +19676,7 @@ var getSelectFlowSchema = function (id, props) {
19666
19676
  } : '', source: {
19667
19677
  method: "post",
19668
19678
  url: "${context.rootUrl}/graphql?keywords=${keywords}",
19669
- 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 "),
19679
+ 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, "\", allData: ").concat(allData, "){\n value:_id\n label:name\n children: flows{\n value: _id,\n label: name\n }\n }\n }\n `\n }\n "),
19670
19680
  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 // if(payload.data.options.length === 1 && payload.data.options[0].children.length === 1){\n // payload.data.value = payload.data.options[0].children[0].value\n // }\n return payload;\n ",
19671
19681
  "headers": {
19672
19682
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
@@ -19745,16 +19755,15 @@ var AmisInstanceDetail = function (props) { return __awaiter(void 0, void 0, voi
19745
19755
  }); };
19746
19756
 
19747
19757
  var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
19748
- var formFactor, appId, objectApiName, display, page, listSchema;
19758
+ var formFactor, appId, objectApiName, display, data, _display, page, listSchema;
19749
19759
  return __generator(this, function (_b) {
19750
19760
  switch (_b.label) {
19751
19761
  case 0:
19752
- // console.time('PageListView')
19753
- console.log("PageListView====>", props);
19754
- formFactor = props.formFactor, appId = props.appId, objectApiName = props.objectApiName, props.listviewId, display = props.display, props.$schema, props.listName;
19762
+ formFactor = props.formFactor, appId = props.appId, objectApiName = props.objectApiName, props.listviewId, display = props.display, props.$schema, props.listName, data = props.data;
19763
+ _display = data.display || display;
19755
19764
  //TODO 此代码应该在object page template中处理
19756
- if (display)
19757
- Router$1.setTabDisplayAs(objectApiName, display);
19765
+ if (_display)
19766
+ Router$1.setTabDisplayAs(objectApiName, _display);
19758
19767
  return [4 /*yield*/, getPage({ type: 'list', appId: appId, objectName: objectApiName, formFactor: formFactor })];
19759
19768
  case 1:
19760
19769
  page = _b.sent();
@@ -19803,13 +19812,14 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
19803
19812
  }); };
19804
19813
 
19805
19814
  var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void 0, function () {
19806
- var defaultFormFactor, appId, objectApiName, display, recordSchema, recordPage;
19815
+ var defaultFormFactor, appId, objectApiName, display, data, _display, recordSchema, recordPage;
19807
19816
  return __generator(this, function (_a) {
19808
19817
  switch (_a.label) {
19809
19818
  case 0:
19810
- defaultFormFactor = props.formFactor, appId = props.appId, objectApiName = props.objectApiName, props.recordId, display = props.display;
19811
- if (display) {
19812
- Router$1.setTabDisplayAs(objectApiName, display);
19819
+ defaultFormFactor = props.formFactor, appId = props.appId, objectApiName = props.objectApiName, props.recordId, display = props.display, data = props.data;
19820
+ _display = data.display || display;
19821
+ if (_display) {
19822
+ Router$1.setTabDisplayAs(objectApiName, _display);
19813
19823
  }
19814
19824
  recordSchema = {};
19815
19825
  return [4 /*yield*/, getPage({ type: 'record', appId: appId, objectName: objectApiName, formFactor: defaultFormFactor })];