adtec-core-package 1.3.2 → 1.3.3
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/package.json
CHANGED
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
labelPosition="top"
|
|
18
18
|
size="default"
|
|
19
19
|
>
|
|
20
|
-
<el-form-item :style="{ width: '
|
|
20
|
+
<el-form-item :style="{ width: '220px' }" label="所属部门" prop="deptIds">
|
|
21
21
|
<el-tree-select
|
|
22
22
|
ref="ref_tree"
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
check-strictly
|
|
24
|
+
v-model="queryParam.deptId"
|
|
25
25
|
:data="orgDeptTree"
|
|
26
|
+
filterable
|
|
26
27
|
:default-expand-all="true"
|
|
27
28
|
:props="{
|
|
28
29
|
label: 'name',
|
|
@@ -30,17 +31,13 @@
|
|
|
30
31
|
disabled: (data: IOrgDeptInfo) => data.isValid !== '1' || queryParam.disabled,
|
|
31
32
|
}"
|
|
32
33
|
:render-after-expand="false"
|
|
33
|
-
:renderContent="renderTreeNode"
|
|
34
|
-
check-strictly
|
|
35
34
|
clearable
|
|
36
35
|
collapse-tags-tooltip
|
|
37
|
-
multiple
|
|
38
36
|
node-key="id"
|
|
39
37
|
placeholder="请选择所属部门"
|
|
40
|
-
show-checkbox
|
|
41
38
|
/>
|
|
42
39
|
</el-form-item>
|
|
43
|
-
<el-form-item :style="{ width: '
|
|
40
|
+
<el-form-item :style="{ width: '220px' }" label="人员编码或名称" prop="codeorname">
|
|
44
41
|
<el-input
|
|
45
42
|
v-model="queryParam.codeorname"
|
|
46
43
|
clearable
|
|
@@ -93,7 +90,7 @@
|
|
|
93
90
|
style="display: flex; justify-content: center; align-items: center; padding-left: 8px"
|
|
94
91
|
>
|
|
95
92
|
<el-radio v-model="checkId" :label="scope.row.id" @change="handleRadioChange(scope.row)"
|
|
96
|
-
|
|
93
|
+
><span></span
|
|
97
94
|
></el-radio>
|
|
98
95
|
</div>
|
|
99
96
|
</template>
|
|
@@ -101,8 +98,8 @@
|
|
|
101
98
|
<el-table-column :show-overflow-tooltip="true" label="用户姓名" prop="name" width="120" />
|
|
102
99
|
<el-table-column label="用户编码" prop="code" width="120" />
|
|
103
100
|
<el-table-column :show-overflow-tooltip="true" label="岗位名称" prop="postName" width="120" />
|
|
104
|
-
<el-table-column :show-overflow-tooltip="true" label="所属部门" prop="deptName"
|
|
105
|
-
<el-table-column :show-overflow-tooltip="true" label="所属组织" prop="orgName" />
|
|
101
|
+
<el-table-column :show-overflow-tooltip="true" label="所属部门" prop="deptName" />
|
|
102
|
+
<el-table-column :show-overflow-tooltip="true" label="所属组织" prop="orgName" v-if="props.showOrgInfo" width="220"/>
|
|
106
103
|
</el-table>
|
|
107
104
|
<el-pagination
|
|
108
105
|
v-model:current-page="queryParam.current"
|
|
@@ -131,21 +128,23 @@ import frameworkUtils from '../../utils/FrameworkUtils'
|
|
|
131
128
|
interface Props<T extends IpageDataQuery, E extends IMdmEmployee> {
|
|
132
129
|
fetchData?: (data: T) => Promise<PageData<E>>
|
|
133
130
|
defalutQueryParam?: any
|
|
134
|
-
multiple?: boolean
|
|
131
|
+
multiple?: boolean,
|
|
132
|
+
showOrgInfo?: boolean
|
|
135
133
|
}
|
|
136
134
|
|
|
137
135
|
const props = withDefaults(defineProps<Props<IMdmEmployeeQuery, IMdmEmployee>>(), {
|
|
138
136
|
fetchData: EmployeeInfoApi.getMdmEmployeeListByIds,
|
|
139
137
|
defalutQueryParam: {
|
|
140
138
|
disabled: false,
|
|
141
|
-
|
|
139
|
+
deptId: undefined
|
|
142
140
|
},
|
|
143
141
|
multiple: true,
|
|
142
|
+
showOrgInfo:true
|
|
144
143
|
})
|
|
145
144
|
const [queryParam, resetQueryParam] = useResetRefHooks<IMdmEmployeeQuery>({
|
|
146
145
|
current: 1,
|
|
147
146
|
size: frameworkUtils.getPageSize(),
|
|
148
|
-
disabled:
|
|
147
|
+
disabled: props.defalutQueryParam.disabled
|
|
149
148
|
})
|
|
150
149
|
const emit = defineEmits(['success'])
|
|
151
150
|
const orgDeptTree = ref<IOrgDeptInfo[]>([])
|
|
@@ -165,10 +164,6 @@ const [userList, resetUserList] = useResetRefHooks<PageData<IMdmEmployee>>({
|
|
|
165
164
|
const getTreeData = async () => {
|
|
166
165
|
try {
|
|
167
166
|
orgDeptTree.value = await deptInfoApi.getMdmOrgDeptTree({})
|
|
168
|
-
nextTick(() => {
|
|
169
|
-
queryParam.value = {...queryParam.value, ...props.defalutQueryParam, }
|
|
170
|
-
ref_tree.value?.setCheckedKeys(props.defalutQueryParam.deptIds)
|
|
171
|
-
})
|
|
172
167
|
} catch (error: any) {
|
|
173
168
|
frameworkUtils.messageError(error)
|
|
174
169
|
}
|
|
@@ -223,35 +218,38 @@ const selectRows = (selects: IMdmEmployee[], row?: IMdmEmployee) => {
|
|
|
223
218
|
const judgeIsSel = (selects: IMdmEmployee[], row: IMdmEmployee) => {
|
|
224
219
|
return selects.some((item) => item.code === row.code)
|
|
225
220
|
}
|
|
226
|
-
const resetQuery = () => {
|
|
221
|
+
const resetQuery = async () => {
|
|
222
|
+
loading.value = true
|
|
227
223
|
resetSelectUserList()
|
|
228
224
|
resetUserList()
|
|
229
225
|
queryRef.value?.resetFields()
|
|
230
|
-
ref_tree.value?.
|
|
226
|
+
ref_tree.value?.setCurrentKey(null)
|
|
231
227
|
resetQueryParam()
|
|
228
|
+
if (!(orgDeptTree.value && orgDeptTree.value.length)) {
|
|
229
|
+
await getTreeData()
|
|
230
|
+
}
|
|
232
231
|
nextTick(() => {
|
|
232
|
+
queryParam.value = {...queryParam.value, ...props.defalutQueryParam, }
|
|
233
|
+
ref_tree.value?.setCurrentKey(props.defalutQueryParam.deptId)
|
|
233
234
|
handleQuery()
|
|
234
235
|
})
|
|
235
236
|
}
|
|
236
237
|
const handleQuery = async () => {
|
|
237
238
|
try {
|
|
238
239
|
loading.value = true
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const select: IOrgDeptInfo[] = ref_tree.value?.
|
|
242
|
-
if (select && select.
|
|
243
|
-
select.
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
249
|
-
item.mdmOrgId && !orgIds.includes(item.mdmOrgId) && deptIds.push(item.id!)
|
|
250
|
-
})
|
|
240
|
+
let deptId = undefined
|
|
241
|
+
let orgId = undefined
|
|
242
|
+
const select: IOrgDeptInfo[] = ref_tree.value?.getCurrentNode()
|
|
243
|
+
if (select && select.id) {
|
|
244
|
+
if (select.mdmOrgId) {
|
|
245
|
+
deptId = select.id
|
|
246
|
+
} else {
|
|
247
|
+
orgId = select.id
|
|
248
|
+
}
|
|
251
249
|
}
|
|
252
250
|
let params = JSON.parse(JSON.stringify(queryParam.value))
|
|
253
|
-
params.
|
|
254
|
-
params.
|
|
251
|
+
params.deptId = deptId
|
|
252
|
+
params.orgId = orgId
|
|
255
253
|
//需要合并默认参数
|
|
256
254
|
userList.value = await props.fetchData(params)
|
|
257
255
|
//设置选中
|
|
@@ -281,9 +279,6 @@ const confirm = async () => {
|
|
|
281
279
|
emit('success', props.multiple ? selectUserList.value : selectRow.value)
|
|
282
280
|
}
|
|
283
281
|
}
|
|
284
|
-
onMounted(() => {
|
|
285
|
-
getTreeData()
|
|
286
|
-
})
|
|
287
282
|
defineExpose({
|
|
288
283
|
confirm,
|
|
289
284
|
resetQuery,
|
|
@@ -909,7 +909,7 @@
|
|
|
909
909
|
background-color: var(--vxe-ui-table-row-radio-checked-background-color);
|
|
910
910
|
}
|
|
911
911
|
&.row--checked {
|
|
912
|
-
background-color: var(--vxe-ui-table-row-
|
|
912
|
+
background-color: var(--vxe-ui-table-row-current-background-color);
|
|
913
913
|
}
|
|
914
914
|
&.row--current {
|
|
915
915
|
background-color: var(--vxe-ui-table-row-current-background-color);
|
|
@@ -923,10 +923,10 @@
|
|
|
923
923
|
background-color: var(--vxe-ui-table-row-hover-radio-checked-background-color);
|
|
924
924
|
}
|
|
925
925
|
&.row--checked {
|
|
926
|
-
|
|
926
|
+
background-color: var(--vxe-ui-table-row-current-background-color);
|
|
927
927
|
}
|
|
928
928
|
&.row--current {
|
|
929
|
-
background-color: var(--vxe-ui-table-row-
|
|
929
|
+
background-color: var(--vxe-ui-table-row-current-background-color);
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
--vxe-ui-input-height-mini: 28px;
|
|
20
20
|
|
|
21
21
|
/*table*/
|
|
22
|
-
--vxe-ui-table-header-font-color:
|
|
22
|
+
--vxe-ui-table-header-font-color: #1F2633;
|
|
23
23
|
--vxe-ui-table-footer-font-color: var(--vxe-ui-font-color);
|
|
24
24
|
--vxe-ui-table-border-radius: var(--vxe-ui-border-radius);
|
|
25
25
|
--vxe-ui-table-border-width: 1.05px;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
/**
|
|
3
|
+
* 校验身份证号码
|
|
4
|
+
* @param rule
|
|
5
|
+
* @param value
|
|
6
|
+
* @param callback
|
|
7
|
+
*/
|
|
8
|
+
validateIDCard: (rule: any, value: any, callback: any) => {
|
|
9
|
+
if (!value) {
|
|
10
|
+
callback()
|
|
11
|
+
} else if (value.length !== 18) {
|
|
12
|
+
callback(new Error('身份证号码必须是18位'))
|
|
13
|
+
} else {
|
|
14
|
+
const weight = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]
|
|
15
|
+
const checkCode = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']
|
|
16
|
+
let sum = 0
|
|
17
|
+
for (let i = 0; i < 17; i++) {
|
|
18
|
+
sum += parseInt(value[i]) * weight[i]
|
|
19
|
+
}
|
|
20
|
+
const mod = sum % 11
|
|
21
|
+
if (checkCode[mod] === value[17]) {
|
|
22
|
+
callback()
|
|
23
|
+
} else {
|
|
24
|
+
callback(new Error('身份证号码校验错误'))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
/**
|
|
29
|
+
* 校验手机号码
|
|
30
|
+
* @param rule
|
|
31
|
+
* @param value
|
|
32
|
+
* @param callback
|
|
33
|
+
*/
|
|
34
|
+
validatePhone : (rule: any, value: any, callback: any) => {
|
|
35
|
+
const phoneReg = /^1[3-9]\d{9}$/
|
|
36
|
+
if (!value || value === '') {
|
|
37
|
+
callback()
|
|
38
|
+
} else if (!phoneReg.test(value)) {
|
|
39
|
+
callback(new Error('请输入正确的手机号码'))
|
|
40
|
+
} else {
|
|
41
|
+
callback()
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* 校验邮箱
|
|
46
|
+
*/
|
|
47
|
+
validateEmail: (rule: any, value: any, callback: any) => {
|
|
48
|
+
const emailReg = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
|
|
49
|
+
if (!value || value === '') {
|
|
50
|
+
callback()
|
|
51
|
+
} else if (!emailReg.test(value)) {
|
|
52
|
+
callback(new Error('请输入正确的邮箱'))
|
|
53
|
+
} else {
|
|
54
|
+
callback()
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|