@steedos-widgets/sortable 1.3.4-beta.5 → 1.3.4-beta.7
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.
- package/dist/assets.json +5 -5
- package/dist/sortable.cjs.js +57 -12
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +57 -12
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +57 -12
- package/package.json +3 -3
package/dist/sortable.umd.js
CHANGED
|
@@ -20339,28 +20339,28 @@
|
|
|
20339
20339
|
}
|
|
20340
20340
|
|
|
20341
20341
|
function getNumberTpl(field){
|
|
20342
|
-
return `<
|
|
20342
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20343
20343
|
}
|
|
20344
20344
|
|
|
20345
20345
|
function getTimeTpl(field){
|
|
20346
|
-
return `<
|
|
20346
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20347
20347
|
}
|
|
20348
20348
|
|
|
20349
20349
|
function getDateTpl(field){
|
|
20350
|
-
return `<
|
|
20350
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20351
20351
|
}
|
|
20352
20352
|
|
|
20353
20353
|
|
|
20354
20354
|
function getDateTimeTpl(field){
|
|
20355
|
-
return `<
|
|
20355
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20356
20356
|
}
|
|
20357
20357
|
|
|
20358
20358
|
function getUiFieldTpl(field){
|
|
20359
|
-
return `<
|
|
20359
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20360
20360
|
}
|
|
20361
20361
|
|
|
20362
20362
|
function getUiFileSizeTpl(field){
|
|
20363
|
-
return `<
|
|
20363
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20364
20364
|
}
|
|
20365
20365
|
|
|
20366
20366
|
//TODO 处理name字段
|
|
@@ -20371,7 +20371,7 @@
|
|
|
20371
20371
|
}
|
|
20372
20372
|
|
|
20373
20373
|
function getSelectTpl(field){
|
|
20374
|
-
return `<
|
|
20374
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
20375
20375
|
}
|
|
20376
20376
|
function getSelectMap(selectOptions){
|
|
20377
20377
|
let map = {};
|
|
@@ -21117,7 +21117,7 @@
|
|
|
21117
21117
|
* @Author: baozhoutao@steedos.com
|
|
21118
21118
|
* @Date: 2022-11-01 15:51:00
|
|
21119
21119
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
21120
|
-
* @LastEditTime: 2023-
|
|
21120
|
+
* @LastEditTime: 2023-09-25 14:53:05
|
|
21121
21121
|
* @Description:
|
|
21122
21122
|
*/
|
|
21123
21123
|
|
|
@@ -21136,18 +21136,31 @@
|
|
|
21136
21136
|
formSchema = _.isString(payload.schema) ? JSON.parse(payload.schema) : payload.schema;
|
|
21137
21137
|
}
|
|
21138
21138
|
|
|
21139
|
+
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
21140
|
+
const selectedRowResponseResult = api.body.selectedRowResponseResult;
|
|
21141
|
+
let defaultData = {};
|
|
21142
|
+
|
|
21143
|
+
if(!_.isEmpty(selectedRowResponseResult)){
|
|
21144
|
+
const fieldsKeys = _.keys(fields);
|
|
21145
|
+
// 如果新建记录时复制的数据中有omit或其他不相关字段数据时不应该一起保存到数据库,
|
|
21146
|
+
// 原规则见:https://github.com/steedos/steedos-frontend/issues/297
|
|
21147
|
+
_.forEach(selectedRowResponseResult, (val, key) => {
|
|
21148
|
+
if (fieldsKeys.indexOf(key) > -1 && fields[key].omit !== true) {
|
|
21149
|
+
defaultData[key] = val;
|
|
21150
|
+
}
|
|
21151
|
+
})
|
|
21152
|
+
}
|
|
21153
|
+
|
|
21139
21154
|
const _master = api.body._master;
|
|
21140
21155
|
if(_master && _master._isRelated){
|
|
21141
21156
|
const relatedKey = _master.relatedKey;
|
|
21142
21157
|
const masterObjectName = _master.objectName;
|
|
21143
21158
|
const recordId = _master.recordId;
|
|
21144
21159
|
let relatedKeySaveValue = recordId;
|
|
21145
|
-
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
21146
21160
|
const relatedField = fields[relatedKey];
|
|
21147
21161
|
if(relatedField.reference_to_field && relatedField.reference_to_field !== '_id'){
|
|
21148
21162
|
relatedKeySaveValue = _master.record[relatedField.reference_to_field];
|
|
21149
21163
|
}
|
|
21150
|
-
let defaultData = {};
|
|
21151
21164
|
let relatedKeyValue;
|
|
21152
21165
|
if(!_.isString(relatedField.reference_to)){
|
|
21153
21166
|
relatedKeyValue = { o: masterObjectName, ids: [relatedKeySaveValue] };
|
|
@@ -21157,6 +21170,9 @@
|
|
|
21157
21170
|
relatedKeyValue = relatedKeySaveValue;
|
|
21158
21171
|
}
|
|
21159
21172
|
defaultData[relatedKey]=relatedKeyValue;
|
|
21173
|
+
}
|
|
21174
|
+
|
|
21175
|
+
if(!_.isEmpty(defaultData)){
|
|
21160
21176
|
if(payload.schema){
|
|
21161
21177
|
// 表单微页面第一层要求是page
|
|
21162
21178
|
formSchema.data.defaultData = defaultData;
|
|
@@ -21178,6 +21194,18 @@
|
|
|
21178
21194
|
"componentId": "object_actions_drawer_${uiSchema.name}"
|
|
21179
21195
|
});
|
|
21180
21196
|
}, 200);
|
|
21197
|
+
`;
|
|
21198
|
+
const getSelectedRowsScript = `
|
|
21199
|
+
const isLookup = event.data.isLookup;
|
|
21200
|
+
if(isLookup){
|
|
21201
|
+
// lookup弹出窗口的新建功能不需要支持复制新建
|
|
21202
|
+
return;
|
|
21203
|
+
}
|
|
21204
|
+
const uiSchema = event.data.uiSchema;
|
|
21205
|
+
const objectName = event.data.objectName;
|
|
21206
|
+
const listViewRef = event.context.scoped.getComponentById("listview_" + objectName);
|
|
21207
|
+
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
21208
|
+
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
21181
21209
|
`;
|
|
21182
21210
|
return {
|
|
21183
21211
|
"type": "service",
|
|
@@ -21191,6 +21219,21 @@
|
|
|
21191
21219
|
"click": {
|
|
21192
21220
|
"weight": 0,
|
|
21193
21221
|
"actions": [
|
|
21222
|
+
{
|
|
21223
|
+
"actionType": "custom",
|
|
21224
|
+
"script": getSelectedRowsScript
|
|
21225
|
+
},
|
|
21226
|
+
{
|
|
21227
|
+
"actionType": "ajax",
|
|
21228
|
+
"outputVar": "selectedRowResponseResult",
|
|
21229
|
+
"args": {
|
|
21230
|
+
"api": {
|
|
21231
|
+
"url": "${context.rootUrl}/api/v1/${uiSchema.name}/${selectedIds|first}",
|
|
21232
|
+
"method": "get"
|
|
21233
|
+
}
|
|
21234
|
+
},
|
|
21235
|
+
"expression": "${selectedIds.length > 0}"
|
|
21236
|
+
},
|
|
21194
21237
|
{
|
|
21195
21238
|
"actionType": "dialog",
|
|
21196
21239
|
"dialog": {
|
|
@@ -21208,7 +21251,8 @@
|
|
|
21208
21251
|
"displayAs": "${displayAs}",
|
|
21209
21252
|
"uiSchema": "${uiSchema}",
|
|
21210
21253
|
"isLookup": "${isLookup}",
|
|
21211
|
-
"listName": "${listName}"
|
|
21254
|
+
"listName": "${listName}",
|
|
21255
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
21212
21256
|
},
|
|
21213
21257
|
"title":instance.t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
21214
21258
|
"body": [
|
|
@@ -21220,7 +21264,8 @@
|
|
|
21220
21264
|
"data": {
|
|
21221
21265
|
"isLookup": "${isLookup}",
|
|
21222
21266
|
"_master": "${_master}",
|
|
21223
|
-
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}"
|
|
21267
|
+
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
21268
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}"
|
|
21224
21269
|
},
|
|
21225
21270
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
21226
21271
|
"method": "get",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/sortable",
|
|
3
|
-
"version": "1.3.4-beta.
|
|
3
|
+
"version": "1.3.4-beta.7",
|
|
4
4
|
"main": "dist/sortable.cjs.js",
|
|
5
5
|
"module": "dist/sortable.esm.js",
|
|
6
6
|
"unpkg": "dist/sortable.umd.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@dnd-kit/core": "^6.0.5",
|
|
47
47
|
"@dnd-kit/sortable": "^7.0.1",
|
|
48
|
-
"@steedos-widgets/amis-lib": "1.3.4-beta.
|
|
48
|
+
"@steedos-widgets/amis-lib": "1.3.4-beta.7"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "ff6cd4d700006d36bf421e097c380042337e6f48"
|
|
51
51
|
}
|