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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
| import {
| noColumnShowList,
| noGroupList,
| noSearchList,
| noVModelList,
| ocrList,
| systemComponentsList,
| useDateList,
| useInputList,
| } from '#/components/FormGenerator/src/helper/config';
| import { useFlowState } from '#/hooks/flow/useFlowStatus';
|
| const { flowStatusList } = useFlowState();
|
| const noUploadList = [
| ...noVModelList,
| 'uploadFile',
| 'uploadImg',
| 'colorPicker',
| 'popupTableSelect',
| 'relationForm',
| 'popupSelect',
| 'calculate',
| 'sign',
| 'signature',
| 'location',
| ...ocrList,
| ];
| 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: '@currentMonth', fullName: '当前月份' },
| { id: '@currentQuarter', fullName: '当前季度' },
| { id: '@currentYear', 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 [];
| }
|
| function getFlowStateField() {
| return {
| id: 'f_flow_state',
| fullName: '流程状态',
| __vModel__: 'f_flow_state',
| __config__: { jnpfKey: 'select', label: '流程状态' },
| options: flowStatusList,
| };
| }
|
| 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 defaultHeaderBtnEnableFunc = '({ onlineUtils }) => {\r\n\r\n return true \r\n}';
| const defaultAddBtnFunc = '({ data, index, refresh, onlineUtils, addRow }) => {\r\n addRow()\r\n}';
| const defaultEditBtnFunc = '({ data, index, refresh, onlineUtils, editRow }) => {\r\n editRow(data)\r\n}';
| const defaultDetailBtnFunc = '({ data, index, refresh, onlineUtils, detailRow }) => {\r\n detailRow(data)\r\n}';
| const defaultRemoveBtnFunc = '({ data, index, refresh, onlineUtils, deleteRow }) => {\r\n deleteRow(data)\r\n}';
| const defaultBatchRemoveBtnFunc = '({ data, index, refresh, onlineUtils, batchDeleteRows }) => {\r\n batchDeleteRows(data)\r\n}';
| function getDefaultBtnEvent(value) {
| if (value === 'remove') return { biz_sign_enabled: false, enableFunc: defaultBtnEnableFunc, customBtn: false, func: defaultRemoveBtnFunc };
| if (value === 'batchRemove') return { biz_sign_enabled: false, enableFunc: defaultHeaderBtnEnableFunc, customBtn: false, func: defaultBatchRemoveBtnFunc };
| if (value === 'edit') return { enableFunc: defaultBtnEnableFunc, customBtn: false, func: defaultEditBtnFunc };
| if (value === 'detail') return { enableFunc: defaultBtnEnableFunc, customBtn: false, func: defaultDetailBtnFunc };
| if (value === 'add') return { enableFunc: defaultHeaderBtnEnableFunc, customBtn: false, func: defaultAddBtnFunc };
| return { biz_sign_enabled: false, enableFunc: defaultHeaderBtnEnableFunc, customBtn: false };
| }
| 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',
| event: { enableFunc: defaultHeaderBtnEnableFunc, customBtn: false, func: defaultAddBtnFunc },
| },
| {
| show: false,
| value: 'download',
| icon: 'icon-ym icon-ym-btn-download',
| label: '导出',
| labelI18nCode: 'common.exportText',
| event: { enableFunc: defaultHeaderBtnEnableFunc },
| },
| {
| show: false,
| value: 'upload',
| icon: 'icon-ym icon-ym-btn-upload',
| label: '导入',
| labelI18nCode: 'common.importText',
| event: { enableFunc: defaultHeaderBtnEnableFunc },
| },
| {
| show: false,
| value: 'batchRemove',
| icon: 'icon-ym icon-ym-btn-clearn',
| label: '批量删除',
| labelI18nCode: 'common.batchDelText',
| event: { enableFunc: defaultHeaderBtnEnableFunc, customBtn: false, func: defaultBatchRemoveBtnFunc },
| },
| {
| show: false,
| value: 'batchPrint',
| icon: 'icon-ym icon-ym-report-icon-preview-printPreview',
| label: '批量打印',
| labelI18nCode: 'common.batchPrintText',
| event: { enableFunc: defaultHeaderBtnEnableFunc },
| },
| ];
| 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, customBtn: false, func: defaultEditBtnFunc },
| },
| {
| show: true,
| value: 'remove',
| icon: 'icon-ym icon-ym-btn-clearn',
| label: '删除',
| labelI18nCode: 'common.delText',
| event: { enableFunc: defaultBtnEnableFunc, customBtn: false, func: defaultRemoveBtnFunc },
| },
| {
| show: true,
| value: 'detail',
| icon: 'icon-ym icon-ym-generator-menu',
| label: '详情',
| labelI18nCode: 'common.detailText',
| event: { enableFunc: defaultBtnEnableFunc, customBtn: false, func: defaultDetailBtnFunc },
| },
| ];
|
| const defaultColumnData = {
| ruleList: { matchLogic: 'and', conditionList: [] }, // 过滤规则
| searchList: [], // 查询字段
| resizable: true, // 列表拖拽
| hasSuperQuery: true, // 高级查询
| showOverflow: true, // 溢出省略
| flowForm: false, // 流程表单
| childTableStyle: 1, // 子表样式
| showSummary: false, // 合计配置
| summaryField: [], // 合计字段
| columnList: [], // 字段列表
| columnOptions: [], // 字段列表
| defaultColumnList: [], // 所有可选择字段列表
| type: 1, // 列表类型
| defaultSortConfig: [], // 默认排序配置
| viewKey: '', // 视图主键
| hasPage: true, // 列表分页
| pageSize: 20, // 分页条数
| hasTreeQuery: false, // 左侧树查询
| treeIncludeChildren: 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, // 溢出省略
| flowForm: false, // 流程表单
| 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,
| defaultAddBtnFunc,
| defaultBatchRemoveBtnFunc,
| defaultBtnEnableFunc,
| defaultBtnsList,
| defaultColumnBtnsList,
| defaultColumnData,
| defaultDetailBtnFunc,
| defaultEditBtnFunc,
| defaultFuncsData,
| defaultHeaderBtnEnableFunc,
| defaultRemoveBtnFunc,
| getDefaultBtnEvent,
| getDefaultValue,
| getFlowStateField,
| getSearchMultiple,
| getSearchType,
| getSysFieldList,
| noColumnShowList,
| noGroupList,
| noSearchList,
| noUploadList,
| sourceTypeOptions,
| systemComponentsList,
| };
|
|