@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.esm.js
CHANGED
|
@@ -1768,7 +1768,7 @@ async function getSelectUserSchema(field, readonly, ctx) {
|
|
|
1768
1768
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
1769
1769
|
* @Date: 2023-03-22 09:31:21
|
|
1770
1770
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
1771
|
-
* @LastEditTime: 2023-11-
|
|
1771
|
+
* @LastEditTime: 2023-11-05 16:31:38
|
|
1772
1772
|
*/
|
|
1773
1773
|
|
|
1774
1774
|
const globalTag = '__G_L_O_B_A_L__';
|
|
@@ -1818,29 +1818,33 @@ const getMoment$1 = () => {
|
|
|
1818
1818
|
}
|
|
1819
1819
|
};
|
|
1820
1820
|
|
|
1821
|
+
const getGlobalNowData = () => {
|
|
1822
|
+
let now = new Date();
|
|
1823
|
+
let moment = getMoment$1();
|
|
1824
|
+
let today = moment().utc();
|
|
1825
|
+
today.set("hours", 0);
|
|
1826
|
+
today.set("minutes", 0);
|
|
1827
|
+
today.set("seconds", 0);
|
|
1828
|
+
today.set("milliseconds", 0);
|
|
1829
|
+
today = today.toDate();
|
|
1830
|
+
let timeNow = moment();
|
|
1831
|
+
timeNow.set("year", 1970);
|
|
1832
|
+
timeNow.set("month", 0);
|
|
1833
|
+
timeNow.set("date", 1);
|
|
1834
|
+
timeNow.set("hours", timeNow.hours() + timeNow.utcOffset() / 60);
|
|
1835
|
+
timeNow.set("seconds", 0);
|
|
1836
|
+
timeNow.set("milliseconds", 0);
|
|
1837
|
+
timeNow = timeNow.toDate();
|
|
1838
|
+
return {
|
|
1839
|
+
now,
|
|
1840
|
+
today,
|
|
1841
|
+
timeNow
|
|
1842
|
+
};
|
|
1843
|
+
};
|
|
1844
|
+
|
|
1821
1845
|
const parseSingleExpression = function (func, formData, dataPath, global, userSession = {}) {
|
|
1822
1846
|
if (global) {
|
|
1823
|
-
|
|
1824
|
-
let moment = getMoment$1();
|
|
1825
|
-
let today = moment().utc();
|
|
1826
|
-
today.set("hours", 0);
|
|
1827
|
-
today.set("minutes", 0);
|
|
1828
|
-
today.set("seconds", 0);
|
|
1829
|
-
today.set("milliseconds", 0);
|
|
1830
|
-
today = today.toDate();
|
|
1831
|
-
let timeNow = moment();
|
|
1832
|
-
timeNow.set("year", 1970);
|
|
1833
|
-
timeNow.set("month", 0);
|
|
1834
|
-
timeNow.set("date", 1);
|
|
1835
|
-
timeNow.set("hours", timeNow.hours() + timeNow.utcOffset() / 60);
|
|
1836
|
-
timeNow.set("seconds", 0);
|
|
1837
|
-
timeNow.set("milliseconds", 0);
|
|
1838
|
-
timeNow = timeNow.toDate();
|
|
1839
|
-
Object.assign(global, {
|
|
1840
|
-
now,
|
|
1841
|
-
today,
|
|
1842
|
-
timeNow
|
|
1843
|
-
});
|
|
1847
|
+
Object.assign(global, getGlobalNowData());
|
|
1844
1848
|
}
|
|
1845
1849
|
|
|
1846
1850
|
var error, funcBody, parent, parentPath, str;
|
|
@@ -3367,7 +3371,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3367
3371
|
if(isLookup){
|
|
3368
3372
|
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3369
3373
|
}
|
|
3370
|
-
|
|
3374
|
+
searchableFieldsStoreKey = searchableFieldsStoreKey + "/" + (data.context && data.context.userId);
|
|
3375
|
+
let defaultSearchableFields = localStorage.getItem(searchableFieldsStoreKey);
|
|
3371
3376
|
if(defaultSearchableFields){
|
|
3372
3377
|
defaultSearchableFields = defaultSearchableFields.split(",");
|
|
3373
3378
|
}
|
|
@@ -3436,7 +3441,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3436
3441
|
if(isLookup){
|
|
3437
3442
|
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3438
3443
|
}
|
|
3439
|
-
|
|
3444
|
+
searchableFieldsStoreKey = searchableFieldsStoreKey + "/" + (data.context && data.context.userId);
|
|
3445
|
+
localStorage.setItem(searchableFieldsStoreKey, value);
|
|
3440
3446
|
|
|
3441
3447
|
// ===START===:当变更可搜索字段时,如果被移除的可搜索字段在本地存储中已经存入过滤条件中则应该清除本地存储中相关字段的过滤条件。
|
|
3442
3448
|
const searchableFields = data.fields;
|
|
@@ -7064,8 +7070,6 @@ function getSelectFieldOptions(field){
|
|
|
7064
7070
|
}
|
|
7065
7071
|
|
|
7066
7072
|
async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
7067
|
-
// console.log('convertSFieldToAmisField====>', field, readonly, ctx)
|
|
7068
|
-
const isMobile = window.innerWidth <= 768;
|
|
7069
7073
|
// 创建人和修改人、创建时间和修改时间不显示
|
|
7070
7074
|
if(_$1.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
|
|
7071
7075
|
return;
|
|
@@ -7154,26 +7158,33 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7154
7158
|
};
|
|
7155
7159
|
break;
|
|
7156
7160
|
case 'date':
|
|
7157
|
-
convertData = isMobile && !readonly ? {
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7162
|
-
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
|
|
7169
|
-
|
|
7170
|
-
|
|
7171
|
-
|
|
7172
|
-
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
} : {
|
|
7161
|
+
// convertData = isMobile && !readonly ? {
|
|
7162
|
+
// type: "native-date",
|
|
7163
|
+
// pipeIn: (value, data) => {
|
|
7164
|
+
// if (value) {
|
|
7165
|
+
// value = moment(value).utc().format('YYYY-MM-DD');
|
|
7166
|
+
// return value;
|
|
7167
|
+
// } else {
|
|
7168
|
+
// return "";
|
|
7169
|
+
// }
|
|
7170
|
+
|
|
7171
|
+
// },
|
|
7172
|
+
// pipeOut: (value, oldValue, data) => {
|
|
7173
|
+
// if (value) {
|
|
7174
|
+
// value = moment(value).format('YYYY-MM-DDT00:00:00.000[Z]');
|
|
7175
|
+
// return value;
|
|
7176
|
+
// } else {
|
|
7177
|
+
// return "";
|
|
7178
|
+
// }
|
|
7179
|
+
// }
|
|
7180
|
+
// } : {
|
|
7181
|
+
// type: getAmisStaticFieldType('date', readonly),
|
|
7182
|
+
// inputFormat: "YYYY-MM-DD",
|
|
7183
|
+
// format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
7184
|
+
// tpl: readonly ? Tpl.getDateTpl(field) : null,
|
|
7185
|
+
// // utc: true
|
|
7186
|
+
// }
|
|
7187
|
+
convertData = {
|
|
7177
7188
|
type: getAmisStaticFieldType('date', readonly),
|
|
7178
7189
|
inputFormat: "YYYY-MM-DD",
|
|
7179
7190
|
format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
@@ -7192,43 +7203,51 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7192
7203
|
};
|
|
7193
7204
|
break;
|
|
7194
7205
|
case 'datetime':
|
|
7195
|
-
convertData = isMobile && !readonly ? {
|
|
7196
|
-
|
|
7197
|
-
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
} : {
|
|
7206
|
+
// convertData = isMobile && !readonly ? {
|
|
7207
|
+
// type: "combo",
|
|
7208
|
+
// pipeIn: (value, data) => {
|
|
7209
|
+
// let revalue = {};
|
|
7210
|
+
// if (value && value != "Invalid date") {
|
|
7211
|
+
// value = moment(value).format('YYYY-MM-DD HH:mm:ss');
|
|
7212
|
+
// revalue[field.name + "-native-date"] = value.split(' ')[0];
|
|
7213
|
+
// revalue[field.name + "-native-time"] = value.split(' ')[1];
|
|
7214
|
+
// } else {
|
|
7215
|
+
// revalue[field.name + "-native-date"] = "";
|
|
7216
|
+
// revalue[field.name + "-native-time"] = "";
|
|
7217
|
+
// }
|
|
7218
|
+
// return revalue;
|
|
7219
|
+
// },
|
|
7220
|
+
// pipeOut: (value, oldValue, data) => {
|
|
7221
|
+
// let revalue = "";
|
|
7222
|
+
// if (value[field.name + "-native-date"] && value[field.name + "-native-time"]) {
|
|
7223
|
+
// revalue = value[field.name + "-native-date"] + " " + value[field.name + "-native-time"];
|
|
7224
|
+
// revalue = moment(revalue).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]');
|
|
7225
|
+
// }
|
|
7226
|
+
// return revalue;
|
|
7227
|
+
// },
|
|
7228
|
+
// items: [
|
|
7229
|
+
// {
|
|
7230
|
+
// type: "native-date",
|
|
7231
|
+
// name: field.name + "-native-date",
|
|
7232
|
+
// className: "steedos-native-date",
|
|
7233
|
+
// value: ""
|
|
7234
|
+
// },
|
|
7235
|
+
// {
|
|
7236
|
+
// type: "native-time",
|
|
7237
|
+
// name: field.name + "-native-time",
|
|
7238
|
+
// className: "steedos-native-time",
|
|
7239
|
+
// value: ""
|
|
7240
|
+
// }
|
|
7241
|
+
// ]
|
|
7242
|
+
// } : {
|
|
7243
|
+
// type: getAmisStaticFieldType('datetime', readonly),
|
|
7244
|
+
// inputFormat: 'YYYY-MM-DD HH:mm',
|
|
7245
|
+
// format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
7246
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
7247
|
+
// utc: true,
|
|
7248
|
+
// }
|
|
7249
|
+
|
|
7250
|
+
convertData = {
|
|
7232
7251
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
7233
7252
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
7234
7253
|
format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
@@ -7248,26 +7267,34 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7248
7267
|
};
|
|
7249
7268
|
break;
|
|
7250
7269
|
case 'time':
|
|
7251
|
-
convertData = isMobile && !readonly ? {
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
|
|
7270
|
-
} : {
|
|
7270
|
+
// convertData = isMobile && !readonly ? {
|
|
7271
|
+
// type: "native-time",
|
|
7272
|
+
// pipeIn: (value, data) => {
|
|
7273
|
+
// if (value) {
|
|
7274
|
+
// value = moment(value).utc().format('HH:mm');
|
|
7275
|
+
// return value;
|
|
7276
|
+
// } else {
|
|
7277
|
+
// return "";
|
|
7278
|
+
// }
|
|
7279
|
+
|
|
7280
|
+
// },
|
|
7281
|
+
// pipeOut: (value, oldValue, data) => {
|
|
7282
|
+
// if (value) {
|
|
7283
|
+
// value = moment('1970-01-01 ' + value).format('1970-01-01THH:mm:00.000[Z]');
|
|
7284
|
+
// return value;
|
|
7285
|
+
// } else {
|
|
7286
|
+
// return "";
|
|
7287
|
+
// }
|
|
7288
|
+
// }
|
|
7289
|
+
// } : {
|
|
7290
|
+
// type: getAmisStaticFieldType('time', readonly),
|
|
7291
|
+
// inputFormat: 'HH:mm',
|
|
7292
|
+
// timeFormat:'HH:mm',
|
|
7293
|
+
// format:'1970-01-01THH:mm:00.000[Z]',
|
|
7294
|
+
// tpl: readonly ? Tpl.getDateTimeTpl(field) : null,
|
|
7295
|
+
// // utc: true
|
|
7296
|
+
// }
|
|
7297
|
+
convertData = {
|
|
7271
7298
|
type: getAmisStaticFieldType('time', readonly),
|
|
7272
7299
|
inputFormat: 'HH:mm',
|
|
7273
7300
|
timeFormat:'HH:mm',
|
|
@@ -7744,7 +7771,7 @@ var config = {
|
|
|
7744
7771
|
async function getQuickEditSchema(field, options){
|
|
7745
7772
|
//判断在amis3.2以上环境下,放开批量编辑
|
|
7746
7773
|
const isAmisVersionforBatchEdit = amisRequire('amis').version[0] >= 3 && amisRequire('amis').version[2] >= 2;
|
|
7747
|
-
const quickEditId = options.objectName + "_" + field.name + "
|
|
7774
|
+
const quickEditId = options.objectName + "_" + field.name + "_quickEdit";//定义快速编辑的表单id,用于setvalue传值
|
|
7748
7775
|
var quickEditSchema = { body: [], id: quickEditId };
|
|
7749
7776
|
//select,avatar,image,file等组件无法行记录字段赋值,暂不支持批量编辑;
|
|
7750
7777
|
if(field.type != 'avatar' && field.type != 'image' && field.type != 'file' && isAmisVersionforBatchEdit){
|
|
@@ -7754,19 +7781,16 @@ async function getQuickEditSchema(field, options){
|
|
|
7754
7781
|
{
|
|
7755
7782
|
actionType: "custom",
|
|
7756
7783
|
script: `
|
|
7757
|
-
|
|
7758
|
-
|
|
7784
|
+
let items = _.cloneDeep(event.data.items);
|
|
7785
|
+
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
7759
7786
|
if(event.data.isBatchEdit){
|
|
7760
7787
|
selectedItems.forEach(function(selectedItem){
|
|
7761
|
-
|
|
7762
|
-
|
|
7763
|
-
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
7764
|
-
selectedItems.forEach(function(selectedItem){
|
|
7788
|
+
selectedItem._display.${field.name} = event.data._display.${field.name};
|
|
7789
|
+
doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: "_display_" + selectedItem._index});
|
|
7765
7790
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + selectedItem._index});
|
|
7766
7791
|
})
|
|
7767
7792
|
}else{
|
|
7768
|
-
|
|
7769
|
-
doAction({actionType: 'setValue', "args": {"value": {items}},componentId: "${options.crudId}","dataMergeMode": "override"});
|
|
7793
|
+
doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "_display_" + event.data._index});
|
|
7770
7794
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
|
|
7771
7795
|
}
|
|
7772
7796
|
`
|
|
@@ -7796,7 +7820,7 @@ async function getQuickEditSchema(field, options){
|
|
|
7796
7820
|
{
|
|
7797
7821
|
"actionType": "custom",
|
|
7798
7822
|
"script": `
|
|
7799
|
-
var _display = event.data._display;
|
|
7823
|
+
var _display = _.cloneDeep(event.data._display);
|
|
7800
7824
|
${displayField}
|
|
7801
7825
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
7802
7826
|
`
|
|
@@ -7818,7 +7842,7 @@ async function getQuickEditSchema(field, options){
|
|
|
7818
7842
|
第二种是增加选项时,按照value的值,找到对应选项,并按照_display的规则为其赋值
|
|
7819
7843
|
*/
|
|
7820
7844
|
TempDisplayField = `
|
|
7821
|
-
const preData = event.data.__super.${field.name};
|
|
7845
|
+
const preData = _.cloneDeep(event.data.__super.${field.name});
|
|
7822
7846
|
if(preData && event.data.${field.name}.length < preData.length){
|
|
7823
7847
|
let deletedIndex;
|
|
7824
7848
|
preData.forEach(function(item,index){
|
|
@@ -8017,8 +8041,124 @@ async function getQuickEditSchema(field, options){
|
|
|
8017
8041
|
quickEditSchema.body.push({
|
|
8018
8042
|
"name": "isBatchEdit",
|
|
8019
8043
|
"type": "checkbox",
|
|
8020
|
-
"option":
|
|
8021
|
-
|
|
8044
|
+
"option": [
|
|
8045
|
+
{
|
|
8046
|
+
"type": "tpl",
|
|
8047
|
+
"tpl": "更新${COUNT(selectedItems)}个选定记录"
|
|
8048
|
+
},
|
|
8049
|
+
{
|
|
8050
|
+
"type": "spinner",
|
|
8051
|
+
"showOn": "${batchPermissionLoading}",
|
|
8052
|
+
"size": "sm",
|
|
8053
|
+
"className": "mr-4"
|
|
8054
|
+
}
|
|
8055
|
+
],
|
|
8056
|
+
"visibleOn": "${ARRAYSOME(selectedItems, item => item._id === _id) && COUNT(selectedItems)>1 && quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}",
|
|
8057
|
+
"disabledOn": "${batchPermissionLoading}",
|
|
8058
|
+
"onEvent":{
|
|
8059
|
+
"change":{
|
|
8060
|
+
"actions":[
|
|
8061
|
+
{
|
|
8062
|
+
"actionType": "setValue",
|
|
8063
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
8064
|
+
"args": {
|
|
8065
|
+
"value":{
|
|
8066
|
+
"batchPermissionLoading": true
|
|
8067
|
+
}
|
|
8068
|
+
},
|
|
8069
|
+
"expression":"${event.data.value}"
|
|
8070
|
+
},
|
|
8071
|
+
{
|
|
8072
|
+
"actionType": "ajax",
|
|
8073
|
+
"args": {
|
|
8074
|
+
"api": {
|
|
8075
|
+
"url": "${context.rootUrl}/graphql",
|
|
8076
|
+
"method": "post",
|
|
8077
|
+
"headers": {
|
|
8078
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
8079
|
+
},
|
|
8080
|
+
"data": {
|
|
8081
|
+
"query": "{rows:${objectName}(filters:[\"_id\",\"in\",${selectedItems | pick:_id | split | json}]){_id,_permissions{allowEdit}}}"
|
|
8082
|
+
},
|
|
8083
|
+
"adaptor": `
|
|
8084
|
+
const noPermission = [];
|
|
8085
|
+
payload.data.rows.forEach(function (row) {
|
|
8086
|
+
if(!row._permissions.allowEdit){
|
|
8087
|
+
noPermission.push(row._id);
|
|
8088
|
+
}
|
|
8089
|
+
})
|
|
8090
|
+
return payload = {data:{noPermission}};
|
|
8091
|
+
`
|
|
8092
|
+
}
|
|
8093
|
+
},
|
|
8094
|
+
"expression":"${event.data.value}"
|
|
8095
|
+
},
|
|
8096
|
+
{
|
|
8097
|
+
"actionType": "setValue",
|
|
8098
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
8099
|
+
"args": {
|
|
8100
|
+
"value":{
|
|
8101
|
+
"batchPermissionLoading": false
|
|
8102
|
+
}
|
|
8103
|
+
},
|
|
8104
|
+
"expression":"${event.data.value}"
|
|
8105
|
+
},
|
|
8106
|
+
{
|
|
8107
|
+
"actionType": "dialog",
|
|
8108
|
+
"dialog":{
|
|
8109
|
+
"title": "记录权限",
|
|
8110
|
+
"showCloseButton": false,
|
|
8111
|
+
"body":[
|
|
8112
|
+
{
|
|
8113
|
+
"type": "tpl",
|
|
8114
|
+
"tpl": "当前选中记录中,有${COUNT(noPermission)}条记录无编辑权限,是否需要批量编辑其他记录?"
|
|
8115
|
+
}
|
|
8116
|
+
],
|
|
8117
|
+
"onEvent":{
|
|
8118
|
+
"confirm":{
|
|
8119
|
+
"actions":[
|
|
8120
|
+
{
|
|
8121
|
+
"actionType": "custom",
|
|
8122
|
+
"script": `
|
|
8123
|
+
const noPermission = event.data.noPermission;
|
|
8124
|
+
const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
|
|
8125
|
+
const selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
|
|
8126
|
+
noPermission.forEach(function (item) {
|
|
8127
|
+
crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
|
|
8128
|
+
})
|
|
8129
|
+
`
|
|
8130
|
+
},
|
|
8131
|
+
{
|
|
8132
|
+
"actionType": "setValue",
|
|
8133
|
+
"componentId": quickEditId,
|
|
8134
|
+
"args": {
|
|
8135
|
+
"value":{
|
|
8136
|
+
"isBatchEdit": true
|
|
8137
|
+
}
|
|
8138
|
+
},
|
|
8139
|
+
}
|
|
8140
|
+
]
|
|
8141
|
+
},
|
|
8142
|
+
"cancel":{
|
|
8143
|
+
"actions":[
|
|
8144
|
+
{
|
|
8145
|
+
"actionType": "setValue",
|
|
8146
|
+
"componentId": quickEditId,
|
|
8147
|
+
"args": {
|
|
8148
|
+
"value":{
|
|
8149
|
+
"isBatchEdit": false
|
|
8150
|
+
}
|
|
8151
|
+
},
|
|
8152
|
+
}
|
|
8153
|
+
]
|
|
8154
|
+
}
|
|
8155
|
+
}
|
|
8156
|
+
},
|
|
8157
|
+
"expression":"${COUNT(event.data.noPermission)>0}"
|
|
8158
|
+
}
|
|
8159
|
+
]
|
|
8160
|
+
}
|
|
8161
|
+
}
|
|
8022
8162
|
});
|
|
8023
8163
|
}
|
|
8024
8164
|
} else {
|
|
@@ -8055,6 +8195,8 @@ async function getTableColumns(fields, options){
|
|
|
8055
8195
|
const columns = [];
|
|
8056
8196
|
if(!options.isLookup){
|
|
8057
8197
|
columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
|
|
8198
|
+
//将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
8199
|
+
columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
|
|
8058
8200
|
}
|
|
8059
8201
|
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
8060
8202
|
|
|
@@ -10412,7 +10554,8 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
10412
10554
|
const quickSaveApiRequestAdaptor = `
|
|
10413
10555
|
var graphqlOrder = "";
|
|
10414
10556
|
var imageNames = ${JSON.stringify(imageNames)};
|
|
10415
|
-
api.data.rowsDiff
|
|
10557
|
+
const rowsDiff = _.cloneDeep(api.data.rowsDiff);
|
|
10558
|
+
rowsDiff.forEach(function (item, index) {
|
|
10416
10559
|
for(key in item){
|
|
10417
10560
|
if(_.includes(imageNames, key)){
|
|
10418
10561
|
if(typeof item[key] == "string"){
|
|
@@ -10426,6 +10569,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
10426
10569
|
}
|
|
10427
10570
|
}
|
|
10428
10571
|
}
|
|
10572
|
+
item = _.omit(item, '_display');
|
|
10429
10573
|
const itemOrder = 'update' + index + ':' + api.data.objectName + '__update(id:"' + item._id + '", doc:' + JSON.stringify(JSON.stringify(_.omit(item, '_id'))) + ') {_id}';
|
|
10430
10574
|
graphqlOrder += itemOrder;
|
|
10431
10575
|
})
|
|
@@ -14539,5 +14683,5 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
14539
14683
|
};
|
|
14540
14684
|
};
|
|
14541
14685
|
|
|
14542
|
-
export { index as Field, Router, absoluteUrl, amisRender, amisRootClick, cloneObject, conditionsToFilters, createObject, defaultsDeep, deleteVariable, execute, executeButton, extendObject, fetchAPI, filtersToConditions, getApp, getApps, getAuthToken, getAuthorization, getButton, getButtonVisible, getButtonVisibleOn$1 as getButtonVisibleOn, getButtons, getCalendarSchema, getDefaultRenderData, getEnv, getEnvs, getEvn, getField, getFileSrc, getFlowFormSchema, getFormPageInitSchema, getFormSchema, getIdsPickerSchema, getImageSrc, getInstanceInfo, getListPageInitSchema, getListSchema, getListViewButtons, getListViewColumns, getListViewFilter, getListViewItemButtons, getListViewSort, getListviewInitSchema, getLookupSapceUserTreeSchema, getNotifications, getObjectDetailButtons, getObjectDetailButtonsSchemas, getObjectDetailMoreButtons, getObjectFieldsFilterBarSchema, getObjectFieldsFilterButtonSchema, getObjectFieldsFilterFormSchema, getObjectListHeader$1 as getObjectListHeader, getObjectListHeaderFieldsFilterBar, getObjectListHeaderFirstLine, getObjectListHeaderSecordLine, getObjectListViewButtonsSchemas, getObjectRecordDetailHeader, getObjectRecordDetailRelatedListButtonsSchemas, getObjectRecordDetailRelatedListHeader, getObjectRelated, getObjectRelatedList, getObjectRelatedListButtons, getObjectRelatedListHeader, getPage, getRecord, getRecordDetailHeaderSchema, getRecordDetailRelatedListSchema, getRecordDetailSchema, getRecordPageInitSchema, getRecordPermissions, getRecordServiceSchema, getReferenceTo, getRelatedFieldValue, getRelatedListSchema, getRelatedsCount, getRootUrl, getSelectUserSchema, getSpaceUsersPickerAmisSchema, getSpaceUsersPickerSchema, getSteedosAuth, getTableSchema, getTenantId, getUISchema, getUISchemaSync, getUserId, getViewSchema, isExpression, isObject, lookupToAmis, lookupToAmisIdsPicker, lookupToAmisPicker, lookupToAmisSelect, lookupToAmisSelectUser, markReadAll, parseSingleExpression, registerRemoteAssets, registerRenders, setEnv, setEnvs, setRootUrl, setSteedosAuth, setUISchemaFunction, setVariable, standardButtonsTodo };
|
|
14686
|
+
export { index as Field, Router, absoluteUrl, amisRender, amisRootClick, cloneObject, conditionsToFilters, createObject, defaultsDeep, deleteVariable, execute, executeButton, extendObject, fetchAPI, filtersToConditions, getApp, getApps, getAuthToken, getAuthorization, getButton, getButtonVisible, getButtonVisibleOn$1 as getButtonVisibleOn, getButtons, getCalendarSchema, getDefaultRenderData, getEnv, getEnvs, getEvn, getField, getFileSrc, getFlowFormSchema, getFormPageInitSchema, getFormSchema, getGlobalNowData, getIdsPickerSchema, getImageSrc, getInstanceInfo, getListPageInitSchema, getListSchema, getListViewButtons, getListViewColumns, getListViewFilter, getListViewItemButtons, getListViewSort, getListviewInitSchema, getLookupSapceUserTreeSchema, getNotifications, getObjectDetailButtons, getObjectDetailButtonsSchemas, getObjectDetailMoreButtons, getObjectFieldsFilterBarSchema, getObjectFieldsFilterButtonSchema, getObjectFieldsFilterFormSchema, getObjectListHeader$1 as getObjectListHeader, getObjectListHeaderFieldsFilterBar, getObjectListHeaderFirstLine, getObjectListHeaderSecordLine, getObjectListViewButtonsSchemas, getObjectRecordDetailHeader, getObjectRecordDetailRelatedListButtonsSchemas, getObjectRecordDetailRelatedListHeader, getObjectRelated, getObjectRelatedList, getObjectRelatedListButtons, getObjectRelatedListHeader, getPage, getRecord, getRecordDetailHeaderSchema, getRecordDetailRelatedListSchema, getRecordDetailSchema, getRecordPageInitSchema, getRecordPermissions, getRecordServiceSchema, getReferenceTo, getRelatedFieldValue, getRelatedListSchema, getRelatedsCount, getRootUrl, getSelectUserSchema, getSpaceUsersPickerAmisSchema, getSpaceUsersPickerSchema, getSteedosAuth, getTableSchema, getTenantId, getUISchema, getUISchemaSync, getUserId, getViewSchema, isExpression, isObject, lookupToAmis, lookupToAmisIdsPicker, lookupToAmisPicker, lookupToAmisSelect, lookupToAmisSelectUser, markReadAll, parseSingleExpression, registerRemoteAssets, registerRenders, setEnv, setEnvs, setRootUrl, setSteedosAuth, setUISchemaFunction, setVariable, standardButtonsTodo };
|
|
14543
14687
|
//# sourceMappingURL=index.esm.js.map
|