1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
| import {
| noColumnShowList,
| noGroupList,
| noSearchList,
| noVModelList,
| systemComponentsList,
| useDateList,
| useInputList,
| } from '#/components/FormGenerator/src/helper/config';
|
| const noUploadList = [
| ...noVModelList,
| 'uploadFile',
| 'uploadImg',
| 'colorPicker',
| 'popupTableSelect',
| 'relationForm',
| 'popupSelect',
| 'calculate',
| 'sign',
| 'signature',
| 'location',
| ];
| const sourceTypeOptions = [
| { id: 2, fullName: '自定义' },
| { id: 4, fullName: '系统变量' },
| ];
|
| function getSysFieldList(jnpfKey, isFromParam = false) {
| if (['datePicker'].includes(jnpfKey)) {
| if (isFromParam) return [{ id: '@currentTime', fullName: '当前时间' }];
| return [
| { id: '@currentTime', fullName: '当前时间' },
| { id: '@pastThreeDays', fullName: '近三天' },
| { id: '@pastWeek', fullName: '近七天' },
| { id: '@pastMonth', fullName: '近一个月' },
| { id: '@pastThreeMonths', fullName: '近三个月' },
| { id: '@pastSixMonths', fullName: '近半年' },
| { id: '@pastYear', fullName: '近一年' },
| ];
| }
| if (['organizeSelect'].includes(jnpfKey)) return [{ id: '@currOrganize', fullName: '当前组织' }];
| if (['posSelect'].includes(jnpfKey)) return [{ id: '@currPosition', fullName: '当前岗位' }];
| if (['userSelect'].includes(jnpfKey)) return [{ id: '@currUser', fullName: '当前用户' }];
| return [];
| }
| const getSearchType = (item) => {
| const jnpfKey = item.__config__.jnpfKey;
| // 等于-1 模糊-2 范围-3
| const fuzzyList = [...useInputList];
| const RangeList = [...useDateList, 'timePicker', 'datePicker', 'inputNumber', 'calculate', 'dateCalculate', 'rate', 'slider'];
| if (RangeList.includes(jnpfKey)) return 3;
| if (fuzzyList.includes(jnpfKey)) return 2;
| return 1;
| };
| const getSearchMultiple = (jnpfKey) => {
| const searchMultipleList = ['select', 'roleSelect', 'userSelect', 'usersSelect', 'organizeSelect', 'posSelect', 'groupSelect'];
| return searchMultipleList.includes(jnpfKey);
| };
| const getDefaultValue = (item) => {
| if (item.__config__.isFromParam) return undefined;
| const jnpfKey = item.__config__.jnpfKey;
| const list = ['areaSelect', 'timePicker', 'datePicker', 'inputNumber', 'calculate'];
| return list.includes(jnpfKey) || item.multiple ? [] : undefined;
| };
| const defaultBtnEnableFunc = '({ row, rowIndex, onlineUtils }) => {\r\n\r\n return true \r\n}';
| const defaultFuncsData = {
| afterOnload: '({ data, tableRef, onlineUtils }) => {\r\n \r\n}',
| rowStyle: '({ row, rowIndex }) => {\r\n \r\n}',
| cellStyle: '({ row, column, rowIndex, columnIndex }) => {\r\n \r\n}',
| };
| const defaultBtnsList = [
| { show: true, value: 'add', icon: 'icon-ym icon-ym-btn-add', label: '新增', labelI18nCode: 'common.add2Text' },
| { show: false, value: 'download', icon: 'icon-ym icon-ym-btn-download', label: '导出', labelI18nCode: 'common.exportText' },
| { show: false, value: 'upload', icon: 'icon-ym icon-ym-btn-upload', label: '导入', labelI18nCode: 'common.importText' },
| { show: false, value: 'batchRemove', icon: 'icon-ym icon-ym-btn-clearn', label: '批量删除', labelI18nCode: 'common.batchDelText' },
| { show: false, value: 'batchPrint', icon: 'icon-ym icon-ym-report-icon-preview-printPreview', label: '批量打印', labelI18nCode: 'common.batchPrintText' },
| ];
| const defaultAppBtnsList = defaultBtnsList.filter((o) => ['add', 'batchRemove'].includes(o.value));
| const defaultColumnBtnsList = [
| {
| show: true,
| value: 'edit',
| icon: 'icon-ym icon-ym-btn-edit',
| label: '编辑',
| labelI18nCode: 'common.editText',
| event: { enableFunc: defaultBtnEnableFunc },
| },
| {
| show: true,
| value: 'remove',
| icon: 'icon-ym icon-ym-btn-clearn',
| label: '删除',
| labelI18nCode: 'common.delText',
| event: { enableFunc: defaultBtnEnableFunc },
| },
| {
| show: true,
| value: 'detail',
| icon: 'icon-ym icon-ym-generator-menu',
| label: '详情',
| labelI18nCode: 'common.detailText',
| event: { enableFunc: defaultBtnEnableFunc },
| },
| ];
|
| const defaultColumnData = {
| ruleList: { matchLogic: 'and', conditionList: [] }, // 过滤规则
| searchList: [], // 查询字段
| resizable: true, // 列表拖拽
| hasSuperQuery: true, // 高级查询
| showOverflow: true, // 溢出省略
| childTableStyle: 1, // 子表样式
| showSummary: false, // 合计配置
| summaryField: [], // 合计字段
| columnList: [], // 字段列表
| columnOptions: [], // 字段列表
| defaultColumnList: [], // 所有可选择字段列表
| type: 1, // 列表类型
| defaultSortConfig: [], // 默认排序配置
| viewKey: '', // 视图主键
| hasPage: true, // 列表分页
| pageSize: 20, // 分页条数
| hasTreeQuery: false, // 左侧树查询
| treeTitle: '左侧标题', // 树形标题
| treeTitleI18nCode: '', // 树形标题多语言标识
| treeDataSource: 'dictionary', // 树形数据来源
| treeDictionary: '', // 数据字典
| treeRelation: '', // 关联字段
| treeRelationFieldSelectType: 'all', // 关联字段选择类型
| treeRelationFieldAbleIds: [], // 关联字段范围
| treeSyncType: 0, // 数据加载 同步、异步
| treeSyncInterfaceId: '',
| treeSyncInterfaceName: '',
| treeSyncTemplateJson: [],
| treePropsUrl: '', // 数据选择id
| treePropsName: '', // 数据选择名称
| treeTemplateJson: [],
| treePropsValue: 'id', // 主键字段
| treePropsChildren: 'children', // 子级字段
| treePropsLabel: 'fullName', // 回显字段
| groupField: '', // 分组字段
| parentField: '', // 父级字段
| printIds: [],
| useColumnPermission: false,
| useFormPermission: false,
| useBtnPermission: false,
| useDataPermission: false,
| customBtnsList: [],
| btnsList: defaultBtnsList, // 按钮
| columnBtnsList: defaultColumnBtnsList, // 列按钮
| funcs: {
| afterOnload: '({ data, tableRef, onlineUtils }) => {\r\n \r\n}',
| rowStyle: '({ row, rowIndex }) => {\r\n \r\n}',
| cellStyle: '({ row, column, rowIndex, columnIndex }) => {\r\n \r\n}',
| },
| uploaderTemplateJson: {},
| complexHeaderList: [],
| tabConfig: { on: false, relationField: '', hasAllTab: true }, // 标签面板
| };
| const defaultAppColumnData = {
| ruleListApp: { matchLogic: 'and', conditionList: [] }, // 过滤规则
| searchList: [], // 查询字段
| hasSuperQuery: false, // 高级查询
| showOverflow: true, // 溢出省略
| columnList: [], // 字段列表
| columnOptions: [],
| defaultColumnList: [], // 所有可选择字段列表
| type: 1, // 列表类型
| defaultSortConfig: [], // 默认排序配置
| viewKey: '', // 视图主键
| hasPage: true, // 列表分页
| pageSize: 20, // 分页条数
| useColumnPermission: false,
| useFormPermission: false,
| useBtnPermission: false,
| useDataPermission: false,
| customBtnsList: [],
| btnsList: defaultAppBtnsList, // 按钮
| columnBtnsList: defaultColumnBtnsList, // 列按钮
| funcs: {
| afterOnload: '({ data, tableRef, onlineUtils }) => {\r\n \r\n}',
| },
| tabConfig: { on: false, relationField: '', hasAllTab: true }, // 标签面板
| };
|
| export {
| defaultAppBtnsList,
| defaultAppColumnData,
| defaultBtnEnableFunc,
| defaultBtnsList,
| defaultColumnBtnsList,
| defaultColumnData,
| defaultFuncsData,
| getDefaultValue,
| getSearchMultiple,
| getSearchType,
| getSysFieldList,
| noColumnShowList,
| noGroupList,
| noSearchList,
| noUploadList,
| sourceTypeOptions,
| systemComponentsList,
| };
|
|