加阅读模式

This commit is contained in:
DESKTOP-AD8UBUJ\ling
2026-03-06 08:04:29 +08:00
parent 1f08afd8d3
commit 23f4390a9b
2 changed files with 35 additions and 2 deletions

View File

@@ -342,6 +342,24 @@ export const widgetTable = {
placeholder: '', placeholder: '',
value:'' value:''
}, },
{
type: 'el-switch',
label: '阅读模式',
name: 'is_read_mode',
required: false,
placeholder: '',
value: false,
},
{
type: 'vue-color',
label: '阅读模式颜色',
name: 'read_color',
relactiveDom:'is_read_mode',
relactiveDomValue:true,
required: false,
placeholder: '',
value:''
},
{ {
type: 'dynamic-add-table', type: 'dynamic-add-table',
label: '', label: '',

View File

@@ -27,12 +27,13 @@
> >
{{ index + 1 }} {{ index + 1 }}
</div> </div>
<div v-for="(itemChild, idx) in header" <div @mouseenter="handleMouseSeen(index, idx)" @mouseleave="handleMouseLeave" v-for="(itemChild, idx) in header"
:key="idx" :key="idx"
:style="[ :style="[
bodyTableStyle, bodyTableStyle,
bodyTable(index), bodyTable(index),
tableFiledWidth(idx), tableFiledWidth(idx),
tableReadColor(index, idx),
tableRowHeight() tableRowHeight()
]" ]"
> >
@@ -114,6 +115,7 @@ export default {
}, },
header: [], header: [],
list: [], list: [],
hoverIndex: {},
optionsSetUp: {}, optionsSetUp: {},
optionsPosition: {}, optionsPosition: {},
optionsData: {}, optionsData: {},
@@ -257,6 +259,12 @@ export default {
window.removeEventListener('resize', this.handleResize); window.removeEventListener('resize', this.handleResize);
}, },
methods: { methods: {
handleMouseSeen(index, idx){
this.hoverIndex = {index, idx}
},
handleMouseLeave(){
this.hoverIndex = {}
},
handleClick(){ handleClick(){
if(!!this.optionsSetUp.is_drill_drown){ if(!!this.optionsSetUp.is_drill_drown){
this.$emit('oepnTheDrillView',this.optionsSetUp.drill_drown_setting) this.$emit('oepnTheDrillView',this.optionsSetUp.drill_drown_setting)
@@ -365,6 +373,13 @@ export default {
} }
return styleJson; return styleJson;
}, },
tableReadColor(index, idx){
let styleJson = {};
if (this.optionsSetUp.is_read_mode && (this.hoverIndex.index === index || this.hoverIndex.idx === idx)) {
styleJson["background-color"] = this.optionsSetUp.read_color;
}
return styleJson;
},
// 添加的方法 - 设备类型检测 // 添加的方法 - 设备类型检测
checkDeviceType() { checkDeviceType() {
this.screenWidth = window.innerWidth; this.screenWidth = window.innerWidth;