adtec-core-package 2.1.0 → 2.1.2
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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<!--修改时间: 2024/11/8 上午10:33-->
|
|
4
4
|
<template>
|
|
5
5
|
<el-drawer v-model="dialogVisible" :title="title" size="850px" @close="dialogVisible = false">
|
|
6
|
-
<userForm ref="ref_form" :fetch-data="fetchData" @success="success" :defalut-query-param="defalutQueryParam"></userForm>
|
|
6
|
+
<userForm ref="ref_form" :multiple="multiple" :fetch-data="fetchData" @success="success" :defalut-query-param="defalutQueryParam"></userForm>
|
|
7
7
|
<template #footer>
|
|
8
8
|
<el-button @click="dialogVisible = false">取消</el-button>
|
|
9
9
|
<el-button type="primary" @click="confirm">确定</el-button>
|
|
@@ -26,6 +26,7 @@ interface Props<T extends IpageDataQuery, E extends IMdmEmployee> {
|
|
|
26
26
|
fetchData?: (data: T) => Promise<PageData<E>>
|
|
27
27
|
defalutQueryParam?: any
|
|
28
28
|
diagLogLoading?: boolean
|
|
29
|
+
multiple?: boolean
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const props = withDefaults(defineProps<Props<IMdmEmployeeQuery, IMdmEmployee>>(), {
|
|
@@ -33,6 +34,7 @@ const props = withDefaults(defineProps<Props<IMdmEmployeeQuery, IMdmEmployee>>()
|
|
|
33
34
|
fetchData: EmployeeInfoApi.getMdmEmployeeListByIds,
|
|
34
35
|
defalutQueryParam: {},
|
|
35
36
|
diagLogLoading: false,
|
|
37
|
+
multiple: true
|
|
36
38
|
})
|
|
37
39
|
watch(
|
|
38
40
|
() => props.modelValue,
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
<el-tree-select
|
|
22
22
|
ref="ref_tree"
|
|
23
23
|
check-strictly
|
|
24
|
+
:disabled="queryParam.disabled"
|
|
24
25
|
v-model="queryParam.deptIds"
|
|
25
26
|
:data="orgDeptTree"
|
|
26
27
|
filterable
|
|
@@ -92,14 +93,14 @@
|
|
|
92
93
|
style="display: flex; justify-content: center; align-items: center; padding-left: 8px"
|
|
93
94
|
>
|
|
94
95
|
<el-radio v-model="checkId" :label="scope.row.id" @change="handleRadioChange(scope.row)"
|
|
95
|
-
|
|
96
|
+
><span></span
|
|
96
97
|
></el-radio>
|
|
97
98
|
</div>
|
|
98
99
|
</template>
|
|
99
100
|
</el-table-column>
|
|
100
|
-
<el-table-column :show-overflow-tooltip="true" label="用户姓名" prop="name" width="120"
|
|
101
|
-
<el-table-column :show-overflow-tooltip="true" label="岗位名称" prop="postName" width="120"
|
|
102
|
-
<el-table-column :show-overflow-tooltip="true" label="所属部门" prop="deptName"
|
|
101
|
+
<el-table-column :show-overflow-tooltip="true" label="用户姓名" prop="name" width="120"/>
|
|
102
|
+
<el-table-column :show-overflow-tooltip="true" label="岗位名称" prop="postName" width="120"/>
|
|
103
|
+
<el-table-column :show-overflow-tooltip="true" label="所属部门" prop="deptName"/>
|
|
103
104
|
<el-table-column
|
|
104
105
|
:show-overflow-tooltip="true"
|
|
105
106
|
label="所属组织"
|
|
@@ -119,16 +120,16 @@
|
|
|
119
120
|
</el-flex>
|
|
120
121
|
</template>
|
|
121
122
|
<script lang="ts" setup>
|
|
122
|
-
import {
|
|
123
|
-
import type {
|
|
124
|
-
import {
|
|
125
|
-
import type {
|
|
126
|
-
import type {
|
|
127
|
-
import {
|
|
123
|
+
import {useVModel} from '@vueuse/core'
|
|
124
|
+
import type {IMdmEmployeeQuery} from '../../interface/IMdmEmployeeQuery'
|
|
125
|
+
import {nextTick, onMounted, ref, watch} from 'vue'
|
|
126
|
+
import type {IpageDataQuery, PageData} from '../../interface//PageData'
|
|
127
|
+
import type {IMdmEmployee} from '../../interface/IMdmEmployee'
|
|
128
|
+
import {ElMessage, ElTooltip, type TableInstance, type TreeNode} from 'element-plus'
|
|
128
129
|
import deptInfoApi from '../../api/DeptInfoApi'
|
|
129
|
-
import type {
|
|
130
|
+
import type {IOrgDeptInfo} from '../../interface/IOrgDeptInfo'
|
|
130
131
|
import EmployeeInfoApi from '../../api/EmployeeInfoApi'
|
|
131
|
-
import {
|
|
132
|
+
import {useResetRefHooks} from '../../hooks/useResetRefHooks'
|
|
132
133
|
import frameworkUtils from '../../utils/FrameworkUtils'
|
|
133
134
|
|
|
134
135
|
// 明确指定 Props 的泛型参数类型
|
|
@@ -143,17 +144,15 @@ const props = withDefaults(defineProps<Props<IMdmEmployeeQuery, IMdmEmployee>>()
|
|
|
143
144
|
fetchData: EmployeeInfoApi.getMdmEmployeeListByIds,
|
|
144
145
|
defalutQueryParam: {
|
|
145
146
|
disabled: false,
|
|
146
|
-
deptIds: []
|
|
147
|
+
deptIds: []
|
|
147
148
|
},
|
|
148
149
|
multiple: true,
|
|
149
150
|
showOrgInfo: true,
|
|
150
151
|
})
|
|
151
|
-
const [queryParam, resetQueryParam] = useResetRefHooks<IMdmEmployeeQuery>({
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
deptIds: props.defalutQueryParam.deptIds,
|
|
156
|
-
})
|
|
152
|
+
const [queryParam, resetQueryParam] = useResetRefHooks<IMdmEmployeeQuery>({...{
|
|
153
|
+
current: 1,
|
|
154
|
+
size: frameworkUtils.getPageSize()
|
|
155
|
+
}, ...props.defalutQueryParam})
|
|
157
156
|
const emit = defineEmits(['success'])
|
|
158
157
|
const orgDeptTree = ref<IOrgDeptInfo[]>([])
|
|
159
158
|
const loading = ref(false)
|
|
@@ -187,7 +186,7 @@ const handleRadioChange = (row: IMdmEmployee) => {
|
|
|
187
186
|
}
|
|
188
187
|
const renderTreeNode = (
|
|
189
188
|
h: (type: any, props: any, children: any) => any,
|
|
190
|
-
{
|
|
189
|
+
{node, data}: { node: TreeNode; data: IOrgDeptInfo },
|
|
191
190
|
) => {
|
|
192
191
|
return [
|
|
193
192
|
h(
|
|
@@ -236,8 +235,7 @@ const resetQuery = async () => {
|
|
|
236
235
|
queryRef.value?.resetFields()
|
|
237
236
|
ref_tree.value?.setCheckedKeys([])
|
|
238
237
|
resetQueryParam()
|
|
239
|
-
queryParam.value
|
|
240
|
-
queryParam.value.disabled = props.defalutQueryParam.disabled
|
|
238
|
+
queryParam.value = {...queryParam.value,...props.defalutQueryParam}
|
|
241
239
|
nextTick(() => {
|
|
242
240
|
ref_tree.value?.setCheckedKeys(queryParam.value.deptIds ?? [])
|
|
243
241
|
handleQuery()
|