Skip to content

Commit

Permalink
添加上传删除本地词条开关
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleBing committed Dec 16, 2022
1 parent 5a8e829 commit 03019b0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
12 changes: 12 additions & 0 deletions assets/scss/_normalization.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
-ms-user-select: none;
user-select: none;
}

.d-flex{
display: flex;
}

.jc-center{
justify-content: center;
}

.al-center{
align-items: center;
}
2 changes: 1 addition & 1 deletion assets/scss/_tool.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

.tool-panel{
border-right: 1px solid $border-color;
width: 400px;
width: 500px;
flex-shrink: 0;
}
.list-container{
Expand Down
14 changes: 13 additions & 1 deletion assets/scss/wubi.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@
user-select: none;
}

.d-flex {
display: flex;
}

.jc-center {
justify-content: center;
}

.al-center {
align-items: center;
}

.mt-0 {
margin-top: 0px !important;
}
Expand Down Expand Up @@ -1631,7 +1643,7 @@ select option {
}
.tool-container .tool-panel {
border-right: 1px solid #eee;
width: 400px;
width: 500px;
flex-shrink: 0;
}
.tool-container .list-container {
Expand Down
9 changes: 6 additions & 3 deletions view/index/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ const app = {
// 网络相关
categories: [],
selectedCategoryId: 10, // 线上的 [ 通用词库 ]
dictBackupInfo: null // 当前词库在线上的备份信息
dictBackupInfo: null, // 当前词库在线上的备份信息
isDeleteAfterUpload: false, // 上传词条后是否在本地删除对应的词条
}
},
mounted() {
Expand Down Expand Up @@ -302,8 +303,10 @@ const app = {
}
// 上传成功
this.tips.push(res.message, message)
// 删除已经上传的词条
this.deleteWords()
if (this.isDeleteAfterUpload){
// 删除已经上传的词条
this.deleteWords()
}
})
.catch(err => {
this.tips.push(err.message)
Expand Down
5 changes: 5 additions & 0 deletions view/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,11 @@
@click="changeSelectedCategoryId(item.id)"
>{{ item.name }}</div>
</div>
<div class="d-flex al-center pt-1 pb-1">
<input type="checkbox" v-model="isDeleteAfterUpload" id="isDeleteAfterUpload">
<label class="checkbox mr-1" for="isDeleteAfterUpload"></label>
<div>上传后删除本地对应的词条</div>
</div>
<div class="btn-item mt-2">
<div class="btn btn-roseo mb-1" @click="uploadChosenWordsToServer">确定上传</div>
</div>
Expand Down

0 comments on commit 03019b0

Please sign in to comment.