@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.esm.js
CHANGED
|
@@ -54034,28 +54034,28 @@ function getLookupListView(refObjectConfig) {
|
|
|
54034
54034
|
}
|
|
54035
54035
|
|
|
54036
54036
|
function getNumberTpl(field){
|
|
54037
|
-
return `<
|
|
54037
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54038
54038
|
}
|
|
54039
54039
|
|
|
54040
54040
|
function getTimeTpl(field){
|
|
54041
|
-
return `<
|
|
54041
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54042
54042
|
}
|
|
54043
54043
|
|
|
54044
54044
|
function getDateTpl(field){
|
|
54045
|
-
return `<
|
|
54045
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54046
54046
|
}
|
|
54047
54047
|
|
|
54048
54048
|
|
|
54049
54049
|
function getDateTimeTpl(field){
|
|
54050
|
-
return `<
|
|
54050
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54051
54051
|
}
|
|
54052
54052
|
|
|
54053
54053
|
function getUiFieldTpl(field){
|
|
54054
|
-
return `<
|
|
54054
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54055
54055
|
}
|
|
54056
54056
|
|
|
54057
54057
|
function getUiFileSizeTpl(field){
|
|
54058
|
-
return `<
|
|
54058
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54059
54059
|
}
|
|
54060
54060
|
|
|
54061
54061
|
//TODO 处理name字段
|
|
@@ -54066,7 +54066,7 @@ async function getRefObjectNameFieldName(field){
|
|
|
54066
54066
|
}
|
|
54067
54067
|
|
|
54068
54068
|
function getSelectTpl(field){
|
|
54069
|
-
return `<
|
|
54069
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
54070
54070
|
}
|
|
54071
54071
|
function getSelectMap(selectOptions){
|
|
54072
54072
|
let map = {};
|
|
@@ -54812,7 +54812,7 @@ async function getListSchema$1(fields, options){
|
|
|
54812
54812
|
* @Author: baozhoutao@steedos.com
|
|
54813
54813
|
* @Date: 2022-11-01 15:51:00
|
|
54814
54814
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
54815
|
-
* @LastEditTime: 2023-
|
|
54815
|
+
* @LastEditTime: 2023-09-25 14:53:05
|
|
54816
54816
|
* @Description:
|
|
54817
54817
|
*/
|
|
54818
54818
|
|
|
@@ -54831,18 +54831,31 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
54831
54831
|
formSchema = _.isString(payload.schema) ? JSON.parse(payload.schema) : payload.schema;
|
|
54832
54832
|
}
|
|
54833
54833
|
|
|
54834
|
+
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
54835
|
+
const selectedRowResponseResult = api.body.selectedRowResponseResult;
|
|
54836
|
+
let defaultData = {};
|
|
54837
|
+
|
|
54838
|
+
if(!_.isEmpty(selectedRowResponseResult)){
|
|
54839
|
+
const fieldsKeys = _.keys(fields);
|
|
54840
|
+
// 如果新建记录时复制的数据中有omit或其他不相关字段数据时不应该一起保存到数据库,
|
|
54841
|
+
// 原规则见:https://github.com/steedos/steedos-frontend/issues/297
|
|
54842
|
+
_.forEach(selectedRowResponseResult, (val, key) => {
|
|
54843
|
+
if (fieldsKeys.indexOf(key) > -1 && fields[key].omit !== true) {
|
|
54844
|
+
defaultData[key] = val;
|
|
54845
|
+
}
|
|
54846
|
+
})
|
|
54847
|
+
}
|
|
54848
|
+
|
|
54834
54849
|
const _master = api.body._master;
|
|
54835
54850
|
if(_master && _master._isRelated){
|
|
54836
54851
|
const relatedKey = _master.relatedKey;
|
|
54837
54852
|
const masterObjectName = _master.objectName;
|
|
54838
54853
|
const recordId = _master.recordId;
|
|
54839
54854
|
let relatedKeySaveValue = recordId;
|
|
54840
|
-
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
54841
54855
|
const relatedField = fields[relatedKey];
|
|
54842
54856
|
if(relatedField.reference_to_field && relatedField.reference_to_field !== '_id'){
|
|
54843
54857
|
relatedKeySaveValue = _master.record[relatedField.reference_to_field];
|
|
54844
54858
|
}
|
|
54845
|
-
let defaultData = {};
|
|
54846
54859
|
let relatedKeyValue;
|
|
54847
54860
|
if(!_.isString(relatedField.reference_to)){
|
|
54848
54861
|
relatedKeyValue = { o: masterObjectName, ids: [relatedKeySaveValue] };
|
|
@@ -54852,6 +54865,9 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
54852
54865
|
relatedKeyValue = relatedKeySaveValue;
|
|
54853
54866
|
}
|
|
54854
54867
|
defaultData[relatedKey]=relatedKeyValue;
|
|
54868
|
+
}
|
|
54869
|
+
|
|
54870
|
+
if(!_.isEmpty(defaultData)){
|
|
54855
54871
|
if(payload.schema){
|
|
54856
54872
|
// 表单微页面第一层要求是page
|
|
54857
54873
|
formSchema.data.defaultData = defaultData;
|
|
@@ -54874,6 +54890,18 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
54874
54890
|
});
|
|
54875
54891
|
}, 200);
|
|
54876
54892
|
`;
|
|
54893
|
+
const getSelectedRowsScript = `
|
|
54894
|
+
const isLookup = event.data.isLookup;
|
|
54895
|
+
if(isLookup){
|
|
54896
|
+
// lookup弹出窗口的新建功能不需要支持复制新建
|
|
54897
|
+
return;
|
|
54898
|
+
}
|
|
54899
|
+
const uiSchema = event.data.uiSchema;
|
|
54900
|
+
const objectName = event.data.objectName;
|
|
54901
|
+
const listViewRef = event.context.scoped.getComponentById("listview_" + objectName);
|
|
54902
|
+
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
54903
|
+
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
54904
|
+
`;
|
|
54877
54905
|
return {
|
|
54878
54906
|
"type": "service",
|
|
54879
54907
|
"body": [
|
|
@@ -54886,6 +54914,21 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
54886
54914
|
"click": {
|
|
54887
54915
|
"weight": 0,
|
|
54888
54916
|
"actions": [
|
|
54917
|
+
{
|
|
54918
|
+
"actionType": "custom",
|
|
54919
|
+
"script": getSelectedRowsScript
|
|
54920
|
+
},
|
|
54921
|
+
{
|
|
54922
|
+
"actionType": "ajax",
|
|
54923
|
+
"outputVar": "selectedRowResponseResult",
|
|
54924
|
+
"args": {
|
|
54925
|
+
"api": {
|
|
54926
|
+
"url": "${context.rootUrl}/api/v1/${uiSchema.name}/${selectedIds|first}",
|
|
54927
|
+
"method": "get"
|
|
54928
|
+
}
|
|
54929
|
+
},
|
|
54930
|
+
"expression": "${selectedIds.length > 0}"
|
|
54931
|
+
},
|
|
54889
54932
|
{
|
|
54890
54933
|
"actionType": "dialog",
|
|
54891
54934
|
"dialog": {
|
|
@@ -54903,7 +54946,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
54903
54946
|
"displayAs": "${displayAs}",
|
|
54904
54947
|
"uiSchema": "${uiSchema}",
|
|
54905
54948
|
"isLookup": "${isLookup}",
|
|
54906
|
-
"listName": "${listName}"
|
|
54949
|
+
"listName": "${listName}",
|
|
54950
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
54907
54951
|
},
|
|
54908
54952
|
"title":instance.t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
54909
54953
|
"body": [
|
|
@@ -54915,7 +54959,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
54915
54959
|
"data": {
|
|
54916
54960
|
"isLookup": "${isLookup}",
|
|
54917
54961
|
"_master": "${_master}",
|
|
54918
|
-
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}"
|
|
54962
|
+
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
54963
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}"
|
|
54919
54964
|
},
|
|
54920
54965
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
54921
54966
|
"method": "get",
|