提交 deef6647 authored 作者: 龙菲's avatar 龙菲

我的创作接口联调;我的笔记完善

上级 5b8ca0cc
// onlyoffice 相关接口
import { post } from './http'
// 创建文档
export const createOfficeFile = (p) => post('/file/createFile', p)
// 编辑文档
export const editOfficeFile = (p) => post('/office/editofficefile', p)
// 查看文档
export const previewOfficeFile = (p) => post('/office/previewofficefile', p)
......@@ -9,11 +9,14 @@ const baseUrl = '/v1/api/folder'
* 获取文件列表相关接口
*/
// 获取文件列表(区分文件路径)
export const getFileListByPath = (params) => {
export const getFileListByPath = (data) => {
return request({
url: baseUrl + '/file/getfilelist',
url: baseUrl + '/file/getFileList',
method: 'post',
params
data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
// 获取文件列表(区分文件类型)
......@@ -60,12 +63,25 @@ export const getFoldTree = (params) => {
/**
* 单文件操作相关接口
*/
// 创建文件
export const createFold = (params) => {
//创建文件
// 创建文档
// export const createOfficeFile = (p) => post('/file/createFile', p)
export const createOfficeFile = (data) => {
return request({
url: baseUrl + '/file/createFile',
method: 'post',
data
})
}
// 创建文件夹
export const createFold = (data) => {
return request({
url: baseUrl + '/file/createFold',
method: 'post',
params
data
})
}
// 获取文件详细信息
......@@ -77,11 +93,11 @@ export const getFileDetail = (params) => {
})
}
// 删除文件
export const deleteFile = (params) => {
export const deleteFile = (data) => {
return request({
url: baseUrl + '/file/deletefile',
method: 'post',
params
data
})
}
// 复制文件
......@@ -109,11 +125,11 @@ export const renameFile = (data) => {
})
}
// 解压文件
export const unzipFile = (params) => {
export const unzipFile = (data) => {
return request({
url: baseUrl + '/file/unzipfile',
method: 'post',
params
data
})
}
// 全局搜索文件
......@@ -125,11 +141,11 @@ export const searchFile = (params) => {
})
}
// 分享文件
export const shareFile = (params) => {
export const shareFile = (data) => {
return request({
url: baseUrl + '/share/sharefile',
method: 'post',
params
data
})
}
// 校验分享链接过期时间
......@@ -165,11 +181,11 @@ export const getShareFileList = (params) => {
})
}
// 保存分享文件
export const saveShareFile = (params) => {
export const saveShareFile = (data) => {
return request({
url: baseUrl + '/share/savesharefile',
method: 'post',
params
data
})
}
......@@ -197,19 +213,19 @@ export const batchMoveFile = (data) => {
* 回收站文件操作相关接口
*/
// 回收站文件删除
export const deleteRecoveryFile = (params) => {
export const deleteRecoveryFile = (data) => {
return request({
url: baseUrl + '/recoveryfile/deleterecoveryfile',
method: 'post',
params
data
})
}
// 回收站文件还原
export const restoreRecoveryFile = (params) => {
export const restoreRecoveryFile = (data) => {
return request({
url: baseUrl + '/recoveryfile/restorefile',
method: 'post',
params
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="1690447883672" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="934" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M333.93241 1024h683.898435v-66.782609H333.93241z" p-id="935"></path><path d="M947.019019 336.428522l-107.364174 106.406956L580.248932 183.451826l107.453218-106.718609a34.504348 34.504348 0 0 1 48.66226 0.066783l210.765913 210.765913c6.544696 6.544696 10.128696 15.204174 10.106435 24.442435 0 9.238261-3.650783 17.92-10.217739 24.420174zM334.978671 942.903652a34.771478 34.771478 0 0 1-24.33113 9.995131l-0.667826-0.022261-209.430261-4.318609A34.57113 34.57113 0 0 1 66.801976 913.385739l4.36313-210.788174c0.222609-8.94887 3.806609-17.385739 10.195478-23.707826l451.561739-448.400696 259.31687 259.361392-457.238261 453.053217z m659.366957-702.553043L783.601976 29.584696a101.398261 101.398261 0 0 0-142.914783-0.24487l-606.386087 602.156522a100.730435 100.730435 0 0 0-29.896348 69.743304L0.019367 911.983304a101.420522 101.420522 0 0 0 99.172174 103.357218l209.430261 4.318608 2.003478 0.022261a101.821217 101.821217 0 0 0 71.323826-29.339826l612.08487-606.47513A100.441043 100.441043 0 0 0 1024.019367 312.186435a100.507826 100.507826 0 0 0-29.673739-71.835826z" p-id="936"></path></svg>
\ No newline at end of file
<?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="1690451279951" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="993" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M487.947 191.383c95.178-95.177 249.492-95.177 344.67 0 94.226 94.227 95.168 246.412 2.826 341.797l-2.826 2.873-296.564 296.564c-95.178 95.177-249.492 95.177-344.67 0-95.177-95.178-95.177-249.492 0-344.67l99.473-99.473c12.497-12.497 32.758-12.497 45.255 0s12.497 32.758 0 45.255l-99.473 99.473c-70.184 70.184-70.184 183.975 0 254.16 69.483 69.482 181.705 70.177 252.042 2.084l2.118-2.084 296.564-296.564c70.184-70.184 70.184-183.975 0-254.16-69.483-69.482-181.705-70.177-252.042-2.084l-2.118 2.084-9.563 9.563c-12.497 12.497-32.758 12.497-45.255 0-12.372-12.372-12.495-32.354-0.37-44.878l0.37-0.377 9.563-9.563zM298.053 381.026c56.035-56.035 146.886-56.035 202.92 0 55.475 55.475 56.03 145.072 1.665 201.23l-1.664 1.69-79.68 79.681c-12.498 12.497-32.759 12.497-45.256 0-12.371-12.371-12.495-32.353-0.37-44.877l0.37-0.377 79.68-79.681c31.042-31.041 31.042-81.37 0-112.41-30.73-30.732-80.364-31.04-111.473-0.923l-0.937 0.922-79.68 79.68c-12.497 12.497-32.759 12.497-45.255 0C206 493.59 205.877 473.609 218 461.085l0.372-0.377 79.68-79.68z" p-id="994"></path></svg>
\ No newline at end of file
<?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="1690447902069" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1083" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M512 811.296a312 312 0 0 0 312-312V89.6h-112v409.696a200 200 0 1 1-400 0V89.6h-112v409.696a312 312 0 0 0 312 312zM864 885.792H160a32 32 0 0 0 0 64h704a32 32 0 0 0 0-64z" p-id="1084"></path></svg>
\ No newline at end of file
$theme-blue: #1A5EFF;
\ No newline at end of file
$theme-blue: #1A5EFF;
$success: #13ce66;
$warning: #ffba00;
$danger: #ff4949;
\ No newline at end of file
......@@ -168,7 +168,7 @@ export default {
display: flex;
.title,
>>> .el-breadcrumb {
::v-deep .el-breadcrumb {
height: 30px;
line-height: 30px;
}
......
......@@ -221,7 +221,11 @@ export default {
currentPage: this.pageData.currentPage,
pageCount: this.pageData.pageCount,
};
getFileListByPath(data).then((res) => {
const params = new URLSearchParams();
for (const key in data) {
params.append(key, data[key]);
}
getFileListByPath(params).then((res) => {
if (res.success) {
this.fileList = res.dataList;
this.pageData.total = Number(res.total);
......
......@@ -125,7 +125,7 @@ export default {
return {
// 上传组件配置项
options: {
target: `${process.env.VUE_APP_BASE_QW_API}/filetransfer/uploadfile`, // 上传文件-目标 URL
target: `${process.env.VUE_APP_BASE_API}/filetransfer/uploadfile`, // 上传文件-目标 URL
chunkSize: 1024 * 1024, // 每个分片的大小
fileParameterName: "file", // 上传文件时文件的参数名,默认 file
maxChunkRetries: 3, // 并发上传数,默认 3
......
......@@ -39,7 +39,7 @@
</template>
<script>
// import { createOfficeFile } from "@/request/onlyoffice.js";
import { createOfficeFile } from "@/api/qwFile";
export default {
name: "AddFileDialog",
......@@ -76,26 +76,25 @@ export default {
this.sureBtnLoading = true;
this.$refs[formName].validate((valid) => {
if (valid) {
console.log("TODO:创建文件");
// createOfficeFile({
// extendName: this.extendName,
// filePath: this.filePath,
// fileName: this.form.fileName,
// })
// .then((res) => {
// this.sureBtnLoading = false;
// if (res.success && res.code === 0) {
// this.$message.success("文件创建成功");
// this.$refs[formName].resetFields();
// this.visible = false;
// this.callback("confirm");
// } else {
// this.$message.warning(res.message);
// }
// })
// .catch(() => {
// this.sureBtnLoading = false;
// });
createOfficeFile({
extendName: this.extendName,
filePath: this.filePath,
fileName: this.form.fileName,
})
.then((res) => {
this.sureBtnLoading = false;
if (res.success && res.code === 0) {
this.$message.success("文件创建成功");
this.$refs[formName].resetFields();
this.visible = false;
this.callback("confirm");
} else {
this.$message.warning(res.message);
}
})
.catch(() => {
this.sureBtnLoading = false;
});
} else {
this.sureBtnLoading = false;
return false;
......
......@@ -78,6 +78,9 @@ export default {
this.onlyOneChild = null;
return {};
},
mounted() {
// console.log("this.onlyOneChild", this.onlyOneChild);
},
methods: {
hasOneShowingChild(children = [], parent) {
if (!children) {
......
......@@ -57,7 +57,7 @@ const fileFunction = {
* @returns {string} 流式图片
*/
getMinImgStream(row) {
return `${process.env.VUE_APP_BASE_QW_API}/filetransfer/preview?userFileId=${row.userFileId
return `${process.env.VUE_APP_BASE_API}/filetransfer/preview?userFileId=${row.userFileId
}&isMin=true&shareBatchNum=${row.shareBatchNum == null ? '' : row.shareBatchNum
}&extractionCode=${row.extractionCode == null ? '' : row.extractionCode}`
},
......@@ -67,7 +67,7 @@ const fileFunction = {
* @returns {string} 文件路径
*/
getViewFilePath(row) {
return `${process.env.VUE_APP_BASE_QW_API}/filetransfer/preview?userFileId=${row.userFileId
return `${process.env.VUE_APP_BASE_API}/filetransfer/preview?userFileId=${row.userFileId
}&isMin=false&shareBatchNum=${row.shareBatchNum == null ? '' : row.shareBatchNum
}&extractionCode=${row.extractionCode == null ? '' : row.extractionCode}`
},
......@@ -77,7 +77,7 @@ const fileFunction = {
* @returns {string} 文件下载路径
*/
getDownloadFilePath(row) {
return `${process.env.VUE_APP_BASE_QW_API}/filetransfer/downloadfile?userFileId=${row.userFileId
return `${process.env.VUE_APP_BASE_API}/filetransfer/downloadfile?userFileId=${row.userFileId
}&shareBatchNum=${row.shareBatchNum == null ? '' : row.shareBatchNum
}&extractionCode=${row.extractionCode == null ? '' : row.extractionCode}`
},
......@@ -87,7 +87,7 @@ const fileFunction = {
* @returns {string} office 文件创建路径
*/
createFileOnlineByOffice(data) {
let fileUrl = `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_QW_API}`
let fileUrl = `${location.protocol}//${location.host}${process.env.VUE_APP_BASE_API}`
const { href } = router.resolve({
name: 'Onlyoffice',
query: {
......
......@@ -28,7 +28,7 @@ export const staticRouters = [
{
path: 'myCreate',
component: () => import('@/views/mine/myCreate/index.vue'),
name: 'MyDoc',
name: 'MyCreate',
meta: {
title: '我的创作',
icon: 'dashboard',
......
......@@ -45,7 +45,7 @@
<span class="card-more" @click="handleToCreate"> 更多 </span>
</template>
<el-table :data="createList.records" size="small">
<el-table-column width="400px" label="名称" prop="name">
<el-table-column width="280px" label="名称" prop="name">
<template slot-scope="scope">
<svg-icon icon-class="word"></svg-icon>
</template>
......@@ -62,7 +62,7 @@
<span class="card-more" @click="handleToRead"> 更多 </span>
</template>
<el-table :data="readList.records" size="small">
<el-table-column width="400px" label="名称">
<el-table-column width="280px" label="名称" show-overflow-tooltip>
<template slot-scope="{ row }">
<span class="name" @click="handleClickName(row)"
><svg-icon
......
......@@ -9,6 +9,24 @@ export default {
components: {
FileList,
},
data() {
return {
isInit: false,
};
},
mounted() {
this.isInit = false;
// 读取当前的查询参数
const currentQueryParams = this.$route.query;
// 修改查询参数,例如,给 "filePath" 参数设置新的值
const newFileType = MY_CREATE;
const newQueryParams = { ...currentQueryParams, fileType: newFilePath };
// 使用 this.$router.push() 导航到当前路由,并传递新的查询参数
this.$router.push({ query: newQueryParams });
this.isInit = true;
},
};
</script>
<style lang="scss"></style>
......@@ -17,7 +17,7 @@
<div v-if="item" class="item">
<div class="item-left" :title="item.name">
<svg-icon
:icon-class="getIcon(item)"
:icon-class="getFileIcon(item)"
style="margin-right: 4px"
></svg-icon>
<span>{{ item.name }}</span>
......@@ -30,7 +30,7 @@
</el-row>
</div>
<div :span="19" class="right">
<div class="singleArticle" v-if="currentFile.name">
<div class="single-article">
<el-row class="info">
<el-col :span="8" class="center">{{ currentFile.name }}</el-col>
<el-col :span="8" class="center">{{ currentFile.author }}</el-col>
......@@ -39,14 +39,31 @@
>
</el-row>
<div>
<div class="card-group">
<el-card
class="info"
class="card-item"
shadow="hover"
v-for="(item, index) in mockNote.data"
:key="index"
>
{{ item }}
<div class="oprations">
<el-link type="primary"><i class="el-icon-edit"></i></el-link>
<el-link type="danger"><i class="el-icon-delete"></i></el-link>
</div>
<div class="bookmark">
<span>
<svg-icon :icon-class="getNoteTypeIcon(item.type)" />
{{ item.subject }}:
</span>
<span> {{ item.bookmarkContent }}</span>
</div>
<div class="source">
<span>
<svg-icon icon-class="source" />
来源:
</span>
<span>{{ item.docName }}</span>
</div>
</el-card>
</div>
</div>
......@@ -69,7 +86,7 @@ export default {
};
},
computed: {
getIcon(row) {
getFileIcon(row) {
return (row) => {
const { showType } = row;
if (["doc", "docx", "word"].includes(row.showType)) {
......@@ -79,6 +96,11 @@ export default {
}
};
},
getNoteTypeIcon(type) {
return (type) => {
return type ? type : "underline";
};
},
},
mounted() {
this.loadBookMarkList();
......@@ -151,13 +173,37 @@ export default {
.right {
flex: 1;
padding: 0 16px 16px;
.info {
padding: 16px;
border-bottom: 1px solid #e7e7e7;
margin-bottom: 8px;
.center {
display: flex;
justify-content: center;
// 单篇文章
.single-article {
//文章基本信息
.info {
padding: 16px;
border-bottom: 1px solid #e7e7e7;
margin-bottom: 8px;
.center {
display: flex;
justify-content: center;
}
}
.card-group {
.card-item {
font-size: 14px;
margin-bottom: 16px;
.oprations {
display: flex;
justify-content: flex-end;
}
.bookmark {
.svg-icon {
color: $theme-blue;
}
}
.source {
.svg-icon {
color: $danger;
}
}
}
}
}
}
......
......@@ -35,7 +35,7 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://192.168.1.230:8091`,
target: `http://192.168.1.230:9600`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论