【升级】用户、角色、字典、机构、岗位这些左树右表得到增强,新增时选择树后对应新增的表单跟着选中

pull/90/head
小诺 2 years ago committed by 俞宝山
parent 41d8a234a3
commit cb4f0a4680

@ -84,12 +84,15 @@
const submitLoading = ref(false)
//
const onOpen = (record) => {
const onOpen = (record, parentId) => {
visible = true
extJson.value = ref([])
formData.value = {
sortCode: 99
}
if (parentId) {
formData.value.parentId = parentId
}
if (record) {
const param = {
id: record.id

@ -19,7 +19,7 @@
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="名称关键词">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入机构名称关键词"></a-input>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入机构名称关键词" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -48,7 +48,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()" v-if="hasPerm('bizOrgAdd')">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.parentId)" v-if="hasPerm('bizOrgAdd')">
<template #icon><plus-outlined /></template>
新增
</a-button>

@ -68,11 +68,14 @@
const submitLoading = ref(false)
//
const onOpen = (record) => {
const onOpen = (record, orgId) => {
visible = true
formData.value = {
sortCode: 99
}
if (orgId) {
formData.value.orgId = orgId
}
if (record) {
formData.value = Object.assign({}, record)
}

@ -19,7 +19,7 @@
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="名称关键词">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入岗位名称关键词"></a-input>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入岗位名称关键词" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -48,7 +48,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()" v-if="hasPerm('bizPositionAdd')">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.orgId)" v-if="hasPerm('bizPositionAdd')">
<template #icon><plus-outlined /></template>
新增
</a-button>

@ -351,33 +351,42 @@
let formData = ref({})
//
const onOpen = (record) => {
const onOpen = (record, orgId) => {
visible = true
formData.value = {
gender: '男',
positionJson: []
}
if (orgId) {
formData.value.orgId = orgId
//
nextTick(() => {
selePositionData(orgId)
})
}
if (record) {
convertFormData(record)
}
//
bizUserApi.userOrgTreeSelector().then((res) => {
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
treeDefaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
treeDefaultExpandedKeys.value.push(items.id)
})
nextTick(() => {
//
bizUserApi.userOrgTreeSelector().then((res) => {
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
treeDefaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
treeDefaultExpandedKeys.value.push(items.id)
})
}
}
}
})
}
})
}
})
})
}
//

@ -60,7 +60,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()" v-if="hasPerm('bizUserAdd')">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.orgId)" v-if="hasPerm('bizUserAdd')">
<template #icon><plus-outlined /></template>
<span>{{ $t('common.addButton') }}{{ $t('model.user') }}</span>
</a-button>

@ -39,7 +39,7 @@
</a-button>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="form.onOpen(undefined, 'BIZ')">
<a-button type="primary" @click="form.onOpen(undefined, 'BIZ', searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>

@ -39,7 +39,7 @@
/>
</a-form-item>
<a-form-item label="排序:" name="sortCode">
<a-input-number style="width: 100%" v-model:value="formData.sortCode" :max="100" />
<a-input-number style="width: 100%" v-model:value="formData.sortCode" :max="1000" />
</a-form-item>
</a-form>
<template #footer>
@ -66,12 +66,15 @@
const defaultExpandedKeys = ref([0])
//
const onOpen = (record, type) => {
const onOpen = (record, type, parentId) => {
visible = true
formData.value = {
sortCode: 99,
category: type
}
if (parentId) {
formData.value.parentId = parentId
}
if (record) {
formData.value = Object.assign({}, record)
formData.value.category = type

@ -39,7 +39,7 @@
</a-button>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="form.onOpen(undefined, 'FRM')">
<a-button type="primary" @click="form.onOpen(undefined, 'FRM', searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>

@ -25,7 +25,7 @@
}"
selectable="false"
tree-line
></a-tree-select>
/>
</a-form-item>
<a-form-item label="组织名称:" name="name">
<a-input v-model:value="formData.name" placeholder="请输入组织名称" allow-clear />
@ -84,12 +84,15 @@
const submitLoading = ref(false)
//
const onOpen = (record) => {
const onOpen = (record, parentId) => {
visible = true
extJson.value = ref([])
formData.value = {
sortCode: 99
}
if (parentId) {
formData.value.parentId = parentId
}
if (record) {
const param = {
id: record.id

@ -8,8 +8,7 @@
:tree-data="treeData"
:field-names="treeFieldNames"
@select="treeSelect"
>
</a-tree>
/>
<a-empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" />
</a-card>
</a-col>
@ -48,7 +47,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.parentId)">
<template #icon><plus-outlined /></template>
新增
</a-button>

@ -67,11 +67,14 @@
const submitLoading = ref(false)
//
const onOpen = (record) => {
const onOpen = (record, orgId) => {
visible = true
formData.value = {
sortCode: 99
}
if (orgId) {
formData.value.orgId = orgId
}
if (record) {
formData.value = Object.assign({}, record)
}

@ -19,7 +19,7 @@
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="名称关键词">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入职位名称关键词"></a-input>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入职位名称关键词" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -48,7 +48,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.orgId)">
<template #icon><plus-outlined /></template>
新增
</a-button>

@ -67,11 +67,19 @@
const submitLoading = ref(false)
//
const onOpen = (record) => {
const onOpen = (record, category, orgId) => {
visible = true
formData.value = {
sortCode: 99
}
//
if (category) {
formData.value.category = category
}
if (orgId) {
formData.value.category = 'ORG'
formData.value.orgId = orgId
}
if (record) {
formData.value = Object.assign({}, record)
}

@ -49,7 +49,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.category, searchFormState.orgId)">
<template #icon><plus-outlined /></template>
新增角色
</a-button>

@ -349,33 +349,42 @@
let formData = ref({})
//
const onOpen = (record) => {
const onOpen = (record, orgId) => {
visible = true
formData.value = {
gender: '男',
positionJson: []
}
if (orgId) {
formData.value.orgId = orgId
//
nextTick(() => {
selePositionData(orgId)
})
}
if (record) {
convertFormData(record)
}
//
userApi.userOrgTreeSelector().then((res) => {
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
treeDefaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
treeDefaultExpandedKeys.value.push(items.id)
})
nextTick(() => {
//
userApi.userOrgTreeSelector().then((res) => {
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
treeDefaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
treeDefaultExpandedKeys.value.push(items.id)
})
}
}
}
})
}
})
}
})
})
}
//

@ -60,7 +60,7 @@
>
<template #operator class="table-operator">
<a-space>
<a-button type="primary" @click="form.onOpen()">
<a-button type="primary" @click="form.onOpen(undefined, searchFormState.orgId)">
<template #icon><plus-outlined /></template>
<span>{{ $t('common.addButton') }}{{ $t('model.user') }}</span>
</a-button>

Loading…
Cancel
Save