@utogether/udp-core 1.0.1-beta.16 → 1.0.1-beta.18
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/build/plugins.ts +39 -39
- package/dist/{403-RBzulrcG.js → 403-B8xAGW0x.js} +1 -1
- package/dist/{404-DX-dU_6C.js → 404-BtgajMpP.js} +1 -1
- package/dist/{500-BCTk0__d.js → 500-DFWWZylZ.js} +1 -1
- package/dist/{AuthorityInfo-BADTOenq.js → AuthorityInfo-BxWSZs7n.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-Cv46yAx_.js → AuthorityInfo.vue_vue_type_style_index_0_lang-XIiFdjxN.js} +1 -1
- package/dist/{Company-B-61KrWd.js → Company-BbUJtuvr.js} +3 -3
- package/dist/{CompanyPanel-CawSrEff.js → CompanyPanel-KOOFrGjk.js} +8 -8
- package/dist/{Department-CrzJPtvP.js → Department-BimSgBm2.js} +3 -3
- package/dist/{DepartmentPanel-DYuL8H-j.js → DepartmentPanel-DYXPUCDs.js} +3 -3
- package/dist/{DesignPanel-DEAv6V68.js → DesignPanel-CHZ36J4q.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BsnXZ2td.js → DesignPanel.vue_vue_type_style_index_0_lang-ZbNixuuY.js} +2 -2
- package/dist/{DictView-BuO-2b-c.js → DictView-7RQYVj4H.js} +1 -1
- package/dist/{InvOrganization-CBgKBJAn.js → InvOrganization-esq9FI1K.js} +1 -1
- package/dist/{Org-BaQw2r-o.js → Org-BGswGV9g.js} +1 -1
- package/dist/{Preview-DvCrmKNk.js → Preview-DP0pD6Kf.js} +1 -1
- package/dist/{ReportDefine-DyhWz0as.js → ReportDefine-1rjKlbK-.js} +1 -1
- package/dist/{ReportDesign-DgZ2f2zv.js → ReportDesign-BIUj35Kh.js} +2 -2
- package/dist/{ReportQuery-DTZYbCDi.js → ReportQuery-CWevStRg.js} +1 -1
- package/dist/{ReportQueryFrom-B-vtJegP.js → ReportQueryFrom-vlOF5_gc.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-D6izgxph.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-BGyeoYxo.js} +1 -1
- package/dist/{ReportTemplate-DA1ZqKGf.js → ReportTemplate-BPURQOFZ.js} +1 -1
- package/dist/{Role-mbqoav5t.js → Role-D8xJ3rai.js} +3 -3
- package/dist/{RoleAssign-ltEJIEcr.js → RoleAssign-CE5FeHLd.js} +8 -8
- package/dist/{RolePanel-u90v9eS0.js → RolePanel-B6wskQVB.js} +1 -1
- package/dist/{RolePanel-1g1a-G8D.js → RolePanel-CqHsGjrK.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-LC4Egk-Q.js → RolePanel.vue_vue_type_script_setup_true_lang-Bjoq-nCm.js} +3 -3
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-D9YxpGnt.js → RolePanel.vue_vue_type_script_setup_true_lang-Dv5IVELj.js} +1 -1
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-DZ3W1epK.js → ScrollPanel.vue_vue_type_style_index_0_lang-Bp8Y_5A2.js} +1 -1
- package/dist/{Staff-CJ2GgCL3.js → Staff-DuYrik71.js} +3 -3
- package/dist/{StaffInfo-3KkodDCK.js → StaffInfo-CZiak-1b.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-CW-isIxJ.js → StaffInfo.vue_vue_type_script_setup_true_lang-LCuqxUh8.js} +1 -1
- package/dist/{StaffPanel-DoXPSoY5.js → StaffPanel-DI6MBAJH.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-DvhGnOMZ.js → StaffPanel.vue_vue_type_script_setup_true_lang-DxJhnVpd.js} +2 -2
- package/dist/{SysUser-BuIZhMPh.js → SysUser-DoNj2tIV.js} +2 -2
- package/dist/{SysUserPanel-t1GJcJGM.js → SysUserPanel-CvfyRxel.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-CDDkFLlN.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BoghL7F3.js} +43 -39
- package/dist/{SystemMenu-DuLEL6_l.js → SystemMenu-Cr3vUEQU.js} +2 -2
- package/dist/{UserInfo-WWby4lts.js → UserInfo-6c8UDIVO.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-B06ZSrJV.js → UserInfo.vue_vue_type_style_index_0_lang-DstUSeNQ.js} +1 -1
- package/dist/{childView-B0-EAoAi.js → childView-BlmHw5jv.js} +1 -1
- package/dist/{childView-IYY4L8VK.js → childView-C050pf1v.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-B56v6yK7.js → childView.vue_vue_type_style_index_0_lang-BxLT1Dz0.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CjF8nZuj.js → childView.vue_vue_type_style_index_0_lang-D0nlTIP-.js} +2 -2
- package/dist/{code-rule-DDLdi3pP.js → code-rule-Br1Mh3_M.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/{cron-task-p3-AFN1w.js → cron-task-DhuIk5pP.js} +1 -1
- package/dist/{frameView-B_WAZErD.js → frameView-hJoSI0Ai.js} +1 -1
- package/dist/index-1dgWFXT2.js +5436 -0
- package/dist/{layoutView-CoEp2afn.js → layoutView-DU-TVfOp.js} +1340 -1337
- package/dist/{login-DP0oP70W.js → login-CzJBV0x8.js} +2 -2
- package/dist/{lov-view-BDoZRK-v.js → lov-view-BxaHaVKE.js} +2 -2
- package/dist/{menuInfo-5Xls76qB.js → menuInfo-Dp7nAbgM.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-BfZczW9a.js → menuInfo.vue_vue_type_style_index_0_lang-Ch4NbiCL.js} +1 -1
- package/dist/{pda-app-DxGYn4G7.js → pda-app-BmxY3H7y.js} +2 -2
- package/dist/{resource-BnYWe_-Q.js → resource-D2dCI_x9.js} +1 -1
- package/dist/{su-welcome-B2rNhhDH.js → su-welcome-BKGU5HUf.js} +1 -1
- package/dist/{sys-config-Bb4WkxZK.js → sys-config-s8DnZMOd.js} +1 -1
- package/dist/udp-core.css +1 -9
- package/index.ts +48 -48
- package/package.json +1 -1
- package/src/App.vue +65 -65
- package/src/components/SuCharts/src/UserInfo.vue +78 -78
- package/src/components/SuScrollTree/ScrollPanel.vue +170 -175
- package/src/components/udp/{grid.vue → grid/index.vue} +39 -25
- package/src/components/udp/index.ts +2 -9
- package/src/components/udp/utils.ts +63 -108
- package/src/layout/components/lay-navbar/index.vue +239 -239
- package/src/layout/components/lay-panel/index.vue +150 -150
- package/src/layout/components/lay-search/index.vue +25 -25
- package/src/layout/components/lay-select-org/index.vue +64 -64
- package/src/layout/components/lay-sidebar/horizontal.vue +190 -190
- package/src/layout/components/lay-sidebar/mixNav.vue +260 -260
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +1 -0
- package/src/layout/components/lay-tag/index.vue +20 -48
- package/src/layout/hooks/useNav.ts +173 -173
- package/src/layout/hooks/useTag.ts +5 -3
- package/src/layout/types.ts +3 -2
- package/src/main.ts +24 -21
- package/src/plugins/i18n/en.ts +302 -302
- package/src/plugins/i18n/zh.ts +356 -354
- package/src/plugins/vxe-table/index.ts +67 -4
- package/src/plugins/vxe-table/render.tsx +18 -29
- package/src/router/index.ts +186 -177
- package/src/router/modules/remaining.ts +58 -58
- package/src/router/utils.ts +393 -377
- package/src/store/modules/app.ts +1 -3
- package/src/store/modules/multiTags.ts +110 -109
- package/src/store/modules/permission.ts +113 -100
- package/src/style/button.scss +85 -85
- package/src/style/login.css +336 -336
- package/src/style/vxetable.scss +338 -321
- package/src/views/organization/company/CompanyPanel.vue +259 -259
- package/src/views/organization/department/DepartmentPanel.vue +269 -283
- package/src/views/system/menu/SystemMenu.vue +183 -183
- package/src/views/system/menu/menuInfo.vue +363 -363
- package/src/views/system/role/UserInfo.vue +195 -195
- package/src/views/system/role-assign/RoleAssign.vue +57 -57
- package/src/views/system/role-assign/RolePanel.vue +139 -139
- package/src/views/system/sys/sys-config.vue +336 -336
- package/src/views/system/sysUser/SysUserPanel.vue +279 -278
- package/src/views/uapp/pda/pda-app.vue +208 -208
- package/src/views/udev/dict/DictView.vue +118 -118
- package/src/views/udev/dict/childView.vue +1 -1
- package/src/views/udev/lov/lov-view.vue +91 -91
- package/src/views/ulogin/login.vue +323 -323
- package/src/views/upms/interface/log-out.vue +101 -101
- package/src/views/urpt/design/DesignPanel.vue +507 -507
- package/types/global.d.ts +230 -230
- package/dist/index-24fnvUBy.js +0 -2822
- package/src/components/udp/count-down.vue +0 -536
- package/src/components/udp/flip-down/FlipCard/flip-card.vue +0 -251
- package/src/components/udp/flip-down/FlipCard/interfaces.ts +0 -4
- package/src/components/udp/flip-down/FlipClock/flip-clock.vue +0 -113
- package/src/components/udp/form-upload.vue +0 -482
- package/src/components/udp/form.vue +0 -112
- package/src/components/udp/lov.vue +0 -388
- package/src/components/udp/modal-form.vue +0 -190
- package/src/components/udp/modal-grid.vue +0 -298
- package/src/components/udp/upload.vue +0 -423
- package/src/utils/udp/http/index.ts +0 -294
- package/src/utils/udp/http/types.d.ts +0 -49
- package/src/utils/udp/useRender.ts +0 -431
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* @Author:
|
|
3
|
-
* @Date:
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2022-06-23 17:29:11
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
6
|
-
* @
|
|
7
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
5
|
+
* @LastEditTime: 2025-10-29 18:04:53
|
|
6
|
+
* @Description: file content
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
// @ts-nocheck
|
|
9
|
+
|
|
10
|
+
import { clone, isString, orderBy, isEmpty, toDateString, isObject, isFunction } from 'xe-utils';
|
|
11
|
+
import { cookies, storageLocal } from '@utogether/utils';
|
|
11
12
|
/** 系统配置的key */
|
|
12
13
|
const kSYSCONFIG = 'kSysConfig';
|
|
13
14
|
const kCOOKIES = 'kCookies_param';
|
|
14
15
|
|
|
15
16
|
const sysConfig = storageLocal.getItem(kSYSCONFIG);
|
|
16
17
|
|
|
17
|
-
const renderHook = useRender();
|
|
18
|
-
|
|
19
18
|
/** 工具栏按钮标准化 */
|
|
20
19
|
export const formatButton = (buttons, auth?) => {
|
|
21
20
|
buttons.forEach(btn => {
|
|
22
21
|
btn.auth = auth ? auth[btn.code] || btn.auth : btn.auth;
|
|
23
|
-
debugger;
|
|
24
22
|
if (!btn.name) {
|
|
25
23
|
btn.name = `message.btn.${btn.code}`;
|
|
26
24
|
} else if (sysConfig?.i18nEnabled === 'Y' && !btn.name.startsWith('message.')) {
|
|
@@ -44,7 +42,8 @@ export const queryAll = (props, http, form) => {
|
|
|
44
42
|
const params = { pageNum: 1, pageSize: 100000 };
|
|
45
43
|
const commonParam = getCookieParam();
|
|
46
44
|
Object.assign(params, form, commonParam, props.defaultParams || {});
|
|
47
|
-
|
|
45
|
+
let query = formatMultipleParams(params, props.items);
|
|
46
|
+
query = formatDateRange(query, props.items);
|
|
48
47
|
|
|
49
48
|
const { url } = props;
|
|
50
49
|
if (!url) return null;
|
|
@@ -71,7 +70,7 @@ export const queryAll = (props, http, form) => {
|
|
|
71
70
|
* @param isDoc doc文档
|
|
72
71
|
* @returns Promise
|
|
73
72
|
*/
|
|
74
|
-
export const query = (props, form, page, http, isDoc) => {
|
|
73
|
+
export const query = (props, form, page, http, code, isDoc) => {
|
|
75
74
|
if (isDoc) return getDocData();
|
|
76
75
|
for (const key in form) {
|
|
77
76
|
if (form[key] && isString(form[key])) {
|
|
@@ -81,9 +80,10 @@ export const query = (props, form, page, http, isDoc) => {
|
|
|
81
80
|
const params = { pageNum: page.currentPage, pageSize: page.pageSize };
|
|
82
81
|
const commonParam = getCookieParam();
|
|
83
82
|
Object.assign(params, commonParam, props.defaultParams || {}, form);
|
|
84
|
-
|
|
83
|
+
|
|
84
|
+
let query = formatMultipleParams(params, props.items, form);
|
|
85
|
+
query = formatDateRange(query, props.items);
|
|
85
86
|
const { url } = props;
|
|
86
|
-
console.log(query);
|
|
87
87
|
if (!url) return null;
|
|
88
88
|
const requestURL = isString(url) ? url : url.fetch || url.restful;
|
|
89
89
|
const method = url.fetch ? 'post' : 'get';
|
|
@@ -133,28 +133,44 @@ export const save = (http, body, props) => {
|
|
|
133
133
|
return allService;
|
|
134
134
|
};
|
|
135
135
|
|
|
136
|
+
/**
|
|
137
|
+
* 多选数据优化
|
|
138
|
+
* @param listQuery
|
|
139
|
+
* @param items
|
|
140
|
+
* @returns
|
|
141
|
+
*/
|
|
142
|
+
const formatMultipleParams = (listQuery: any, items) => {
|
|
143
|
+
const multipleItems = items.filter(f => f.itemRender?.props?.multiple || f.multiple);
|
|
144
|
+
debugger;
|
|
145
|
+
if (isEmpty(multipleItems)) return listQuery;
|
|
146
|
+
const query = clone(listQuery, true);
|
|
147
|
+
multipleItems.forEach((element: any) => {
|
|
148
|
+
if (element.itemRender.name === '#select') {
|
|
149
|
+
// const data = query[`_${element.field}`] || query[`${element.field}`];
|
|
150
|
+
// query[element.field] = !isString(data) ? data?.join(',') : data;
|
|
151
|
+
delete query[`_${element.field}`];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
return query;
|
|
155
|
+
};
|
|
156
|
+
|
|
136
157
|
const startFormatter = 'yyyy-MM-dd 00:00:00';
|
|
137
158
|
const endFormatter = 'yyyy-MM-dd 23:59:59';
|
|
159
|
+
// 时间范围优化
|
|
138
160
|
const formatDateRange = (listQuery: any, items) => {
|
|
139
|
-
const dateRanges = items.filter(
|
|
140
|
-
f => f.itemRender?.name === '#SuDateRange' || f.itemRender?.props?.multiple || f.multiple
|
|
141
|
-
);
|
|
161
|
+
const dateRanges = items.filter(f => ['#SuDateRange', 'VxeDateRangePicker'].includes(f.itemRender?.name));
|
|
142
162
|
if (isEmpty(dateRanges)) return listQuery;
|
|
143
163
|
const query = clone(listQuery, true);
|
|
144
164
|
dateRanges.forEach((element: any) => {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
} else if (val) {
|
|
153
|
-
query[`${element.field}From`] = toDateString(val[0], startFormatter);
|
|
154
|
-
query[`${element.field}To`] = toDateString(val[1], endFormatter);
|
|
155
|
-
}
|
|
156
|
-
delete query[element.field];
|
|
165
|
+
const val = query[element.field];
|
|
166
|
+
if (val && element.itemRender.startField) {
|
|
167
|
+
query[element.itemRender.startField] = toDateString(query[element.itemRender.startField], startFormatter);
|
|
168
|
+
query[element.itemRender.endField] = toDateString(query[element.itemRender.endField], endFormatter);
|
|
169
|
+
} else if (val) {
|
|
170
|
+
query[`${element.field}From`] = toDateString(val[0], startFormatter);
|
|
171
|
+
query[`${element.field}To`] = toDateString(val[1], endFormatter);
|
|
157
172
|
}
|
|
173
|
+
delete query[element.field];
|
|
158
174
|
});
|
|
159
175
|
return query;
|
|
160
176
|
};
|
|
@@ -170,19 +186,22 @@ export const inlineButtons = [
|
|
|
170
186
|
name: 'add',
|
|
171
187
|
status: 'u-cyan',
|
|
172
188
|
icon: 'vxe-icon-add',
|
|
173
|
-
auth: 'add'
|
|
189
|
+
auth: 'add',
|
|
190
|
+
sort: 1
|
|
174
191
|
},
|
|
175
192
|
{
|
|
176
193
|
code: 'delete',
|
|
177
194
|
status: 'danger',
|
|
178
195
|
icon: 'vxe-icon-delete',
|
|
179
|
-
auth: 'del'
|
|
196
|
+
auth: 'del',
|
|
197
|
+
sort: 2
|
|
180
198
|
},
|
|
181
199
|
{
|
|
182
200
|
code: 'save',
|
|
183
201
|
status: 'primary',
|
|
184
202
|
icon: 'vxe-icon-save',
|
|
185
|
-
auth: 'edit'
|
|
203
|
+
auth: 'edit',
|
|
204
|
+
sort: 3
|
|
186
205
|
}
|
|
187
206
|
];
|
|
188
207
|
// form 模式按钮
|
|
@@ -191,13 +210,15 @@ export const dialogButtons = [
|
|
|
191
210
|
code: 'add',
|
|
192
211
|
status: 'u-cyan',
|
|
193
212
|
icon: 'vxe-icon-add',
|
|
194
|
-
auth: 'add'
|
|
213
|
+
auth: 'add',
|
|
214
|
+
sort: 1
|
|
195
215
|
},
|
|
196
216
|
{
|
|
197
|
-
code: '
|
|
217
|
+
code: 'del',
|
|
198
218
|
status: 'danger',
|
|
199
219
|
icon: 'vxe-icon-delete',
|
|
200
|
-
auth: 'del'
|
|
220
|
+
auth: 'del',
|
|
221
|
+
sort: 2
|
|
201
222
|
}
|
|
202
223
|
];
|
|
203
224
|
|
|
@@ -228,10 +249,8 @@ export const getExportConfig = attrs => {
|
|
|
228
249
|
export const getToolBarConfig = (data, props, attrs, hasAuthority) => {
|
|
229
250
|
const refreshOptions = {
|
|
230
251
|
icon: 'ri-refresh-line',
|
|
231
|
-
code: 'query',
|
|
232
252
|
iconLoading: 'vxe-icon-spinner roll vxe-loading--default-icon'
|
|
233
253
|
};
|
|
234
|
-
debugger;
|
|
235
254
|
// 不可编辑时
|
|
236
255
|
if (!props.editable) {
|
|
237
256
|
data.editConfig.editable = props.editable;
|
|
@@ -255,6 +274,10 @@ export const getToolBarConfig = (data, props, attrs, hasAuthority) => {
|
|
|
255
274
|
// 先设置传入的按钮
|
|
256
275
|
let buttons = clone(attrs.buttons || [], true);
|
|
257
276
|
|
|
277
|
+
buttons.forEach((button, idx) => {
|
|
278
|
+
button.sort = button.sort || idx + 10;
|
|
279
|
+
});
|
|
280
|
+
|
|
258
281
|
// 获取默认的按钮
|
|
259
282
|
const toolButtons = attrs.mode !== 'form' ? clone(inlineButtons, true) : clone(dialogButtons, true);
|
|
260
283
|
// 判断传入的按钮是否有默认按钮的auth,有就不加入按钮组中,相当于重写了默认的按钮
|
|
@@ -284,11 +307,12 @@ export const getToolBarConfig = (data, props, attrs, hasAuthority) => {
|
|
|
284
307
|
exportBtn = { icon: 'ri-download-2-line', code: 'export' };
|
|
285
308
|
}
|
|
286
309
|
data.toolbarConfig = {
|
|
287
|
-
buttons,
|
|
310
|
+
buttons: orderBy(buttons, 'sort'),
|
|
288
311
|
enabled: true,
|
|
289
312
|
refreshOptions,
|
|
290
|
-
|
|
313
|
+
customOptions: attrs.gridId ? {} : null,
|
|
291
314
|
exportOptions: exportBtn,
|
|
315
|
+
custom: !!attrs.gridId,
|
|
292
316
|
export: hasExport,
|
|
293
317
|
refresh: true,
|
|
294
318
|
perfect: true
|
|
@@ -380,72 +404,3 @@ export const getAttrs = attrs => {
|
|
|
380
404
|
});
|
|
381
405
|
return data;
|
|
382
406
|
};
|
|
383
|
-
|
|
384
|
-
export const formatItems = (items, status, t, span = 24) => {
|
|
385
|
-
if (!items.length) return items;
|
|
386
|
-
return items.map(item => {
|
|
387
|
-
if (item.children?.length) {
|
|
388
|
-
item.children = formatItems(item.children, status, t, span);
|
|
389
|
-
return item;
|
|
390
|
-
} else {
|
|
391
|
-
item.title = item.title || `message.${item.field}`;
|
|
392
|
-
item.span = item.span || span;
|
|
393
|
-
if (item.type === 'collapseNode') {
|
|
394
|
-
// 折叠项目,title和宽度不需要
|
|
395
|
-
item.title = '';
|
|
396
|
-
item.titleWidth = 0;
|
|
397
|
-
}
|
|
398
|
-
let disabled = false;
|
|
399
|
-
let placeholder = t(`message.udp.placeholder`) + t(item.title);
|
|
400
|
-
if (status === 'detail') {
|
|
401
|
-
disabled = true;
|
|
402
|
-
placeholder = '';
|
|
403
|
-
} else {
|
|
404
|
-
disabled = item.disabled === false ? item.disabled : item.disabled || item.itemRender?.props?.disabled;
|
|
405
|
-
}
|
|
406
|
-
let itemRender = {
|
|
407
|
-
name: 'VxeInput',
|
|
408
|
-
props: { disabled, placeholder: disabled ? '' : placeholder }
|
|
409
|
-
};
|
|
410
|
-
if (item.code && !item.itemRender) {
|
|
411
|
-
itemRender = renderHook.renderDict(item.code);
|
|
412
|
-
}
|
|
413
|
-
item.itemRender = item.itemRender || itemRender;
|
|
414
|
-
|
|
415
|
-
item.itemRender['props'] = Object.assign(item.itemRender.props || {}, {
|
|
416
|
-
disabled,
|
|
417
|
-
placeholder: disabled ? '' : placeholder
|
|
418
|
-
});
|
|
419
|
-
console.log('--------------', { item });
|
|
420
|
-
return item;
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* @description: 标准化必填数据
|
|
427
|
-
* @param {*} records 数据列表
|
|
428
|
-
* @param {*} t i18n对象
|
|
429
|
-
* @return {*} rule数据
|
|
430
|
-
*/
|
|
431
|
-
export const formatRules = (records, t) => {
|
|
432
|
-
const rule = {};
|
|
433
|
-
records.forEach(item => {
|
|
434
|
-
if (item.children?.length) {
|
|
435
|
-
const subRuls = formatRules(item.children, t);
|
|
436
|
-
merge(rule, subRuls);
|
|
437
|
-
} else {
|
|
438
|
-
if (item.required) {
|
|
439
|
-
const { field, title } = item;
|
|
440
|
-
const i18n = title?.startsWith('message.');
|
|
441
|
-
rule[field] = [
|
|
442
|
-
{
|
|
443
|
-
required: true,
|
|
444
|
-
message: `${t('message.required')}${title && i18n ? t(title) : title || t(`message.${field}`)}`
|
|
445
|
-
}
|
|
446
|
-
];
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
return rule;
|
|
451
|
-
};
|