@utogether/udp-core 1.0.0 → 1.0.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/{403-B1R-4vXw.js → 403-JWjatlxJ.js} +1 -1
- package/dist/{404-fXPl8csw.js → 404-BcdMJfPb.js} +1 -1
- package/dist/{500-eI5842YB.js → 500-bsa3F_cc.js} +1 -1
- package/dist/{AuthorityInfo-CfVH6PaB.js → AuthorityInfo-CqItgNs5.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js → AuthorityInfo.vue_vue_type_style_index_0_lang-32L40GY2.js} +1 -1
- package/dist/{Company-CYC9Avfz.js → Company-DVff9IA7.js} +3 -3
- package/dist/{CompanyPanel-B4MzoqN_.js → CompanyPanel-CNrdq4XE.js} +1 -1
- package/dist/{Department-B4BNSiYx.js → Department-CqcpfL4i.js} +3 -3
- package/dist/{DepartmentPanel-zJO89L2O.js → DepartmentPanel-Bvti4LGu.js} +1 -1
- package/dist/{DesignPanel-S8P0J97f.js → DesignPanel-CjykspE1.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js → DesignPanel.vue_vue_type_style_index_0_lang-BK9EERdd.js} +2 -2
- package/dist/{DictView-bIS5-rK-.js → DictView-q7kR9K--.js} +9 -9
- package/dist/InvOrganization-DI45LqZV.js +260 -0
- package/dist/{Org-kXHSjsgJ.js → Org-CZju_ZiR.js} +1 -1
- package/dist/{Preview-CRyiwUIR.js → Preview-Cm_7RhYU.js} +1 -1
- package/dist/{ReportDefine-WZYIx8Sm.js → ReportDefine-CJVlQ--7.js} +1 -1
- package/dist/{ReportDesign-D-7GKgpb.js → ReportDesign-B0unlrkt.js} +2 -2
- package/dist/{ReportQuery-BIIJny6w.js → ReportQuery-BKuMCEvF.js} +2 -2
- package/dist/{ReportQueryFrom-OoUl7N2O.js → ReportQueryFrom-DAngMJLU.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-CPpwmztJ.js} +1 -1
- package/dist/{ReportTemplate-Cfeq9US-.js → ReportTemplate-8YH3L8Pv.js} +1 -1
- package/dist/{Role-BwTV2QMH.js → Role-MxI30-0W.js} +3 -3
- package/dist/{RoleAssign-De1JjOun.js → RoleAssign-BzUY_y_y.js} +3 -3
- package/dist/{RolePanel-pUBXsqCM.js → RolePanel-CXdcvsR5.js} +1 -1
- package/dist/{RolePanel-E3RcdByM.js → RolePanel-DS_TErTn.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js → RolePanel.vue_vue_type_script_setup_true_lang-DJKu6PXz.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js → RolePanel.vue_vue_type_script_setup_true_lang-Ddl-A7Zh.js} +3 -3
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js → ScrollPanel.vue_vue_type_style_index_0_lang-DnchUgIF.js} +1 -1
- package/dist/{Staff-Czm7A8vI.js → Staff-D7tXo_Gn.js} +3 -3
- package/dist/StaffInfo-Bk8BY8PO.js +4 -0
- package/dist/{StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js → StaffInfo.vue_vue_type_script_setup_true_lang-DqKwZi5f.js} +1 -1
- package/dist/{StaffPanel-CHk60LEz.js → StaffPanel-VtpGCTIq.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js → StaffPanel.vue_vue_type_script_setup_true_lang-C3Ixs12y.js} +46 -49
- package/dist/{SysUser-BGwbttRn.js → SysUser-D0Q6OvD7.js} +2 -2
- package/dist/{SysUserPanel-BCbKoLKt.js → SysUserPanel-1_vrsANQ.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js → SysUserPanel.vue_vue_type_script_setup_true_lang-C5XEmxsV.js} +1 -2
- package/dist/{SystemMenu-BkqZSDKl.js → SystemMenu-9PG3vESE.js} +2 -2
- package/dist/{UserInfo-BsyAcT2d.js → UserInfo-qgXUEGwi.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js → UserInfo.vue_vue_type_style_index_0_lang-CN0C5rVk.js} +1 -1
- package/dist/{childView-CyuLTUqC.js → childView-C7ZSA5fR.js} +1 -1
- package/dist/{childView-CF83nhxb.js → childView-yV2QLwfA.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js → childView.vue_vue_type_style_index_0_lang-DdKxPGdh.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CNSgGda3.js → childView.vue_vue_type_style_index_0_lang-bkmucBUL.js} +1 -1
- package/dist/{code-rule-Bz-gnktN.js → code-rule-95K1jr-u.js} +1 -1
- package/dist/core.es.js +1 -1
- package/dist/core.umd.js +63 -63
- package/dist/{cron-task-CIifSUdW.js → cron-task-DGrQwOHs.js} +1 -1
- package/dist/{frameView-_d2mqjjQ.js → frameView-7SmME93D.js} +1 -1
- package/dist/index-OswH7SsT.js +9937 -0
- package/dist/{layoutView-DLKVepB8.js → layoutView-C6WIVWGZ.js} +2 -2
- package/dist/{login-LREiDfFU.js → login-BhCMeCLS.js} +4 -4
- package/dist/{lov-view-DDrIVILB.js → lov-view-DoF5LqFQ.js} +2 -2
- package/dist/{menuInfo-B1FUV-Sk.js → menuInfo-CNzGQwOD.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js → menuInfo.vue_vue_type_style_index_0_lang-51SYxVc_.js} +1 -1
- package/dist/{pda-app-CRhVGijN.js → pda-app-nn3llDUx.js} +1 -1
- package/dist/{redirect-DiaNDu8F.js → redirect-CmMplDV4.js} +1 -1
- package/dist/{resource-BCwx9fEv.js → resource-gVFFMO9l.js} +1 -1
- package/dist/{su-welcome-189A7N4r.js → su-welcome-BN_s_RX_.js} +1 -1
- package/dist/{sys-config-BZ3sejow.js → sys-config-DGutV-VX.js} +1 -1
- package/dist/udp-core.css +2 -2
- package/dist/{utogether-r08LNiIZ.js → utogether-wFDCI28t.js} +1 -1
- package/package.json +2 -1
- package/src/components/udp/form-upload.vue +132 -0
- package/src/components/udp/index.ts +4 -0
- package/src/components/udp/modal-form.vue +180 -0
- package/src/components/udp/utils.ts +40 -0
- package/src/main.ts +5 -4
- package/src/plugins/vxe-table/index.ts +3 -3
- package/src/plugins/vxe-table/render.tsx +604 -184
- package/src/utils/udp/useRender.ts +420 -0
- package/src/views/organization/inv-org/InvOrganization.vue +2 -1
- package/src/views/organization/staff/StaffInfo.vue +0 -30
- package/src/views/organization/staff/StaffPanel.vue +4 -3
- package/src/views/system/role/AuthorityInfo.vue +1 -19
- package/src/views/system/sysUser/SysUserPanel.vue +1 -1
- package/src/views/udev/dict/DictView.vue +2 -2
- package/src/views/ulogin/login.vue +1 -1
- package/dist/InvOrganization-MuM2jtsG.js +0 -66
- package/dist/StaffInfo-DJzvBuxy.js +0 -4
- package/dist/index-BKIw8tSn.js +0 -9195
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-29 18:18:00
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-04-18 11:09:01
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare interface Fn<T = any, R = T> {
|
|
10
|
+
(...arg: T[]): R;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface IAttrs {
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
defaultValue?: string;
|
|
16
|
+
code?: string;
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface IEvents {
|
|
21
|
+
change?: Fn;
|
|
22
|
+
clear?: Fn;
|
|
23
|
+
blur?: Fn;
|
|
24
|
+
focus?: Fn;
|
|
25
|
+
input?: Fn;
|
|
26
|
+
filterMethod?: Fn;
|
|
27
|
+
}
|
|
28
|
+
import { isObject, isEmpty, isString, isFunction } from 'xe-utils';
|
|
29
|
+
import { storageLocal } from '@utogether/utils';
|
|
30
|
+
|
|
31
|
+
export const useRender = () => {
|
|
32
|
+
const optionProps = { value: 'dictCode', label: 'dictName' };
|
|
33
|
+
/**
|
|
34
|
+
* @description: 字典下拉渲染
|
|
35
|
+
* @param {*} attrs string|object string时默认未code
|
|
36
|
+
* @param {*} methods fn|object 回调函数 fn默认为onChange
|
|
37
|
+
*/
|
|
38
|
+
const renderDict = (attrs: IAttrs | string, methods?) => {
|
|
39
|
+
const events = getEvents(methods);
|
|
40
|
+
let props = {
|
|
41
|
+
clearable: true,
|
|
42
|
+
disabled: false,
|
|
43
|
+
showValue: false,
|
|
44
|
+
placeholder: null
|
|
45
|
+
};
|
|
46
|
+
let defaultValue;
|
|
47
|
+
let dictCode;
|
|
48
|
+
if (isObject(attrs)) {
|
|
49
|
+
props = Object.assign(props, attrs);
|
|
50
|
+
defaultValue = attrs.defaultValue;
|
|
51
|
+
dictCode = attrs?.code;
|
|
52
|
+
// keyValue = attrs?.keyValue;
|
|
53
|
+
} else {
|
|
54
|
+
dictCode = attrs;
|
|
55
|
+
}
|
|
56
|
+
const opts = storageLocal.getItem('kLov')[dictCode]?.children;
|
|
57
|
+
const options = opts ? opts.filter(opt => opt.enabled === '1') : [];
|
|
58
|
+
return {
|
|
59
|
+
name: '#select',
|
|
60
|
+
optionProps,
|
|
61
|
+
options,
|
|
62
|
+
props,
|
|
63
|
+
defaultValue,
|
|
64
|
+
events
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* @description: 远程搜索下拉选择-编辑
|
|
69
|
+
* @param {*} attrs attrs
|
|
70
|
+
* @return {*}
|
|
71
|
+
*/
|
|
72
|
+
const renderSelect = (attrs, methods?) => {
|
|
73
|
+
const events = getEvents(methods);
|
|
74
|
+
return {
|
|
75
|
+
name: '#SuSelect',
|
|
76
|
+
optionProps: attrs?.optionProps || { label: 'label', value: 'value' },
|
|
77
|
+
props: attrs?.props,
|
|
78
|
+
options: attrs?.options || [],
|
|
79
|
+
events
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* @description: 查询关联了用户的员工
|
|
84
|
+
* @param {*} attr '渲染器属性'
|
|
85
|
+
* @param {*} callback 回调函数
|
|
86
|
+
* @return {*} 渲染组件
|
|
87
|
+
*/
|
|
88
|
+
const renderUser = (attr?, callback?) => {
|
|
89
|
+
const attrs = {
|
|
90
|
+
optionProps: { extLabel: 'userName', value: 'employeeName' },
|
|
91
|
+
props: {
|
|
92
|
+
attrs: { disabled: attr?.disabled },
|
|
93
|
+
disabled: attr?.disabled,
|
|
94
|
+
defaultValue: attr?.defaultValue,
|
|
95
|
+
mapField: attr?.mapField,
|
|
96
|
+
code: 'SYS037',
|
|
97
|
+
url: '/uums/employee/listEmployeeIsUser',
|
|
98
|
+
fetchField: 'employeeName'
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
return renderSelect(attrs, callback);
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* @description: 系统用户下拉
|
|
105
|
+
* @param {*} options 映射字段
|
|
106
|
+
* @return {*}
|
|
107
|
+
*/
|
|
108
|
+
const renderSysUser = (options?) => {
|
|
109
|
+
const attrs = {
|
|
110
|
+
optionProps: { extLabel: 'userName', value: 'name' },
|
|
111
|
+
props: {
|
|
112
|
+
code: 'sys/listUsers',
|
|
113
|
+
url: '/uums/user',
|
|
114
|
+
fetchField: 'name',
|
|
115
|
+
mapField: options?.mapField
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return renderSelect(attrs);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @description: 查询库存组织
|
|
123
|
+
* @param {*} name '渲染器属性'
|
|
124
|
+
* @param {*} callback 回调函数
|
|
125
|
+
* @return {*} 渲染组件
|
|
126
|
+
*/
|
|
127
|
+
const renderInvOrg = (attrs?, methods?) => {
|
|
128
|
+
const optionProps = {
|
|
129
|
+
label: 'organizationName',
|
|
130
|
+
value: attrs?.field || 'organizationName'
|
|
131
|
+
};
|
|
132
|
+
const props = {
|
|
133
|
+
mapField: {},
|
|
134
|
+
defaultParams: attrs?.defaultParams,
|
|
135
|
+
url: '/uums/cusOrganization',
|
|
136
|
+
fetchField: 'organizationName'
|
|
137
|
+
};
|
|
138
|
+
const mapField = {
|
|
139
|
+
organizationId: 'id',
|
|
140
|
+
organizationCode: 'organizationCode'
|
|
141
|
+
};
|
|
142
|
+
Object.assign(props.mapField, mapField, attrs?.mapField || {});
|
|
143
|
+
return { name: '#SuSelect', props, optionProps, options: [], methods };
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* @description: 查询业务单元
|
|
147
|
+
* @param {*} name '渲染器属性'
|
|
148
|
+
* @param {*} callback 回调函数
|
|
149
|
+
* @return {*} 渲染组件
|
|
150
|
+
*/
|
|
151
|
+
const renderBU = (attrs?, methods?) => {
|
|
152
|
+
const optionProps = {
|
|
153
|
+
label: 'orgName',
|
|
154
|
+
value: attrs?.field || 'orgName'
|
|
155
|
+
};
|
|
156
|
+
const props = {
|
|
157
|
+
mapField: {},
|
|
158
|
+
defaultParams: attrs?.defaultParams,
|
|
159
|
+
url: '/uums/org',
|
|
160
|
+
fetchField: 'orgName'
|
|
161
|
+
};
|
|
162
|
+
const mapField = { orgId: 'id', orgCode: 'orgCode' };
|
|
163
|
+
Object.assign(props.mapField, mapField, attrs?.mapField || {});
|
|
164
|
+
return { name: '#SuSelect', props, optionProps, options: [], methods };
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* @description: item input渲染器
|
|
168
|
+
* @param {*} name 渲染器名称
|
|
169
|
+
* @param {*} props 渲染的参数(请查看目标渲染的 Props)
|
|
170
|
+
* @return {*} item 渲染器
|
|
171
|
+
*/
|
|
172
|
+
const renderInput = (attrs?, methods?) => {
|
|
173
|
+
const props = Object.assign({ disabled: false }, attrs);
|
|
174
|
+
const defaultValue = props?.defaultValue;
|
|
175
|
+
return {
|
|
176
|
+
name: 'VxeInput',
|
|
177
|
+
props,
|
|
178
|
+
defaultValue,
|
|
179
|
+
events: getEvents(methods)
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* @description: item input渲染器
|
|
184
|
+
* @param {*} name 渲染器名称
|
|
185
|
+
* @param {*} props 渲染的参数(请查看目标渲染的 Props)
|
|
186
|
+
* @return {*} item 渲染器
|
|
187
|
+
*/
|
|
188
|
+
const renderTextarea = (attrs?, methods?) => {
|
|
189
|
+
const props = Object.assign({ disabled: false, rows: 3 }, attrs);
|
|
190
|
+
const defaultValue = props?.defaultValue;
|
|
191
|
+
return {
|
|
192
|
+
name: 'VxeTextarea',
|
|
193
|
+
props,
|
|
194
|
+
defaultValue,
|
|
195
|
+
events: getEvents(methods)
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* @description: checkbox
|
|
200
|
+
* @param {*} attrs
|
|
201
|
+
* @return {*} checkbox渲染器
|
|
202
|
+
*/
|
|
203
|
+
const renderCheckBox = (attrs, methods?) => {
|
|
204
|
+
const name = 'VxeCheckbox';
|
|
205
|
+
const { defaultValue, options, props } = commonProps(attrs);
|
|
206
|
+
return { name, defaultValue, options, props, events: getEvents(methods) };
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* @description: radio
|
|
210
|
+
* @param {*} attrs
|
|
211
|
+
* @param {*} methods 事件
|
|
212
|
+
* @return {*} radio渲染器
|
|
213
|
+
*/
|
|
214
|
+
const renderRadio = (attrs: string | IAttrs, methods?) => {
|
|
215
|
+
const name = 'VxeRadio';
|
|
216
|
+
const { defaultValue, options, props } = commonProps(attrs);
|
|
217
|
+
return { name, defaultValue, options, props, events: getEvents(methods) };
|
|
218
|
+
};
|
|
219
|
+
const commonProps = (attrs: string | IAttrs) => {
|
|
220
|
+
let props = { disabled: false };
|
|
221
|
+
let defaultValue;
|
|
222
|
+
const dictData = storageLocal.getItem('kLov');
|
|
223
|
+
let code = '';
|
|
224
|
+
if (isObject(attrs)) {
|
|
225
|
+
defaultValue = attrs.defaultValue;
|
|
226
|
+
code = attrs.code!;
|
|
227
|
+
props = Object.assign(props, attrs || {});
|
|
228
|
+
} else if (isString(attrs)) {
|
|
229
|
+
code = attrs;
|
|
230
|
+
}
|
|
231
|
+
const options = code
|
|
232
|
+
? dictData[code]?.children.map(m => {
|
|
233
|
+
return { label: m.dictName, value: m.dictCode };
|
|
234
|
+
})
|
|
235
|
+
: [];
|
|
236
|
+
return { props, defaultValue, options };
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* @description: 数值录入
|
|
240
|
+
* @param {*} attrs 渲染的参数(请查看目标渲染的props)
|
|
241
|
+
* @param {*} methods 渲染目标的events,
|
|
242
|
+
* @return {*} editRender
|
|
243
|
+
*/
|
|
244
|
+
const renderNumber = (attrs?, methods?) => {
|
|
245
|
+
const events = getEvents(methods);
|
|
246
|
+
const props = Object.assign(
|
|
247
|
+
{ type: 'number', clearable: true, min: 0, controls: false },
|
|
248
|
+
attrs || {}
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
return {
|
|
252
|
+
name: 'VxeInput',
|
|
253
|
+
props,
|
|
254
|
+
defaultValue: attrs?.defaultValue,
|
|
255
|
+
events
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* @description: 时间日期
|
|
260
|
+
* @param {*} attrs 渲染的参数(请查看目标渲染的props)
|
|
261
|
+
* @param {*} methods 渲染目标的events,
|
|
262
|
+
* @return {*} editRender
|
|
263
|
+
*/
|
|
264
|
+
const renderDate = (attrs?, methods?) => {
|
|
265
|
+
const events = getEvents(methods);
|
|
266
|
+
const valueFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
267
|
+
const defaultValue = attrs?.defaultValue;
|
|
268
|
+
const prop = { type: 'date', valueFormat, clearable: true };
|
|
269
|
+
const props = Object.assign(prop, attrs || {});
|
|
270
|
+
return { name: 'VxeInput', props, defaultValue, events };
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* @description: 值集视图
|
|
274
|
+
* @param {*} attrs 渲染的参数
|
|
275
|
+
* @param {*} methods 渲染目标的events,
|
|
276
|
+
* @return {*} editRender
|
|
277
|
+
*/
|
|
278
|
+
const renderLov = (attrs, methods?) => {
|
|
279
|
+
const events = getEvents(methods);
|
|
280
|
+
const props = Object.assign({}, attrs || {});
|
|
281
|
+
return { name: '#lov', props, events };
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* @description: 本地下拉选择
|
|
285
|
+
* @param {*} attrs 同ElSelect
|
|
286
|
+
* @param {*} methods 事件, 默认为change事件
|
|
287
|
+
* @return {*}
|
|
288
|
+
*/
|
|
289
|
+
const renderSelectLocal = (attrs, methods?) => {
|
|
290
|
+
const events = getEvents(methods);
|
|
291
|
+
const optionProps = attrs?.optionProps || {
|
|
292
|
+
label: 'label',
|
|
293
|
+
value: 'value'
|
|
294
|
+
};
|
|
295
|
+
const props = Object.assign({ clearable: true, disabled: false, showValue: false }, attrs || {});
|
|
296
|
+
console.log('itemRender');
|
|
297
|
+
return {
|
|
298
|
+
name: '#select',
|
|
299
|
+
optionProps,
|
|
300
|
+
options: attrs?.options || [],
|
|
301
|
+
props,
|
|
302
|
+
events
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
/**
|
|
306
|
+
* @description: 渲染成switch
|
|
307
|
+
* @param {*} attrs 请查看目标渲染的props
|
|
308
|
+
* @param {*} methods 请查看目标渲染的event
|
|
309
|
+
* @return {*} switchRender
|
|
310
|
+
*/
|
|
311
|
+
const renderSwitch = (attrs?: string | IAttrs, methods?) => {
|
|
312
|
+
let props = {
|
|
313
|
+
openLabel: '是',
|
|
314
|
+
closeLabel: '否',
|
|
315
|
+
openValue: 'Y',
|
|
316
|
+
closeValue: 'N'
|
|
317
|
+
};
|
|
318
|
+
let defaultValue = 'Y';
|
|
319
|
+
if (isObject(attrs) && !isFunction(attrs)) {
|
|
320
|
+
props = Object.assign(props, attrs || {});
|
|
321
|
+
defaultValue = attrs.defaultValue || defaultValue;
|
|
322
|
+
} else if (!isEmpty(attrs) && isString(attrs)) {
|
|
323
|
+
defaultValue = attrs;
|
|
324
|
+
props = Object.assign(props, { defaultValue });
|
|
325
|
+
}
|
|
326
|
+
// @ts-ignore
|
|
327
|
+
const events = isFunction(attrs) ? getEvents(attrs) : getEvents(methods);
|
|
328
|
+
return { name: 'VxeSwitch', props, defaultValue, events };
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* @description: 表格渲染el-tag组件
|
|
332
|
+
* @param {*} code 数据字典code
|
|
333
|
+
* @param {*} tagMap 渲染tag对应的type {1: 'success'}
|
|
334
|
+
* @return {*} table cellRender
|
|
335
|
+
*/
|
|
336
|
+
const renderCellTag = (code, tagMap) => {
|
|
337
|
+
return { name: '#tag', props: { code, tagMap } };
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* @description: cell渲染成el-switch
|
|
341
|
+
* @param {*} attrs 请查看目标渲染的props
|
|
342
|
+
* @param {*} methods 请查看目标渲染的event
|
|
343
|
+
* @return {*} cellRender
|
|
344
|
+
*/
|
|
345
|
+
const renderEnabled = (options?, methods?) => {
|
|
346
|
+
const props: IAttrs = {
|
|
347
|
+
openLabel: '启用',
|
|
348
|
+
closeLabel: '禁用',
|
|
349
|
+
openValue: '1',
|
|
350
|
+
closeValue: '0',
|
|
351
|
+
defaultValue: '1'
|
|
352
|
+
};
|
|
353
|
+
if (!isFunction(options) && isObject(options)) {
|
|
354
|
+
Object.assign(props, options);
|
|
355
|
+
}
|
|
356
|
+
const fun = isFunction(options) ? options : methods;
|
|
357
|
+
return renderSwitch(props, fun);
|
|
358
|
+
// return { name: "#switch", props, events };
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* icon选择器
|
|
362
|
+
* @returns render 函数
|
|
363
|
+
*/
|
|
364
|
+
const renderIconSelect = () => {
|
|
365
|
+
return { name: '#iconSelect' };
|
|
366
|
+
};
|
|
367
|
+
/**
|
|
368
|
+
* 树形选择器
|
|
369
|
+
* @param sourceData 展示数据
|
|
370
|
+
* @param props 请查看element plus的TreeSelect渲染的props
|
|
371
|
+
* @param events 事件
|
|
372
|
+
* @returns render 函数
|
|
373
|
+
*/
|
|
374
|
+
const renderTreeSelect = (sourceData: IRecord[] = [], props = {}, events?) => {
|
|
375
|
+
return { name: '#treeSelect', sourceData, props, events };
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
const getEvents = (methods: IEvents | Fn) => {
|
|
379
|
+
let events: any = {};
|
|
380
|
+
if (isObject(methods) && !isFunction(methods)) {
|
|
381
|
+
events = {
|
|
382
|
+
change: methods?.change || cb,
|
|
383
|
+
blur: methods?.blur || cb,
|
|
384
|
+
focus: methods?.focus || cb,
|
|
385
|
+
input: methods?.input || cb,
|
|
386
|
+
clear: methods?.clear || cb,
|
|
387
|
+
filterMethod: methods?.filterMethod
|
|
388
|
+
};
|
|
389
|
+
} else if (methods) {
|
|
390
|
+
events = { change: methods };
|
|
391
|
+
}
|
|
392
|
+
return events;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
function cb() {}
|
|
396
|
+
// 回调函数
|
|
397
|
+
// const callback = (e) => cb && cb(e);
|
|
398
|
+
|
|
399
|
+
return {
|
|
400
|
+
renderDict,
|
|
401
|
+
renderSelect,
|
|
402
|
+
renderInput,
|
|
403
|
+
renderTextarea,
|
|
404
|
+
renderCheckBox,
|
|
405
|
+
renderRadio,
|
|
406
|
+
renderUser,
|
|
407
|
+
renderSysUser,
|
|
408
|
+
renderInvOrg,
|
|
409
|
+
renderBU,
|
|
410
|
+
renderNumber,
|
|
411
|
+
renderLov,
|
|
412
|
+
renderSelectLocal,
|
|
413
|
+
renderDate,
|
|
414
|
+
renderSwitch,
|
|
415
|
+
renderCellTag,
|
|
416
|
+
renderEnabled,
|
|
417
|
+
renderIconSelect,
|
|
418
|
+
renderTreeSelect
|
|
419
|
+
};
|
|
420
|
+
};
|
|
@@ -21,7 +21,8 @@ export default { name: 'InvOrganization' };
|
|
|
21
21
|
<script setup lang="tsx">
|
|
22
22
|
import { ref, reactive } from 'vue';
|
|
23
23
|
import to from 'await-to-js';
|
|
24
|
-
import { useRender } from '@utogether/utils';
|
|
24
|
+
// import { useRender } from '@utogether/utils';
|
|
25
|
+
import { useRender } from '../../../utils/udp/useRender';
|
|
25
26
|
import { getServiceApi } from '../../../api';
|
|
26
27
|
|
|
27
28
|
const url = '/uums/cusOrganization';
|
|
@@ -131,33 +131,3 @@ onMounted(() => {
|
|
|
131
131
|
data.value = props.record;
|
|
132
132
|
});
|
|
133
133
|
</script>
|
|
134
|
-
|
|
135
|
-
<style lang="scss">
|
|
136
|
-
.u-menu-prefix.vxe-input {
|
|
137
|
-
height: 34px;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.u-menu-prefix.vxe-input .vxe-input--prefix {
|
|
141
|
-
top: 1px;
|
|
142
|
-
width: 150px;
|
|
143
|
-
height: 32px;
|
|
144
|
-
text-align: center;
|
|
145
|
-
background-color: #f5f7fa;
|
|
146
|
-
border-right: 1px solid #dcdfe6;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.u-menu-prefix.vxe-input .vxe-input--inner {
|
|
150
|
-
padding-left: 160px;
|
|
151
|
-
border: 1px solid #dcdfe6;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.my-dropdown2 {
|
|
155
|
-
background-color: #fff;
|
|
156
|
-
border: 1px solid #dcdfe6;
|
|
157
|
-
border-radius: 4px;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.list-item2:hover {
|
|
161
|
-
background-color: #f5f7fa;
|
|
162
|
-
}
|
|
163
|
-
</style>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-11-17 16:42:14
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
5
|
+
* @LastEditTime: 2025-07-16 15:30:33
|
|
6
6
|
* @Description: 员工管理
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -60,7 +60,7 @@ watch(
|
|
|
60
60
|
const formItems = [{ field: 'employeeCode' }, { field: 'employeeName' }];
|
|
61
61
|
// 列字段
|
|
62
62
|
const columns = [
|
|
63
|
-
|
|
63
|
+
{ type: 'checkbox', width: 50, align: 'center' },
|
|
64
64
|
{ field: 'employeeCode' },
|
|
65
65
|
{ field: 'employeeName', width: 150 },
|
|
66
66
|
{ field: 'gender', width: 100, formatter: ['formatDict', 'SU.GENDER'] },
|
|
@@ -71,7 +71,7 @@ const columns = [
|
|
|
71
71
|
fixed: 'right',
|
|
72
72
|
slots: {
|
|
73
73
|
default: ({ row }) => {
|
|
74
|
-
const content = ['1', 'Y'].includes(row.enabled) ? 'disabled' : '
|
|
74
|
+
const content = ['1', 'Y'].includes(row.enabled) ? 'disabled' : 'enable';
|
|
75
75
|
const icon = ['1', 'Y'].includes(row.enabled) ? 'ri-stop-circle-fill' : 'ri-play-circle-fill';
|
|
76
76
|
const status = ['1', 'Y'].includes(row.enabled) ? 'warning' : 'success';
|
|
77
77
|
return [
|
|
@@ -119,6 +119,7 @@ const handleUpdate = async (record: IRecord) => {
|
|
|
119
119
|
xgrid.value.showLoading();
|
|
120
120
|
body.enabled = body.enabled === '1' ? '0' : '1';
|
|
121
121
|
await getServiceApi().put(url, body);
|
|
122
|
+
xgrid.value.hiddenLoading();
|
|
122
123
|
xgrid.value.refreshData();
|
|
123
124
|
};
|
|
124
125
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-11-22 19:50:48
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
5
|
+
* @LastEditTime: 2025-07-14 14:58:13
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
|
|
@@ -113,24 +113,6 @@ onBeforeMount(() => {
|
|
|
113
113
|
</script>
|
|
114
114
|
|
|
115
115
|
<style lang="scss">
|
|
116
|
-
.u-menu-prefix.vxe-input {
|
|
117
|
-
height: 34px;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.u-menu-prefix.vxe-input .vxe-input--prefix {
|
|
121
|
-
top: 1px;
|
|
122
|
-
width: 150px;
|
|
123
|
-
height: 32px;
|
|
124
|
-
text-align: center;
|
|
125
|
-
background-color: #f5f7fa;
|
|
126
|
-
border-right: 1px solid #dcdfe6;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.u-menu-prefix.vxe-input .vxe-input--inner {
|
|
130
|
-
padding-left: 160px;
|
|
131
|
-
border: 1px solid #dcdfe6;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
116
|
.my-dropdown2 {
|
|
135
117
|
background-color: #fff;
|
|
136
118
|
border: 1px solid #dcdfe6;
|
|
@@ -265,7 +265,7 @@ const getUnitList = () => {
|
|
|
265
265
|
serviceApi
|
|
266
266
|
.get('/uums/unit', { pageSize: 10 })
|
|
267
267
|
.then(res => {
|
|
268
|
-
paramExt.value = { unitId: res[0].id,
|
|
268
|
+
paramExt.value = { unitId: res[0].id, enabled: '1' };
|
|
269
269
|
})
|
|
270
270
|
.catch(() => {
|
|
271
271
|
errorMessage('获取租户失败,刷新后重试');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wei.li
|
|
3
3
|
* @Date: 2021-12-23 17:33:21
|
|
4
4
|
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2025-
|
|
5
|
+
* @LastEditTime: 2025-07-16 15:26:43
|
|
6
6
|
* @Description: 数据字典
|
|
7
7
|
-->
|
|
8
8
|
<template>
|
|
@@ -47,7 +47,7 @@ const columns = [
|
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
field: 'dictName',
|
|
50
|
-
title: 'message.udp.
|
|
50
|
+
title: 'message.udp.dictName',
|
|
51
51
|
required: true,
|
|
52
52
|
editRender: renderHook.renderInput()
|
|
53
53
|
},
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
SHENZHEN U-TOGETHER CO. LTD
|
|
95
95
|
</a>
|
|
96
96
|
</span>
|
|
97
|
-
<span class="flex items-center text-white" style="width:
|
|
97
|
+
<span class="flex items-center text-white" style="width: 75px; font-size: 10px">技术支持</span>
|
|
98
98
|
</span>
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { defineComponent as u, ref as s, reactive as m, resolveComponent as f, createBlock as p, openBlock as g } from "vue";
|
|
2
|
-
import { t as _ } from "./await-to-js.es5-BtRbN2QH.js";
|
|
3
|
-
import { useRender as h } from "@utogether/utils";
|
|
4
|
-
import { w as z } from "./index-BKIw8tSn.js";
|
|
5
|
-
const k = {
|
|
6
|
-
name: "InvOrganization"
|
|
7
|
-
}, R = /* @__PURE__ */ u({
|
|
8
|
-
...k,
|
|
9
|
-
setup(w) {
|
|
10
|
-
const r = "/uums/cusOrganization", n = s(null), e = h(), i = [{
|
|
11
|
-
field: "organizationCode"
|
|
12
|
-
}, {
|
|
13
|
-
field: "organizationName"
|
|
14
|
-
}], d = [{
|
|
15
|
-
type: "checkbox",
|
|
16
|
-
width: 40,
|
|
17
|
-
align: "center"
|
|
18
|
-
}, {
|
|
19
|
-
field: "organizationCode",
|
|
20
|
-
width: 120,
|
|
21
|
-
required: !0,
|
|
22
|
-
editRender: e.renderInput()
|
|
23
|
-
}, {
|
|
24
|
-
field: "organizationName",
|
|
25
|
-
minWidth: 120,
|
|
26
|
-
required: !0,
|
|
27
|
-
editRender: e.renderInput()
|
|
28
|
-
}, {
|
|
29
|
-
field: "orgName",
|
|
30
|
-
minWidth: 170,
|
|
31
|
-
required: !0,
|
|
32
|
-
editRender: e.renderBU()
|
|
33
|
-
}, {
|
|
34
|
-
field: "orgCode",
|
|
35
|
-
width: 110
|
|
36
|
-
}, {
|
|
37
|
-
field: "enabled",
|
|
38
|
-
width: 80,
|
|
39
|
-
cellRender: e.renderEnabled(a)
|
|
40
|
-
}];
|
|
41
|
-
async function a(t) {
|
|
42
|
-
const [o] = await _(z().put(r, [t]));
|
|
43
|
-
!o && n.value.refreshData();
|
|
44
|
-
}
|
|
45
|
-
const c = m({
|
|
46
|
-
columns: d
|
|
47
|
-
});
|
|
48
|
-
return (t, o) => {
|
|
49
|
-
const l = f("ut-grid");
|
|
50
|
-
return g(), p(l, {
|
|
51
|
-
ref_key: "xgrid",
|
|
52
|
-
ref: n,
|
|
53
|
-
items: i,
|
|
54
|
-
"default-params": {
|
|
55
|
-
organizationId: "",
|
|
56
|
-
orgId: ""
|
|
57
|
-
},
|
|
58
|
-
columns: c.columns,
|
|
59
|
-
url: r
|
|
60
|
-
}, null, 8, ["columns"]);
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
export {
|
|
65
|
-
R as default
|
|
66
|
-
};
|