@steedos-widgets/amis-lib 1.3.4-beta.19 → 1.3.4-beta.21
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +262 -117
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +262 -118
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +117 -24
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/expression.d.ts +5 -0
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1795,7 +1795,7 @@ async function getSelectUserSchema(field, readonly, ctx) {
|
|
|
1795
1795
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
1796
1796
|
* @Date: 2023-03-22 09:31:21
|
|
1797
1797
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
1798
|
-
* @LastEditTime: 2023-11-
|
|
1798
|
+
* @LastEditTime: 2023-11-05 16:31:38
|
|
1799
1799
|
*/
|
|
1800
1800
|
|
|
1801
1801
|
const globalTag = '__G_L_O_B_A_L__';
|
|
@@ -1845,29 +1845,33 @@ const getMoment$1 = () => {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
};
|
|
1847
1847
|
|
|
1848
|
+
const getGlobalNowData = () => {
|
|
1849
|
+
let now = new Date();
|
|
1850
|
+
let moment = getMoment$1();
|
|
1851
|
+
let today = moment().utc();
|
|
1852
|
+
today.set("hours", 0);
|
|
1853
|
+
today.set("minutes", 0);
|
|
1854
|
+
today.set("seconds", 0);
|
|
1855
|
+
today.set("milliseconds", 0);
|
|
1856
|
+
today = today.toDate();
|
|
1857
|
+
let timeNow = moment();
|
|
1858
|
+
timeNow.set("year", 1970);
|
|
1859
|
+
timeNow.set("month", 0);
|
|
1860
|
+
timeNow.set("date", 1);
|
|
1861
|
+
timeNow.set("hours", timeNow.hours() + timeNow.utcOffset() / 60);
|
|
1862
|
+
timeNow.set("seconds", 0);
|
|
1863
|
+
timeNow.set("milliseconds", 0);
|
|
1864
|
+
timeNow = timeNow.toDate();
|
|
1865
|
+
return {
|
|
1866
|
+
now,
|
|
1867
|
+
today,
|
|
1868
|
+
timeNow
|
|
1869
|
+
};
|
|
1870
|
+
};
|
|
1871
|
+
|
|
1848
1872
|
const parseSingleExpression = function (func, formData, dataPath, global, userSession = {}) {
|
|
1849
1873
|
if (global) {
|
|
1850
|
-
|
|
1851
|
-
let moment = getMoment$1();
|
|
1852
|
-
let today = moment().utc();
|
|
1853
|
-
today.set("hours", 0);
|
|
1854
|
-
today.set("minutes", 0);
|
|
1855
|
-
today.set("seconds", 0);
|
|
1856
|
-
today.set("milliseconds", 0);
|
|
1857
|
-
today = today.toDate();
|
|
1858
|
-
let timeNow = moment();
|
|
1859
|
-
timeNow.set("year", 1970);
|
|
1860
|
-
timeNow.set("month", 0);
|
|
1861
|
-
timeNow.set("date", 1);
|
|
1862
|
-
timeNow.set("hours", timeNow.hours() + timeNow.utcOffset() / 60);
|
|
1863
|
-
timeNow.set("seconds", 0);
|
|
1864
|
-
timeNow.set("milliseconds", 0);
|
|
1865
|
-
timeNow = timeNow.toDate();
|
|
1866
|
-
Object.assign(global, {
|
|
1867
|
-
now,
|
|
1868
|
-
today,
|
|
1869
|
-
timeNow
|
|
1870
|
-
});
|
|
1874
|
+
Object.assign(global, getGlobalNowData());
|
|
1871
1875
|
}
|
|
1872
1876
|
|
|
1873
1877
|
var error, funcBody, parent, parentPath, str;
|
|
@@ -3394,7 +3398,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3394
3398
|
if(isLookup){
|
|
3395
3399
|
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3396
3400
|
}
|
|
3397
|
-
|
|
3401
|
+
searchableFieldsStoreKey = searchableFieldsStoreKey + "/" + (data.context && data.context.userId);
|
|
3402
|
+
let defaultSearchableFields = localStorage.getItem(searchableFieldsStoreKey);
|
|
3398
3403
|
if(defaultSearchableFields){
|
|
3399
3404
|
defaultSearchableFields = defaultSearchableFields.split(",");
|
|
3400
3405
|
}
|
|
@@ -3463,7 +3468,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3463
3468
|
if(isLookup){
|
|
3464
3469
|
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3465
3470
|
}
|
|
3466
|
-
|
|
3471
|
+
searchableFieldsStoreKey = searchableFieldsStoreKey + "/" + (data.context && data.context.userId);
|
|
3472
|
+
localStorage.setItem(searchableFieldsStoreKey, value);
|
|
3467
3473
|
|
|
3468
3474
|
// ===START===:当变更可搜索字段时,如果被移除的可搜索字段在本地存储中已经存入过滤条件中则应该清除本地存储中相关字段的过滤条件。
|
|
3469
3475
|
const searchableFields = data.fields;
|
|
@@ -7091,8 +7097,6 @@ function getSelectFieldOptions(field){
|
|
|
7091
7097
|
}
|
|
7092
7098
|
|
|
7093
7099
|
async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
7094
|
-
// console.log('convertSFieldToAmisField====>', field, readonly, ctx)
|
|
7095
|
-
const isMobile = window.innerWidth <= 768;
|
|
7096
7100
|
// 创建人和修改人、创建时间和修改时间不显示
|
|
7097
7101
|
if(___namespace.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
|
|
7098
7102
|
return;
|
|
@@ -7181,26 +7185,33 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7181
7185
|
};
|
|
7182
7186
|
break;
|
|
7183
7187
|
case 'date':
|
|
7184
|
-
convertData = isMobile && !readonly ? {
|
|
7185
|
-
|
|
7186
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
7193
|
-
|
|
7194
|
-
|
|
7195
|
-
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
} : {
|
|
7188
|
+
// convertData = isMobile && !readonly ? {
|
|
7189
|
+
// type: "native-date",
|
|
7190
|
+
// pipeIn: (value, data) => {
|
|
7191
|
+
// if (value) {
|
|
7192
|
+
// value = moment(value).utc().format('YYYY-MM-DD');
|
|
7193
|
+
// return value;
|
|
7194
|
+
// } else {
|
|
7195
|
+
// return "";
|
|
7196
|
+
// }
|
|
7197
|
+
|
|
7198
|
+
// },
|
|
7199
|
+
// pipeOut: (value, oldValue, data) => {
|
|
7200
|
+
// if (value) {
|
|
7201
|
+
// value = moment(value).format('YYYY-MM-DDT00:00:00.000[Z]');
|
|
7202
|
+
// return value;
|
|
7203
|
+
// } else {
|
|
7204
|
+
// return "";
|
|
7205
|
+
// }
|
|
7206
|
+
// }
|
|
7207
|
+
// } : {
|
|
7208
|
+
// type: getAmisStaticFieldType('date', readonly),
|
|
7209
|
+
// inputFormat: "YYYY-MM-DD",
|
|
7210
|
+
// format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
7211
|
+
// tpl: readonly ? Tpl.getDateTpl(field) : null,
|
|
7212
|
+
// // utc: true
|
|
7213
|
+
// }
|
|
7214
|
+
convertData = {
|
|
7204
7215
|
type: getAmisStaticFieldType('date', readonly),
|
|
7205
7216
|
inputFormat: "YYYY-MM-DD",
|
|
7206
7217
|
format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
@@ -7219,43 +7230,51 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7219
7230
|
};
|
|
7220
7231
|
break;
|
|
7221
7232
|
case 'datetime':
|
|
7222
|
-
convertData = isMobile && !readonly ? {
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
} : {
|
|
7233
|
+
// convertData = isMobile && !readonly ? {
|
|
7234
|
+
// type: "combo",
|
|
7235
|
+
// pipeIn: (value, data) => {
|
|
7236
|
+
// let revalue = {};
|
|
7237
|
+
// if (value && value != "Invalid date") {
|
|
7238
|
+
// value = moment(value).format('YYYY-MM-DD HH:mm:ss');
|
|
7239
|
+
// revalue[field.name + "-native-date"] = value.split(' ')[0];
|
|
7240
|
+
// revalue[field.name + "-native-time"] = value.split(' ')[1];
|
|
7241
|
+
// } else {
|
|
7242
|
+
// revalue[field.name + "-native-date"] = "";
|
|
7243
|
+
// revalue[field.name + "-native-time"] = "";
|
|
7244
|
+
// }
|
|
7245
|
+
// return revalue;
|
|
7246
|
+
// },
|
|
7247
|
+
// pipeOut: (value, oldValue, data) => {
|
|
7248
|
+
// let revalue = "";
|
|
7249
|
+
// if (value[field.name + "-native-date"] && value[field.name + "-native-time"]) {
|
|
7250
|
+
// revalue = value[field.name + "-native-date"] + " " + value[field.name + "-native-time"];
|
|
7251
|
+
// revalue = moment(revalue).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]');
|
|
7252
|
+
// }
|
|
7253
|
+
// return revalue;
|
|
7254
|
+
// },
|
|
7255
|
+
// items: [
|
|
7256
|
+
// {
|
|
7257
|
+
// type: "native-date",
|
|
7258
|
+
// name: field.name + "-native-date",
|
|
7259
|
+
// className: "steedos-native-date",
|
|
7260
|
+
// value: ""
|
|
7261
|
+
// },
|
|
7262
|
+
// {
|
|
7263
|
+
// type: "native-time",
|
|
7264
|
+
// name: field.name + "-native-time",
|
|
7265
|
+
// className: "steedos-native-time",
|
|
7266
|
+
// value: ""
|
|
7267
|
+
// }
|
|
7268
|
+
// ]
|
|
7269
|
+
// } : {
|
|
7270
|
+
// type: getAmisStaticFieldType('datetime', readonly),
|
|
7271
|
+
// inputFormat: 'YYYY-MM-DD HH:mm',
|
|
7272
|
+
// format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
7273
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
7274
|
+
// utc: true,
|
|
7275
|
+
// }
|
|
7276
|
+
|
|
7277
|
+
convertData = {
|
|
7259
7278
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
7260
7279
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
7261
7280
|
format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
@@ -7275,26 +7294,34 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7275
7294
|
};
|
|
7276
7295
|
break;
|
|
7277
7296
|
case 'time':
|
|
7278
|
-
convertData = isMobile && !readonly ? {
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
} : {
|
|
7297
|
+
// convertData = isMobile && !readonly ? {
|
|
7298
|
+
// type: "native-time",
|
|
7299
|
+
// pipeIn: (value, data) => {
|
|
7300
|
+
// if (value) {
|
|
7301
|
+
// value = moment(value).utc().format('HH:mm');
|
|
7302
|
+
// return value;
|
|
7303
|
+
// } else {
|
|
7304
|
+
// return "";
|
|
7305
|
+
// }
|
|
7306
|
+
|
|
7307
|
+
// },
|
|
7308
|
+
// pipeOut: (value, oldValue, data) => {
|
|
7309
|
+
// if (value) {
|
|
7310
|
+
// value = moment('1970-01-01 ' + value).format('1970-01-01THH:mm:00.000[Z]');
|
|
7311
|
+
// return value;
|
|
7312
|
+
// } else {
|
|
7313
|
+
// return "";
|
|
7314
|
+
// }
|
|
7315
|
+
// }
|
|
7316
|
+
// } : {
|
|
7317
|
+
// type: getAmisStaticFieldType('time', readonly),
|
|
7318
|
+
// inputFormat: 'HH:mm',
|
|
7319
|
+
// timeFormat:'HH:mm',
|
|
7320
|
+
// format:'1970-01-01THH:mm:00.000[Z]',
|
|
7321
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
7322
|
+
// // utc: true
|
|
7323
|
+
// }
|
|
7324
|
+
convertData = {
|
|
7298
7325
|
type: getAmisStaticFieldType('time', readonly),
|
|
7299
7326
|
inputFormat: 'HH:mm',
|
|
7300
7327
|
timeFormat:'HH:mm',
|
|
@@ -7771,7 +7798,7 @@ var config = {
|
|
|
7771
7798
|
async function getQuickEditSchema(field, options){
|
|
7772
7799
|
//判断在amis3.2以上环境下,放开批量编辑
|
|
7773
7800
|
const isAmisVersionforBatchEdit = amisRequire('amis').version[0] >= 3 && amisRequire('amis').version[2] >= 2;
|
|
7774
|
-
const quickEditId = options.objectName + "_" + field.name + "
|
|
7801
|
+
const quickEditId = options.objectName + "_" + field.name + "_quickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
7775
7802
|
var quickEditSchema = { body: [], id: quickEditId };
|
|
7776
7803
|
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
7777
7804
|
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
@@ -7781,19 +7808,16 @@ async function getQuickEditSchema(field, options){
|
|
|
7781
7808
|
{
|
|
7782
7809
|
actionType: "custom",
|
|
7783
7810
|
script: `
|
|
7784
|
-
|
|
7785
|
-
|
|
7811
|
+
let items = _.cloneDeep(event.data.items);
|
|
7812
|
+
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
7786
7813
|
if(event.data.isBatchEdit){
|
|
7787
7814
|
selectedItems.forEach(function(selectedItem){
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
7791
|
-
selectedItems.forEach(function(selectedItem){
|
|
7815
|
+
selectedItem._display.${field.name} = event.data._display.${field.name};
|
|
7816
|
+
doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: "_display_" + selectedItem._index});
|
|
7792
7817
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + selectedItem._index});
|
|
7793
7818
|
})
|
|
7794
7819
|
}else{
|
|
7795
|
-
|
|
7796
|
-
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
7820
|
+
doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "_display_" + event.data._index});
|
|
7797
7821
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
|
|
7798
7822
|
}
|
|
7799
7823
|
`
|
|
@@ -7823,7 +7847,7 @@ async function getQuickEditSchema(field, options){
|
|
|
7823
7847
|
{
|
|
7824
7848
|
"actionType": "custom",
|
|
7825
7849
|
"script": `
|
|
7826
|
-
var _display = event.data._display;
|
|
7850
|
+
var _display = _.cloneDeep(event.data._display);
|
|
7827
7851
|
${displayField}
|
|
7828
7852
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
7829
7853
|
`
|
|
@@ -7845,7 +7869,7 @@ async function getQuickEditSchema(field, options){
|
|
|
7845
7869
|
第二种是增加选项时,按照value的值,找到对应选项,并按照_display的规则为其赋值
|
|
7846
7870
|
*/
|
|
7847
7871
|
TempDisplayField = `
|
|
7848
|
-
const preData = event.data.__super.${field.name};
|
|
7872
|
+
const preData = _.cloneDeep(event.data.__super.${field.name});
|
|
7849
7873
|
if(preData && event.data.${field.name}.length < preData.length){
|
|
7850
7874
|
let deletedIndex;
|
|
7851
7875
|
preData.forEach(function(item,index){
|
|
@@ -8044,8 +8068,124 @@ async function getQuickEditSchema(field, options){
|
|
|
8044
8068
|
quickEditSchema.body.push({
|
|
8045
8069
|
"name": "isBatchEdit",
|
|
8046
8070
|
"type": "checkbox",
|
|
8047
|
-
"option":
|
|
8048
|
-
|
|
8071
|
+
"option": [
|
|
8072
|
+
{
|
|
8073
|
+
"type": "tpl",
|
|
8074
|
+
"tpl": "更新${COUNT(selectedItems)}个选定记录"
|
|
8075
|
+
},
|
|
8076
|
+
{
|
|
8077
|
+
"type": "spinner",
|
|
8078
|
+
"showOn": "${batchPermissionLoading}",
|
|
8079
|
+
"size": "sm",
|
|
8080
|
+
"className": "mr-4"
|
|
8081
|
+
}
|
|
8082
|
+
],
|
|
8083
|
+
"visibleOn": "${ARRAYSOME(selectedItems, item => item._id === _id) && COUNT(selectedItems)>1 && quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}",
|
|
8084
|
+
"disabledOn": "${batchPermissionLoading}",
|
|
8085
|
+
"onEvent":{
|
|
8086
|
+
"change":{
|
|
8087
|
+
"actions":[
|
|
8088
|
+
{
|
|
8089
|
+
"actionType": "setValue",
|
|
8090
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
8091
|
+
"args": {
|
|
8092
|
+
"value":{
|
|
8093
|
+
"batchPermissionLoading": true
|
|
8094
|
+
}
|
|
8095
|
+
},
|
|
8096
|
+
"expression":"${event.data.value}"
|
|
8097
|
+
},
|
|
8098
|
+
{
|
|
8099
|
+
"actionType": "ajax",
|
|
8100
|
+
"args": {
|
|
8101
|
+
"api": {
|
|
8102
|
+
"url": "${context.rootUrl}/graphql",
|
|
8103
|
+
"method": "post",
|
|
8104
|
+
"headers": {
|
|
8105
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
8106
|
+
},
|
|
8107
|
+
"data": {
|
|
8108
|
+
"query": "{rows:${objectName}(filters:[\"_id\",\"in\",${selectedItems | pick:_id | split | json}]){_id,_permissions{allowEdit}}}"
|
|
8109
|
+
},
|
|
8110
|
+
"adaptor": `
|
|
8111
|
+
const noPermission = [];
|
|
8112
|
+
payload.data.rows.forEach(function (row) {
|
|
8113
|
+
if(!row._permissions.allowEdit){
|
|
8114
|
+
noPermission.push(row._id);
|
|
8115
|
+
}
|
|
8116
|
+
})
|
|
8117
|
+
return payload = {data:{noPermission}};
|
|
8118
|
+
`
|
|
8119
|
+
}
|
|
8120
|
+
},
|
|
8121
|
+
"expression":"${event.data.value}"
|
|
8122
|
+
},
|
|
8123
|
+
{
|
|
8124
|
+
"actionType": "setValue",
|
|
8125
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
8126
|
+
"args": {
|
|
8127
|
+
"value":{
|
|
8128
|
+
"batchPermissionLoading": false
|
|
8129
|
+
}
|
|
8130
|
+
},
|
|
8131
|
+
"expression":"${event.data.value}"
|
|
8132
|
+
},
|
|
8133
|
+
{
|
|
8134
|
+
"actionType": "dialog",
|
|
8135
|
+
"dialog":{
|
|
8136
|
+
"title": "记录权限",
|
|
8137
|
+
"showCloseButton": false,
|
|
8138
|
+
"body":[
|
|
8139
|
+
{
|
|
8140
|
+
"type": "tpl",
|
|
8141
|
+
"tpl": "当前选中记录中,有${COUNT(noPermission)}条记录无编辑权限,是否需要批量编辑其他记录?"
|
|
8142
|
+
}
|
|
8143
|
+
],
|
|
8144
|
+
"onEvent":{
|
|
8145
|
+
"confirm":{
|
|
8146
|
+
"actions":[
|
|
8147
|
+
{
|
|
8148
|
+
"actionType": "custom",
|
|
8149
|
+
"script": `
|
|
8150
|
+
const noPermission = event.data.noPermission;
|
|
8151
|
+
const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
|
|
8152
|
+
const selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
|
|
8153
|
+
noPermission.forEach(function (item) {
|
|
8154
|
+
crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
|
|
8155
|
+
})
|
|
8156
|
+
`
|
|
8157
|
+
},
|
|
8158
|
+
{
|
|
8159
|
+
"actionType": "setValue",
|
|
8160
|
+
"componentId": quickEditId,
|
|
8161
|
+
"args": {
|
|
8162
|
+
"value":{
|
|
8163
|
+
"isBatchEdit": true
|
|
8164
|
+
}
|
|
8165
|
+
},
|
|
8166
|
+
}
|
|
8167
|
+
]
|
|
8168
|
+
},
|
|
8169
|
+
"cancel":{
|
|
8170
|
+
"actions":[
|
|
8171
|
+
{
|
|
8172
|
+
"actionType": "setValue",
|
|
8173
|
+
"componentId": quickEditId,
|
|
8174
|
+
"args": {
|
|
8175
|
+
"value":{
|
|
8176
|
+
"isBatchEdit": false
|
|
8177
|
+
}
|
|
8178
|
+
},
|
|
8179
|
+
}
|
|
8180
|
+
]
|
|
8181
|
+
}
|
|
8182
|
+
}
|
|
8183
|
+
},
|
|
8184
|
+
"expression":"${COUNT(event.data.noPermission)>0}"
|
|
8185
|
+
}
|
|
8186
|
+
]
|
|
8187
|
+
}
|
|
8188
|
+
}
|
|
8049
8189
|
});
|
|
8050
8190
|
}
|
|
8051
8191
|
} else {
|
|
@@ -8082,6 +8222,8 @@ async function getTableColumns(fields, options){
|
|
|
8082
8222
|
const columns = [];
|
|
8083
8223
|
if(!options.isLookup){
|
|
8084
8224
|
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
8225
|
+
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
8226
|
+
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
8085
8227
|
}
|
|
8086
8228
|
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
8087
8229
|
|
|
@@ -10439,7 +10581,8 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
10439
10581
|
const quickSaveApiRequestAdaptor = `
|
|
10440
10582
|
var graphqlOrder = "";
|
|
10441
10583
|
var imageNames = ${JSON.stringify(imageNames)};
|
|
10442
|
-
api.data.rowsDiff
|
|
10584
|
+
const rowsDiff = _.cloneDeep(api.data.rowsDiff);
|
|
10585
|
+
rowsDiff.forEach(function (item, index) {
|
|
10443
10586
|
for(key in item){
|
|
10444
10587
|
if(_.includes(imageNames, key)){
|
|
10445
10588
|
if(typeof item[key] == "string"){
|
|
@@ -10453,6 +10596,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
10453
10596
|
}
|
|
10454
10597
|
}
|
|
10455
10598
|
}
|
|
10599
|
+
item = _.omit(item, '_display');
|
|
10456
10600
|
const itemOrder = 'update' + index + ':' + api.data.objectName + '__update(id:"' + item._id + '", doc:' + JSON.stringify(JSON.stringify(_.omit(item, '_id'))) + ') {_id}';
|
|
10457
10601
|
graphqlOrder += itemOrder;
|
|
10458
10602
|
})
|
|
@@ -14603,6 +14747,7 @@ exports.getFileSrc = getFileSrc;
|
|
|
14603
14747
|
exports.getFlowFormSchema = getFlowFormSchema;
|
|
14604
14748
|
exports.getFormPageInitSchema = getFormPageInitSchema;
|
|
14605
14749
|
exports.getFormSchema = getFormSchema;
|
|
14750
|
+
exports.getGlobalNowData = getGlobalNowData;
|
|
14606
14751
|
exports.getIdsPickerSchema = getIdsPickerSchema;
|
|
14607
14752
|
exports.getImageSrc = getImageSrc;
|
|
14608
14753
|
exports.getInstanceInfo = getInstanceInfo;
|