feat: 优化应用

This commit is contained in:
wangdan-fit2cloud 2023-12-04 15:23:09 +08:00
parent cc40a4c95c
commit ef8d1890bc
3 changed files with 40 additions and 59 deletions

View File

@ -18,7 +18,7 @@
placement="top" placement="top"
v-if="buttonData?.vote_status === '-1'" v-if="buttonData?.vote_status === '-1'"
> >
<el-button text @click="voteHandle('1')" :disabled="loading"> <el-button text @click="voteHandle('0')" :disabled="loading">
<AppIcon iconName="app-like"></AppIcon> <AppIcon iconName="app-like"></AppIcon>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -26,7 +26,7 @@
effect="dark" effect="dark"
content="取消赞同" content="取消赞同"
placement="top" placement="top"
v-if="buttonData?.vote_status === '1'" v-if="buttonData?.vote_status === '0'"
> >
<el-button text @click="voteHandle('-1')" :disabled="loading"> <el-button text @click="voteHandle('-1')" :disabled="loading">
<AppIcon iconName="app-like-color"></AppIcon> <AppIcon iconName="app-like-color"></AppIcon>
@ -39,7 +39,7 @@
placement="top" placement="top"
v-if="buttonData?.vote_status === '-1'" v-if="buttonData?.vote_status === '-1'"
> >
<el-button text @click="voteHandle('0')" :disabled="loading"> <el-button text @click="voteHandle('1')" :disabled="loading">
<AppIcon iconName="app-oppose"></AppIcon> <AppIcon iconName="app-oppose"></AppIcon>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
@ -47,7 +47,7 @@
effect="dark" effect="dark"
content="取消反对" content="取消反对"
placement="top" placement="top"
v-if="buttonData?.vote_status === '0'" v-if="buttonData?.vote_status === '1'"
> >
<el-button text @click="voteHandle('-1')" :disabled="loading"> <el-button text @click="voteHandle('-1')" :disabled="loading">
<AppIcon iconName="app-oppose-color"></AppIcon> <AppIcon iconName="app-oppose-color"></AppIcon>

View File

@ -1,10 +1,5 @@
<template> <template>
<el-card <el-card shadow="always" class="card-box" @mouseenter="cardEnter()" @mouseleave="cardLeave()">
shadow="always"
class="card-box"
@mouseenter="cardEnter()"
@mouseleave="cardLeave()"
>
<div class="card-header"> <div class="card-header">
<slot name="header"> <slot name="header">
<div class="title flex align-center"> <div class="title flex align-center">
@ -17,7 +12,7 @@
</div> </div>
</slot> </slot>
</div> </div>
<div class="description mt-12"> <div class="description mt-12" v-if="$slots.description || description">
<slot name="description"> <slot name="description">
{{ description }} {{ description }}
</slot> </slot>

View File

@ -1,44 +1,34 @@
<template> <template>
<card-box <card-box :title="model.name" shadow="hover" class="model-card">
style="
--app-card-box-description-height: 100%;
--card-min-height: 153px;
--card-min-width: 20px;
width: 100%;
"
:title="model.name"
>
<template #icon> <template #icon>
<AppAvatar <span style="height: 32px; width: 32px" :innerHTML="icon" class="mr-12"></span>
class="mr-12"
shape="square"
style="--el-avatar-bg-color: rgba(255, 255, 255, 0)"
:size="32"
>
<span style="height: 24px; width: 24px" :innerHTML="icon"></span
></AppAvatar>
</template> </template>
<template #description> <div class="border-t mt-16">
<el-descriptions :column="1" label-align="center"> <ul>
<el-descriptions-item label="模型类型" label-class-name="ellipsis-1"> <li class="flex mt-16">
<span class="ellipsis-1"> {{ model.model_type }}</span></el-descriptions-item <el-text type="info">模型类型</el-text>
> <span class="ellipsis-1 ml-16"> {{ model.model_type }}</span>
<el-descriptions-item label="模型名称" label-class-name="ellipsis-1"> </li>
<span class="ellipsis-1">{{ model.model_name }}</span></el-descriptions-item <li class="flex mt-12">
> <el-text type="info">模型名称</el-text>
</el-descriptions> <span class="ellipsis-1 ml-16"> {{ model.model_name }}</span>
</template> </li>
<template #mouseEnter> </ul>
</div>
<div class="operation-button">
<el-tooltip effect="dark" content="修改" placement="top"> <el-tooltip effect="dark" content="修改" placement="top">
<el-button text @click.stop="openEditModel" class="edit-button"> <el-button text @click.stop="openEditModel">
<el-icon><Edit /></el-icon> </el-button <el-icon><EditPen /></el-icon>
></el-tooltip> </el-button>
</el-tooltip>
<el-tooltip effect="dark" content="删除" placement="top"> <el-tooltip effect="dark" content="删除" placement="top">
<el-button text @click.stop="deleteModel" class="delete-button"> <el-button text @click.stop="deleteModel">
<el-icon><Delete /></el-icon> <el-icon><Delete /></el-icon>
</el-button> </el-button>
</el-tooltip> </el-tooltip>
</template> </div>
<template #mouseEnter> </template>
<EditModel ref="eidtModelRef" @submit="emit('change')"></EditModel> <EditModel ref="eidtModelRef" @submit="emit('change')"></EditModel>
</card-box> </card-box>
</template> </template>
@ -77,20 +67,16 @@ const icon = computed(() => {
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-descriptions__cell) { .model-card {
display: flex; min-height: 153px;
flex-wrap: nowrap; .operation-button {
} position: absolute;
.delete-button { right: 12px;
position: absolute; top: 18px;
right: 12px; height: auto;
top: 18px; .el-button + .el-button {
height: auto; margin-left: 4px;
} }
.edit-button { }
position: absolute;
right: 30px;
top: 18px;
height: auto;
} }
</style> </style>