feat(移动端适配): 优化富文本编辑器移动端体验

- 修改viewport设置禁止用户缩放
- 添加移动端检测并自动跳转移动版页面
- 调整移动版页面布局和样式
- 实现标题高亮功能
- 优化卡片标题显示为2行省略
This commit is contained in:
34701892@qq.com 2025-08-04 08:51:44 +08:00
parent 2489a79f94
commit aae623288b
3 changed files with 45 additions and 23 deletions

View File

@ -4,7 +4,8 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="keywords" content="管理系统" />
<meta name="description" content="" />
<link rel="icon" href="/favicon.ico" />

View File

@ -290,6 +290,7 @@ import { highlightTitle } from '/@/utils/highlight';
import clipboard from 'clipboard';
import { Session } from '/@/utils/storage';
import recordDialog from './dialog/recordDialog.vue';
import { isMobileByWidth } from '/@/utils/Utils'
const recordDialogRef = ref();
/** 管理后台需求文件0519V1.1 start */
@ -701,6 +702,9 @@ function recordDialogClose() { }
//
onMounted(async () => {
if (isMobileByWidth() && Session.get('userInfoLocal').userType == '01') {
router.push('/richeditMobile');
}
NextLoading.done();
getTagSourceFn();
getData();

View File

@ -32,7 +32,7 @@
<el-card v-for="(item, index) in tableData.data" :key="index" class="card">
<template #header>
<div class="card_header" @click.stop="goDetail(1, item, true)">
<text class="card_title">{{ item.title }}</text>
<text class="card_title" v-html="item.title"></text>
<div class="r_point" :style="{ color: '#000' }">
<div class="point" :style="{ backgroundColor: item.status == 2 ? '#52C41A' : '#D9D9D9' }">
</div>
@ -43,7 +43,7 @@
</div>
</div>
</template>
<div style="display: flex;min-height: 40px;" @click.stop="goDetail(1, item, true)">
<div style="display: flex;align-items: center;" @click.stop="goDetail(1, item, true)">
<div style="display: flex;align-items: center;gap: 5px;" v-if="item.submitter">
<el-icon>
<UserFilled />
@ -116,14 +116,12 @@ import {
} from '/@/api/api';
import preventBack from 'vue-prevent-browser-back';//
import router from '/@/router';
import { highlightTitle } from '/@/utils/highlight';
const loading = ref(false)
const tabsList = ref([
{
name: "全部",
status: null,
},
{
name: "审核中",
status: 3,
@ -132,7 +130,10 @@ const tabsList = ref([
name: "已发布",
status: 2,
},
{
name: "全部",
status: null,
},
])
const tabIndex = ref(0)
@ -215,17 +216,17 @@ async function getData() {
tableData.data.push(...data);
}
// tableData.data.forEach((item, index) => {
// item.columns.forEach((childItem, childIndex) => {
// if (childIndex < 2) {
// if (!item.columnsMin) {
// item.columnsMin = [];
// }
// item.columnsMin.push(childItem);
// }
// });
// item.title = highlightTitle(item.title, form.value.keyword);
// });
tableData.data.forEach((item, index) => {
item.columns.forEach((childItem, childIndex) => {
if (childIndex < 2) {
if (!item.columnsMin) {
item.columnsMin = [];
}
item.columnsMin.push(childItem);
}
});
item.title = highlightTitle(item.title, form.value.keyword);
});
}
} catch (error) {
loading.value = false;
@ -327,7 +328,8 @@ function restData() {
onMounted(() => {
getData();
changeTab(0)
// getData();
})
</script>
@ -336,6 +338,7 @@ onMounted(() => {
.all {
display: flex;
flex-direction: column;
max-width: 100vw;
height: 100vh;
scrollbar-width: none;
/* Firefox */
@ -398,10 +401,19 @@ onMounted(() => {
.card_title {
font-size: 15px;
font-weight: bold;
width: 80%;
width: 73%;
// overflow: hidden;
// text-overflow: ellipsis;
// white-space: nowrap;
height: 43px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: -webkit-box;
text-overflow: ellipsis; // text-overflow: clip|ellipsis|string; (//)
-webkit-line-clamp: 2;
/*要显示的行数*/
/* autoprefixer: off */
-webkit-box-orient: vertical; //
}
.r_point {
@ -430,4 +442,9 @@ onMounted(() => {
padding: 0 0px 0 15px;
}
}
:deep(.highlight) {
color: #ff0000;
font-weight: bold;
}
</style>