@steedos-widgets/sortable 3.6.0-beta.3 → 3.6.0-beta.4

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.
@@ -53975,8 +53975,8 @@ const Router = {
53975
53975
  /*
53976
53976
  * @Author: baozhoutao@steedos.com
53977
53977
  * @Date: 2022-07-20 16:29:22
53978
- * @LastEditors: liaodaxue
53979
- * @LastEditTime: 2023-09-11 17:19:53
53978
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
53979
+ * @LastEditTime: 2023-12-28 14:59:08
53980
53980
  * @Description:
53981
53981
  */
53982
53982
 
@@ -54033,6 +54033,21 @@ function getLookupListView(refObjectConfig) {
54033
54033
  return listView;
54034
54034
  }
54035
54035
 
54036
+
54037
+ /**
54038
+ * 获取可比较的amis版本号
54039
+ * @returns 只返回前两位版本,第三位忽略,比如3.6.3返回3.6
54040
+ */
54041
+ function getComparableAmisVersion() {
54042
+ let amis = (window.amisRequire && window.amisRequire('amis')) || window.Amis;
54043
+ let amisVersion = amis && amis.version;
54044
+ if(amisVersion){
54045
+ let comparableVersions = amisVersion.split(".");
54046
+ let comparableVersion = parseFloat(comparableVersions[0].toString() + "." + comparableVersions[1].toString());
54047
+ return comparableVersion;
54048
+ }
54049
+ }
54050
+
54036
54051
  function getNumberTpl(field){
54037
54052
  return `<span>\${_display.${field.name}}</span>`
54038
54053
  }
@@ -55507,8 +55522,8 @@ async function getTableColumns(fields, options){
55507
55522
  const href = Router.getObjectDetailPath({
55508
55523
  ...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
55509
55524
  });
55510
- columns[1].type = "tpl";
55511
- columns[1].tpl = `<a href="${href}">\${${columns[1].name}}</a>`;
55525
+ columns[0].type = "tpl";
55526
+ columns[0].tpl = `<a href="${href}">\${${columns[0].name}}</a>`;
55512
55527
  }
55513
55528
  return columns;
55514
55529
  }
@@ -59457,7 +59472,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
59457
59472
  sendOn.push(`this.${fName}`);
59458
59473
  });
59459
59474
  if(depend_on.length > 0){
59460
- apiInfo.url = `${apiInfo.url}?${depend_on.join('&')}`;
59475
+ apiInfo.url = `${apiInfo.url}&${depend_on.join('&')}`;
59461
59476
  apiInfo.sendOn = `${sendOn.join(' && ')}`;
59462
59477
  }
59463
59478
  }
@@ -59565,6 +59580,13 @@ async function lookupToAmisSelect(field, readonly, ctx){
59565
59580
  autoComplete: apiInfo,
59566
59581
  searchable: true,
59567
59582
  };
59583
+ let amisVersion = getComparableAmisVersion();
59584
+ if(amisVersion >= 3.6){
59585
+ // amis 3.6中不加source会造成子表组件中弹出行编辑窗口的lookup字段有时不请求接口(概率现象,同一个地方反复操作有时请求有时不请求)
59586
+ // 但是同时配置autoComplete和source会多请求一次接口
59587
+ // TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
59588
+ data.source = apiInfo;
59589
+ }
59568
59590
  //删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
59569
59591
  const select_menuTpl = `<span class='flex items-center mt-0.5'>
59570
59592
  <span role='img' aria-label='smile' class='anticon anticon-smile'>
@@ -60527,9 +60549,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60527
60549
  }
60528
60550
  if(!lodash.exports.isEmpty(convertData)){
60529
60551
  if(field.is_wide || convertData.type === 'group'){
60530
- convertData.className = 'col-span-2 m-1';
60552
+ convertData.className = 'col-span-2 m-0';
60531
60553
  }else {
60532
- convertData.className = 'm-1';
60554
+ convertData.className = 'm-0';
60533
60555
  }
60534
60556
  if(readonly){
60535
60557
  convertData.className = `${convertData.className} border-b`;