Merge remote-tracking branch 'origin/master'

This commit is contained in:
GUjiYN 2024-02-29 21:13:25 +08:00
commit 127fccf31e

View File

@ -8,7 +8,7 @@
</a-space> </a-space>
</div> </div>
<a-table :row-selection="rowSelection" :columns="columns" :data-source="states.data" :pagination="pagination" :scroll="{ x: 1000, y: 430}" style="width: 85vw;"> <a-table :row-selection="rowSelection" :columns="columns" :data-source="states.data" :pagination="pagination" :scroll="{ x:0,y: 430}" style="width: 85vw;">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
@ -28,6 +28,13 @@
<template v-else-if="column.key === 'photo'"> <template v-else-if="column.key === 'photo'">
<img :src="record.image" alt="" style="width: 50px;height: 50px;text-align: center"> <img :src="record.image" alt="" style="width: 50px;height: 50px;text-align: center">
</template> </template>
<template v-else-if="column.key === 'image'">
<div :style="ellipsis ? { width: '250px' } : {}" class="image-cell">
<a-tooltip v-if="ellipsis" :title="record.image">
<div class="ellipsis-text">{{ record.image }}</div>
</a-tooltip>
</div>
</template>
</template> </template>
</a-table> </a-table>
@ -107,6 +114,23 @@
</a-form-item> </a-form-item>
</a-modal> </a-modal>
</template> </template>
<style>
.image-cell {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3; /* 设置显示的行数 */
overflow: hidden;
}
.ellipsis-text {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2; /* 设置显示的行数 */
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<script setup> <script setup>
import {computed, createVNode, onMounted, reactive, ref} from 'vue'; import {computed, createVNode, onMounted, reactive, ref} from 'vue';
import { import {
@ -123,6 +147,7 @@ import requests from "../../public/request.js";
// const onChange = pageNumber => { // const onChange = pageNumber => {
// console.log('Page: ', pageNumber); // console.log('Page: ', pageNumber);
// }; // };
const ellipsis = ref(true);
const open = ref(false); const open = ref(false);
const addopen = ref(false); const addopen = ref(false);
@ -154,7 +179,7 @@ const columns = [
dataIndex: 'photo', dataIndex: 'photo',
resizable: true, resizable: true,
width: 150, width: 150,
// maxWidth: 150, maxWidth: 150,
}, },
{ {
@ -162,20 +187,21 @@ const columns = [
dataIndex: 'title', dataIndex: 'title',
key: 'title', key: 'title',
width:150, width:150,
// maxWidth: 150, maxWidth: 150,
}, },
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createdAt', dataIndex: 'createdAt',
key: 'createdAt', key: 'createdAt',
width:200, width:200,
// maxWidth: 150, maxWidth: 200,
}, },
{ {
title: '图片地址', title: '图片地址',
dataIndex: 'image', dataIndex: 'image',
key: 'image', key: 'image',
width:250, width:250,
maxWidth: 250
}, },
{ {
@ -183,14 +209,14 @@ const columns = [
dataIndex: 'displayOrder', dataIndex: 'displayOrder',
key: 'displayOrder', key: 'displayOrder',
width:80, width:80,
// maxWidth: 80, maxWidth: 80,
}, },
{ {
title: '状态', title: '状态',
key: 'isActive', key: 'isActive',
dataIndex: 'isActive', dataIndex: 'isActive',
width: 80, width: 80,
// maxWidth: 80, maxWidth: 80,
}, },
{ {
title: '操作', title: '操作',