File tree Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Expand file tree Collapse file tree 2 files changed +13
-21
lines changed Original file line number Diff line number Diff line change 33
33
style =" width : 100% "
34
34
>
35
35
<el-option
36
- v-for =" item in props.userOption "
36
+ v-for =" item in userList "
37
37
:key =" item.id"
38
38
:label =" item.nickname"
39
39
:value =" item.id"
@@ -88,6 +88,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
88
88
const formType = ref (' ' ) // 表单的类型:create - 新增;update - 修改
89
89
const formRef = ref () // 表单 Ref
90
90
const deptOptions = ref () // 树形结构
91
+ const userList = ref () // 负责人列表选项结构
91
92
92
93
const formData = ref ({
93
94
id: undefined ,
@@ -100,12 +101,6 @@ const formData = ref({
100
101
email: undefined ,
101
102
status: undefined
102
103
})
103
- const props = defineProps ({
104
- userOption: {
105
- type: Array ,
106
- default : () => [] as UserVO []
107
- }
108
- })
109
104
110
105
const formRules = reactive ({
111
106
parentId: [{ required: true , message: ' 上级部门不能为空' , trigger: ' blur' }],
@@ -118,12 +113,12 @@ const formRules = reactive({
118
113
})
119
114
120
115
/** 打开弹窗 */
121
- const openModal = async (type : string , id ? : number ) => {
116
+ const openModal = async (type : string , id ? : number , userOption ? : UserVO []) => {
117
+ userList .value = userOption
122
118
modelVisible .value = true
123
119
modelTitle .value = t (' action.' + type )
124
120
formType .value = type
125
121
resetForm ()
126
- console .log (id )
127
122
// 修改时,设置数据
128
123
if (id ) {
129
124
formLoading .value = true
Original file line number Diff line number Diff line change 85
85
</ContentWrap >
86
86
87
87
<!-- 添加或修改部门对话框 -->
88
- <dept-form ref =" modalRef" @success =" getList" :userOption = " userOption " />
88
+ <dept-form ref =" modalRef" @success =" getList" />
89
89
</template >
90
90
<script setup lang="ts" name="Dept">
91
91
import { handleTree } from ' @/utils/tree'
@@ -105,17 +105,14 @@ const queryParams = reactive({
105
105
pageSize: 100
106
106
})
107
107
108
- // 搜索的表单
109
- const queryFormRef = ref ()
110
- // 数据变量
111
- const deptDatas = ref ()
108
+ const queryFormRef = ref () // 搜索的表单
109
+ const deptDatas = ref () // 数据变量
112
110
const userOption = ref <UserVO []>([])
113
- // 是否展开,默认全部展开
114
- const isExpandAll = ref (true )
115
- // 重新渲染表格状态
116
- const refreshTable = ref (true )
117
- // 列表的加载中
118
- const loading = ref (true )
111
+
112
+ const isExpandAll = ref (true ) // 是否展开,默认全部展开
113
+ const refreshTable = ref (true ) // 重新渲染表格状态
114
+ const loading = ref (true ) // 列表的加载中
115
+
119
116
// 获取用户列表
120
117
const getUserList = async () => {
121
118
const res = await getListSimpleUsersApi ()
@@ -172,7 +169,7 @@ const resetQuery = () => {
172
169
/** 添加/修改操作 */
173
170
const modalRef = ref ()
174
171
const openModal = (type : string , id ? : number ) => {
175
- modalRef .value .openModal (type , id )
172
+ modalRef .value .openModal (type , id , userOption . value )
176
173
}
177
174
178
175
const userNicknameFormat = (row ) => {
You can’t perform that action at this time.
0 commit comments