重新dept模块
parent
15ac1d9d8b
commit
1846ba150e
|
@ -33,7 +33,7 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in props.userOption"
|
v-for="item in userList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.nickname"
|
:label="item.nickname"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
|
@ -88,6 +88,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const deptOptions = ref() // 树形结构
|
const deptOptions = ref() // 树形结构
|
||||||
|
const userList = ref() // 负责人列表选项结构
|
||||||
|
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
|
@ -100,12 +101,6 @@ const formData = ref({
|
||||||
email: undefined,
|
email: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
})
|
})
|
||||||
const props = defineProps({
|
|
||||||
userOption: {
|
|
||||||
type: Array,
|
|
||||||
default: () => [] as UserVO[]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
parentId: [{ required: true, message: '上级部门不能为空', trigger: 'blur' }],
|
||||||
|
@ -118,12 +113,12 @@ const formRules = reactive({
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const openModal = async (type: string, id?: number) => {
|
const openModal = async (type: string, id?: number, userOption?: UserVO[]) => {
|
||||||
|
userList.value = userOption
|
||||||
modelVisible.value = true
|
modelVisible.value = true
|
||||||
modelTitle.value = t('action.' + type)
|
modelTitle.value = t('action.' + type)
|
||||||
formType.value = type
|
formType.value = type
|
||||||
resetForm()
|
resetForm()
|
||||||
console.log(id)
|
|
||||||
// 修改时,设置数据
|
// 修改时,设置数据
|
||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<!-- 添加或修改部门对话框 -->
|
<!-- 添加或修改部门对话框 -->
|
||||||
<dept-form ref="modalRef" @success="getList" :userOption="userOption" />
|
<dept-form ref="modalRef" @success="getList" />
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Dept">
|
<script setup lang="ts" name="Dept">
|
||||||
import { handleTree } from '@/utils/tree'
|
import { handleTree } from '@/utils/tree'
|
||||||
|
@ -105,17 +105,14 @@ const queryParams = reactive({
|
||||||
pageSize: 100
|
pageSize: 100
|
||||||
})
|
})
|
||||||
|
|
||||||
// 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const queryFormRef = ref()
|
const deptDatas = ref() // 数据变量
|
||||||
// 数据变量
|
|
||||||
const deptDatas = ref()
|
|
||||||
const userOption = ref<UserVO[]>([])
|
const userOption = ref<UserVO[]>([])
|
||||||
// 是否展开,默认全部展开
|
|
||||||
const isExpandAll = ref(true)
|
const isExpandAll = ref(true) // 是否展开,默认全部展开
|
||||||
// 重新渲染表格状态
|
const refreshTable = ref(true) // 重新渲染表格状态
|
||||||
const refreshTable = ref(true)
|
const loading = ref(true) // 列表的加载中
|
||||||
// 列表的加载中
|
|
||||||
const loading = ref(true)
|
|
||||||
//获取用户列表
|
//获取用户列表
|
||||||
const getUserList = async () => {
|
const getUserList = async () => {
|
||||||
const res = await getListSimpleUsersApi()
|
const res = await getListSimpleUsersApi()
|
||||||
|
@ -172,7 +169,7 @@ const resetQuery = () => {
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
const modalRef = ref()
|
const modalRef = ref()
|
||||||
const openModal = (type: string, id?: number) => {
|
const openModal = (type: string, id?: number) => {
|
||||||
modalRef.value.openModal(type, id)
|
modalRef.value.openModal(type, id, userOption.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
const userNicknameFormat = (row) => {
|
const userNicknameFormat = (row) => {
|
||||||
|
|
Loading…
Reference in New Issue