美化pagetype列表页卡片模式布局
This commit is contained in:
parent
9e0c6e48c8
commit
a24c346de2
@ -144,34 +144,34 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
</div>
|
||||||
<!-- 操作列覆盖组件(卡片视图) -->
|
<div class="card-actions">
|
||||||
<component
|
<!-- 操作列覆盖组件(卡片视图) -->
|
||||||
v-if="actionsComponent"
|
<component
|
||||||
:is="actionsComponent"
|
v-if="actionsComponent"
|
||||||
:context="{
|
:is="actionsComponent"
|
||||||
row,
|
:context="{
|
||||||
entity,
|
row,
|
||||||
openDetail,
|
entity,
|
||||||
editRecord,
|
openDetail,
|
||||||
deleteRecord,
|
editRecord,
|
||||||
router,
|
deleteRecord,
|
||||||
t
|
router,
|
||||||
}"
|
t
|
||||||
/>
|
}"
|
||||||
<!-- 默认操作按钮 -->
|
/>
|
||||||
<template v-else>
|
<!-- 默认操作按钮 -->
|
||||||
<button class="action-btn" @click.stop="openDetail(row.name)" :title="t('View')">
|
<template v-else>
|
||||||
<i class="fa fa-eye"></i>
|
<button class="action-btn" @click.stop="openDetail(row.name)" :title="t('View')">
|
||||||
</button>
|
<i class="fa fa-eye"></i>
|
||||||
<button class="action-btn" @click.stop="editRecord(row)" :title="t('Edit')">
|
</button>
|
||||||
<i class="fa fa-edit"></i>
|
<button class="action-btn" @click.stop="editRecord(row)" :title="t('Edit')">
|
||||||
</button>
|
<i class="fa fa-edit"></i>
|
||||||
<button class="action-btn" @click.stop="deleteRecord(row.name)" :title="t('Delete')">
|
</button>
|
||||||
<i class="fa fa-trash"></i>
|
<button class="action-btn" @click.stop="deleteRecord(row.name)" :title="t('Delete')">
|
||||||
</button>
|
<i class="fa fa-trash"></i>
|
||||||
</template>
|
</button>
|
||||||
</div>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -363,8 +363,9 @@ const primaryLabel = computed(() => {
|
|||||||
return f?.fieldname || 'name'
|
return f?.fieldname || 'name'
|
||||||
})
|
})
|
||||||
const cardBadges = computed(() => {
|
const cardBadges = computed(() => {
|
||||||
|
// 显示所有 displayColumns 中的字段,除了已经显示的 primaryLabel 和 name
|
||||||
const keys = displayColumns.value.map((c: any) => c.key).filter((k: string) => k && k !== 'actions' && k !== primaryLabel.value && k !== 'name')
|
const keys = displayColumns.value.map((c: any) => c.key).filter((k: string) => k && k !== 'actions' && k !== primaryLabel.value && k !== 'name')
|
||||||
return keys.slice(0, 2).map((k: string) => ({ key: k }))
|
return keys.map((k: string) => ({ key: k }))
|
||||||
})
|
})
|
||||||
|
|
||||||
const metaFields = ref<any[]>([])
|
const metaFields = ref<any[]>([])
|
||||||
@ -920,21 +921,140 @@ function formatDisplayValue(value: any, fieldName: string) {
|
|||||||
.loading i { margin-right: 8px; }
|
.loading i { margin-right: 8px; }
|
||||||
|
|
||||||
/* 卡片视图样式(对齐 AgentList 设计) */
|
/* 卡片视图样式(对齐 AgentList 设计) */
|
||||||
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 24px; }
|
.agent-grid {
|
||||||
.agent-card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; }
|
display: grid;
|
||||||
.agent-card:hover { border-color: #2563eb; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1); transform: translateY(-2px); }
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||||
.agent-card.selected { border-color: #3b82f6; background: #f0f9ff; box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1); }
|
gap: 20px;
|
||||||
.card-checkbox { position: absolute; top: 12px; right: 12px; z-index: 10; }
|
margin-bottom: 24px;
|
||||||
.card-checkbox input[type="checkbox"] { cursor: pointer; accent-color: #3b82f6; }
|
}
|
||||||
.card-content { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
|
|
||||||
.info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
|
.agent-card {
|
||||||
.title { font-size: 16px; font-weight: 600; color: #111827; line-height: 1.4; }
|
background: white;
|
||||||
.desc { font-size: 14px; color: #6b7280; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
border: 1px solid #e5e7eb;
|
||||||
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
|
border-radius: 12px;
|
||||||
.badge { background: #f3f4f6; color: #374151; padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
|
padding: 0;
|
||||||
.card-actions { display: flex; align-items: center; gap: 6px; }
|
cursor: pointer;
|
||||||
.action-btn { width: 28px; height: 28px; border: none; background: #f3f4f6; color: #6b7280; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
.action-btn:hover { background: #3b82f6; color: white; }
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.agent-card:hover {
|
||||||
|
border-color: #2563eb;
|
||||||
|
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
|
||||||
|
transform: translateY(-2px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.agent-card.selected {
|
||||||
|
border-color: #3b82f6;
|
||||||
|
background: #f0f9ff;
|
||||||
|
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-checkbox {
|
||||||
|
position: absolute;
|
||||||
|
top: 12px;
|
||||||
|
right: 12px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-checkbox input[type="checkbox"] {
|
||||||
|
cursor: pointer;
|
||||||
|
accent-color: #3b82f6;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
|
padding: 20px;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #111827;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #6b7280;
|
||||||
|
line-height: 1.5;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.meta {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
background: #f3f4f6;
|
||||||
|
color: #374151;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.4;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 12px 20px;
|
||||||
|
border-top: 1px solid #f3f4f6;
|
||||||
|
background: #fafbfc;
|
||||||
|
margin-top: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border: none;
|
||||||
|
background: #f3f4f6;
|
||||||
|
color: #6b7280;
|
||||||
|
border-radius: 6px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 13px;
|
||||||
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn:hover {
|
||||||
|
background: #3b82f6;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
/* 工具栏样式(对齐 AgentList) */
|
/* 工具栏样式(对齐 AgentList) */
|
||||||
.header-right { display: flex; align-items: center; gap: 12px; }
|
.header-right { display: flex; align-items: center; gap: 12px; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user