回滚代码格式化的问题

This commit is contained in:
jmal 2024-03-18 12:05:20 +08:00
parent 306762738c
commit 9467abc6c0
6 changed files with 70 additions and 83 deletions

View File

@ -98,8 +98,8 @@
<label class="menuitem"> <label class="menuitem">
<svg-icon icon-class="file-upload" /> <svg-icon icon-class="file-upload" />
<span class="menuitem text">{{ <span class="menuitem text">{{
singleFileType !== "" ? singleFileType : "上传文件" singleFileType !== "" ? singleFileType : "上传文件"
}}</span> }}</span>
</label> </label>
</li> </li>
<li v-if="singleFileType === ''" @click="uploadFolder"> <li v-if="singleFileType === ''" @click="uploadFolder">
@ -237,10 +237,10 @@
<div class="info-statistics"> <div class="info-statistics">
<span v-if="tableLoading">获取更多数据...</span> <span v-if="tableLoading">获取更多数据...</span>
<span v-if="!tableLoading">{{ <span v-if="!tableLoading">{{
!finished !finished
? "已加载 " + getSummaries3 ? "已加载 " + getSummaries3
: "已全部加载 " + getSummaries3 : "已全部加载 " + getSummaries3
}}</span> }}</span>
</div> </div>
</div> </div>
@ -369,7 +369,7 @@
v-if="scope.row.ossPlatform" v-if="scope.row.ossPlatform"
size="small" size="small"
class="pc list oss-folder" class="pc list oss-folder"
>{{ scope.row.ossPlatform }} >{{ scope.row.ossPlatform }}
</el-tag> </el-tag>
</div> </div>
</template> </template>
@ -386,10 +386,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tooltip <el-tooltip
v-if=" v-if="scope.row.index === cellMouseIndex && (!scope.row.isShare || scope.row.shareBase)"
scope.row.index === cellMouseIndex &&
(!scope.row.isShare || scope.row.shareBase)
"
class="item" class="item"
effect="light" effect="light"
content="分享" content="分享"
@ -478,7 +475,7 @@
placement="top" placement="top"
> >
<span <span
>&nbsp;&nbsp;&nbsp;{{ formatTime(scope.row.agoTime) }}</span >&nbsp;&nbsp;&nbsp;{{ formatTime(scope.row.agoTime) }}</span
> >
</el-tooltip> </el-tooltip>
</template> </template>
@ -620,7 +617,7 @@
</div> </div>
<div class="target"> <div class="target">
<span class="folder" style="display: none;white-space: nowrap;" <span class="folder" style="display: none;white-space: nowrap;"
>document</span >document</span
> >
</div> </div>
</div> </div>
@ -661,8 +658,8 @@
</el-form-item> </el-form-item>
<el-form-item label="类型:" class="details-name"> <el-form-item label="类型:" class="details-name">
<span>{{ <span>{{
rowContextData.isFolder ? "文件夹" : rowContextData.contentType rowContextData.isFolder ? "文件夹" : rowContextData.contentType
}}</span> }}</span>
</el-form-item> </el-form-item>
<div v-if="rowContextData.music"> <div v-if="rowContextData.music">
<el-form-item label="🎵 歌手:"> <el-form-item label="🎵 歌手:">
@ -693,15 +690,9 @@
> >
</el-form-item> </el-form-item>
<el-form-item label="位置:" class="details-position"> <el-form-item label="位置:" class="details-position">
<a <a :href="'/?path=' + rowContextData.path + '&highlight=' + rowContextData.name">{{
:href=" rowContextData.path
'/?path=' + }}</a>
rowContextData.path +
'&highlight=' +
rowContextData.name
"
>{{ rowContextData.path }}</a
>
</el-form-item> </el-form-item>
<el-form-item label="创建时间:"> <el-form-item label="创建时间:">
<span>{{ rowContextData.uploadDate }}</span> <span>{{ rowContextData.uploadDate }}</span>
@ -722,18 +713,18 @@
<span class="dialog-msg">查看压缩文件</span> <span class="dialog-msg">查看压缩文件</span>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="unzipTo(openingFile)" <el-button size="small" @click="unzipTo(openingFile)"
>解压到...</el-button >解压到...</el-button
> >
<el-button <el-button
size="small" size="small"
@click="unzip(openingFile, openingFile.id, false)" @click="unzip(openingFile, openingFile.id, false)"
>解压到当前目录</el-button >解压到当前目录</el-button
> >
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
@click="compressionFilePreview(openingFile)" @click="compressionFilePreview(openingFile)"
>预览</el-button >预览</el-button
> >
</span> </span>
</el-dialog> </el-dialog>
@ -788,39 +779,36 @@
size="small" size="small"
@click="fileTreeAndNewFolder" @click="fileTreeAndNewFolder"
:disabled="fileTreeAndNewFolderDisabled" :disabled="fileTreeAndNewFolderDisabled"
><i class="el-icon-folder-add"></i>&nbsp;&nbsp;新建文件夹 ><i class="el-icon-folder-add"></i>&nbsp;&nbsp;新建文件夹
</el-button> </el-button>
<el-button <el-button
v-if="!unzipOperating" v-if="!unzipOperating"
size="small" size="small"
type="primary" type="primary"
@click="moveFileTree" @click="moveFileTree"
>移 动</el-button >移 动</el-button
> >
<el-button <el-button
v-if="!unzipOperating" v-if="!unzipOperating"
size="small" size="small"
type="primary" type="primary"
@click="copyFileTree" @click="copyFileTree"
>复制</el-button >复制</el-button
> >
<el-button <el-button
v-if="unzipOperating" v-if="unzipOperating"
size="small" size="small"
type="primary" type="primary"
@click="confirmUnzip" @click="confirmUnzip"
>解压</el-button >解压</el-button
> >
<el-button size="small" @click="dialogMoveOrCopyVisible = false" <el-button size="small" @click="dialogMoveOrCopyVisible = false"
>取 消</el-button >取 消</el-button
> >
</div> </div>
</el-dialog> </el-dialog>
<tag-dialog <tag-dialog :fileList="tagDialogObjectList"
:fileList="tagDialogObjectList" :status.sync="tagDialogVisible" @onSuccess="allocateTagSuccess"/>
:status.sync="tagDialogVisible"
@onSuccess="allocateTagSuccess"
/>
<share-dialog <share-dialog
:file.sync="shareDialogObject" :file.sync="shareDialogObject"
:status.sync="shareDialogVisible" :status.sync="shareDialogVisible"
@ -844,14 +832,14 @@
></el-input> ></el-input>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="newCreateFileDialog = false" <el-button size="small" @click="newCreateFileDialog = false"
>取消</el-button >取消</el-button
> >
<el-button <el-button
size="small" size="small"
type="primary" type="primary"
@click="createFile(newCreateFileName)" @click="createFile(newCreateFileName)"
v-loading="createFileLoading" v-loading="createFileLoading"
>确定</el-button >确定</el-button
> >
</span> </span>
</el-dialog> </el-dialog>
@ -1241,11 +1229,19 @@ export default {
} }
}, },
created() {}, created() {},
watch: {
$route(to) {
if (to.query.tagId && this.queryCondition.tagId !== this.$route.query.tagId) {
this.queryCondition.tagId = this.$route.query.tagId;
this.getFileList();
}
}
},
mounted() { mounted() {
Bus.$on("fileSuccess", (filename) => { Bus.$on("fileSuccess", (filename) => {
this.setOnCreateFilename(filename) this.setOnCreateFilename(filename)
}); });
Bus.$on("loadFileFaild", () => { Bus.$on("loadFileFailed", () => {
this.notPreviewDialogVisible = true; this.notPreviewDialogVisible = true;
}); });
Bus.$on("clickMore", rows => { Bus.$on("clickMore", rows => {
@ -1330,7 +1326,7 @@ export default {
}, },
destroyed() { destroyed() {
Bus.$off("fileSuccess"); Bus.$off("fileSuccess");
Bus.$off("loadFileFaild"); Bus.$off("loadFileFailed");
Bus.$off("clickMore"); Bus.$off("clickMore");
Bus.$off("renameRow"); Bus.$off("renameRow");
Bus.$off("msg/file/change"); Bus.$off("msg/file/change");
@ -1392,16 +1388,15 @@ export default {
// 获取有效长度。如果有后缀,则包括后缀和点的长度;否则是基础名称和后7位的长度 // 获取有效长度。如果有后缀,则包括后缀和点的长度;否则是基础名称和后7位的长度
getEffectiveLength(base, suffix) { getEffectiveLength(base, suffix) {
let chineseLength = Array.from(base).reduce( let chineseLength = Array.from(base).reduce(
(count, char) => count + this.getCharLength(char), (count, char) => count + this.getCharLength(char),
0 0
); );
return suffix return suffix
? chineseLength + suffix.length + 1 ? chineseLength + suffix.length + 1
: chineseLength; : chineseLength;
}, },
keydown(event) { keydown(event) {
console.log('sdf')
const isMac = navigator.platform.startsWith("Mac"); const isMac = navigator.platform.startsWith("Mac");
const { key, c, keyCode, ctrlKey, metaKey } = event; const { key, c, keyCode, ctrlKey, metaKey } = event;
this.isCmd = (isMac && metaKey) || (!isMac && ctrlKey); this.isCmd = (isMac && metaKey) || (!isMac && ctrlKey);
@ -2549,11 +2544,11 @@ export default {
this.darwRectangle(); this.darwRectangle();
this.loadContextMenus(); this.loadContextMenus();
// 使列表滑到顶部 // 使列表滑到顶部
if (!this.grid) { if (!this.grid) {
if (this.fileListScrollTop > 0) { if (this.fileListScrollTop > 0) {
this.$refs.fileListTable.pagingScrollTopLeft() this.$refs.fileListTable.pagingScrollTopLeft()
} }
} }
this.fileListScrollTop = 0 this.fileListScrollTop = 0
}, },
// 加载菜单查看状态 // 加载菜单查看状态
@ -2698,15 +2693,15 @@ export default {
this.pathList.push(item1); this.pathList.push(item1);
this.$router.push(`?vmode=${this.vmode}&search-file=${key}`); this.$router.push(`?vmode=${this.vmode}&search-file=${key}`);
api.searchFile({ api.searchFile({
userId: this.$store.state.user.userId, userId: this.$store.state.user.userId,
username: this.$store.state.user.name, username: this.$store.state.user.name,
keyword: key, keyword: key,
sortableProp: this.sortable.prop, sortableProp: this.sortable.prop,
order: this.sortable.order, order: this.sortable.order,
currentDirectory: encodeURI(this.$route.query.path), currentDirectory: encodeURI(this.$route.query.path),
pageIndex: this.pagination.pageIndex, pageIndex: this.pagination.pageIndex,
pageSize: this.pagination.pageSize pageSize: this.pagination.pageSize
}) })
.then(res => { .then(res => {
this.loadData(res, onLoad); this.loadData(res, onLoad);
this.path = ""; this.path = "";
@ -4039,7 +4034,7 @@ export default {
this.pagination.pageIndex = 1; this.pagination.pageIndex = 1;
const path = encodeURI(this.path); const path = encodeURI(this.path);
if (this.$store.getters.userId !== row.userId) { if (this.$store.getters.userId !== row.userId) {
row.mountFileId = row.id row.mountFileId = row.id
} }
if (row.mountFileId) { if (row.mountFileId) {
localStorage.setItem(this.path, row.mountFileId) localStorage.setItem(this.path, row.mountFileId)
@ -4187,7 +4182,7 @@ export default {
} }
a:hover { a:hover {
color: #409eff; color: #409EFF;
} }
} }
@ -4219,7 +4214,7 @@ export default {
>>> .plTableBox .el-table .el-table__header { >>> .plTableBox .el-table .el-table__header {
th { th {
background-color: #ffffff; background-color: #FFFFFF;
} }
.is-sortable:hover { .is-sortable:hover {
@ -4239,7 +4234,7 @@ export default {
} }
.home-link:hover { .home-link:hover {
color: #409eff; color: #409EFF;
} }
.info-statistics { .info-statistics {
@ -4268,7 +4263,7 @@ export default {
margin-left: 5px !important; margin-left: 5px !important;
} }
> .open-file-dialog { > > > .open-file-dialog {
.el-dialog { .el-dialog {
width: 420px; width: 420px;
} }
@ -4282,13 +4277,13 @@ export default {
} }
} }
> .v-contextmenu-item { > > > .v-contextmenu-item {
.svg-icon { .svg-icon {
font-size: 14px; font-size: 14px;
} }
} }
> .new-text-file-dialog { > > > .new-text-file-dialog {
height: 350px; height: 350px;
top: calc(50% - 175px); top: calc(50% - 175px);
@ -4312,7 +4307,7 @@ export default {
} }
} }
> .van-grid-item__content { > > > .van-grid-item__content {
background-size: cover; background-size: cover;
background-position: center; background-position: center;
padding: 0; padding: 0;
@ -4377,3 +4372,4 @@ export default {
} }
} }
</style> </style>

View File

@ -140,11 +140,11 @@ export default {
this.drawioUrlValid = true this.drawioUrlValid = true
} else { } else {
this.$emit('onClose') this.$emit('onClose')
Bus.$emit('loadFileFaild') Bus.$emit('loadFileFailed')
} }
}).catch(() => { }).catch(() => {
this.$emit('onClose') this.$emit('onClose')
Bus.$emit('loadFileFaild') Bus.$emit('loadFileFailed')
}) })
}, },
viewHistoryFile({historyInfo, recovery}) { viewHistoryFile({historyInfo, recovery}) {

View File

@ -96,7 +96,7 @@ export default {
$J.loadScript($J.apiUrl(officeApiUrl), (e) => { $J.loadScript($J.apiUrl(officeApiUrl), (e) => {
if (e !== null) { if (e !== null) {
this.$emit('onClose') this.$emit('onClose')
Bus.$emit('loadFileFaild') Bus.$emit('loadFileFailed')
return return
} }
if(this.$store.state.user.token && this.$store.state.user.userId === this.file.userId){ if(this.$store.state.user.token && this.$store.state.user.userId === this.file.userId){

View File

@ -98,7 +98,7 @@ export default {
let that = this let that = this
this.delayClosing = setTimeout(function () { this.delayClosing = setTimeout(function () {
if (!that.readyShow) { if (!that.readyShow) {
that.loadFileFaild() that.loadFileFailed()
} }
},12000) },12000)
} }
@ -129,9 +129,9 @@ export default {
/** /**
* 加载失败 * 加载失败
*/ */
loadFileFaild() { loadFileFailed() {
this.close() this.close()
Bus.$emit('loadFileFaild') Bus.$emit('loadFileFailed')
this.readyShow = true this.readyShow = true
}, },
/** /**

View File

@ -178,7 +178,6 @@ export default {
mounted() { mounted() {
tagApi.tagList({userId: this.$store.state.user.userId,}).then(res => { tagApi.tagList({userId: this.$store.state.user.userId,}).then(res => {
this.tagList = res.data this.tagList = res.data
console.log(this.tagList)
}) })
Bus.$on('msg/file/change', (msg) => this.onmessage(msg)) Bus.$on('msg/file/change', (msg) => this.onmessage(msg))
}, },
@ -209,9 +208,7 @@ export default {
}) })
}, },
tagClick(tag) { tagClick(tag) {
console.log('tagClick', tag.id)
this.$router.push(`/tag?tagId=${tag.id}`); this.$router.push(`/tag?tagId=${tag.id}`);
Bus.$emit('tagPageChange', tag.id)
}, },
mouseleave() { mouseleave() {
}, },

View File

@ -28,17 +28,11 @@ export default {
} }
}, },
mounted() { mounted() {
console.log('tag mounted')
if (this.$route.query.tagId) { if (this.$route.query.tagId) {
this.queryCondition.tagId = this.$route.query.tagId this.queryCondition.tagId = this.$route.query.tagId
} }
Bus.$on('tagPageChange', (tagId) => {
console.log('tagPageChange', tagId)
this.queryCondition.tagId = tagId
})
}, },
destroyed() { destroyed() {
Bus.$off('tagPageChange')
} }
} }
</script> </script>