Merge branch 'master' of https://gitcode.com/hk_openRepo/OpenRepo_Portal into junjie_dev

# Conflicts:
#	src/views/Jyh/Home/index.vue
This commit is contained in:
@user8949
2025-03-19 20:56:39 +08:00
8 changed files with 61 additions and 46 deletions

View File

@@ -10,7 +10,7 @@
</div>
<div class="g-user-drawer-info-list">
<div class="g-user-drawer-info-list-name">
<span class="break-all">{{ accountInfo.username?accountInfo.username[0]:'' }}</span>
<span class="break-all">{{ accountInfo.username ? accountInfo.username[0] : '' }}</span>
<GIcon class="close-icon" name="gt-close" size="12" @click="handleClose" />
</div>
<div class="g-user-drawer-info-list-id break-all">@{{ accountInfo.username }}</div>
@@ -69,6 +69,10 @@ const logout = async () => {
router.go(0);
}
}
// 退出系统刷新页面
setTimeout(() => {
location.reload();
}, 100);
};
const handleClick = (item) => {
@@ -107,9 +111,7 @@ const getRouterLink = (params) => {
};
const blockList = ref([
[
{ id: 'myPage', label: '个人中心', to: getRouterLink('PersonalCenter') }
],
[{ id: 'myPage', label: '个人中心', to: getRouterLink('PersonalCenter') }],
// [
// // { id: 'dashboard', label: '工作台', icon: 'gt-member-c', to: getRouterLink('dashboard') },
// // { id: 'myIssues', label: '我的 Issue', icon: 'gt-issue-c', to: getRouterLink('issues') },
@@ -126,9 +128,7 @@ const blockList = ref([
// { id: 'personalSetting', label: '个人设置', icon: 'gt-setting-c', to: getRouterLink('setting') },
// { id: 'help', label: '帮助文档', icon: 'gt-file-c', href: 'https://gitcode.com/Gitcode-offical-team/GitCode-Docs/wiki' }
// ],
[
{ id: 'logout', label: '退出登录', icon: 'gt-exit', action: logout }
]
[{ id: 'logout', label: '退出登录', icon: 'gt-exit', action: logout }]
]);
</script>

View File

@@ -2,7 +2,7 @@
<div class="TableSetting">
<d-button @click.stop="toggleColumnList" class="output-btn" icon="icon-form-settings" variant="text">设置</d-button>
<!-- 多选列表 -->
<div v-if="showColumnList" class="column-list">
<div v-if="showColumnList" ref="columnListRef" class="column-list">
<div class="column-list-header">
<span class="title1">展示列设置</span>
<a class="title2">恢复默认</a>
@@ -20,7 +20,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, defineProps, defineEmits } from 'vue';
import { ref, defineProps, defineEmits,onMounted,onUnmounted } from 'vue';
const props = defineProps({
@@ -42,6 +42,29 @@ const toggleColumnList = () => {
const newValue = !props.showColumnList;
emits('update:show-column-list', newValue); // 触发事件,更新父组件的 showColumnList
};
// 关闭多选列表
const closeColumnList = () => {
emits('update:show-column-list', false);
};
// 监听点击事件
const columnListRef = ref<HTMLElement | null>(null);
const handleClickOutside = (event: MouseEvent) => {
if (columnListRef.value && !columnListRef.value.contains(event.target as Node)) {
closeColumnList();
}
};
onMounted(() => {
document.addEventListener('click', handleClickOutside);
});
onUnmounted(() => {
document.removeEventListener('click', handleClickOutside);
});
</script>
<style lang="scss" scoped>
.TableSetting {