fix: 修复oss设为默认功能bug,修复重置时没有对部门树选中状态重置问题
This commit is contained in:
parent
c125bd8c79
commit
3b709f1e0a
@ -204,6 +204,7 @@ async function handleStatusChange(
|
|||||||
callback: (flag: boolean) => void
|
callback: (flag: boolean) => void
|
||||||
) {
|
) {
|
||||||
const { error } = await fetchUpdateOssConfigStatus({
|
const { error } = await fetchUpdateOssConfigStatus({
|
||||||
|
configKey: row.configKey,
|
||||||
ossConfigId: row.ossConfigId,
|
ossConfigId: row.ossConfigId,
|
||||||
status: value
|
status: value
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
import { ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
import { NButton, NDivider } from 'naive-ui';
|
import { NButton, NDivider } from 'naive-ui';
|
||||||
import { useLoading } from '@sa/hooks';
|
import { useLoading } from '@sa/hooks';
|
||||||
import { fetchBatchDeletePost, fetchGetPostList } from '@/service/api/system/post';
|
import { fetchBatchDeletePost, fetchGetPostList } from '@/service/api/system/post';
|
||||||
@ -43,7 +43,8 @@ const {
|
|||||||
// the value can not be undefined, otherwise the property in Form will not be reactive
|
// the value can not be undefined, otherwise the property in Form will not be reactive
|
||||||
postCode: null,
|
postCode: null,
|
||||||
postName: null,
|
postName: null,
|
||||||
status: null
|
status: null,
|
||||||
|
belongDeptId: null
|
||||||
},
|
},
|
||||||
columns: () => [
|
columns: () => [
|
||||||
{
|
{
|
||||||
@ -180,10 +181,16 @@ async function handleExport() {
|
|||||||
download('/system/post/export', searchParams, `岗位信息_${new Date().getTime()}.xlsx`);
|
download('/system/post/export', searchParams, `岗位信息_${new Date().getTime()}.xlsx`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const expandedKeys = ref<CommonType.IdType[]>([100]);
|
||||||
|
|
||||||
|
const selectable = computed(() => {
|
||||||
|
return !loading.value;
|
||||||
|
});
|
||||||
|
|
||||||
const { loading: treeLoading, startLoading: startTreeLoading, endLoading: endTreeLoading } = useLoading();
|
const { loading: treeLoading, startLoading: startTreeLoading, endLoading: endTreeLoading } = useLoading();
|
||||||
const deptPattern = ref<string>();
|
const deptPattern = ref<string>();
|
||||||
const deptData = ref<Api.Common.CommonTreeRecord>([]);
|
const deptData = ref<Api.Common.CommonTreeRecord>([]);
|
||||||
|
const selectedKeys = ref<string[]>([]);
|
||||||
async function getTreeData() {
|
async function getTreeData() {
|
||||||
startTreeLoading();
|
startTreeLoading();
|
||||||
const { data: tree, error } = await fetchGetDeptTree();
|
const { data: tree, error } = await fetchGetDeptTree();
|
||||||
@ -203,9 +210,12 @@ function handleClickTree(keys: string[]) {
|
|||||||
|
|
||||||
function handleResetTreeData() {
|
function handleResetTreeData() {
|
||||||
deptPattern.value = undefined;
|
deptPattern.value = undefined;
|
||||||
searchParams.belongDeptId = null;
|
|
||||||
getTreeData();
|
getTreeData();
|
||||||
getDataByPage();
|
}
|
||||||
|
|
||||||
|
function handleResetSearch() {
|
||||||
|
resetSearchParams();
|
||||||
|
selectedKeys.value = [];
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -222,10 +232,11 @@ function handleResetTreeData() {
|
|||||||
<NInput v-model:value="deptPattern" clearable :placeholder="$t('common.keywordSearch')" />
|
<NInput v-model:value="deptPattern" clearable :placeholder="$t('common.keywordSearch')" />
|
||||||
<NSpin class="dept-tree" :show="treeLoading">
|
<NSpin class="dept-tree" :show="treeLoading">
|
||||||
<NTree
|
<NTree
|
||||||
|
v-model:expanded-keys="expandedKeys"
|
||||||
|
v-model:selected-keys="selectedKeys"
|
||||||
block-node
|
block-node
|
||||||
show-line
|
show-line
|
||||||
:data="deptData as []"
|
:data="deptData as []"
|
||||||
:default-expanded-keys="deptData?.length ? [deptData[0].id!] : []"
|
|
||||||
:show-irrelevant-nodes="false"
|
:show-irrelevant-nodes="false"
|
||||||
:pattern="deptPattern"
|
:pattern="deptPattern"
|
||||||
block-line
|
block-line
|
||||||
@ -233,6 +244,7 @@ function handleResetTreeData() {
|
|||||||
key-field="id"
|
key-field="id"
|
||||||
label-field="label"
|
label-field="label"
|
||||||
virtual-scroll
|
virtual-scroll
|
||||||
|
:selectable="selectable"
|
||||||
@update:selected-keys="handleClickTree"
|
@update:selected-keys="handleClickTree"
|
||||||
>
|
>
|
||||||
<template #empty>
|
<template #empty>
|
||||||
@ -242,7 +254,7 @@ function handleResetTreeData() {
|
|||||||
</NSpin>
|
</NSpin>
|
||||||
</template>
|
</template>
|
||||||
<div class="h-full flex-col-stretch gap-12px overflow-hidden lt-sm:overflow-auto">
|
<div class="h-full flex-col-stretch gap-12px overflow-hidden lt-sm:overflow-auto">
|
||||||
<PostSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getDataByPage" />
|
<PostSearch v-model:model="searchParams" @reset="handleResetSearch" @search="getDataByPage" />
|
||||||
<NCard title="岗位信息列表" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
|
<NCard title="岗位信息列表" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
|
||||||
<template #header-extra>
|
<template #header-extra>
|
||||||
<TableHeaderOperation
|
<TableHeaderOperation
|
||||||
|
@ -212,6 +212,7 @@ async function handleResetPwd(userId: CommonType.IdType) {
|
|||||||
const { loading: treeLoading, startLoading: startTreeLoading, endLoading: endTreeLoading } = useLoading();
|
const { loading: treeLoading, startLoading: startTreeLoading, endLoading: endTreeLoading } = useLoading();
|
||||||
const deptPattern = ref<string>();
|
const deptPattern = ref<string>();
|
||||||
const deptData = ref<Api.Common.CommonTreeRecord>([]);
|
const deptData = ref<Api.Common.CommonTreeRecord>([]);
|
||||||
|
const selectedKeys = ref<string[]>([]);
|
||||||
|
|
||||||
async function getTreeData() {
|
async function getTreeData() {
|
||||||
startTreeLoading();
|
startTreeLoading();
|
||||||
@ -267,6 +268,11 @@ const expandedKeys = ref<CommonType.IdType[]>([100]);
|
|||||||
const selectable = computed(() => {
|
const selectable = computed(() => {
|
||||||
return !loading.value;
|
return !loading.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function handleResetSearch() {
|
||||||
|
resetSearchParams();
|
||||||
|
selectedKeys.value = [];
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -283,6 +289,7 @@ const selectable = computed(() => {
|
|||||||
<NSpin class="dept-tree" :show="treeLoading">
|
<NSpin class="dept-tree" :show="treeLoading">
|
||||||
<NTree
|
<NTree
|
||||||
v-model:expanded-keys="expandedKeys"
|
v-model:expanded-keys="expandedKeys"
|
||||||
|
v-model:selected-keys="selectedKeys"
|
||||||
block-node
|
block-node
|
||||||
show-line
|
show-line
|
||||||
:data="deptData as []"
|
:data="deptData as []"
|
||||||
@ -302,7 +309,7 @@ const selectable = computed(() => {
|
|||||||
</NSpin>
|
</NSpin>
|
||||||
</template>
|
</template>
|
||||||
<div class="h-full flex-col-stretch gap-12px overflow-hidden lt-sm:overflow-auto">
|
<div class="h-full flex-col-stretch gap-12px overflow-hidden lt-sm:overflow-auto">
|
||||||
<UserSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getDataByPage" />
|
<UserSearch v-model:model="searchParams" @reset="handleResetSearch" @search="getDataByPage" />
|
||||||
<TableRowCheckAlert v-model:checked-row-keys="checkedRowKeys" />
|
<TableRowCheckAlert v-model:checked-row-keys="checkedRowKeys" />
|
||||||
<NCard :title="$t('page.system.user.title')" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
|
<NCard :title="$t('page.system.user.title')" :bordered="false" size="small" class="sm:flex-1-hidden card-wrapper">
|
||||||
<template #header-extra>
|
<template #header-extra>
|
||||||
|
Loading…
Reference in New Issue
Block a user