Merge branch 'wsw' into 'master'

# Conflicts:
#   conflict src/views/Jyh/Home/index.vue
This commit is contained in:
yfzmpj
2025-03-19 20:21:29 +08:00
17 changed files with 192 additions and 193 deletions

View File

@@ -2,14 +2,14 @@
<d-layout class="dlayout">
<d-header class="dheader">
<div class="title">
<h1>Apache License 2.0</h1>
<h1>{{ data.licenseName }}</h1>
<d-icon style="cursor: pointer;" name="icon-close" @click="emit('close')"></d-icon>
</div>
<div class="sub-title">
<span>分数</span>
<span>3</span>
<span>类型</span>
<d-tag color="#3ac295" size="sm">获准的</d-tag>
<d-tag color="#3ac295" size="sm">{{ data.category }}</d-tag>
</div>
</d-header>
<d-content class="dcontent">
@@ -78,7 +78,11 @@
<script setup>
import { ref, defineEmits } from 'vue';
const props = defineProps({
data: {
type: Object
}
})
const emit = defineEmits(['close']);
</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 {