优化单元格溢出提示宽度

This commit is contained in:
likun 2025-06-09 16:44:42 +08:00
parent 0eb04fd3bb
commit 16ef5c843a
7 changed files with 35 additions and 17 deletions

View File

@ -60,6 +60,7 @@ func getFieldTypeDtoDescInfo(project *Project, poValue reflect.Value, fieldType
Choices: make([]*dto.CommonDtoFieldChoice, 0),
MultiChoice: fieldType.Tag.Get("multi_choice") == "true",
Uneditable: fieldType.Tag.Get("uneditable") == "true",
BigColumn: fieldType.Tag.Get("big_column") == "true",
Where: fieldType.Tag.Get("where"),
}

View File

@ -15,8 +15,8 @@ type GlobalMail struct {
ID int `gorm:"primarykey" readonly:"true"`
ProjectId int `gorm:"index:idx_project_id"`
ServerIDs []string `gorm:"type:json;serializer:json" desc:"不选就是默认所有区服" name:"区服" type:"[]string" choices:"GetChoiceServers" multi_choice:"true"`
Title string `name:"邮件标题" required:"true"`
Content string `name:"邮件内容" required:"true"`
Title string `name:"邮件标题" required:"true" big_column:"true"`
Content string `name:"邮件内容" required:"true" big_column:"true"`
DelayInvokeCreateHook sql.NullTime `name:"邮件定时发送时间" desc:"不填或者无效就立即发送"`
ExpireAt sql.NullTime `name:"邮件到期时间" desc:"不填就是永久有效"`
CreateRoleTimeBefore sql.NullTime `name:"创角时间" desc:"在这时间之前创建的角色才能收到邮件,不填就是都生效"`

View File

@ -14,9 +14,9 @@ type Notice struct {
ID int `gorm:"primarykey" readonly:"true"`
ProjectId int `gorm:"index:idx_project_id"`
//ServerIDs []string `gorm:"type:json;serializer:json" name:"公告生效服务器" desc:"为空表示所有服" choices:"GetChoiceServers"`
Mod string `name:"公告分栏标题" desc:"显示到公告弹窗左边的分栏标题" required:"true"` // 左边分栏标题
Title string `name:"公告标题" desc:"显示到公告内容区里的标题" required:"true"` // 公告内容上面的标题
Content string `name:"公告内容" desc:"仅支持<color=#xxx></color>颜色标签和\\n换行标签" type:"text" required:"true"` // 公告内容
Mod string `name:"公告分栏标题" desc:"显示到公告弹窗左边的分栏标题" required:"true"` // 左边分栏标题
Title string `name:"公告标题" desc:"显示到公告内容区里的标题" required:"true" big_column:"true"` // 公告内容上面的标题
Content string `name:"公告内容" desc:"仅支持<color=#xxx></color>颜色标签和\\n换行标签" type:"text" required:"true" big_column:"true"` // 公告内容
//StartAt time.Time `name:"开始时间" required:"true"`
//EndAt time.Time `name:"结束时间" required:"true"`
Status bool `name:"是否启用" desc:"启用的公告才会导出到cdn被客户端显示" type:"tagStatus" choices:"GetStatusChoices" required:"true"`

View File

@ -22,8 +22,8 @@ type RoleMail struct {
ProjectId int `gorm:"index:idx_project_id"`
ServerID string `name:"所属区服" choices:"GetChoiceServers" required:"true" where:"eq"`
RoleIDs []string `gorm:"type:json;serializer:json" name:"生效的角色id" desc:"生效的角色id逗号分隔多个" required:"true"`
Title string `name:"邮件标题" required:"true"`
Content string `name:"邮件内容" required:"true"`
Title string `name:"邮件标题" required:"true" big_column:"true"`
Content string `name:"邮件内容" required:"true" big_column:"true"`
Attach []*MailAttachItem `gorm:"type:json;serializer:json" name:"邮件附件" type:"items" desc:"搜索道具并点击添加"`
CreatedAt time.Time `readonly:"true" where:"range"`

View File

@ -26,6 +26,7 @@ type CommonDtoFieldDesc struct {
Choices []*CommonDtoFieldChoice `json:"choices"` // 可选项,用于字段做下拉框
MultiChoice bool `json:"multi_choice"` // 是否多选
Uneditable bool `json:"uneditable"` // 不可编辑某些数据一旦新增之后不能修改例如封禁的值、服务器的id等
BigColumn bool `json:"big_column"` // 大列,表示内容很长,需要省略
Where string `json:"where"` // sql list的where条件用于表格页面查询条件编写eq gt lt ge lt range like
}

View File

@ -596,7 +596,8 @@ const handlePaginationCurChange = (val) => {
</el-table-column>
<template v-for="fieldDescInfo in fieldsDescInfo">
<!-- 道具列表 -->
<el-table-column prop="jsonValue" :label="fieldDescInfo.name" show-overflow-tooltip
<el-table-column prop="jsonValue" :label="fieldDescInfo.name"
:show-overflow-tooltip="{effect:'light',placement:'top'}"
v-if="(fieldDescInfo.type === 'items')"></el-table-column>
<!-- 角色状态 -->
<el-table-column prop="tagValue" :label="fieldDescInfo.name"
@ -606,10 +607,19 @@ const handlePaginationCurChange = (val) => {
<!-- <el-tag type="success" v-else-if="scope.row.Status === '在线'">{{ scope.row.Status }}</el-tag>-->
</template>
</el-table-column>
<!-- 其它普通字段 -->
<el-table-column :prop="fieldDescInfo.key" :label="fieldDescInfo.name"
:show-overflow-tooltip="(fieldDescInfo.key === 'Title' || fieldDescInfo.key === 'Content')"
v-else>
:show-overflow-tooltip="{effect:'light',placement:'top'}"
v-else-if="(fieldDescInfo.big_column)">
<template #header>
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top"
v-if="fieldDescInfo.help_text !== ''">
<span>{{ fieldDescInfo.name }}</span>
</el-tooltip>
<span v-else>{{ fieldDescInfo.name }}</span>
</template>
</el-table-column>
<!-- 其它普通字段 -->
<el-table-column :prop="fieldDescInfo.key" :label="fieldDescInfo.name" v-else>
<template #header>
<el-tooltip effect="light" :content="fieldDescInfo.help_text" placement="top"
v-if="fieldDescInfo.help_text !== ''">
@ -926,6 +936,12 @@ const handlePaginationCurChange = (val) => {
flex: 1;
position: absolute;
}
/*控制表格tooltip宽度*/
::v-deep(.el-popper) {
max-width: 640px;
word-break: break-all;
}
}
}
}

View File

@ -93,17 +93,17 @@ const handlePaginationCurChange = (val) => {
<el-container v-if="listDataOK">
<el-header style="margin-bottom: 10px">
<el-row>
<el-input v-model="whereCondUserId" placeholder="用户id" style="width: 150px;margin-left: 10px"
<el-input v-model="whereCondUserId" placeholder="用户id" style="width: 150px;margin-right: 10px"
v-if="disableConditionInput1 === false"/>
<el-input v-model="whereCondOpResourceType" placeholder="操作资源类型"
style="width: 150px;margin-left: 10px" v-if="disableConditionInput1 === false"/>
style="width: 150px;margin-right: 10px" v-if="disableConditionInput1 === false"/>
<el-input v-model="whereCondOpResourceGroup" placeholder="操作资源组"
style="width: 150px;margin-left: 10px" v-if="disableConditionInput1 === false"/>
<el-input v-model="whereCondOpResourceKey" placeholder="操作对象" style="width: 150px;margin-left: 10px"
style="width: 150px;margin-right: 10px" v-if="disableConditionInput1 === false"/>
<el-input v-model="whereCondOpResourceKey" placeholder="操作对象" style="width: 150px;margin-right: 10px"
v-if="disableConditionInput1 === false"/>
<el-input v-model="whereCondMethod" placeholder="操作方法" style="width: 150px;margin-left: 10px"
<el-input v-model="whereCondMethod" placeholder="操作方法" style="width: 150px;margin-right: 10px"
v-if="disableConditionInput1 === false"/>
<el-button @click="listData" type="primary" style="margin-left: 10px"
<el-button @click="listData" type="primary" style="margin-right: 10px"
v-if="disableConditionInput1 === false">条件搜索
</el-button>
<el-button @click="resetConditionSearch" v-if="disableConditionInput1 === false">清空条件</el-button>