Skip to content

Commit

Permalink
Merge pull request 'feat:超长文本隐藏显示' (#44) from dev into main
Browse files Browse the repository at this point in the history
  • Loading branch information
FleyX committed May 25, 2023
2 parents b0f1901 + 3f0d519 commit ea859cc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion openRenamerBackend/service/RenamerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RenamerService {
for (let i in fileList) {
let obj = fileList[i];
ruleObjs.forEach(item => (item.data as RuleInterface).deal(obj));
if (newNameSet.has(obj.name)) {
if (newNameSet.has(obj.path + obj.name)) {
obj.errorMessage = "重名";
}
newNameSet.add(obj.path + obj.name);
Expand Down
2 changes: 1 addition & 1 deletion openRenamerFront/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default {
name: "Home",
data() {
return {
version: "1.6",
version: "1.6.1",
latestVersion: null,
activeIndex: location.pathname,
showNewVersion: false
Expand Down
33 changes: 27 additions & 6 deletions openRenamerFront/src/views/home/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,24 @@
</div>
<div class="fileBlock">
<!-- 左侧原始文件名 -->
<div style="flex: 4">
<div style="width:50%;">
<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 style="flex: 4">
<div style="width:50%">
<div v-for="(item, index) in changedFileList" :key="index" class="oneLine">
<div style="flex: 4">{{ item.name }}</div>
<div style="color: red; flex: 1">{{ item.errorMessage }}</div>
<div style="display:inline-block;width:72%;" class="oneLineText">
<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>
Expand Down Expand Up @@ -355,15 +363,28 @@ function readChar(a, i, n) {
margin-top: 20px;
display: flex;
.el-checkbox__label {
width: 95%;
}
.oneLine {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid rgb(214, 212, 212);
height: 1.5em;
padding-top: 0.1em;
padding-bottom: 0.1em;
padding-right: 0.2em;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.oneLineText {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.oneFileName {
Expand Down

0 comments on commit ea859cc

Please sign in to comment.