@steedos-widgets/amis-lib 1.2.2 → 1.2.3-beta.1
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 +31 -64
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +31 -64
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +31 -64
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/header.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -360,14 +360,19 @@
|
|
|
360
360
|
* @Author: baozhoutao@steedos.com
|
|
361
361
|
* @Date: 2022-08-16 17:02:08
|
|
362
362
|
* @LastEditors: baozhoutao@steedos.com
|
|
363
|
-
* @LastEditTime: 2023-04-
|
|
363
|
+
* @LastEditTime: 2023-04-17 15:24:21
|
|
364
364
|
* @Description:
|
|
365
365
|
*/
|
|
366
366
|
|
|
367
367
|
|
|
368
368
|
const Router = {
|
|
369
369
|
getTabDisplayAs(tab_id){
|
|
370
|
-
|
|
370
|
+
var urlSearch = new URLSearchParams(document.location.search);
|
|
371
|
+
if(urlSearch.has('display')){
|
|
372
|
+
return urlSearch.get('display')
|
|
373
|
+
}
|
|
374
|
+
// const key = `tab.${tab_id}.display`;
|
|
375
|
+
const key = `page.display`;
|
|
371
376
|
const value = localStorage.getItem(key);
|
|
372
377
|
return value ? value : 'grid'
|
|
373
378
|
},
|
|
@@ -2854,7 +2859,6 @@
|
|
|
2854
2859
|
function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
2855
2860
|
const { icon, label } = objectSchema;
|
|
2856
2861
|
const listViewButtonOptions = [];
|
|
2857
|
-
// let currentListView;
|
|
2858
2862
|
_$1.each(
|
|
2859
2863
|
objectSchema.list_views,
|
|
2860
2864
|
(listView, name) => {
|
|
@@ -2862,19 +2866,11 @@
|
|
|
2862
2866
|
type: "button",
|
|
2863
2867
|
label: listView.label,
|
|
2864
2868
|
actionType: "link",
|
|
2865
|
-
// icon: "fa fa-plus",
|
|
2866
2869
|
link: `/app/\${appId}/${objectSchema.name}/grid/${name}`
|
|
2867
2870
|
});
|
|
2868
|
-
// if(name === listViewName){
|
|
2869
|
-
// currentListView = listView;
|
|
2870
|
-
// }
|
|
2871
2871
|
}
|
|
2872
2872
|
);
|
|
2873
2873
|
|
|
2874
|
-
// if(!currentListView){
|
|
2875
|
-
// return {};
|
|
2876
|
-
// }
|
|
2877
|
-
|
|
2878
2874
|
const buttons = getListViewButtons(objectSchema, {});
|
|
2879
2875
|
let amisButtonsSchema = _$1.map(buttons, (button) => {
|
|
2880
2876
|
return {
|
|
@@ -2885,34 +2881,7 @@
|
|
|
2885
2881
|
className: `button_${button.name}`
|
|
2886
2882
|
}
|
|
2887
2883
|
});
|
|
2888
|
-
|
|
2889
|
-
// const bulkDeleteScript = `
|
|
2890
|
-
// const data = event.data;
|
|
2891
|
-
// const listViewId = data.listViewId;
|
|
2892
|
-
// const uiSchema = data.uiSchema;
|
|
2893
|
-
// const scopeId = data.scopeId;
|
|
2894
|
-
// BuilderAmisObject.AmisLib.standardButtonsTodo.standard_delete_many.call({
|
|
2895
|
-
// listViewId,
|
|
2896
|
-
// uiSchema,
|
|
2897
|
-
// scopeId
|
|
2898
|
-
// })
|
|
2899
|
-
// `;
|
|
2900
|
-
// amisButtonsSchema.push({
|
|
2901
|
-
// type: 'button',
|
|
2902
|
-
// label: "删除",
|
|
2903
|
-
// className: `antd-Button antd-Button--default antd-Button--size-default`,
|
|
2904
|
-
// "onEvent": {
|
|
2905
|
-
// "click": {
|
|
2906
|
-
// "actions": [
|
|
2907
|
-
// {
|
|
2908
|
-
// "actionType": "custom",
|
|
2909
|
-
// "script": bulkDeleteScript
|
|
2910
|
-
// }
|
|
2911
|
-
// ]
|
|
2912
|
-
// }
|
|
2913
|
-
// }
|
|
2914
|
-
// });
|
|
2915
|
-
// }
|
|
2884
|
+
|
|
2916
2885
|
const reg = new RegExp('_', 'g');
|
|
2917
2886
|
const standardIcon = icon && icon.replace(reg, '-');
|
|
2918
2887
|
return {
|
|
@@ -3102,27 +3071,14 @@
|
|
|
3102
3071
|
* @param {*} objectSchema 对象UISchema
|
|
3103
3072
|
* @returns amisSchema
|
|
3104
3073
|
*/
|
|
3105
|
-
|
|
3074
|
+
function getObjectListHeader$1(objectSchema, listViewName, ctx) {
|
|
3106
3075
|
let firstLineSchema = getObjectListHeaderFirstLine(objectSchema);
|
|
3107
|
-
// let secordLineSchema = await getObjectListHeaderSecordLine(objectSchema, listViewName, ctx);
|
|
3108
|
-
// let body = [firstLineSchema, secordLineSchema];
|
|
3109
3076
|
let body = [firstLineSchema];
|
|
3110
|
-
// let roundedCss = "";
|
|
3111
|
-
// if (ctx.onlyFirstLine) {
|
|
3112
|
-
// body = [firstLineSchema];
|
|
3113
|
-
// }
|
|
3114
|
-
// else if (ctx.onlySecordLine) {
|
|
3115
|
-
// // 列表视图自定义amisSchema时不能加圆角
|
|
3116
|
-
// roundedCss = "";
|
|
3117
|
-
// // body = [secordLineSchema];
|
|
3118
|
-
// }
|
|
3119
3077
|
let headerSchema = [{
|
|
3120
3078
|
"type": "wrapper",
|
|
3121
3079
|
"body": body,
|
|
3122
3080
|
"className": `bg-gray-100 sm:rounded-tl sm:rounded-tr p-4 -mb-4`
|
|
3123
3081
|
}];
|
|
3124
|
-
// const fieldsFilterBarSchema = await getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx);
|
|
3125
|
-
// headerSchema.push(fieldsFilterBarSchema);
|
|
3126
3082
|
return headerSchema;
|
|
3127
3083
|
}
|
|
3128
3084
|
|
|
@@ -3376,6 +3332,7 @@
|
|
|
3376
3332
|
"icon": "fa fa-table-columns",
|
|
3377
3333
|
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3378
3334
|
"align": "right",
|
|
3335
|
+
"visibleOn": "${formFactor !== 'SMALL'}",
|
|
3379
3336
|
"buttons": [
|
|
3380
3337
|
{
|
|
3381
3338
|
"label": "显示为",
|
|
@@ -3512,7 +3469,7 @@ setTimeout(()=>{
|
|
|
3512
3469
|
}
|
|
3513
3470
|
}
|
|
3514
3471
|
} : {},
|
|
3515
|
-
|
|
3472
|
+
getDisplayAsButton(mainObject?.name)
|
|
3516
3473
|
]
|
|
3517
3474
|
}else {
|
|
3518
3475
|
return [
|
|
@@ -4105,7 +4062,7 @@ setTimeout(()=>{
|
|
|
4105
4062
|
}
|
|
4106
4063
|
]
|
|
4107
4064
|
},
|
|
4108
|
-
|
|
4065
|
+
getDisplayAsButton(showDisplayAs)
|
|
4109
4066
|
// {
|
|
4110
4067
|
// "type": "search-box",
|
|
4111
4068
|
// "align": "right",
|
|
@@ -8370,8 +8327,8 @@ setTimeout(()=>{
|
|
|
8370
8327
|
/*
|
|
8371
8328
|
* @Author: baozhoutao@steedos.com
|
|
8372
8329
|
* @Date: 2022-07-05 15:55:39
|
|
8373
|
-
* @LastEditors:
|
|
8374
|
-
* @LastEditTime: 2023-04-
|
|
8330
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
8331
|
+
* @LastEditTime: 2023-04-17 15:26:17
|
|
8375
8332
|
* @Description:
|
|
8376
8333
|
*/
|
|
8377
8334
|
|
|
@@ -8584,6 +8541,7 @@ setTimeout(()=>{
|
|
|
8584
8541
|
return { uiSchema };
|
|
8585
8542
|
}
|
|
8586
8543
|
|
|
8544
|
+
// 直接返回自定义的列表视图schema
|
|
8587
8545
|
if(listView.enable_amis_schema && listView.amis_schema){
|
|
8588
8546
|
const amisSchema = _$1.isString(listView.amis_schema) ? JSON.parse(listView.amis_schema) : listView.amis_schema;
|
|
8589
8547
|
return {
|
|
@@ -8597,6 +8555,7 @@ setTimeout(()=>{
|
|
|
8597
8555
|
let sort = getListViewSort(listView);
|
|
8598
8556
|
let listviewFilter = getListViewFilter(listView);
|
|
8599
8557
|
let listview_filters = listView && listView._filters;
|
|
8558
|
+
// 返回 calendar 组件
|
|
8600
8559
|
if(listView.type === "calendar"){
|
|
8601
8560
|
const amisSchema = {
|
|
8602
8561
|
"type": "steedos-object-calendar",
|
|
@@ -8615,14 +8574,21 @@ setTimeout(()=>{
|
|
|
8615
8574
|
|
|
8616
8575
|
const defaults = ctx.defaults || {};
|
|
8617
8576
|
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8577
|
+
// // 未自定义header 且显示header的时候, 使用系统header
|
|
8578
|
+
// if(!defaults.headerSchema && ctx.showHeader){
|
|
8579
|
+
// defaults.headerSchema = getObjectListHeader(uiSchema, listViewName);
|
|
8580
|
+
// }
|
|
8581
|
+
|
|
8582
|
+
// // 如果不显示header,则清理掉
|
|
8583
|
+
// if(!ctx.showHeader){
|
|
8584
|
+
// defaults.headerSchema = null;
|
|
8585
|
+
// }
|
|
8621
8586
|
|
|
8622
|
-
|
|
8623
|
-
defaults.headerSchema = null;
|
|
8624
|
-
}
|
|
8587
|
+
defaults.headerSchema = null;
|
|
8625
8588
|
|
|
8589
|
+
/**
|
|
8590
|
+
* 本次存储代码段
|
|
8591
|
+
*/
|
|
8626
8592
|
try {
|
|
8627
8593
|
const listViewPropsStoreKey = location.pathname + "/crud/" + ctx.listViewId;
|
|
8628
8594
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
@@ -8737,7 +8703,7 @@ setTimeout(()=>{
|
|
|
8737
8703
|
headerToolbarItems: ctx.headerToolbarItems,
|
|
8738
8704
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8739
8705
|
});
|
|
8740
|
-
|
|
8706
|
+
console.log('getTableSchema====>amisSchema', amisSchema);
|
|
8741
8707
|
// console.timeEnd('getTableSchema');
|
|
8742
8708
|
return {
|
|
8743
8709
|
uiSchema,
|
|
@@ -8935,6 +8901,7 @@ setTimeout(()=>{
|
|
|
8935
8901
|
if(typeof window != 'undefined'){
|
|
8936
8902
|
window.getUISchema = getUISchema;
|
|
8937
8903
|
window.getUISchemaSync = getUISchemaSync;
|
|
8904
|
+
window.getListSchema = getListSchema;
|
|
8938
8905
|
}
|
|
8939
8906
|
|
|
8940
8907
|
// import { getListSchema } from './objects';
|