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

我的笔记新增按标签分类模块

上级 0d79d6bd
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
import request from '@/utils/request' import request from '@/utils/request'
import qs from 'qs'
const baseUrl = '/v1/api' const baseUrl = '/v1/api'
export const getBookMarkList = params => { export const getBookMarkList = params => {
...@@ -44,7 +45,9 @@ export const pdfRemoveMark = data => { ...@@ -44,7 +45,9 @@ export const pdfRemoveMark = data => {
data data
}) })
} }
export const addOrUpdateBookMarkDoc = data => {
// 新增和编辑笔记-doc
export const addOrUpdateNoteDoc = data => {
return request({ return request({
url: baseUrl + '/doc/bookmark/addOrUpdate', url: baseUrl + '/doc/bookmark/addOrUpdate',
method: 'post', method: 'post',
...@@ -52,10 +55,21 @@ export const addOrUpdateBookMarkDoc = data => { ...@@ -52,10 +55,21 @@ export const addOrUpdateBookMarkDoc = data => {
}) })
} }
export const addOrUpdateBookMarkPdf = data => { // 新增和编辑笔记-pdf
export const addOrUpdateNotePdf = data => {
return request({ return request({
url: baseUrl + '/doc/bookmark/pdf/addOrUpdate', url: baseUrl + '/doc/bookmark/pdf/addOrUpdate',
method: 'post', method: 'post',
data data
}) })
} }
// 删除笔记
export const deleteNote = data => {
return request({
url: baseUrl + '/doc/bookmark/delete',
method: 'post',
data: qs.stringify(data),
headers: { 'content-type': 'application/x-www-form-urlencoded' }
})
}
<?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="1693794833067" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2373" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M863.286375 564.350417l109.00951-108.71652V211.917933L780.732138 20.802289H539.360094l-13.081141 13.046672L103.40823 455.340907l0.137878 0.137878L0 558.749137l433.401128 434.331802 151.596465-151.200067c27.230834 93.067407 113.197543 161.299604 214.934007 161.299604 123.538366 0 224.051166-100.5128 224.051165-224.051165 0.017235-101.529647-67.921973-187.375713-160.69639-214.778894zM766.479037 55.271699l171.347438 170.951039v215.089119l-115.300177 114.903779c-1.620062-0.172347-3.291829-0.120643-4.929126-0.258521l-3.826104-0.327459-2.998839-0.258521a193.959371 193.959371 0 0 0-10.823395-0.327459c-123.538366 0-224.051166 100.5128-224.051165 224.051165 0 3.429706 0.103408 6.911117 0.310225 10.530405 0.068939 1.240899 0.224051 2.585206 0.310224 3.860574l0.275756 3.446941c0.103408 1.309838 0.068939 2.671379 0.206816 3.981217l-40.122393 40.00175-384.575209-385.368004L553.613195 55.271699h212.865842zM48.756981 558.818076l79.141765-78.934949 384.695851 385.523117-79.141765 78.934949L48.756981 558.818076z m751.191853 409.89299c-95.635378 0-174.742674-71.248271-187.565294-163.402238l-0.051705-0.344694c-0.379164-2.774788-0.568745-5.170412-0.8445-7.721148-0.137878-1.258133-0.310225-2.619675-0.413633-3.826105-0.361929-4.739544-0.723858-9.461853-0.723858-14.28757 0-104.528486 85.053269-189.581755 189.581756-189.581756 4.842952 0 9.599731 0.361929 14.356509 0.723858l2.395624 0.258521c3.102247 0.310225 6.135555 0.58598 9.582496 1.068551l0.430868 0.051704c91.878213 13.081141 162.816259 92.05056 162.816258 187.461887 0.017235 104.562955-85.036035 189.59899-189.564521 189.59899z" p-id="2374"></path><path d="M903.357065 761.894606h-86.173525v-86.173525a17.234705 17.234705 0 1 0-34.469411 0v86.173525h-86.173525a17.234705 17.234705 0 1 0 0 34.46941h86.173525v86.173525a17.234705 17.234705 0 1 0 34.469411 0v-86.173525h86.173525a17.234705 17.234705 0 1 0 0-34.46941zM731.268535 311.551763c37.39931 0 67.818564-30.419254 67.818564-67.818564s-30.419254-67.835799-67.818564-67.835799-67.835799 30.436489-67.835799 67.835799 30.436489 67.818564 67.835799 67.818564z m0-101.167719c18.38943 0 33.349154 14.959724 33.349154 33.366389a33.400858 33.400858 0 0 1-33.349154 33.349155 33.400858 33.400858 0 0 1-33.366389-33.349155c0-18.406665 14.959724-33.366389 33.366389-33.366389z" p-id="2375"></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="1693797030803" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2498" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M0.65995 468.63725l159.772685 0 0 42.630015-159.772685 0 0-42.630015Z" p-id="2499"></path><path d="M863.150181 468.63725l159.772685 0 0 42.630015-159.772685 0 0-42.630015Z" p-id="2500"></path><path d="M0.301349 0 0.301349 383.682563 42.931364 383.682563 42.931364 42.629127 981.070411 42.629127 981.070411 382.148745 1023.698651 382.148745 1023.698651 0Z" p-id="2501"></path><path d="M981.070411 980.484134 42.931364 980.484134 42.931364 604.522143 0.301349 604.522143 0.301349 1023.112374 1023.698651 1023.112374 1023.698651 604.522143 981.070411 604.522143Z" p-id="2502"></path><path d="M479.5981 576.137638l127.857203 0 0 126.252375c0 19.40528-6.873776 27.720561-25.168636 27.720561-15.522804 0-31.046495-0.554766-46.571075-1.665186 3.325047 13.861168 9.314748 27.498654 10.977271 39.141645 18.851402 0 36.592383 0.887626 52.668178 0.33286 36.592383-1.660748 51.560421-20.623991 51.560421-58.321468L650.921462 576.137638l84.333349 0L735.25481 342.127463 623.997989 342.127463l17.627365-42.133832 137.145322 0 0-43.023233L371.826098 256.970397l0 209.246296c0 142.48173-15.522804 199.573835-63.200748 272.755051 12.195982 8.870047 28.166149 19.40528 38.700495 28.828318 52.668178-91.477851 68.190094-156.332246 68.190094-302.138135L415.515939 299.993631l178.209565 0-16.632336 42.133832L479.5981 342.127463 479.5981 576.137638zM523.063371 480.726716l168.390646 0 0 52.224365L523.063371 532.951081 523.063371 480.726716zM523.063371 384.709546l168.390646 0 0 54.650247L523.063371 439.359793 523.063371 384.709546zM273.81177 768.254527c14.415934-65.972804 32.156028-143.587712 46.015421-200.13659-12.750748-3.880701-40.366569-13.864719-50.900027-18.297523-12.198644 60.426917-30.493504 138.598366-47.678832 201.245235L273.81177 768.254527zM765.371961 734.095127l38.03655-29.163841c-26.611028-33.264673-53.221169-64.866822-84.26944-99.792244l-35.817485 25.837018C712.703783 665.905033 738.207054 698.612276 765.371961 734.095127zM470.420046 742.632314c29.937851-34.925421 57.657524-70.407384 84.268552-108.660515l-40.699429-28.278878c-21.619907 34.371543-49.340468 70.404721-80.386963 103.116403C442.474029 716.018623 460.441355 733.211051 470.420046 742.632314zM309.175678 372.420364l40.920447-40.92311c-26.05715-24.946729-52.668178-49.33958-79.833972-73.177665l-39.256149 37.040634C256.508388 319.19742 284.229836 346.918868 309.175678 372.420364zM298.203733 506.468758l40.366569-42.363727c-26.611916-24.391963-53.222056-47.678832-82.05215-71.517804L218.923639 431.62857C247.198966 457.130066 272.145695 480.412496 298.203733 506.468758z" p-id="2503"></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="1693797033594" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2650" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M512 42.666667C251.733333 42.666667 42.666667 251.733333 42.666667 512s209.066667 469.333333 469.333333 469.333333 469.333333-209.066667 469.333333-469.333333S772.266667 42.666667 512 42.666667z m0 896C277.333333 938.666667 85.333333 746.666667 85.333333 512S277.333333 85.333333 512 85.333333s426.666667 192 426.666667 426.666667-192 426.666667-426.666667 426.666667z" p-id="2651"></path><path d="M716.8 279.466667l-283.733333 142.933333c-4.266667 2.133333-8.533333 6.4-8.533334 8.533333l-142.933333 283.733334c-4.266667 8.533333-2.133333 17.066667 4.266667 25.6 4.266667 4.266667 8.533333 6.4 14.933333 6.4 4.266667 0 6.4 0 8.533333-2.133334l283.733334-142.933333c4.266667-2.133333 8.533333-6.4 8.533333-8.533333l142.933333-283.733334c4.266667-8.533333 2.133333-17.066667-4.266666-25.6-6.4-6.4-17.066667-8.533333-23.466667-4.266666z m-270.933333 196.266666l100.266666 100.266667-200.533333 100.266667 100.266667-200.533334z m132.266666 72.533334L477.866667 448l200.533333-100.266667-100.266667 200.533334z" p-id="2652"></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="1693794836142" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2522" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M583.9696 104.64l270.9136 0.6144c35.232 0.08 63.776 28.624 63.856 63.856l0.6144 270.912a64 64 0 0 1-18.7456 45.4016L476.784 909.248c-24.9936 24.9936-65.5168 24.9936-90.5104 0L114.7456 637.72c-24.9936-24.9936-24.9936-65.5168 0-90.5104l423.824-423.824A64 64 0 0 1 583.9696 104.64z m-0.1088 48a16 16 0 0 0-11.3504 4.6864L148.688 581.1504c-6.248 6.248-6.248 16.3792 0 22.6272l271.5296 271.5296c6.248 6.248 16.3776 6.248 22.6272 0l423.824-423.824a16 16 0 0 0 4.6864-11.3504l-0.616-270.9136c-0.0192-8.808-7.1552-15.944-15.9632-15.9648L583.8608 152.64zM672 256c53.0192 0 96 42.9808 96 96s-42.9808 96-96 96-96-42.9808-96-96 42.9808-96 96-96z m0 48c-26.5104 0-48 21.4896-48 48 0 26.5104 21.4896 48 48 48 26.5104 0 48-21.4896 48-48 0-26.5104-21.4896-48-48-48z" p-id="2523"></path></svg>
\ No newline at end of file
...@@ -326,11 +326,6 @@ export default { ...@@ -326,11 +326,6 @@ export default {
}, },
// 批量下载文件链接 // 批量下载文件链接
batchDownloadLink() { batchDownloadLink() {
// return `${
// process.env.VUE_APP_BASE_API
// }/filetransfer/batchDownloadFile?userFileIds=${this.selectedFiles
// .map((item) => item.userFileId)
// .join(",")}`;
return `${ return `${
process.env.VUE_APP_BASE_API process.env.VUE_APP_BASE_API
}/v1/api/folder/transfer/batchDownloadFile?userFileIds=${this.selectedFiles }/v1/api/folder/transfer/batchDownloadFile?userFileIds=${this.selectedFiles
......
...@@ -302,13 +302,8 @@ const fileFunction = { ...@@ -302,13 +302,8 @@ const fileFunction = {
*/ */
handleFileNameClickNew(row, currentIndex = 0, fileList = []) { handleFileNameClickNew(row, currentIndex = 0, fileList = []) {
console.log('row', row); console.log('row', row);
// 如果当前文件在回收站中,则不允许预览
// if (row.deleteFlag !== undefined && row.deleteFlag !== 0) {
// return false
// }
// 若是文件夹则进入该文件夹 // 若是文件夹则进入该文件夹
if (row.isDir) { if (row.isDir) {
// debugger
if (router.currentRoute.name === 'Share') { if (router.currentRoute.name === 'Share') {
// 当前是查看他人分享列表的页面 // 当前是查看他人分享列表的页面
router.push({ router.push({
...@@ -342,7 +337,8 @@ const fileFunction = { ...@@ -342,7 +337,8 @@ const fileFunction = {
const WORD = ['doc', 'docx'] const WORD = ['doc', 'docx']
const PDF = ['pdf'] const PDF = ['pdf']
// 若当前点击项是word // 若当前点击项是word
if (WORD.includes(row.extendName.toLowerCase()) || WORD.includes(row.suffix.toLowerCase())) { let extentName = row.extendName || row.suffix || row.showType
if (WORD.includes(extentName.toLowerCase())) {
let flag = false let flag = false
const { fileId, userId, id } = row const { fileId, userId, id } = row
...@@ -354,35 +350,35 @@ const fileFunction = { ...@@ -354,35 +350,35 @@ const fileFunction = {
fileId: fileId, fileId: fileId,
flag flag
} }
// 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')
getViewUrlDbPath(params).then(res => {
if (res.data) {
// console.log('res.data', res.data);
// 跳转 使用sessionStorage,避免关键信息在ip中暴露
// 使用push会停留当前页面,故不采纳
// params 传递参数,子组件无法渲染iframe组件,故不采纳
localStorage.wpsUrl = res.data.wpsUrl
localStorage.token = res.data.token
let resolve = router.resolve({ let resolve = router.resolve({
path: '/wpsReader', path: '/wpsReader',
query: { query: {
wpsUrl: res.data.wpsUrl, 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`,
token: res.data.token // 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') window.open(resolve.href, '_blank')
} // getViewUrlDbPath(params).then(res => {
}) // if (res.data) {
return false // // console.log('res.data', res.data);
// // 跳转 使用sessionStorage,避免关键信息在ip中暴露
// // 使用push会停留当前页面,故不采纳
// // params 传递参数,子组件无法渲染iframe组件,故不采纳
// localStorage.wpsUrl = res.data.wpsUrl
// localStorage.token = res.data.token
// let resolve = router.resolve({
// path: '/wpsReader',
// query: {
// wpsUrl: res.data.wpsUrl,
// token: res.data.token
// }
// })
// window.open(resolve.href, '_blank')
// }
// })
// return false
} }
// 若当前点击项是pdf // 若当前点击项是pdf
if (PDF.includes(row.extendName.toLowerCase())) { if (PDF.includes(row.extendName.toLowerCase())) {
......
...@@ -388,3 +388,26 @@ export function isNumberStr(str) { ...@@ -388,3 +388,26 @@ export function isNumberStr(str) {
return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str)
} }
// 复制文字到剪切板
export function textCopy(t) {
// 如果当前浏览器版本不兼容navigator.clipboard
if (!navigator.clipboard) {
var ele = document.createElement("input");
ele.value = t;
document.body.appendChild(ele);
ele.select();
document.execCommand("copy");
document.body.removeChild(ele);
if (document.execCommand("copy")) {
console.log("复制成功!");
} else {
console.log("复制失败!");
}
} else {
navigator.clipboard.writeText(t).then(function () {
console.log("复制成功!");
}).catch(function () {
console.log("复制失败!");
})
}
}
import { textCopy } from "@/utils/index";
import { addOrUpdateNoteDoc, deleteNote } from "@/api/doc/bookMark";
import AddOrUpdateNoteDialog from "@/views/read/wpsReader/component/addOrUpdateNoteDialog.vue";
export default {
components:{
AddOrUpdateNoteDialog
},
methods: {
// 笔记操作
handleNoteOperation(type, item) {
switch (type) {
case "copyOrigin":
textCopy(item.bookmarkContent);
this.$message.success("已复制到剪贴板");
break;
case "copyNote":
textCopy(item.noteContent);
this.$message.success("已复制到剪贴板");
break;
case "view":
this.$file.handleFileNameClickNew(item);
break;
case "edit":
this.handleOpenEditNote(item);
break;
case "delete":
this.handleDeleteNote(item);
break;
}
},
// 打开笔记
handleOpenEditNote(item) {
const { id, docId, bookmarkContent, noteContent, tagName } = item;
this.form = {
id,
docId,
bookmarkContent,
noteContent,
tagsArr: tagName.split(","),
};
this.$refs.AddOrUpdateNoteDialog.dialogVisible = true;
},
// 删除笔记
async handleDeleteNote(item) {
this.loading = true;
const params = {
id: item.id,
};
let res = await deleteNote(params);
if (res.code == 200) {
this.$message.success("操作成功");
}
this.loading = false;
},
}
}
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane name="byFile"> <el-tab-pane name="byFile">
<span slot="label"><i class="el-icon-document"></i> 按文件分类</span> <span slot="label"><i class="el-icon-document"></i> 按文件分类</span>
<NoteByFile /> <NoteByFile ref="NoteByFile" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="byTag"> <el-tab-pane name="byTag">
<span slot="label"><i class="el-icon-price-tag"></i> 按标签分类</span> <span slot="label"><i class="el-icon-price-tag"></i> 按标签分类</span>
<NoteByTag /> <NoteByTag ref="NoteByTag" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
...@@ -25,6 +25,15 @@ export default { ...@@ -25,6 +25,15 @@ export default {
activeName: "byFile", activeName: "byFile",
}; };
}, },
watch: {
activeName(value) {
if (value == "byFile") {
this.$refs.NoteByFile.loadfileList();
} else {
this.$refs.NoteByTag.loadtagList();
}
},
},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -33,6 +42,7 @@ export default { ...@@ -33,6 +42,7 @@ export default {
} }
::v-deep .el-tabs__header { ::v-deep .el-tabs__header {
padding: 0 20px; padding: 0 20px;
margin: 0 !important;
} }
::v-deep .el-tab-pane { ::v-deep .el-tab-pane {
height: calc(100vh - 138px); height: calc(100vh - 138px);
......
...@@ -34,6 +34,14 @@ ...@@ -34,6 +34,14 @@
</el-form> </el-form>
<div class="mb8"> <div class="mb8">
<el-button
type="primary"
plain
size="mini"
:disabled="multiple"
@click.native="handleMultiDownload"
>批量下载</el-button
>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :showSearch.sync="showSearch"
@queryTable="getList" @queryTable="getList"
...@@ -79,7 +87,7 @@ ...@@ -79,7 +87,7 @@
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.shareFrom}} {{ scope.row.shareFrom }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -95,6 +103,16 @@ ...@@ -95,6 +103,16 @@
> >
预览 预览
</el-link> </el-link>
<el-divider direction="vertical"></el-divider>
<el-link
target="_blank"
type="primary"
icon="el-icon-download"
:href="$file.getDownloadFilePath(scope.row)"
:download="scope.row.fileName + '.' + scope.row.extendName"
>
下载
</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -105,14 +123,15 @@ ...@@ -105,14 +123,15 @@
:limit.sync="queryParams.pageCount" :limit.sync="queryParams.pageCount"
@pagination="getList" @pagination="getList"
/> />
<!-- 多选文件下载,页面隐藏 -->
<a :href="batchDownloadLink" ref="batchDownloadRef"></a>
</div> </div>
</template> </template>
<script> <script>
import { getMyShareList, removeShare } from "@/api/user/share"; import { getMyShareList, removeShare } from "@/api/user/share";
import { shareStatusConstant } from "../constant"; import { shareStatusConstant } from "../constant";
import store from '@/store' import { mapGetters } from "vuex";
// const myUserId = store.user.userInfo.id
export default { export default {
name: "myShare", name: "myShare",
dicts: ["share_type", "share_status"], dicts: ["share_type", "share_status"],
...@@ -121,7 +140,7 @@ export default { ...@@ -121,7 +140,7 @@ export default {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
shareIdsArr: [], selectedFiles: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -144,28 +163,41 @@ export default { ...@@ -144,28 +163,41 @@ export default {
pageCount: 10, pageCount: 10,
fileName: "", //文件名称 fileName: "", //文件名称
shareStatus: "", //分享状态 shareStatus: "", //分享状态
shareTo:'',//分享人 shareTo: "", //分享给谁
}, },
// 分享状态常量 // 分享状态常量
shareStatusConstant, shareStatusConstant,
// 批量取消的弹窗可见性 // 批量取消的弹窗可见性
multiCancelVisible: false, multiCancelVisible: false,
shareIdsArr: [], selectedFiles: [],
}; };
}, },
computed: {
...mapGetters(["userInfo"]),
// 批量下载文件链接
batchDownloadLink() {
return `${
process.env.VUE_APP_BASE_API
}/v1/api/folder/transfer/batchDownloadFile?userFileIds=${this.selectedFiles
.map((item) => item.userFileId)
.join(",")}`;
},
},
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.shareIdsArr = selection.map((item) => item.shareId); this.selectedFiles = selection;
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
/** 查询字典类型列表 */ /** 查询字典类型列表 */
getList() { getList() {
this.loading = true; this.loading = true;
// 分享给我的
this.queryParams.shareTo = this.userInfo.userId;
getMyShareList(this.queryParams).then((res) => { getMyShareList(this.queryParams).then((res) => {
this.total = res.data.total; this.total = res.data.total;
this.loading = false; this.loading = false;
...@@ -196,6 +228,10 @@ export default { ...@@ -196,6 +228,10 @@ export default {
handleOpenFile(file) { handleOpenFile(file) {
this.$file.handleFileNameClickNew(file); this.$file.handleFileNameClickNew(file);
}, },
// 批量下载
handleMultiDownload() {
this.$refs["batchDownloadRef"].click();
},
}, },
}; };
</script> </script>
......
...@@ -165,6 +165,8 @@ ...@@ -165,6 +165,8 @@
:limit.sync="queryParams.pageCount" :limit.sync="queryParams.pageCount"
@pagination="getList" @pagination="getList"
/> />
<!-- 多选文件下载,页面隐藏 -->
<a :href="batchDownloadLink" ref="batchDownloadRef"></a>
<el-dialog <el-dialog
title="批量取消" title="批量取消"
:visible.sync="multiCancelVisible" :visible.sync="multiCancelVisible"
...@@ -172,7 +174,7 @@ ...@@ -172,7 +174,7 @@
> >
<div class="multi-verify"> <div class="multi-verify">
<div class="text"> <div class="text">
一共选择了{{ shareIdsArr.length }}条数据,是否确定批量取消分享? 一共选择了{{ selectedFiles.length }}条数据,是否确定批量取消分享?
</div> </div>
<div class="buttons"> <div class="buttons">
<el-button <el-button
...@@ -197,7 +199,7 @@ ...@@ -197,7 +199,7 @@
<script> <script>
import { getMyShareList, removeShare } from "@/api/user/share"; import { getMyShareList, removeShare } from "@/api/user/share";
import { shareStatusConstant } from "../constant"; import { shareStatusConstant } from "../constant";
import { mapGetters } from "vuex";
export default { export default {
name: "myShare", name: "myShare",
dicts: ["share_type", "share_status"], dicts: ["share_type", "share_status"],
...@@ -206,7 +208,7 @@ export default { ...@@ -206,7 +208,7 @@ export default {
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
shareIdsArr: [], selectedFiles: [],
// 非单个禁用 // 非单个禁用
single: true, single: true,
// 非多个禁用 // 非多个禁用
...@@ -234,10 +236,10 @@ export default { ...@@ -234,10 +236,10 @@ export default {
shareStatusConstant, shareStatusConstant,
// 批量取消的弹窗可见性 // 批量取消的弹窗可见性
multiCancelVisible: false, multiCancelVisible: false,
shareIdsArr: [],
}; };
}, },
computed: { computed: {
...mapGetters(["userInfo"]),
getShareStatusTagType(shareStatus) { getShareStatusTagType(shareStatus) {
return (shareStatus) => { return (shareStatus) => {
switch (shareStatus) { switch (shareStatus) {
...@@ -252,6 +254,14 @@ export default { ...@@ -252,6 +254,14 @@ export default {
} }
}; };
}, },
// 批量下载文件链接
batchDownloadLink() {
return `${
process.env.VUE_APP_BASE_API
}/v1/api/folder/transfer/batchDownloadFile?userFileIds=${this.selectedFiles
.map((item) => item.userFileId)
.join(",")}`;
},
}, },
created() { created() {
this.getList(); this.getList();
...@@ -259,13 +269,14 @@ export default { ...@@ -259,13 +269,14 @@ export default {
methods: { methods: {
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.shareIdsArr = selection.map((item) => item.shareId); this.selectedFiles = selection;
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
}, },
/** 查询字典类型列表 */ /** 查询字典类型列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.shareFrom = this.userInfo.userId;
getMyShareList(this.queryParams).then((res) => { getMyShareList(this.queryParams).then((res) => {
this.total = res.data.total; this.total = res.data.total;
this.loading = false; this.loading = false;
...@@ -308,10 +319,12 @@ export default { ...@@ -308,10 +319,12 @@ export default {
this.multiCancelVisible = true; this.multiCancelVisible = true;
}, },
// 批量下载 // 批量下载
handleMultiDownload() {}, handleMultiDownload() {
this.$refs["batchDownloadRef"].click();
},
// 提交批量取消分享 // 提交批量取消分享
handleSubmitMultiRemoveShare() { handleSubmitMultiRemoveShare() {
const fileIds = this.shareIdsArr.join(","); const fileIds = this.selectedFiles.map((item) => item.shareId).join(",");
this.handleCancelShare(fileIds); this.handleCancelShare(fileIds);
this.handleCloseMultiRemoveShare(); this.handleCloseMultiRemoveShare();
}, },
......
<template> <template>
<!-- doc文档的新增或更新笔记--> <!-- doc文档的新增或更新笔记-->
<el-dialog <el-dialog
title="添加笔记" :title="formData.docId ? '编辑笔记' : '新增笔记'"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="500px" width="500px"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<el-form-item label="标签" disabled style="width: 100%"> <el-form-item label="标签" disabled style="width: 100%">
<el-select <el-select
style="width: 100%" style="width: 100%"
v-model="tagsArr" v-model="form.tagsArr"
multiple multiple
filterable filterable
remote remote
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
</template> </template>
<script> <script>
import { addOrUpdateBookMarkDoc } from "@/api/doc/bookMark"; import { addOrUpdateNoteDoc } from "@/api/doc/bookMark";
import { tagSuggest } from "@/api/doc/tag"; import { tagSuggest } from "@/api/doc/tag";
export default { export default {
...@@ -67,8 +67,11 @@ export default { ...@@ -67,8 +67,11 @@ export default {
formData: { formData: {
type: Object, type: Object,
default: () => ({ default: () => ({
id:"",//笔记id
docId: "", //文档Id docId: "", //文档Id
bookmarkContent: "", //笔记内容 bookmarkContent: "", //笔记内容
noteContent: "", //标签,提交给后台的时候使用多个用逗号分割
tagsArr: [], //笔记标签
}), }),
}, },
}, },
...@@ -76,15 +79,16 @@ export default { ...@@ -76,15 +79,16 @@ export default {
return { return {
dialogVisible: false, //新建笔记窗口可见性 dialogVisible: false, //新建笔记窗口可见性
form: { form: {
id:'',
docId: "", docId: "",
docSType: "doc", //文档类型 docSType: "doc", //文档类型
bookmarkContent: "", //原文 bookmarkContent: "", //原文
noteContent: "", //笔记 noteContent: "", //笔记
tagsArr: "", //标签,提交给后台的时候使用多个用逗号分割
type: "note", // 笔记类型,新增时必传,[underline-下划线,note-笔记,highlight-高亮] type: "note", // 笔记类型,新增时必传,[underline-下划线,note-笔记,highlight-高亮]
offset: "0", //偏移量,新增时必传 offset: "0", //偏移量,新增时必传
sectionId: "0", //父节点ID,新增时必传 sectionId: "0", //父节点ID,新增时必传
}, },
tagsArr: [], //标签,提交给后台的时候使用多个用逗号分割
options: [], //标签可选项 options: [], //标签可选项
rules: { rules: {
noteContent: [ noteContent: [
...@@ -101,12 +105,7 @@ export default { ...@@ -101,12 +105,7 @@ export default {
watch: { watch: {
formData: { formData: {
handler(value) { handler(value) {
console.log("value", value); this.form = { ...this.form, ...value };
const { docId, bookmarkContent } = value;
if (docId && bookmarkContent) {
this.form.docId = docId;
this.form.bookmarkContent = bookmarkContent;
}
}, },
deep: true, deep: true,
immediate: true, immediate: true,
...@@ -118,16 +117,21 @@ export default { ...@@ -118,16 +117,21 @@ export default {
handleSubmitAddNote() { handleSubmitAddNote() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
if (valid) { if (valid) {
this.loading = true;
const formData = new FormData(); const formData = new FormData();
for (const key in this.form) { for (const key in this.form) {
if (key == "tagsArr") {
formData.append("tags", this.form.tagsArr.join(","));
} else {
formData.append(key, this.form[key]); formData.append(key, this.form[key]);
} }
formData.append("tags", this.tagsArr.join(",")); }
let res = await addOrUpdateBookMarkDoc(formData); let res = await addOrUpdateNoteDoc(formData);
this.loading = false;
if (res.code == 200) { if (res.code == 200) {
this.$message.success('新建笔记成功!') this.$message.success("操作成功!");
this.dialogVisible = false this.dialogVisible = false;
this.$emit('update') this.$emit("update");
} }
} }
}); });
......
...@@ -29,7 +29,9 @@ export default { ...@@ -29,7 +29,9 @@ export default {
controlButton: null, //新建笔记按钮 controlButton: null, //新建笔记按钮
form: { form: {
docId: "", //文档Id docId: "", //文档Id
bookmarkContent: "", //笔记内容 bookmarkContent: "", //原文内容
noteContent: "", //笔记内容
tagsArr: [], //标签
}, },
}; };
}, },
......
...@@ -35,9 +35,9 @@ module.exports = { ...@@ -35,9 +35,9 @@ module.exports = {
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
target: `http://222.85.214.245:9600`, // target: `http://222.85.214.245:9600`,
// target: `http://222.85.214.245:9558`, // target: `http://222.85.214.245:9558`,
// target: `http://172.24.100.246:9600`, target: `http://172.24.100.246:9600`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: '' ['^' + process.env.VUE_APP_BASE_API]: ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论