提交 789504b0 authored 作者: xiejiang's avatar xiejiang

style: 修改页面菜单登录页面还原度

上级 442c6fd6
......@@ -16,7 +16,6 @@ declare module 'vue' {
Drawer: typeof import('./components/Drawer/index.vue')['default']
FooterFixBtn: typeof import('./components/FooterFixBtn/index.vue')['default']
ImageViewer: typeof import('./components/ImageViewer/index.vue')['default']
Img: typeof import('./components/Upload/Img.vue')['default']
InfoLable: typeof import('./components/InfoLable/index.vue')['default']
Media: typeof import('./components/Upload/media.vue')['default']
OperateBtn: typeof import('./components/OperateBtn/index.vue')['default']
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-27 15:14:31
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 10:59:29
* @LastEditTime: 2024-12-11 14:05:24
* @Description: 弹窗
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-06 09:53:55
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-02 14:13:30
* @LastEditTime: 2024-12-11 14:09:22
* @Description: 抽屉
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -73,15 +73,18 @@ watch(
)
</script>
<style lang="less" scoped>
/* stylelint-disable-next-line selector-pseudo-class-no-unknown */
:global(.t-drawer__footer) {
padding-top: 12px;
<style lang="less">
.t-drawer__footer {
padding-top: 10px;
padding-bottom: 12px;
height: 48px;
}
/* stylelint-disable-next-line selector-pseudo-class-no-unknown */
:global(.t-drawer__body) {
padding: 20px 16px;
.t-drawer__header {
min-height: 48px;
}
.t-drawer__body {
padding: 20px;
}
</style>
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-28 09:24:26
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 10:23:44
* @LastEditTime: 2024-12-11 15:38:35
* @Description: table操作按钮
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -47,7 +47,7 @@ const handleClick = () => {
</script>
<style lang="less" scoped>
.t-button--variant-text {
padding: 0 8px;
padding: 0 10px 0 0;
color: var(--td-brand-color-8);
}
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-07 11:19:31
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 11:15:52
* @LastEditTime: 2024-12-11 16:00:12
* @Description: 表格页面容器组件
-->
<template>
......@@ -12,6 +12,7 @@
:filter-conditions="props.filterConditions"
v-bind="filtersProps"
@on-filter="handleSeach"
@on-search="onSeachChange"
@clear="handleClear"
/>
<div class="mt-[12px] p-[16px] bg-white flex-1 max-h-[calc(100%-64px)] overflow-auto">
......@@ -119,6 +120,7 @@ const emit = defineEmits<{
'page-change': [pageInfo: Pagination]
clear: []
change: [changeParams: any]
'on-search': [params: Record<string, any>]
}>()
// 清空
......@@ -159,6 +161,12 @@ const handleSeach = (params: Record<string, any>) => {
emit('search-change', params)
}
// 处理搜索条件不调用接口
const onSeachChange = (params: Record<string, any>) => {
searchValue.value = params
emit('on-search', params)
}
// 处理排序变化
const onSortChange: TableProps['onSortChange'] = val => {
emit('sort-change', val)
......
......@@ -2,85 +2,96 @@
<div class="px-[16px] pb-[16px] pt-[4px] bg-white">
<!-- 筛选框区域 && 按钮 -->
<div class="flex">
<div class="flex-1 flex flex-wrap">
<div class="mr-[8px] mt-[12px]" v-for="item in filterData" :key="item.prop">
<t-input
v-model="item.str"
clearable
v-bind="item.$attrs"
:placeholder="item.label"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'input'"
>
<template #suffix-icon>
<SearchIcon />
</template>
</t-input>
<t-select
v-model="item.str"
:placeholder="item.label"
clearable
v-bind="item.$attrs"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'select' && item.selectData"
>
<t-option v-for="opt in item.selectData" :key="opt.value" :value="opt.value" :label="opt.label" />
</t-select>
<t-select
v-model="item.values"
v-bind="item.$attrs"
:placeholder="item.label"
clearable
multiple
filterable
:min-collapsed-num="minCollapsedNum"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'multiple-select' && item.selectData"
>
<t-option v-for="opt in item.selectData" :key="opt.value" :value="opt.value" :label="opt.label" />
</t-select>
<t-date-picker
v-model="item.str"
allow-input
clearable
:placeholder="item.label"
v-bind="item.$attrs"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'date'"
/>
<div class="flex-1">
<div class="flex flex-wrap">
<div class="mr-[8px] mt-[12px]" v-for="item in filterData" :key="item.prop">
<t-input
v-model="item.str"
clearable
v-bind="item.$attrs"
:placeholder="item.label"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'input'"
>
<template #suffix-icon>
<SearchIcon />
</template>
</t-input>
<t-select
v-model="item.str"
:placeholder="item.label"
clearable
v-bind="item.$attrs"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'select' && item.selectData"
>
<t-option v-for="opt in item.selectData" :key="opt.value" :value="opt.value" :label="opt.label" />
</t-select>
<t-select
v-model="item.values"
v-bind="item.$attrs"
:placeholder="item.label"
clearable
multiple
filterable
:min-collapsed-num="minCollapsedNum"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'multiple-select' && item.selectData"
>
<t-option v-for="opt in item.selectData" :key="opt.value" :value="opt.value" :label="opt.label" />
</t-select>
<t-date-picker
v-model="item.str"
allow-input
clearable
:placeholder="item.label"
v-bind="item.$attrs"
:style="{ width: (item.width || 160) + 'px' }"
v-if="item.type === 'date'"
/>
</div>
</div>
<!-- 筛选结果区域 -->
<transition>
<div class="mt-[4px] flex flex-wrap max-h-[100vh] min-h-[36px]" v-if="isShowFilterResult">
<div v-for="item in filterData" :key="item.prop">
<div class="flex items-center mr-[16px] mt-[12px]" v-if="item.str || item.values?.length">
<div class="text-font-gray-3">{{ item.label }}:</div>
<template v-if="['select', 'input', 'date'].includes(item.type)">
<t-tag :closable="!item.closable" @close="filterResultClose(item)">{{
returnFilterResult(item)
}}</t-tag>
</template>
<template v-else-if="item.type === 'multiple-select'">
<t-tag
:closable="!item.closable"
v-for="itx in item.values"
:key="itx"
class="mr-[8px]"
@close="filterMultipleResultClose(item, itx)"
>
{{ returnMultipleResult(item, itx) }}
</t-tag>
</template>
</div>
</div>
</div>
</transition>
</div>
<div class="flex flex-col w-[60px] mt-[12px] ml-[88px]">
<t-button theme="default" variant="base" @click="handleFilterSearch">查询</t-button>
<t-button v-show="isShowFilterResult" theme="default" variant="outline" class="mt-[12px]" @click="handleClear">
<t-button theme="default" variant="base" class="bg-btn" @click="handleFilterSearch">查询</t-button>
<t-button
v-show="isShowFilterResult"
theme="default"
variant="outline"
class="mt-[12px] clear-btn"
@click="handleClear"
>
清空
</t-button>
</div>
</div>
<!-- 筛选结果区域 -->
<transition>
<div class="mt-[4px] flex flex-wrap max-h-[100vh] min-h-[36px]" v-if="isShowFilterResult">
<div v-for="item in filterData" :key="item.prop">
<div class="flex items-center mr-[16px] mt-[12px]" v-if="item.str || item.values?.length">
<div class="text-font-gray-3">{{ item.label }}:</div>
<template v-if="['select', 'input', 'date'].includes(item.type)">
<t-tag :closable="!item.closable" @close="filterResultClose(item)">{{ returnFilterResult(item) }}</t-tag>
</template>
<template v-else-if="item.type === 'multiple-select'">
<t-tag
:closable="!item.closable"
v-for="itx in item.values"
:key="itx"
class="mr-[8px]"
@close="filterMultipleResultClose(item, itx)"
>
{{ returnMultipleResult(item, itx) }}
</t-tag>
</template>
</div>
</div>
</div>
</transition>
</div>
</template>
......@@ -145,6 +156,7 @@ const filterParams: DynamicType = reactive({})
const emit = defineEmits<{
'on-filter': [filter: DynamicType['filter']]
'on-search': [filter: DynamicType['filter']]
clear: []
}>()
......@@ -173,16 +185,16 @@ watch(
}
)
// watch(
// () => filterData,
// () => {
// handleFilterSearch()
// },
// {
// deep: true,
// immediate: true
// }
// )
watch(
() => filterData,
() => {
resetFilterConditions()
emit('on-search', filterParams as DynamicType)
},
{
deep: true
}
)
defineExpose<DynamicType>({
resetFilterConditions
......@@ -230,4 +242,12 @@ defineExpose<DynamicType>({
border-top: 1px solid var(--td-gray-color-2);
}
}
.bg-btn {
background-color: var(--td-gray-color-1);
}
.clear-btn {
border-color: var(--td-gray-color-2);
}
</style>
......@@ -8,7 +8,7 @@
<template>
<div class="sreach-with-button-wrap" :style="{ width }">
<t-input
v-model="searchKey"
v-model.trim="searchKey"
clearable
:placeholder="placeholder"
borderless
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-12-10 15:36:04
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 09:59:56
* @LastEditTime: 2024-12-11 15:32:44
* @Description: 更新版本弹窗
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -29,7 +29,7 @@
<div class="content-div text-[var(--td-font-gray-1)]" v-html="state?.description"></div>
</div>
<div class="flex justify-center">
<t-button class="mt-[60px] w-[250px]" @click="handleConfirm" shape="round">更新至最新版本</t-button>
<t-button class="mt-[60px] w-[200px]" @click="handleConfirm" shape="round">更新至最新版本</t-button>
</div>
</main>
</template>
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-08 11:40:59
* @LastEditTime: 2024-12-11 14:32:29
* @Description:
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -20,8 +20,7 @@
<Icon
:name="isCollapse ? 'indent-right' : 'indent-left'"
size="24"
class="cursor-pointer"
:class="[isCollapse ? 'ml-[33px]' : 'ml-[15px]']"
class="cursor-pointer ml-[15px]"
@click="changeCollapse"
></Icon>
<Breadcrumb id="breadcrumb" />
......
......@@ -52,8 +52,8 @@ provide('refresh', refreshCurrentPage)
const screenWidth = ref(0)
const listeningWindow = useDebounceFn(() => {
screenWidth.value = document.body.clientWidth
if (!isCollapse.value && screenWidth.value < 1200) globalStore.setGlobalState('isCollapse', true)
if (isCollapse.value && screenWidth.value > 1200) globalStore.setGlobalState('isCollapse', false)
if (!isCollapse.value && screenWidth.value < 1440) globalStore.setGlobalState('isCollapse', true)
if (isCollapse.value && screenWidth.value > 1440) globalStore.setGlobalState('isCollapse', false)
}, 100)
window.addEventListener('resize', listeningWindow, false)
onBeforeUnmount(() => {
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-08 16:25:46
* @LastEditTime: 2024-12-11 15:09:34
* @Description:
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -30,7 +30,7 @@
</div>
</template>
<template #default>
<t-icon name="search" size="24" />
<t-icon name="search" size="16" />
</template>
</t-tooltip>
</div>
......@@ -99,7 +99,16 @@ const handleClickMenu = (label: string) => {
display: flex;
justify-content: center;
align-items: center;
margin: 16px 8px;
margin: 16px 8px 0;
:deep(.t-input) {
background-color: var(--td-gray-color-1);
border: none;
}
:deep(.t-input--focused) {
box-shadow: none;
}
:deep(.t-input.t-input--prefix.t-input--suffix) {
padding: 0 4px 0 14px;
......
......@@ -2,21 +2,21 @@
* @Author: zhanyoulin<zhanyoulin456@163.com>
* @Date: 2023-06-25 09:01:18
* @LastEditors: xiejiang
* @LastEditTime: 2024-11-30 15:19:39
* @LastEditTime: 2024-12-11 15:18:35
* @Description:
-->
<template>
<template v-for="subItem in menuList" :key="subItem.menuId">
<t-submenu v-if="subItem.children?.length" :value="subItem.menuSign" :title="subItem.menuName">
<template #icon>
<t-icon :name="subItem.icon" />
<t-icon size="16" :name="subItem.icon" />
</template>
<SubMenu :menu-list="subItem.children" />
</t-submenu>
<t-menu-item v-else :value="subItem.menuSign" @click="handleClickMenu(subItem)" class="reset-menu-item">
<template #icon>
<!-- <template #icon>
<t-icon :name="subItem.icon" />
</template>
</template> -->
<span>{{ subItem.menuName }}</span>
</t-menu-item>
</template>
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-08 11:25:18
* @LastEditTime: 2024-12-11 15:19:39
* @Description:
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -38,8 +38,6 @@ const defaultMenu = ref('')
// 设置展开菜单
const expandedFunc = (name: string) => {
expanded.value = [menuList.value.find(item => item.children?.some(em => em.menuSign === name))?.menuSign] as string[]
console.log(expanded.value)
}
watch(activeMenu, val => {
......@@ -53,52 +51,100 @@ onMounted(() => {
})
</script>
<style lang="less">
.t-default-menu {
height: calc(100% - 112px) !important;
.t-default-menu .reset-menu-item.t-is-active::after {
background: none;
}
.t-default-menu.t-is-collapsed {
width: 52px !important;
.t-default-menu.t-is-collapsed .t-menu .t-menu__item {
justify-content: flex-start !important;
}
.t-default-menu__inner .t-menu {
padding: var(--td-comp-paddingTB-l) 0;
.t-default-menu .t-menu__item .t-icon {
width: 16px !important;
height: 16px !important;
}
.t-default-menu .t-menu__item.t-is-opened {
color: var(--td-brand-color) !important;
font-weight: 700;
.t-default-menu {
height: calc(100% - 112px) !important;
font-size: 13px;
.t-icon {
color: var(--td-brand-color);
.t-submenu {
> .t-menu__item {
.t-menu__content {
font-weight: 700;
}
> .t-icon {
font-weight: 400;
}
}
.t-is-active {
color: var(--td-brand-color);
> .t-icon {
color: var(--td-brand-color);
}
}
}
}
.t-is-collapsed {
.t-menu__item {
border-radius: 0 8px 8px 0;
height: 48px;
line-height: 48px;
color: var(--td-font-gray-1);
}
.t-is-opened {
color: var(--td-white);
background-color: var(--td-brand-color) !important;
border-radius: 0 8px 8px 0;
// .t-menu__content {
// font-size: 13px;
// }
.t-icon {
color: var(--td-white) !important;
}
.t-default-menu.t-is-collapsed {
width: 52px !important;
}
.t-default-menu__inner .t-menu {
padding: var(--td-comp-paddingTB-l) 0;
}
.t-menu__item.t-is-opened .t-icon {
// .t-default-menu .t-menu__item.t-is-opened {
// // color: var(--td-brand-color) !important;
// font-weight: 700;
// .t-icon {
// font-weight: 400;
// }
// }
.t-is-active {
color: var(--td-brand-color);
}
.t-menu__item.t-is-active:not(.t-is-opened) {
color: var(--td-white);
background-color: var(--td-brand-color) !important;
.t-is-collapsed {
.t-menu__item {
border-radius: 0 8px 8px 0;
}
.t-is-opened {
color: var(--td-white);
background-color: var(--td-brand-color) !important;
border-radius: 0 8px 8px 0;
.t-icon {
color: var(--td-white) !important;
}
}
.t-menu__item.t-is-opened .t-icon {
color: var(--td-brand-color);
}
.t-menu__item.t-is-active:not(.t-is-opened) {
color: var(--td-white);
background-color: var(--td-brand-color) !important;
.t-icon {
color: var(--td-white) !important;
.t-icon {
color: var(--td-white) !important;
}
}
}
}
......
......@@ -20,11 +20,9 @@
color: var(--td-font-gray-0);
cursor: pointer;
background-color: var(--white);
border-color: #e1e3e5;
&.active {
color: var(--primary);
background-color: #e8ebf4;
border: none;
.t-tag__icon-close {
......@@ -45,7 +43,6 @@
}
&:hover {
background-color: var(--td-brand-color-1);
color: var(--td-brand-color);
}
}
......
......@@ -18,4 +18,8 @@
position: relative;
}
}
.t-layout__sider {
border-top: 1px solid var(--td-gray-color-2);
}
}
......@@ -57,6 +57,14 @@ p {
margin: 8px 0;
}
.t-tag--default {
background: var(--td-gray-color-1);
}
.t-input {
border-color: var(--td-gray-color-2);
}
// 表格
.t-table {
thead th {
......@@ -93,6 +101,10 @@ p {
.t-dialog__body__icon {
color: var(--td-font-gray-2);
}
.t-button {
background-color: var(--td-gray-color-1);
}
}
/* scroll bar */
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-28 15:01:02
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 11:09:12
* @LastEditTime: 2024-12-11 16:09:04
* @Description: 机构管理
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -16,6 +16,7 @@
:pagination="pagination"
@search-change="handleSearch"
@clear="handleClear(true)"
@on-search="onSearch"
@page-change="handlePage"
>
<template #header-left>
......@@ -246,6 +247,11 @@ const handleSearch = (params: Record<string, any>) => {
getData()
}
// 搜索
const onSearch = (params: Record<string, any>) => {
searchParams.value = params
}
const handleClear = (flge: boolean | null) => {
if (flge) {
searchParams.value = {}
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-05 10:14:56
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-10 17:13:32
* @LastEditTime: 2024-12-11 15:52:07
* @Description: 首页
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -13,12 +13,12 @@
</div> -->
<div class="home-avatar flex items-center justify-center">
<div class="text-center">
<p class="text-20 bold">{{ userInfo && userInfo.userName }},您好!</p>
<p class="text-[20px] bold">{{ userInfo && userInfo.userName }},您好!</p>
<p class="text-14">欢迎使用智慧教育平台</p>
</div>
</div>
<div class="home-line w-full"></div>
<div class="home-user flex flex-col items-center justify-center">
<div class="home-user flex flex-col items-center justify-center text-right">
<p>
<span>角色:</span>
<span class="max-w-[calc(100%-90px)]">
......@@ -28,7 +28,7 @@
</p>
<p>
<span>上次登录:</span>
<span class="max-w-[calc(100%-90px)] text-right"
<span class="max-w-[calc(100%-90px)]"
>{{ userInfo?.loginInfo.loginAddress || '-' }}{{ userInfo?.loginInfo.loginIp || '-' }}{{
userInfo?.loginInfo.time || '-'
}}{{ userInfo?.loginInfo.device || '-' }}</span
......@@ -87,7 +87,8 @@ onMounted(() => {
}
&-user {
width: 33%;
// width: 33%;
width: 600px;
margin: 0 auto;
> p {
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-05 10:14:56
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-10 11:20:18
* @LastEditTime: 2024-12-11 14:15:44
* @Description: 登录
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -10,7 +10,7 @@
<div class="login">
<div class="left"></div>
<div class="right">
<div class="px-[168px]">
<div class="px-[168px] mt-[-40px]">
<div class="text-center flex flex-col items-center">
<!-- <img :src="logo" class="" width="46" alt="" /> -->
<img :src="welcome" class="mb-[28px]" height="46" alt="" />
......
......@@ -98,6 +98,11 @@ const dictionarys = [
value: 'isAllowDelete',
allow: 5,
noAllow: 6
},
{
value: 'isAllowEdit',
allow: 1,
noAllow: 2
}
]
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 11:28:55
* @LastEditTime: 2024-12-11 16:20:23
* @Description: 系统字典
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -15,6 +15,7 @@
:loading="loading"
:pagination="pagination"
@search-change="handleSearch"
@on-search="onSearch"
@clear="handleClear(true)"
@page-change="handlePage"
>
......@@ -223,6 +224,9 @@ const handleSearch = (params: Record<string, any>) => {
getData()
}
const onSearch = (params: Record<string, any>) => {
searchParams.value = params
}
// 清空搜索条件
const handleClear = (flge: boolean | null) => {
if (flge) {
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 11:08:50
* @LastEditTime: 2024-12-11 16:20:08
* @Description: 菜单管理
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -21,9 +21,10 @@
:loading="loading"
:pagination="pagination"
:show-tree="true"
@on-search="onSearch"
@search-change="handleSearch"
@page-change="handlePage"
@clear="handleClear(true)"
@clear="handleSearch({})"
table-maxheight="550px"
class="max-h-[calc(100%-50px)]"
>
......@@ -37,10 +38,10 @@
/></template>
<template #header-right>
<div class="flex items-center justify-end gap-2">
<t-button variant="outline" @click="handleLog">
<t-button variant="outline" shape="round" @click="handleLog">
<template #icon><RootListIcon /></template>操作日志</t-button
>
<t-button variant="outline" @click="handleSort">
<t-button variant="outline" shape="round" @click="handleSort">
<template #icon><UnfoldMoreIcon /></template>菜单排序</t-button
>
<t-button shape="round" theme="primary" @click="handleEdit(null)">
......@@ -199,6 +200,10 @@ const handleClear = (flge: boolean | null) => {
getData()
}
const onSearch = (params: Record<string, any>) => {
searchParams.value = params
}
// 分页变更
const handlePage = (pageInfo: { page: number; limit: number }) => {
pagination.value = { ...pagination.value, ...pageInfo }
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-11 09:38:40
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 09:06:44
* @LastEditTime: 2024-12-11 16:06:52
* @Description: 版本管理
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -20,9 +20,10 @@
:loading="loading"
:pagination="pagination"
:show-tree="true"
@on-search="onSearch"
@search-change="handleSearch"
@page-change="handlePage"
@clear="handleSearch(searchParams)"
@clear="handleSearch({})"
table-maxheight="550px"
class="max-h-[calc(100%-50px)]"
>
......@@ -182,6 +183,11 @@ const handleSearch = (params: Record<string, any>) => {
getData()
}
// 搜索
const onSearch = (params: Record<string, any>) => {
searchParams.value = params
}
// 分页变更
const handlePage = (pageInfo: { page: number; limit: number }) => {
pagination.value = { ...pagination.value, ...pageInfo }
......
......@@ -60,7 +60,7 @@ const rules: FormProps['rules'] = {
version: [
{
required: true,
message: '请填写版本号!',
message: '请输入版本号!',
trigger: 'blur'
},
{
......
......@@ -2,19 +2,19 @@
* @Author: xiejiang
* @Date: 2024-12-05 17:16:22
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 10:19:13
* @LastEditTime: 2024-12-11 16:47:06
* @Description: 功能权限
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
<template>
<div class="p-[16px] capabilities" v-loading="loading">
<t-collapse :borderless="true" default-expand-all :expand-on-row-click="false">
<t-collapse :borderless="true" default-expand-all :expand-on-row-click="false" v-if="!loading">
<t-collapse-panel
v-for="(item, index) in menuTree"
:key="item.menuId"
:class="index === 0 ? 'magrin-bottom' : ''"
>
<template #expandIcon><CaretDownSmallIcon class="text-[var(--td-brand-color)]" /></template>
<!-- <template #expandIcon><CaretDownSmallIcon class="text-[var(--td-brand-color)]" /></template> -->
<template #header>
<t-checkbox v-model="item.selected" @change="handleSelectAll(item)">{{ item.menuName }}</t-checkbox>
</template>
......@@ -75,7 +75,6 @@ function findNodeById(tree: ResMenuTree[], id: string) {
}
})
}
const handleSelectAll = (itx: ResMenuTree) => {
// 勾选则需要勾选父级
if (itx.selected) {
......@@ -119,7 +118,6 @@ const getData = () => {
getMenuTree({ roleId: props.roleId, condMenuName: props.condMenuName })
.then(res => {
if (Array.isArray(res.data)) {
// 检查 res.data 是否为数组
menuTree.value = res.data as ResMenuTree[]
} else {
menuTree.value = [] // 如果不是数组,设置为空数组
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-28 15:01:02
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 11:09:59
* @LastEditTime: 2024-12-11 16:07:24
* @Description: 角色管理
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -16,6 +16,7 @@
:pagination="pagination"
@search-change="handleSearch"
@clear="handleClear(true)"
@on-search="onSearch"
@page-change="handlePage"
>
<template #header-left>
......@@ -157,6 +158,11 @@ const handleSearch = (params: Record<string, any>) => {
getData()
}
// 搜索
const onSearch = (params: Record<string, any>) => {
searchParams.value = params
}
// 清空搜索条件
const handleClear = (flge: boolean | null) => {
if (flge) {
......
......@@ -119,15 +119,15 @@ const getData = () => {
const dataPermissions = (row: ResUserList) => {
const areaPermissions = row.areaPermissions || []
const rolePermissions = row.rolePermissions || []
const areaPermissionsTxt = areaPermissions.map((val: { name: string }) => val.name).join(',') || '-'
const rolePermissionsTxt = rolePermissions.map((val: { name: string }) => val.name).join(',') || '-'
const areaPermissionsTxt = areaPermissions.map((val: { name: string }) => val.name).join(';') || '-'
const rolePermissionsTxt = rolePermissions.map((val: { name: string }) => val.name).join(';') || '-'
return { areaPermissionsTxt, rolePermissionsTxt }
}
const functionPermission = (row: ResUserList) => {
const buttonNames = row.buttonNames || []
return row.menuName || '-' + (buttonNames.length ? '(' + buttonNames.join(',') + ')' : '')
return row.menuName || '-' + (buttonNames.length ? '(' + buttonNames.join(';') + ')' : '')
}
// 合并单元格
......
......@@ -2,7 +2,7 @@
* @Author: xiejiang
* @Date: 2024-11-28 15:01:02
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 11:10:10
* @LastEditTime: 2024-12-11 16:20:34
* @Description: 用户管理
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
......@@ -16,6 +16,7 @@
:pagination="pagination"
@search-change="handleSearch"
@clear="handleClear(true)"
@on-search="onSearch"
@page-change="handlePage"
>
<template #header-left>
......@@ -169,6 +170,11 @@ const columns: PrimaryTableCol[] = [
// 表格数据,自行规范ts
const tableData = ref<ResUserList[]>([])
// 搜索
const onSearch = (params: Record<string, any>) => {
searchParams.value = params
}
// 获取表格数据接口
const getData = () => {
loading.value = true
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论