feat:超长文本隐藏显示

This commit is contained in:
fanxb 2023-05-24 22:04:24 +08:00
parent faedc09771
commit 3f0d519a99
3 changed files with 29 additions and 8 deletions

View File

@ -14,7 +14,7 @@ class RenamerService {
for (let i in fileList) { for (let i in fileList) {
let obj = fileList[i]; let obj = fileList[i];
ruleObjs.forEach(item => (item.data as RuleInterface).deal(obj)); ruleObjs.forEach(item => (item.data as RuleInterface).deal(obj));
if (newNameSet.has(obj.name)) { if (newNameSet.has(obj.path + obj.name)) {
obj.errorMessage = "重名"; obj.errorMessage = "重名";
} }
newNameSet.add(obj.path + obj.name); newNameSet.add(obj.path + obj.name);

View File

@ -42,7 +42,7 @@ export default {
name: "Home", name: "Home",
data() { data() {
return { return {
version: "1.6", version: "1.6.1",
latestVersion: null, latestVersion: null,
activeIndex: location.pathname, activeIndex: location.pathname,
showNewVersion: false showNewVersion: false

View File

@ -59,16 +59,24 @@
</div> </div>
<div class="fileBlock"> <div class="fileBlock">
<!-- 左侧原始文件名 --> <!-- 左侧原始文件名 -->
<div style="flex: 4"> <div style="width:50%;">
<div v-for="(item, index) in fileList" :key="index" class="oneLine"> <div v-for="(item, index) in fileList" :key="index" class="oneLine">
<el-checkbox v-model="item.checked" style="height: 1.2em">{{ item.name }}</el-checkbox> <el-checkbox class="oneLineText" style="width: 95%" v-model="item.checked">
<el-tooltip show-after="300" style="color:white" effect="dark" :content="item.name" placement="top">
<span class="oneLineText" style="width: 100%;display: inline-block">{{ item.name }}</span>
</el-tooltip>
</el-checkbox>
</div> </div>
</div> </div>
<!-- 右边的预览文件名 --> <!-- 右边的预览文件名 -->
<div style="flex: 4"> <div style="width:50%">
<div v-for="(item, index) in changedFileList" :key="index" class="oneLine"> <div v-for="(item, index) in changedFileList" :key="index" class="oneLine">
<div style="flex: 4">{{ item.name }}</div> <div style="display:inline-block;width:72%;" class="oneLineText">
<div style="color: red; flex: 1">{{ item.errorMessage }}</div> <el-tooltip show-after="300" style="color:white" effect="dark" :content="item.name" placement="top">
<span class="oneLineText" style="width: 100%;display: inline-block">{{ item.name }}</span>
</el-tooltip>
</div>
<div style="display:inline-block;color: red; width: 25%">{{ item.errorMessage }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -355,15 +363,28 @@ function readChar(a, i, n) {
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
.el-checkbox__label {
width: 95%;
}
.oneLine { .oneLine {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
border-top: 1px solid rgb(214, 212, 212); border-top: 1px solid rgb(214, 212, 212);
height: 1.5em; height: 1.5em;
padding-top: 0.1em; padding-top: 0.1em;
padding-bottom: 0.1em; padding-bottom: 0.1em;
padding-right: 0.2em; padding-right: 0.2em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.oneLineText {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.oneFileName { .oneFileName {