@steedos-widgets/sortable 1.3.22-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
  }
@@ -55137,7 +55152,7 @@ async function getQuickEditSchema(field, options){
55137
55152
  "actions":[
55138
55153
  {
55139
55154
  "actionType": "setValue",
55140
- "componentId": `service_listview_${options.objectName}`,
55155
+ "componentId": quickEditId,
55141
55156
  "args": {
55142
55157
  "value":{
55143
55158
  "quickedit_record_permissions_loading": true
@@ -55162,7 +55177,7 @@ async function getQuickEditSchema(field, options){
55162
55177
  },
55163
55178
  {
55164
55179
  "actionType": "setValue",
55165
- "componentId": `service_listview_${options.objectName}`,
55180
+ "componentId": quickEditId,
55166
55181
  "args": {
55167
55182
  "value":{
55168
55183
  "quickedit_record_permissions_loading": false
@@ -55171,7 +55186,7 @@ async function getQuickEditSchema(field, options){
55171
55186
  },
55172
55187
  {
55173
55188
  "actionType": "setValue",
55174
- "componentId": `service_listview_${options.objectName}`,
55189
+ "componentId": quickEditId,
55175
55190
  "args": {
55176
55191
  "value":{
55177
55192
  "quickedit_record_permissions": "${event.data}"
@@ -55350,8 +55365,6 @@ function getFieldWidth(width){
55350
55365
  async function getTableColumns(fields, options){
55351
55366
  const columns = [];
55352
55367
  if(!options.isLookup && !options.isInputTable){
55353
- //将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
55354
- columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
55355
55368
  if(!options.enable_tree){
55356
55369
  columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
55357
55370
  }
@@ -55509,8 +55522,8 @@ async function getTableColumns(fields, options){
55509
55522
  const href = Router.getObjectDetailPath({
55510
55523
  ...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
55511
55524
  });
55512
- columns[1].type = "tpl";
55513
- 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>`;
55514
55527
  }
55515
55528
  return columns;
55516
55529
  }
@@ -55896,6 +55909,7 @@ async function getTableSchema$1(fields, options){
55896
55909
  if(!isLookup && !hiddenColumnOperation){
55897
55910
  columns.push(await getTableOperation(options));
55898
55911
  }
55912
+
55899
55913
  }
55900
55914
 
55901
55915
  return {
@@ -59175,6 +59189,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
59175
59189
  */
59176
59190
  return payload;
59177
59191
  }
59192
+ if(!payload.data.rows){
59193
+ payload.data.rows = [];
59194
+ }
59178
59195
  if(enable_tree){
59179
59196
  const records = payload.data.rows;
59180
59197
  const treeRecords = [];
@@ -59455,7 +59472,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
59455
59472
  sendOn.push(`this.${fName}`);
59456
59473
  });
59457
59474
  if(depend_on.length > 0){
59458
- apiInfo.url = `${apiInfo.url}?${depend_on.join('&')}`;
59475
+ apiInfo.url = `${apiInfo.url}&${depend_on.join('&')}`;
59459
59476
  apiInfo.sendOn = `${sendOn.join(' && ')}`;
59460
59477
  }
59461
59478
  }
@@ -59563,6 +59580,13 @@ async function lookupToAmisSelect(field, readonly, ctx){
59563
59580
  autoComplete: apiInfo,
59564
59581
  searchable: true,
59565
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
+ }
59566
59590
  //删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
59567
59591
  const select_menuTpl = `<span class='flex items-center mt-0.5'>
59568
59592
  <span role='img' aria-label='smile' class='anticon anticon-smile'>
@@ -60525,9 +60549,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
60525
60549
  }
60526
60550
  if(!lodash.exports.isEmpty(convertData)){
60527
60551
  if(field.is_wide || convertData.type === 'group'){
60528
- convertData.className = 'col-span-2 m-1';
60552
+ convertData.className = 'col-span-2 m-0';
60529
60553
  }else {
60530
- convertData.className = 'm-1';
60554
+ convertData.className = 'm-0';
60531
60555
  }
60532
60556
  if(readonly){
60533
60557
  convertData.className = `${convertData.className} border-b`;