fix:修复一些bug

This commit is contained in:
fanxb 2023-03-09 09:55:50 +08:00
parent 1d4e61f9ef
commit 11f28f12fa
2 changed files with 12 additions and 8 deletions

View File

@ -45,14 +45,14 @@ export default {
activeIndex: location.pathname, activeIndex: location.pathname,
}; };
}, },
async beforeCreate() {
window.token = localStorage.getItem("token");
window.isWindows = await httpUtil.get("/file/isWindows");
},
async created() { async created() {
// //
let config = await httpUtil.get("https://s3.fleyx.com/picbed/openRenamer/config.json"); let config = await httpUtil.get("https://s3.fleyx.com/picbed/openRenamer/config.json");
this.latestVersion = config.version; this.latestVersion = config.version;
window.token = localStorage.getItem("token");
window.isWindows = await httpUtil.get("/file/isWindows");
console.log(this.$route);
console.log(this.activeIndex);
}, },
async mounted() { async mounted() {
console.log(this.$route); console.log(this.$route);

View File

@ -22,7 +22,7 @@
</el-tag> </el-tag>
</div> </div>
<div style="margin-top: 5px"> <div style="margin-top: 5px">
<el-button type="primary" size="small" @click="selectAllFiles">反选</el-button> <el-button type="primary" size="small" @click="selectAllFiles">{{ allChecked ? "不选" : "全选" }}</el-button>
<el-tooltip effect="dark" content="一键选中所有的非视频、字幕文件和小于5MB的视频文件" placement="bottom"> <el-tooltip effect="dark" content="一键选中所有的非视频、字幕文件和小于5MB的视频文件" placement="bottom">
<el-button type="success" size="small" @click="choseAdFile">一键选择</el-button> <el-button type="success" size="small" @click="choseAdFile">一键选择</el-button>
</el-tooltip> </el-tooltip>
@ -120,7 +120,11 @@ export default {
showNameEditDialog: false // showNameEditDialog: false //
}; };
}, },
computed: {}, computed: {
allChecked() {
return this.fileList.length > 0 && this.fileList.filter(item => item.checked).length === this.fileList.length;
}
},
async created() { async created() {
this.savePathList = await HttpUtil.get("/file/path"); this.savePathList = await HttpUtil.get("/file/path");
window.isWindows = await HttpUtil.get("/file/isWindows"); window.isWindows = await HttpUtil.get("/file/isWindows");
@ -214,9 +218,9 @@ export default {
this.showNameEditDialog = false; this.showNameEditDialog = false;
await this.showResult(); await this.showResult();
}, },
//
selectAllFiles() { selectAllFiles() {
this.fileList.forEach((item) => (item.checked = !item.checked)); let checked = !this.allChecked;
this.fileList.forEach((item) => (item.checked = checked));
}, },
// //
checkRuleAndFile() { checkRuleAndFile() {