czh-20260624-过滤admin账户;首页增加刷新按钮
This commit is contained in:
@@ -114,7 +114,7 @@ async function loadUsersByUsernames(valueStr: string) {
|
|||||||
url: '/sys/user/queryUserComponentData',
|
url: '/sys/user/queryUserComponentData',
|
||||||
params: { [paramKey]: valueStr, isMultiTranslate: 'true', pageNo: 1, pageSize: 9999 },
|
params: { [paramKey]: valueStr, isMultiTranslate: 'true', pageNo: 1, pageSize: 9999 },
|
||||||
});
|
});
|
||||||
innerSelectedUsers.value = [...(res.records || res)];
|
innerSelectedUsers.value = (res.records || res).filter((u: UserItem) => !u.username.toLowerCase().includes('admin'));
|
||||||
} catch {
|
} catch {
|
||||||
innerSelectedUsers.value = [];
|
innerSelectedUsers.value = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,11 +205,7 @@ async function loadData(arg?: number) {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res: any = await defHttp.get({ url: url.pageUserDepart, params });
|
const res: any = await defHttp.get({ url: url.pageUserDepart, params });
|
||||||
dataSource.value = (res.records || []).filter((user: UserItem) => {
|
dataSource.value = (res.records || []).filter((user: UserItem) => !user.username.toLowerCase().includes('admin'));
|
||||||
const userLevel = user.userSecurityLevel;
|
|
||||||
const docLevel = props.secLevel;
|
|
||||||
return userLevel !== null && userLevel > docLevel;
|
|
||||||
});
|
|
||||||
ipagination.total = res.total;
|
ipagination.total = res.total;
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
@@ -267,11 +263,7 @@ async function getAllUsersInDepart() {
|
|||||||
const filteredParam = filterObj(param);
|
const filteredParam = filterObj(param);
|
||||||
try {
|
try {
|
||||||
const res: any = await defHttp.get({ url: url.listUserDepart, params: filteredParam });
|
const res: any = await defHttp.get({ url: url.listUserDepart, params: filteredParam });
|
||||||
allUserList.value = (res.records || res).filter((user: UserItem) => {
|
allUserList.value = (res.records || res).filter((user: UserItem) => !user.username.toLowerCase().includes('admin'));
|
||||||
const userLevel = user.userSecurityLevel;
|
|
||||||
const docLevel = props.secLevel;
|
|
||||||
return userLevel !== null && userLevel > docLevel;
|
|
||||||
});
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
allUserList.value = [];
|
allUserList.value = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="my-work__tab" :class="{ 'my-work__tab--active': activeTab === 'cc' }" @click="activeTab = 'cc'">我的抄送</div>
|
<div class="my-work__tab" :class="{ 'my-work__tab--active': activeTab === 'cc' }" @click="activeTab = 'cc'">我的抄送</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ReloadOutlined class="my-work__refresh" :class="{ 'my-work__refresh--spinning': refreshing }" @click="handleRefresh" />
|
||||||
<a class="my-work__more" @click="goMore">
|
<a class="my-work__more" @click="goMore">
|
||||||
更多
|
更多
|
||||||
<RightOutlined class="my-work__more-icon" />
|
<RightOutlined class="my-work__more-icon" />
|
||||||
@@ -62,7 +63,7 @@
|
|||||||
import HeaderCell from '/@/components/Table/src/components/HeaderCell.vue';
|
import HeaderCell from '/@/components/Table/src/components/HeaderCell.vue';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { RightOutlined, QuestionCircleOutlined } from '@ant-design/icons-vue';
|
import { RightOutlined, QuestionCircleOutlined, ReloadOutlined } from '@ant-design/icons-vue';
|
||||||
import { Tooltip } from 'ant-design-vue';
|
import { Tooltip } from 'ant-design-vue';
|
||||||
import TaskHandleModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/TaskHandleModal.vue';
|
import TaskHandleModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/TaskHandleModal.vue';
|
||||||
import SelectEntrusterModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/SelectEntrusterModal.vue';
|
import SelectEntrusterModal from '/@/views/super/bpm/process/personalOffice/myHandleTask/modal/SelectEntrusterModal.vue';
|
||||||
@@ -81,6 +82,9 @@
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const activeTab = ref<'todo' | 'cc'>('todo');
|
const activeTab = ref<'todo' | 'cc'>('todo');
|
||||||
const todoTotal = ref(0);
|
const todoTotal = ref(0);
|
||||||
|
const refreshing = ref(false);
|
||||||
|
|
||||||
|
const emit = defineEmits(['refresh']);
|
||||||
|
|
||||||
const { tableContext: todoContext } = useListPage({
|
const { tableContext: todoContext } = useListPage({
|
||||||
designScope: 'process-portal-todo',
|
designScope: 'process-portal-todo',
|
||||||
@@ -131,6 +135,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleRefresh() {
|
||||||
|
refreshing.value = true;
|
||||||
|
try {
|
||||||
|
reloadTodo();
|
||||||
|
await fetchTodoTotal();
|
||||||
|
emit('refresh');
|
||||||
|
} finally {
|
||||||
|
refreshing.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function goMore() {
|
function goMore() {
|
||||||
if (activeTab.value === 'todo') {
|
if (activeTab.value === 'todo') {
|
||||||
router.push('/task/myTodoTaskInfo');
|
router.push('/task/myTodoTaskInfo');
|
||||||
@@ -286,6 +301,32 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__refresh {
|
||||||
|
font-size: 14px;
|
||||||
|
color: rgba(0, 0, 0, 0.45);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.2s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&--spinning {
|
||||||
|
animation: spin 0.8s linear infinite;
|
||||||
|
color: @primary-color;
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
from {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&__actions {
|
&__actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
onMounted(async () => {
|
async function loadStats() {
|
||||||
try {
|
try {
|
||||||
const res = await getProcessPortalStats();
|
const res = await getProcessPortalStats();
|
||||||
if (res) {
|
if (res) {
|
||||||
@@ -104,7 +104,13 @@
|
|||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
loadStats();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
defineExpose({ refresh: loadStats });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
@@ -2,15 +2,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="process-portal">
|
<div class="process-portal">
|
||||||
<WelcomeBanner />
|
<WelcomeBanner />
|
||||||
<StatCards />
|
<StatCards ref="statCardsRef" />
|
||||||
<MyWork />
|
<MyWork @refresh="statCardsRef?.refresh()" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
import WelcomeBanner from './components/WelcomeBanner.vue';
|
import WelcomeBanner from './components/WelcomeBanner.vue';
|
||||||
import StatCards from './components/StatCards.vue';
|
import StatCards from './components/StatCards.vue';
|
||||||
import MyWork from './components/MyWork.vue';
|
import MyWork from './components/MyWork.vue';
|
||||||
|
|
||||||
|
const statCardsRef = ref<InstanceType<typeof StatCards> | null>(null);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
Reference in New Issue
Block a user