@steedos-widgets/amis-object 1.1.0-beta.1 → 1.1.0

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.
@@ -1260,7 +1260,7 @@ function getRecordPermissionsQuery(object, recordId, options){
1260
1260
  function getApi$2 (isMobile){
1261
1261
  if(isMobile);else {
1262
1262
  // return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
1263
- return `\${context.rootUrl}/graphql`
1263
+ return `\${context.rootUrl}/graphql?reload=\${additionalFilters}`
1264
1264
  }
1265
1265
  }
1266
1266
 
@@ -1407,6 +1407,7 @@ async function getSource$1(field, ctx) {
1407
1407
  }
1408
1408
  data.$value = `$${valueField}`;
1409
1409
  // data["&"] = "$$";
1410
+
1410
1411
  const requestAdaptor = `
1411
1412
  var filters = [['parent', '=', null]];
1412
1413
  api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters));
@@ -1519,7 +1520,7 @@ async function getDeferApi$1(field, ctx) {
1519
1520
  `;
1520
1521
  return {
1521
1522
  "method": "post",
1522
- "url": getApi$2() + "?ref=${ref}&dep=${value}",
1523
+ "url": getApi$2() + "&ref=${ref}&dep=${value}",
1523
1524
  "requestAdaptor": requestAdaptor,
1524
1525
  "adaptor": adaptor,
1525
1526
  "data": data,
@@ -1628,6 +1629,11 @@ async function getSelectUserSchema(field, readonly, ctx) {
1628
1629
  if (typeof amisSchema.searchable !== "boolean") {
1629
1630
  amisSchema.searchable = true;
1630
1631
  }
1632
+
1633
+ if(ctx.value){
1634
+ amisSchema.value = ctx.value;
1635
+ }
1636
+
1631
1637
  const onEvent = field.onEvent;
1632
1638
  if (onEvent) {
1633
1639
  amisSchema.onEvent = onEvent;
@@ -4027,7 +4033,7 @@ async function getDeferApi(field, ctx) {
4027
4033
  `;
4028
4034
  return {
4029
4035
  "method": "post",
4030
- "url": getApi$2() + "?dep=${value}",
4036
+ "url": getApi$2() + "&dep=${value}",
4031
4037
  "requestAdaptor": requestAdaptor,
4032
4038
  "adaptor": adaptor,
4033
4039
  "data": data,
@@ -4536,6 +4542,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
4536
4542
  type: getAmisStaticFieldType('select', readonly),
4537
4543
  joinValues: false,
4538
4544
  extractValue: true,
4545
+ clearable: true,
4539
4546
  // labelField: labelField,
4540
4547
  // valueField: valueField,
4541
4548
  source: apiInfo,
@@ -4597,21 +4604,20 @@ async function lookupToAmis(field, readonly, ctx){
4597
4604
  // return await lookupToAmisGroup(field, readonly, ctx);
4598
4605
  }
4599
4606
 
4600
- if(ctx.ids || ctx.idsTrackOn){
4601
- return await lookupToAmisIdsPicker(field, readonly, ctx);
4602
- }
4603
-
4604
4607
  let referenceTo = await getReferenceTo(field);
4605
4608
  if(!referenceTo){
4606
4609
  return await lookupToAmisSelect(field, readonly, ctx);
4607
4610
  }
4608
4611
 
4609
- const refObject = await getUISchema(referenceTo.objectName);
4610
-
4611
4612
  if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
4613
+ if(ctx.idsDependOn || field.amis){
4614
+ return await lookupToAmisIdsPicker(field, readonly, ctx);
4615
+ }
4612
4616
  return await lookupToAmisSelectUser(field, readonly, ctx);
4613
4617
  }
4614
4618
 
4619
+ const refObject = await getUISchema(referenceTo.objectName);
4620
+
4615
4621
  // 此处不参考 steedos 的 enable_enhanced_lookup 规则. 如果默认是开启弹出选择,用户选择过程操作太繁琐, 所以默认是关闭弹出选择.
4616
4622
  // 由于amis picker 目前不支持联动, 配置了depend_on时, 使用使用select ,以支持联动
4617
4623
  // TODO: 确认 amis picker 支持联动时, 清理field.depend_on判断
@@ -4646,7 +4652,7 @@ async function getIdsPickerSchema(field, readonly, ctx){
4646
4652
  }
4647
4653
  const refObjectConfig = await getUISchema(referenceTo.objectName);
4648
4654
 
4649
- const { ids, idsTrackOn } = ctx;
4655
+ const { idsDependOn } = ctx;
4650
4656
 
4651
4657
  const fields = {
4652
4658
  [referenceTo.labelField.name]: referenceTo.labelField,
@@ -4660,14 +4666,9 @@ async function getIdsPickerSchema(field, readonly, ctx){
4660
4666
  source.data.$term = "$term";
4661
4667
  source.data.$self = "$$";
4662
4668
 
4663
- if(ids && ids.length){
4664
- source.sendOn = true;
4665
- }
4666
- else {
4667
- source.sendOn = false;
4668
- }
4669
- if(idsTrackOn){
4670
- source.sendOn = `\${${idsTrackOn} && ${idsTrackOn}.length}`;
4669
+ if(idsDependOn && source.url){
4670
+ source.sendOn = `\${${idsDependOn} && ${idsDependOn}.length}`;
4671
+ source.url = `${source.url}&depend_on_${idsDependOn}=\${${idsDependOn}|join}`;
4671
4672
  }
4672
4673
 
4673
4674
  source.requestAdaptor = `
@@ -4684,10 +4685,10 @@ async function getIdsPickerSchema(field, readonly, ctx){
4684
4685
  }
4685
4686
  }
4686
4687
 
4687
- var ids = ${JSON.stringify(ids)};
4688
- var idsTrackOn = "${idsTrackOn}";
4689
- if(idsTrackOn){
4690
- ids = api.data.$self[idsTrackOn];
4688
+ var ids;
4689
+ var idsDependOn = "${idsDependOn}";
4690
+ if(idsDependOn){
4691
+ ids = api.data.$self[idsDependOn];
4691
4692
  }
4692
4693
  if(ids && ids.length){
4693
4694
  filters.push(["${referenceTo.valueField.name}", "=", ids]);
@@ -4730,6 +4731,14 @@ async function getIdsPickerSchema(field, readonly, ctx){
4730
4731
  data.extractValue = true;
4731
4732
  }
4732
4733
 
4734
+ if(ctx.value){
4735
+ data.value = ctx.value;
4736
+ }
4737
+
4738
+ if(ctx.selectFirst != undefined){
4739
+ data.selectFirst = ctx.selectFirst;
4740
+ }
4741
+
4733
4742
  if(readonly){
4734
4743
  data.tpl = await getLookupTpl(field, ctx);
4735
4744
  }
@@ -5704,15 +5713,17 @@ async function getEditFormInitApi(object, recordId, fields){
5704
5713
  const dataKeys = _.keys(data);
5705
5714
  const uiSchema = api.body.uiSchema;
5706
5715
  const fieldKeys = uiSchema && _.keys(uiSchema.fields);
5707
- _.each(dataKeys, function(key){
5708
- if(fieldKeys.indexOf(key)<0){
5709
- delete data[key];
5710
- }
5711
- })
5712
5716
 
5713
5717
  if(data){
5714
5718
  ${getScriptForAddUrlPrefixForImgFields(fields)}
5715
5719
  ${getScriptForRewriteValueForFileFields(fields)}
5720
+
5721
+ _.each(dataKeys, function(key){
5722
+ if(fieldKeys.indexOf(key)<0){
5723
+ delete data[key];
5724
+ }
5725
+ })
5726
+
5716
5727
  //初始化接口返回的字段移除字段值为null的字段
5717
5728
  for (key in data){
5718
5729
  if(data[key] === null){
@@ -6793,6 +6804,10 @@ async function getTableApi(mainObject, fields, options){
6793
6804
 
6794
6805
  if(!_.isEmpty(systemFilters)){
6795
6806
  filters = systemFilters;
6807
+ };
6808
+
6809
+ if(api.data.$self.additionalFilters){
6810
+ userFilters.push(api.data.$self.additionalFilters)
6796
6811
  }
6797
6812
 
6798
6813
  if(!_.isEmpty(userFilters)){
@@ -7209,7 +7224,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
7209
7224
  initialView = "dayGridMonth";
7210
7225
  break;
7211
7226
  case "agenda":
7212
- initialView = "timeGridDay";
7227
+ initialView = "listWeek";
7213
7228
  break;
7214
7229
  }
7215
7230
  }
@@ -7431,6 +7446,30 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
7431
7446
  }
7432
7447
  ]
7433
7448
  },
7449
+ "eventDidMount": {
7450
+ "weight": 0,
7451
+ "actions": [
7452
+ {
7453
+ "componentId": "",
7454
+ "args": {
7455
+ },
7456
+ "actionType": "custom",
7457
+ "script": "console.log('eventDidMount'); console.log(event);"
7458
+ }
7459
+ ]
7460
+ },
7461
+ "eventWillUnmount": {
7462
+ "weight": 0,
7463
+ "actions": [
7464
+ {
7465
+ "componentId": "",
7466
+ "args": {
7467
+ },
7468
+ "actionType": "custom",
7469
+ "script": "console.log('eventWillUnmount'); console.log(event);"
7470
+ }
7471
+ ]
7472
+ },
7434
7473
  }
7435
7474
  };
7436
7475
  return amisSchema;
@@ -9261,7 +9300,6 @@ const getJudgeInput = async (instance) => {
9261
9300
  "args": {
9262
9301
  "value": {
9263
9302
  new_judge: "${event.data.value}",
9264
- new_next_step: undefined,
9265
9303
  next_step: undefined,
9266
9304
  }
9267
9305
  },
@@ -9313,6 +9351,11 @@ const getNextStepInput = async (instance) => {
9313
9351
  id: "u:next_step",
9314
9352
  multiple: false,
9315
9353
  required: true,
9354
+ // selectFirst: true,
9355
+ autoFill: {
9356
+ "new_next_step": "${step}",
9357
+ "next_users": null
9358
+ },
9316
9359
  "source": {
9317
9360
  "url": "${context.rootUrl}/api/workflow/v2/nextStep?judge=${new_judge}",
9318
9361
  "headers": {
@@ -9324,10 +9367,12 @@ const getNextStepInput = async (instance) => {
9324
9367
  "requestAdaptor": "let { context, judge } = api.data; if(!judge){judge='approved'}\nconst formValues = SteedosUI.getRef(api.data.$scopeId).getComponentById(\"instance_form\").getValues();\n\napi.data = {\nflowVersionId: context.flowVersion._id,\n instanceId: context._id,\n flowId: context.flow._id,\n step: context.step,\n judge: judge,\n values: formValues\n}\n\n\n return api;",
9325
9368
  "adaptor": `
9326
9369
  payload.data = {
9370
+ value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
9327
9371
  options: _.map(payload.nextSteps, (item)=>{
9328
9372
  return {
9329
9373
  label: item.name,
9330
- value: item
9374
+ value: item._id,
9375
+ step: item
9331
9376
  }
9332
9377
  })
9333
9378
  };
@@ -9340,44 +9385,29 @@ const getNextStepInput = async (instance) => {
9340
9385
  "judge": "${new_judge}",
9341
9386
  }
9342
9387
  },
9343
- // "labelField": "name",
9344
- // "valueField": "_id",
9345
- "onEvent": {
9346
- // "change": {
9347
- // "weight": 0,
9348
- // "actions": [
9349
- // {
9350
- // "componentId": "u:next_users",
9351
- // "args": {
9352
- // },
9353
- // "actionType": "reload"
9354
- // }
9355
- // ]
9356
- // },
9357
- "change": {
9358
- "weight": 0,
9359
- "actions": [
9360
- {
9361
- "componentId": "instance_approval",
9362
- "args": {
9363
- "value": {
9364
- new_next_step: "${event.data.value}",
9365
- }
9366
- },
9367
- "actionType": "setValue"
9368
- },
9369
- {
9370
- // "componentId": "u:next_step",
9371
- "args": {
9372
- next_step: "${event.data.value}",
9373
- },
9374
- "actionType": "broadcast",
9375
- eventName: "approve_next_step_change"
9376
- },
9377
- ]
9378
- }
9379
-
9380
- }
9388
+ // "onEvent": {
9389
+ // "change": {
9390
+ // "weight": 0,
9391
+ // "actions": [
9392
+ // {
9393
+ // "componentId": "instance_approval",
9394
+ // "args": {
9395
+ // "value": {
9396
+ // new_next_step: "${event.data.value}",
9397
+ // }
9398
+ // },
9399
+ // "actionType": "setValue"
9400
+ // },
9401
+ // // {
9402
+ // // "args": {
9403
+ // // next_step: "${event.data.value}",
9404
+ // // },
9405
+ // // "actionType": "broadcast",
9406
+ // // eventName: "approve_next_step_change"
9407
+ // // },
9408
+ // ]
9409
+ // }
9410
+ // }
9381
9411
  },
9382
9412
  ],
9383
9413
  id: "u:4d3a884b437c",
@@ -9415,56 +9445,44 @@ const getNextStepUsersInput = async (instance) => {
9415
9445
  body: [
9416
9446
  // TODO 处理下一步处理人默认值
9417
9447
  Object.assign({},
9418
- // await lookupToAmisPicker(
9419
- // {
9420
- // name: "next_users",
9421
- // label: false,
9422
- // reference_to: "space_users",
9423
- // reference_to_field: 'user',
9424
- // multiple: false,
9425
- // },
9426
- // false,
9427
- // {}
9428
- // ),
9429
9448
  {
9430
9449
  "type": "steedos-select-user"
9431
9450
  },
9432
-
9433
9451
  {
9434
9452
  name: "next_users",
9435
- // value: "",
9436
9453
  hiddenOn: "this.new_next_step.deal_type != 'pickupAtRuntime'",
9437
9454
  required: true
9438
9455
  }),
9439
9456
  {
9440
- type: "list-select",
9457
+ type: "steedos-select-user",
9441
9458
  label: "",
9442
9459
  name: "next_users",
9443
- // options: await getNextStepOptions(instance),
9444
9460
  id: "u:next_users",
9445
9461
  required: true,
9446
- multiple: "this.new_next_step.deal_type === 'counterSign'",
9447
- "source": {
9448
- "url": "${context.rootUrl}/api/workflow/v2/nextStepUsers",
9449
- "method": "post",
9450
- "sendOn": "!!this.new_next_step && this.new_next_step.step_type != 'end'",
9451
- "headers": {
9452
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
9453
- },
9454
- "messages": {
9462
+ hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'",
9463
+ amis: {
9464
+ multiple: "this.new_next_step.deal_type === 'counterSign'",
9465
+ "source": {
9466
+ "url": "${context.rootUrl}/api/workflow/v2/nextStepUsers",
9467
+ "method": "post",
9468
+ "sendOn": "!!this.new_next_step && this.new_next_step.step_type != 'end'",
9469
+ "headers": {
9470
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
9471
+ },
9472
+ "messages": {
9473
+ },
9474
+ "requestAdaptor": "\nconst { context, next_step, $scopeId } = api.data;\nconst formValues = SteedosUI.getRef($scopeId).getComponentById(\"instance_form\").getValues();\n\napi.data = {\n instanceId: context._id,\n nextStepId: next_step._id,\n values: formValues\n}\n\n\n return api;",
9475
+ "adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
9476
+ "data": {
9477
+ "&": "$$",
9478
+ "$scopeId": "$scopeId",
9479
+ "context": "${context}",
9480
+ "next_step": "${new_next_step}",
9481
+ }
9455
9482
  },
9456
- "requestAdaptor": "console.log('======requestAdaptor====');\nconst { context, next_step, $scopeId } = api.data;\nconst formValues = SteedosUI.getRef($scopeId).getComponentById(\"instance_form\").getValues();\n\napi.data = {\n instanceId: context._id,\n nextStepId: next_step._id,\n values: formValues\n}\n\n\n return api;",
9457
- "adaptor": "\npayload.data = payload.nextStepUsers;\nreturn payload;",
9458
- "data": {
9459
- "&": "$$",
9460
- "$scopeId": "$scopeId",
9461
- "context": "${context}",
9462
- "next_step": "${new_next_step}",
9463
- }
9464
- },
9465
- "labelField": "name",
9466
- "valueField": "id",
9467
- hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'"
9483
+ "labelField": "name",
9484
+ "valueField": "id",
9485
+ }
9468
9486
  }
9469
9487
  ],
9470
9488
  id: "u:81a4913c61cc",
@@ -9651,6 +9669,9 @@ const getApprovalDrawerSchema = async (instance) => {
9651
9669
  size: "sm",
9652
9670
  title: `${instance.step.name}`,
9653
9671
  className: "approval-drawer absolute",
9672
+ headerClassName: 'p-2',
9673
+ bodyClassName: 'p-2',
9674
+ footerClassName: 'p-2 pt-0',
9654
9675
  drawerContainer: ()=>{
9655
9676
  return window.$(".antd-Page-content",window.$(".steedos-instance-wrapper"))[0];
9656
9677
  },
@@ -9663,6 +9684,10 @@ const getApprovalDrawerSchema = async (instance) => {
9663
9684
  clearPersistDataAfterSubmit: true,
9664
9685
  persistData: `workflow_approve_form_${instance.approve._id}`,
9665
9686
  body: [
9687
+ {
9688
+ type: 'hidden',
9689
+ name: 'new_next_step'
9690
+ },
9666
9691
  await getJudgeInput(instance),
9667
9692
  {
9668
9693
  type: "textarea",
@@ -9693,7 +9718,7 @@ const getApprovalDrawerSchema = async (instance) => {
9693
9718
  // {
9694
9719
  // "actionType": "reload",
9695
9720
  // "componentId": "u:nex_users",
9696
- // "args": {t
9721
+ // "args": {
9697
9722
  // }
9698
9723
  // }
9699
9724
  // ]
@@ -10004,7 +10029,7 @@ const getInstanceApprovalHistory = async ()=>{
10004
10029
  * @Author: baozhoutao@steedos.com
10005
10030
  * @Date: 2022-09-07 16:20:45
10006
10031
  * @LastEditors: baozhoutao@steedos.com
10007
- * @LastEditTime: 2023-03-18 17:29:01
10032
+ * @LastEditTime: 2023-03-23 16:49:44
10008
10033
  * @Description:
10009
10034
  */
10010
10035
 
@@ -10568,7 +10593,6 @@ const getFormTableView = async (instance) => {
10568
10593
  trs: await getFormTrs(instance),
10569
10594
  id: "u:047f3669468b",
10570
10595
  };
10571
- console.log(`getFormTableView formSchema=====>`, formSchema);
10572
10596
  return formSchema;
10573
10597
  };
10574
10598
 
@@ -10717,6 +10741,7 @@ const getFlowFormSchema = async (instance, box) => {
10717
10741
  type: "page",
10718
10742
  name: "instancePage",
10719
10743
  className: "steedos-amis-instance-view",
10744
+ bodyClassName: "overflow-y-auto h-full",
10720
10745
  "title": {
10721
10746
  "type": "steedos-record-detail-header",
10722
10747
  "label": "标题面板",
@@ -12086,15 +12111,15 @@ var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0,
12086
12111
  * @Author: baozhoutao@steedos.com
12087
12112
  * @Date: 2022-12-08 10:32:17
12088
12113
  * @LastEditors: baozhoutao@steedos.com
12089
- * @LastEditTime: 2023-03-07 12:40:53
12114
+ * @LastEditTime: 2023-03-22 15:41:38
12090
12115
  * @Description:
12091
12116
  */
12092
12117
  var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void 0, function () {
12093
- var appId, _a, objectApiName, recordId, onEvent, schema, recordDetailData;
12118
+ var className, appId, _a, objectApiName, recordId, onEvent, schema, recordDetailData;
12094
12119
  return __generator(this, function (_b) {
12095
12120
  switch (_b.label) {
12096
12121
  case 0:
12097
- props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, recordId = props.recordId, onEvent = props.onEvent, props.defaultData;
12122
+ className = props.className, props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, recordId = props.recordId, onEvent = props.onEvent, props.defaultData;
12098
12123
  return [4 /*yield*/, getRecordDetailSchema(objectApiName, appId, { onEvent: onEvent })];
12099
12124
  case 1:
12100
12125
  schema = (_b.sent()).amisSchema;
@@ -12103,6 +12128,7 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
12103
12128
  recordDetailData.recordId = recordId;
12104
12129
  }
12105
12130
  schema.data = Object.assign({}, schema.data, recordDetailData);
12131
+ schema.className = className;
12106
12132
  return [2 /*return*/, schema];
12107
12133
  }
12108
12134
  });
@@ -12189,12 +12215,11 @@ var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, v
12189
12215
  }); };
12190
12216
 
12191
12217
  var AmisSelectUser = function (props) { return __awaiter(void 0, void 0, void 0, function () {
12192
- var $schema, ids, idsTrackOn, _a, readonly, _b, ctx, amisSchema, steedosField, error_1;
12218
+ var $schema, idsDependOn, _a, readonly, amis, _b, ctx, amisSchema, steedosField, options, error_1;
12193
12219
  return __generator(this, function (_c) {
12194
12220
  switch (_c.label) {
12195
12221
  case 0:
12196
- console.log("AmisSelectUser props", props);
12197
- $schema = props.$schema, props.data, ids = props.ids, idsTrackOn = props.idsTrackOn, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b;
12222
+ $schema = props.$schema, props.data, idsDependOn = props.idsDependOn, _a = props.readonly, readonly = _a === void 0 ? false : _a, amis = props.amis, _b = props.ctx, ctx = _b === void 0 ? {} : _b;
12198
12223
  _c.label = 1;
12199
12224
  case 1:
12200
12225
  _c.trys.push([1, 3, , 4]);
@@ -12202,13 +12227,15 @@ var AmisSelectUser = function (props) { return __awaiter(void 0, void 0, void 0,
12202
12227
  type: "lookup",
12203
12228
  reference_to: "users",
12204
12229
  name: $schema.name,
12230
+ label: $schema.label,
12205
12231
  multiple: $schema.multiple,
12206
12232
  required: $schema.required,
12207
12233
  searchable: $schema.searchable,
12208
- onEvent: $schema.onEvent,
12209
- filters: $schema.filters
12234
+ filters: $schema.filters,
12235
+ amis: amis
12210
12236
  };
12211
- return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, Object.assign.apply(Object, __spreadArray(__spreadArray([{}], __read(ctx), false), [{ ids: ids, idsTrackOn: idsTrackOn }], false)))];
12237
+ options = Object.assign.apply(Object, __spreadArray(__spreadArray([{}], __read(ctx), false), [{ idsDependOn: idsDependOn }], false));
12238
+ return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, options)];
12212
12239
  case 2:
12213
12240
  amisSchema = _c.sent();
12214
12241
  return [3 /*break*/, 4];
@@ -12216,10 +12243,7 @@ var AmisSelectUser = function (props) { return __awaiter(void 0, void 0, void 0,
12216
12243
  error_1 = _c.sent();
12217
12244
  console.log("error", error_1);
12218
12245
  return [3 /*break*/, 4];
12219
- case 4:
12220
- amisSchema.name = $schema.name;
12221
- amisSchema.label = $schema.label;
12222
- return [2 /*return*/, amisSchema];
12246
+ case 4: return [2 /*return*/, amisSchema];
12223
12247
  }
12224
12248
  });
12225
12249
  }); };
@@ -12559,7 +12583,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
12559
12583
  "source": {
12560
12584
  "method": "get",
12561
12585
  "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
12562
- "adaptor": "\n try {\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n })\n })\n } else {\n\n if(stacked){\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n }\n })\n })\n }else{\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n });\n })\n }\n\n \n }\n });\n payload.data = data.nav;\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
12586
+ "adaptor": "\n try {\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n });\n })\n }\n \n payload.data = data.nav;\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
12563
12587
  "headers": {
12564
12588
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
12565
12589
  },
@@ -12976,28 +13000,34 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
12976
13000
  * @Author: baozhoutao@steedos.com
12977
13001
  * @Date: 2023-01-14 16:41:24
12978
13002
  * @LastEditors: baozhoutao@steedos.com
12979
- * @LastEditTime: 2023-02-23 09:48:53
13003
+ * @LastEditTime: 2023-03-23 11:37:25
12980
13004
  * @Description:
12981
13005
  */
12982
13006
  var getSelectFlowSchema = function (id, props) {
12983
- 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;
12984
- return {
12985
- "type": mode,
12986
- "id": id,
12987
- "label": label,
12988
- "name": name,
12989
- "options": [],
12990
- "multiple": multiple,
12991
- "delimiter": delimiter,
12992
- "joinValues": joinValues,
12993
- "extractValue": extractValue,
12994
- "searchable": searchable,
12995
- "showOutline": showOutline,
12996
- "initiallyOpen": initiallyOpen,
12997
- "unfoldedLevel": unfoldedLevel,
12998
- "className": className,
12999
- "required": required,
13000
- "treeContainerClassName": treeContainerClassName,
13007
+ 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;
13008
+ 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, "className": className, "required": required, "treeContainerClassName": treeContainerClassName,
13009
+ // "menuTpl": {
13010
+ // type: "tpl",
13011
+ // tpl: "<div class='flex justify-between'><span>${label}</span><span class='rounded p-1 text-xs text-center w-14 ${children != null ? \'hidden\' : \'\'}'><button onClick='console.log(11111)'><i class='fa-regular fa-star'></i></button></span></div>",
13012
+ // "onEvent": {
13013
+ // "click": {
13014
+ // "weight": 0,
13015
+ // "actions": [
13016
+ // {
13017
+ // "args": {
13018
+ // "api": {
13019
+ // "url": "/aaa",
13020
+ // "method": "get",
13021
+ // "messages": {
13022
+ // }
13023
+ // }
13024
+ // },
13025
+ // "actionType": "download"
13026
+ // }
13027
+ // ]
13028
+ // }
13029
+ // }
13030
+ // },
13001
13031
  "source": {
13002
13032
  "method": "post",
13003
13033
  "url": "${context.rootUrl}/graphql?keywords=${keywords}",
@@ -13005,12 +13035,7 @@ var getSelectFlowSchema = function (id, props) {
13005
13035
  "headers": {
13006
13036
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
13007
13037
  }
13008
- },
13009
- "showIcon": showIcon,
13010
- "showRadio": showRadio,
13011
- "onlyLeaf": true,
13012
- "onEvent": onEvent,
13013
- };
13038
+ }, "showIcon": showIcon, "showRadio": showRadio, "onlyLeaf": true, "onEvent": onEvent }, amis);
13014
13039
  };
13015
13040
  /**
13016
13041
  *
@@ -13119,7 +13144,7 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
13119
13144
  return [2 /*return*/, {
13120
13145
  type: 'service',
13121
13146
  data: defData,
13122
- "className": (displayAs === 'grid') ? '' : 'p-0 flex flex-1 overflow-hidden h-full',
13147
+ "className": (displayAs === 'grid') ? 'h-full' : 'p-0 flex flex-1 overflow-hidden h-full',
13123
13148
  body: (displayAs === 'grid') ? defaultsDeep$1({ data: defData }, listSchema) : [
13124
13149
  {
13125
13150
  "type": "wrapper",
@@ -13157,13 +13182,14 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
13157
13182
  recordPage = _a.sent();
13158
13183
  recordSchema = recordPage ? JSON.parse(recordPage.schema) : {
13159
13184
  "type": "wrapper",
13160
- "className": "p-0 m-0 sm:m-3 flex-1",
13185
+ "className": "overflow-y-auto p-0 m-0 flex-1 h-full",
13161
13186
  "name": "amis-".concat(appId, "-").concat(objectApiName, "-detail"),
13162
13187
  "body": [
13163
13188
  {
13164
13189
  "type": "steedos-record-detail",
13165
13190
  "recordId": "${recordId}",
13166
13191
  "objectApiName": "${objectName}",
13192
+ className: "sm:m-3",
13167
13193
  appId: appId,
13168
13194
  }
13169
13195
  ],
@@ -13191,7 +13217,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
13191
13217
  },
13192
13218
  {
13193
13219
  "type": "wrapper",
13194
- "className": 'p-0 flex-1 overflow-y-auto focus:outline-none lg:order-last',
13220
+ "className": 'p-0 flex-1 focus:outline-none lg:order-last h-full',
13195
13221
  "body": defaultsDeep$1({ data: defData }, recordSchema)
13196
13222
  }
13197
13223
  ]