提交 619ae000 authored 作者: 龙菲's avatar 龙菲

修改我的文件icon、网格文件名称展示等样式

上级 477ee4a5
......@@ -12,4 +12,11 @@ export const verity = params => {
params
})
}
// 新增阅读记录,浏览历史接口
export const addNearRead = data => {
return request({
url: baseUrl + '/user/nearRead/add',
method: 'post',
data
})
}
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1693905752136" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1677" width="80" height="80" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M918.673 883H104.327C82.578 883 65 867.368 65 848.027V276.973C65 257.632 82.578 242 104.327 242h814.346C940.422 242 958 257.632 958 276.973v571.054C958 867.28 940.323 883 918.673 883z" fill="#FFE9B4" p-id="1678"></path><path d="M512 411H65V210.37C65 188.597 82.598 171 104.371 171h305.92c17.4 0 32.71 11.334 37.681 28.036L512 411z" fill="#FFB02C" p-id="1679"></path><path d="M918.673 883H104.327C82.578 883 65 865.42 65 843.668V335.332C65 313.58 82.578 296 104.327 296h814.346C940.422 296 958 313.58 958 335.332v508.336C958 865.32 940.323 883 918.673 883z" fill="#FFCA28" p-id="1680"></path></svg>
\ No newline at end of file
<template>
<div class="breadcrumb-wrapper">
<div class="title">当前位置:</div>
<!-- <el-input
class="file-path-input"
ref="filePathInputRef"
placeholder="请输入路径"
v-model="inputFilePath"
size="mini"
:autofocus="true"
v-show="isShowInput"
@blur="handleInputBlurEnter"
@change="handleInputBlurEnter"
></el-input> -->
<div
class="breadcrumb-box"
@click.self="handleClickBreadCrumbSelf"
>
<div class="breadcrumb-box" @click.self="handleClickBreadCrumbSelf">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item
v-for="(item, index) in breadCrumbList"
......@@ -45,18 +31,6 @@ export default {
},
data() {
return {
fileTypeMap: {
1: "全部图片",
2: "全部文档",
3: "全部视频",
4: "全部音乐",
5: "其他",
6: "回收站",
10: "我的创作",
11: "我的收藏",
12: "我的笔记",
},
isShowInput: false, // 是否展示路径输入框
inputFilePath: "", // 路径输入
breadCrumbList: [],
};
......@@ -78,79 +52,22 @@ export default {
// 根目录
filePathList[i] = "";
_path.push(filePathList[i]);
// res.push({
// path: "/",
// name:
// this.fileType === 0
// ? "全部文件"
// : this.fileType === 8
// ? "我的分享"
// : this.$route.name === "Share"
// ? "全部分享"
// : "",
// });
}
}
this.breadCrumbList = res;
},
},
computed: {
/**
* 面包屑导航栏数组
*/
// breadCrumbList: {
// get() {
// let filePath = this.$route.query.filePath;
// let filePathList = filePath ? filePath.split("/") : [];
// let res = []; // 返回结果数组
// let _path = []; // 存放祖先路径
// for (let i = 0; i < filePathList.length; i++) {
// if (filePathList[i]) {
// _path.push(filePathList[i]);
// res.push({
// path: _path.join("/"),
// name: filePathList[i],
// });
// } else if (i === 0) {
// // 根目录
// filePathList[i] = "";
// _path.push(filePathList[i]);
// res.push({
// path: "/",
// name:
// this.fileType === 0
// ? "全部文件"
// : this.fileType === 8
// ? "我的分享"
// : this.$route.name === "Share"
// ? "全部分享"
// : "",
// });
// }
// }
// return res;
// },
// set() {
// return [];
// },
// },
},
methods: {
/**
* 点击面包屑导航栏空白处
*/
handleClickBreadCrumbSelf() {
this.inputFilePath = this.filePath;
this.isShowInput = true;
this.$nextTick(() => {
this.$refs.filePathInputRef.focus();
});
},
/**
* 路径输入框失去焦点或用户按下回车时触发
*/
handleInputBlurEnter() {
this.isShowInput = false;
if (this.inputFilePath !== this.filePath) {
const fixInputFilePath = this.inputFilePath.endsWith("/")
? this.inputFilePath.slice(0, -1)
......@@ -162,25 +79,6 @@ export default {
},
// 获取文件参数
getRouteQuery(item) {
// debugger;
// let routeName = this.$route.name;
// if (routeName === "Share") {
// // 当前是查看他人分享列表的页面
// return { query: { filePath: item.path } };
// } else if (this.fileType === 8) {
// // 当前是我的已分享列表页面
// return {
// query: {
// fileType: 8,
// filePath: item.path,
// shareBatchNum:
// item.path === "/" ? undefined : this.$route.query.shareBatchNum, // 当查看的是根目录,批次号置空
// },
// };
// } else {
// // 网盘页面
// return { query: { filePath: item.path, fileType: item.fileType } };
// }
return {
query: { filePath: item.path, fileType: this.$route.query.fileType },
};
......
......@@ -416,10 +416,8 @@ export default {
.file-table-wrapper {
margin-top: 2px;
height: calc(100vh - 262px) !important;
height: calc(100vh - 270px) !important;
.file-type-0 {
// height: calc(100vh - 206px) !important;
::v-deep .el-table__body-wrapper {
height: calc(100vh - 262px) !important;
}
......@@ -443,7 +441,7 @@ export default {
.file-table {
width: 100% !important;
height: calc(100vh - 290px);
height: calc(100%);
::v-deep .el-table__header-wrapper {
th {
......
......@@ -238,7 +238,7 @@ export default {
left: "126px",
right: "auto",
},
dirImg: require("@/assets/images/file/dir.png"),
dirImg: require("@/assets/images/file/dir.svg"),
wordImg: require("@/assets/images/file/file_word.svg"),
excelImg: require("@/assets/images/file/file_excel.svg"),
pptImg: require("@/assets/images/file/file_ppt.svg"),
......@@ -292,7 +292,7 @@ export default {
},
// 分享按钮是否显示
shareBtnShow() {
return this.fileType !=this.TEMPLATE_MANAGE;//模板管理不能分享
return this.fileType != this.TEMPLATE_MANAGE; //模板管理不能分享
},
// 下载按钮是否显示
downloadBtnShow() {
......
<template>
<!-- 文件平铺 -->
<div class="file-grid-wrapper">
<div
class="file-list empty"
v-loading="loading"
element-loading-text="文件加载中……"
v-if="fileListSorted.length == 0"
>
<el-empty></el-empty>
</div>
<ul
v-else
class="file-list"
v-loading="loading"
element-loading-text="文件加载中……"
......@@ -353,10 +362,10 @@ export default {
line-height: 22px;
font-size: 12px;
word-break: break-all;
@include setEllipsis(2);
::v-deep .keyword {
color: $Danger;
}
// @include setEllipsis(2);
// ::v-deep .keyword {
// color: $Danger;
// }
}
.file-checked-wrapper {
......@@ -383,6 +392,10 @@ export default {
background: $tabBackColor;
}
}
.empty{
display: flex;
justify-content: center;
}
.right-menu-list {
position: fixed;
......
......@@ -51,7 +51,7 @@
</el-dropdown-item>
<!-- 只有我的创作采用到新建word文档 -->
<el-dropdown-item
v-if="[MY_CREATE].includes(fileType)"
v-if="[MY_CREATE,TEMPLATE_MANAGE].includes(fileType)"
divided
@click.native="handleCreateFileByTemplate('docx')"
>
......@@ -279,7 +279,7 @@ export default {
},
operatePopoverVisible: false, // 收纳栏是否显示
fileGroupLable: 0, // 文件展示模式
dirImg: require("@/assets/images/file/dir.png"),
dirImg: require("@/assets/images/file/dir.svg"),
wordImg: require("@/assets/images/file/file_word.svg"),
excelImg: require("@/assets/images/file/file_excel.svg"),
pptImg: require("@/assets/images/file/file_ppt.svg"),
......
......@@ -304,35 +304,13 @@ const fileFunction = {
console.log('row', row);
// 若是文件夹则进入该文件夹
if (row.isDir) {
if (router.currentRoute.name === 'Share') {
// 当前是查看他人分享列表的页面
router.push({
query: {
filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName
}`
}
})
} else if (Number(router.currentRoute.query.fileType) === 8) {
// 当前是我的已分享列表页面
router.push({
query: {
fileType: 8,
filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName
}`,
shareBatchNum: row.shareBatchNum
}
})
} else if (Number(router.currentRoute.query.fileType) !== 6) {
// 回收站页面不允许打开文件夹
// 网盘页面
router.push({
query: {
filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName
}`,
fileType: router.currentRoute.query.fileType
}
})
}
router.push({
query: {
filePath: `${row.filePath === '/' ? '' : row.filePath}/${row.fileName
}`,
fileType: router.currentRoute.query.fileType
}
})
} else {
const WORD = ['doc', 'docx']
const PDF = ['pdf']
......@@ -341,25 +319,28 @@ const fileFunction = {
if (WORD.includes(extentName.toLowerCase())) {
let flag = false
const { fileId, userId, id } = row
// 根据当前文件的作者的userId进行判断,和本人一致则是可编辑
if (store.getters.userInfo.userId == userId) {
flag = true
}
const params = {
fileId: fileId,
flag
}
// 暂时写死---start
let resolve = router.resolve({
path: '/wpsReader',
query: {
wpsUrl: `https://wwo.wps.cn/office/w/2c9a8083849eac7001849eae1df50001?_w_userid=1638778159578505218&_w_filrread=1&_w_filetype=db&_w_filepath=http://222.85.214.245:9559/ls/public/stream?randomCode=34df183096eb4996a93c3f779702e45d&_w_tokentype=1&_w_appid=1058dd766ec443c79f95933ec6a41169&_w_redirectkey=123456&_w_signature=E1OEcnnGEgVfK7mcnGDFgXJSLPY%3D`,
// wpsUrl: `http://localhost/office/w/2c9a8083849eac7001849eae1df50001?_w_userid=1638778159578505218&_w_filrread=1&_w_filetype=db&_w_filepath=http://222.85.214.245:9559/ls/public/stream?randomCode=34df183096eb4996a93c3f779702e45d&_w_tokentype=1&_w_appid=1058dd766ec443c79f95933ec6a41169&_w_redirectkey=123456&_w_signature=E1OEcnnGEgVfK7mcnGDFgXJSLPY%3D`,
token: `0617753de96249a5a9839daf9b8ff8b5`,
fileId
}
})
window.open(resolve.href, '_blank')
// 暂时写死---end
// 实际实现逻辑---start
// const params = {
// fileId: fileId,
// flag
// }
// getViewUrlDbPath(params).then(res => {
// if (res.data) {
// // console.log('res.data', res.data);
......@@ -379,9 +360,12 @@ const fileFunction = {
// }
// })
// return false
// 实际实现逻辑---end
}
// 若当前点击项是pdf
if (PDF.includes(row.extendName.toLowerCase())) {
else if (PDF.includes(extentName.toLowerCase())) {
router.push('/pdfReader')
return false
}
......
......@@ -27,7 +27,7 @@ export const fileImgMap = new Map([
['sass', require('@/assets/images/file/file_sass.png')],
['csv', require('@/assets/images/file/file_csv.png')],
['dmg', require('@/assets/images/file/file_dmg.png')],
['dir', require('@/assets/images/file/dir.png')],
['dir', require('@/assets/images/file/dir.svg')],
['doc', require('@/assets/images/file/file_word.svg')],
['docx', require('@/assets/images/file/file_word.svg')],
['exe', require('@/assets/images/file/file_exe.png')],
......
......@@ -54,7 +54,7 @@
</div>
<div :span="19" class="right">
<div class="note-container">
<div class="card-group" v-if="noteList.records.length>0">
<div class="card-group" v-if="noteList.records.length > 0">
<el-card
class="card-item"
shadow="hover"
......@@ -136,7 +136,6 @@
</el-pagination>
</div>
</div>
</div>
</div>
<AddOrUpdateNoteDialog
......@@ -170,12 +169,6 @@ export default {
total: 0,
},
editNoteDialogVisible: false, //笔记笔记弹窗可见性
form: {
docId: "", //文档Id
bookmarkContent: "", //原文内容
noteContent: "", //笔记内容
tagsArr: [], //标签
},
loading: false,
};
},
......
......@@ -165,12 +165,6 @@ export default {
total: 0,
},
loading: false,
form: {
docId: "", //文档Id
bookmarkContent: "", //原文内容
noteContent: "", //笔记内容
tagsArr: [], //标签
},
};
},
computed: {
......
// mixins
// 混入了笔记的复制、预览、编辑、删除等操作,在此文件写的方法和属性可以被共享使用
import { textCopy } from "@/utils/index";
import { deleteNote } from "@/api/doc/bookMark";
import AddOrUpdateNoteDialog from "@/views/read/wpsReader/component/addOrUpdateNoteDialog.vue";
......@@ -5,6 +8,16 @@ export default {
components: {
AddOrUpdateNoteDialog
},
data() {
return {
form: {
docId: "", //文档Id
bookmarkContent: "", //原文内容
noteContent: "", //笔记内容
tagsArr: [], //标签
},
}
},
methods: {
// 笔记操作
handleNoteOperation(type, item) {
......@@ -37,7 +50,7 @@ export default {
docId,
bookmarkContent,
noteContent,
tagsArr: tagName.split(","),
tagsArr: tagName && tagName.length > 0 ? tagName.split(",") : [],
};
this.$refs.AddOrUpdateNoteDialog.dialogVisible = true;
},
......
......@@ -40,24 +40,28 @@
:key="index"
shadow="hover"
>
<div class="tag" v-if="item.tagName && item.tagName.length > 0">
<el-tag
style="margin-right: 8px"
type="warning"
v-for="(v, i) in item.tagName.split(',')"
>{{ v }}
</el-tag>
<el-dropdown>
<el-link>更多</el-link>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(dropItem, i) in dropdownList"
@click.native="handleClickDropdown(dropItem.value, item)"
>{{ dropItem.label }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<div class="card-header">
<div class="tag" v-if="item.tagName && item.tagName.length > 0">
<el-tag
style="margin-right: 8px"
type="warning"
v-for="(v, i) in item.tagName.split(',')"
:key="i"
>{{ v }}
</el-tag>
</div>
<div class="operations">
<el-dropdown>
<el-link>更多</el-link>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-for="(dropItem, i) in dropdownList"
@click.native="handleNoteOperation(dropItem.value, item)"
>{{ dropItem.label }}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<div class="origin oneRow">
<svg-icon
......@@ -115,6 +119,11 @@
:total="tagList.total"
>
</el-pagination>
<AddOrUpdateNoteDialog
:formData="form"
ref="AddOrUpdateNoteDialog"
@update="loadNoteList"
/>
</div>
</div>
</template>
......@@ -122,7 +131,10 @@
<script>
// import { noteList, tagList } from "./mockData";
import { getNoteByTag, getNoteAllTagList } from "@/api/doc/index";
import noteOperationMixins from "@/views/mine/myNote/components/noteOperationMixins";
export default {
//noteOperationMixins主要混入属性form、handleNoteOperation方法、AddOrUpdateNoteDialog组件
mixins: [noteOperationMixins],
data() {
return {
searchParams: {
......@@ -221,6 +233,7 @@ export default {
console.log(type, item);
switch (type) {
case "view":
this.$file.handleFileNameClickNew(item);
break;
case "edit":
this.handleOpenAddUpdateDialog(item);
......@@ -314,5 +327,14 @@ export default {
}
}
}
.card-header {
height: 30px;
.tag {
float: left;
}
.operations {
float: right;
}
}
}
</style>
......@@ -6,44 +6,49 @@
@handleInsertText="handleInsertText"
@handleOpenAddUpdateDialog="handleOpenAddUpdateDialog"
/>
<AddOrUpdateNoteDialog
:formData="form"
ref="AddOrUpdateNoteDialog"
@update="handleUpdateRightPanel"
/>
</div>
</template>
<script>
import WebOfficeSDK from "/public/weboffice/web-office-sdk-v1.1.19.es";
import RightPanel from "./component/rightPanel.vue";
import AddOrUpdateNoteDialog from "./component/addOrUpdateNoteDialog.vue";
export default {
components: {
RightPanel,
AddOrUpdateNoteDialog,
},
data() {
return {
wpsInstance: null, //wps实例
controlButton: null, //新建笔记按钮
form: {
docId: "", //文档Id
bookmarkContent: "", //原文内容
noteContent: "", //笔记内容
tagsArr: [], //标签
},
wpsInstance: {}, //wps实例
controlButton: {}, //新建笔记按钮
routeParams:{},//路由传过来的参数
};
},
mounted() {
const { wpsUrl, token, fileId } = this.$route.query;
this.form.docId = fileId;
this.routeParams = { wpsUrl, token, fileId }
this.initWps(wpsUrl, token);
},
destroyed() {
this.removeSelectionChangeListener();
},
methods: {
// 新增阅读记录
async addViewRecord() {
const params = {
docId: this.routeParams.fileId,
docSType: "docx", //枚举值docx,pdf
};
try {
let res = await addNearRead(params);
if (res.code == 200) {
// console.log();
} else {
throw res.code;
}
} catch (error) {
console.error(error);
}
},
// 初始化WPS
async initWps(wpsUrl, token) {
this.wpsInstance = WebOfficeSDK.config({
......@@ -55,6 +60,7 @@ export default {
await this.wpsInstance.ready();
this.addSelectionListen();
this.initAddNoteButton();
this.addViewRecord();
},
// 添加监听选取文字
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论