整理目录结构

This commit is contained in:
WangHao
2020-09-20 21:16:14 +08:00
parent b1a03bcce1
commit 262fb3611f
18 changed files with 1393 additions and 1807 deletions

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询share书签分享列表
export function listShare(query) {
return request({
url: '/note/share/list',
method: 'get',
params: query
})
}
// 查询share书签分享详细
export function getShare(noteId) {
return request({
url: '/note/share/' + noteId,
method: 'get'
})
}
// 新增share书签分享
export function addShare(data) {
return request({
url: '/note/share',
method: 'post',
data: data
})
}
// 修改share书签分享
export function updateShare(data) {
return request({
url: '/note/share',
method: 'put',
data: data
})
}
// 删除share书签分享
export function delShare(noteId) {
return request({
url: '/note/share/' + noteId,
method: 'delete'
})
}
// 导出share书签分享
export function exportShare(query) {
return request({
url: '/note/share/export',
method: 'get',
params: query
})
}

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'
// 查询便签标签列表
// 查询便签标签列表
export function listTag(query) {
return request({
url: '/note/tag/list',
@ -9,15 +9,15 @@ export function listTag(query) {
})
}
// 查询便签标签详细
export function getTag(id) {
// 查询便签标签详细
export function getTag(noteTagId) {
return request({
url: '/note/tag/' + id,
url: '/note/tag/' + noteTagId,
method: 'get'
})
}
// 新增便签标签
// 新增便签标签
export function addTag(data) {
return request({
url: '/note/tag',
@ -26,7 +26,7 @@ export function addTag(data) {
})
}
// 修改便签标签
// 修改便签标签
export function updateTag(data) {
return request({
url: '/note/tag',
@ -35,15 +35,15 @@ export function updateTag(data) {
})
}
// 删除便签标签
export function delTag(id) {
// 删除便签标签
export function delTag(noteTagId) {
return request({
url: '/note/tag/' + id,
url: '/note/tag/' + noteTagId,
method: 'delete'
})
}
// 导出便签标签
// 导出便签标签
export function exportTag(query) {
return request({
url: '/note/tag/export',

View File

@ -152,7 +152,7 @@ export const constantRoutes = [
{
path: '/content',
name: 'content',
component: resolve => require(['../views/bookmark/content/index.vue'], resolve),
component: resolve => require(['../views/bookmark/bookmark/index.vue'], resolve),
query:{
t:Date.now(),
},

View File

@ -1,376 +1,375 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
<el-form-item label="用户ID" prop="userid">
<el-input
v-model="queryParams.userid"
placeholder="请输入所属用户ID"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标题" prop="title">
<el-input
v-model="queryParams.title"
placeholder="请输入书签标题"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="书签地址" prop="url">-->
<!-- <el-input-->
<!-- v-model="queryParams.url"-->
<!-- placeholder="请输入书签地址"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="书签地址" prop="urls">-->
<!-- <el-input-->
<!-- v-model="queryParams.urls"-->
<!-- placeholder="请输入书签地址"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="书签描述" prop="description">-->
<!-- <el-input-->
<!-- v-model="queryParams.description"-->
<!-- placeholder="请输入书签描述"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="书签描述" prop="image">-->
<!-- <el-input-->
<!-- v-model="queryParams.image"-->
<!-- placeholder="请输入书签描述"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标签" prop="label">-->
<!-- <el-input-->
<!-- v-model="queryParams.label"-->
<!-- placeholder="请输入标签"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="分类ID" prop="menuId">-->
<!-- <el-input-->
<!-- v-model="queryParams.menuId"-->
<!-- placeholder="请输入分类ID"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="点赞数" prop="zcount">-->
<!-- <el-input-->
<!-- v-model="queryParams.zcount"-->
<!-- placeholder="请输入点赞数"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="0 未删除 1表示删除" prop="idelete">-->
<!-- <el-input-->
<!-- v-model="queryParams.idelete"-->
<!-- placeholder="请输入0 未删除 1表示删除"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="0公开显示 1隐藏显示 2好友显示 3稍后再看" prop="start">-->
<!-- <el-input-->
<!-- v-model="queryParams.start"-->
<!-- placeholder="请输入0公开显示 1隐藏显示 2好友显示 3稍后再看"-->
<!-- clearable-->
<!-- size="small"-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['bookmark:bookmark:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['bookmark:bookmark:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['bookmark:bookmark:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['bookmark:bookmark:export']"
>导出</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="bookmarkList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="ID" align="center" prop="bookmarkId" />
<el-table-column label="用户ID" align="center" prop="userid" />
<el-table-column label="书签标题" align="center" prop="title" />
<el-table-column label="标签" align="center" prop="label" />
<el-table-column label="点赞数" align="center" prop="zcount" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['bookmark:bookmark:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['bookmark:bookmark:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<template >
<div >
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改书签管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="所属用户ID" prop="userid">
<el-input v-model="form.userid" placeholder="请输入所属用户ID" />
</el-form-item>
<el-form-item label="书签标题" prop="title">
<el-input v-model="form.title" placeholder="请输入书签标题" />
</el-form-item>
<el-form-item label="书签地址" prop="url">
<el-input v-model="form.url" placeholder="请输入书签地址" />
</el-form-item>
<el-form-item label="书签地址" prop="urls">
<el-input v-model="form.urls" placeholder="请输入书签地址" />
</el-form-item>
<el-form-item label="书签描述" prop="description">
<el-input v-model="form.description" placeholder="请输入书签描述" />
</el-form-item>
<el-form-item label="书签描述" prop="image">
<el-input v-model="form.image" placeholder="请输入书签描述" />
</el-form-item>
<el-form-item label="标签" prop="label">
<el-input v-model="form.label" placeholder="请输入标签" />
</el-form-item>
<el-form-item label="分类ID" prop="menuId">
<el-input v-model="form.menuId" placeholder="请输入分类ID" />
</el-form-item>
<el-form-item label="点赞数" prop="zcount">
<el-input v-model="form.zcount" placeholder="请输入点赞数" />
</el-form-item>
<el-form-item label="0 未删除 1表示删除" prop="idelete">
<el-input v-model="form.idelete" placeholder="请输入0 未删除 1表示删除" />
</el-form-item>
<el-form-item label="0公开显示 1隐藏显示 2好友显示 3稍后再看" prop="start">
<el-input v-model="form.start" placeholder="请输入0公开显示 1隐藏显示 2好友显示 3稍后再看" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
<div class="filter" >
<div class="filter-sort" >
<el-dropdown trigger="click" size="small">
<span class="el-dropdown-link">
<span>按时间排序()</span> <i class="el-icon-caret-bottom"></i>
</span>
<el-dropdown-menu slot="dropdown" class="filter-sort-dropdown">
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按时间排序()</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按时间排序()</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按字母A-Z排序</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按字母A-Z排序</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按网站A-Z排序</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div >
<el-divider direction="vertical"></el-divider>
</div>
<div class="filler-tag">
<el-tag size="small">我的最爱</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >...</el-tag>
</div>
</div>
</el-dialog>
</div>
<div class="nullbookmark" v-if="showimg">
<div class="nullbookmark-img">
</div>
<div style="color: #000000" class="nullbookmark-text">
此目录还未添加书签
</div>
</div>
<div class="bookmarklist" v-loading="loading" v-if="showbookmark" >
<el-row >
<hr class="bookamrk-hr"/>
<el-col :span="24" v-for="bm in bookmarkList">
<div class="editBookamrk">
<div class="editlist">
<div> <el-button plain size="small" @click="handleUpdate(bm.bookmarkId)">修改</el-button></div>
<div> <el-button plain size="small" @click="handleDelete(bm.bookmarkId)">删除</el-button></div>
<div> <el-button plain size="small">笔记</el-button></div>
<div> <el-button plain size="small">分享</el-button></div>
</div>
</div>
<div class="bookmark" :data-id="bm.id" @click="windowurl(bm.url,bm.bookmarkId)">
<p class="bookmark-title">{{bm.title}}</p>
<div class="">
<p class="description">{{bm.description}}</p>
</div>
<div class="info-wrap">
<div class="info">
<div class="bookmark-icon">
<!-- <img :err-src='bm.icon' :ng-src="bm.icon" :src="bm.icon" />-->
<img :ng-src="'https://favicon.lucq.fun/?url=http://'+bm.urls" :src="'https://favicon.lucq.fun/?url=http://'+bm.urls" onerror="this.src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAAmVJREFUSMftlG1IU2EUx8+5jRHzg+5OiD64WTBBjSY5ZybUJMaMiIUICUKFIGmoIIogYWKFBmtDxN1tBKIWvlS6SR+iLFDBXqSMgmzbvQ7fkAjcINmQ5u7pQwyCiOvWx/p/fPj9/5znnPM8AP+VolRTjjHhTlmZipzEk9GYao4sVaMYxXp62NgIdpLBCuLP05mZZHOYZA3p5KgMjBcUwCmw4PfVVYiBGmbW1zMzOU4QCgtTvdAeRESEyNZyJbx+dDTjVv/9YFSjSScnfabsbPYMF+AbxsYS3F5TfwPZAacpMNfUBEAljK24mMJwlLIUClTAdfwok9FXWBTtc3Phzqv7c/RWa8KnrHZM8VltbRjC92AxGkEPRpSJInjJQPpIBJoZC6nn50M19dM5J/v6/lhRxgXXDX9Qp1POcmHh2sTEQbfbvVmrUCTbr4RPaeMe8Q0eTyI36VkrW50mftjrPWCyDn9oSUuTdj4Y/1Qpl7NdzkNC98iIqsIxHdQVFaU8eWW1U1guLy1lr3Acr3O7pXi227EhDLpcCZ8UL/kK8LIYjxtDIRhEP8xGIlI8bcAKvY3FGB/zYvf81pYUL/0PvGTKoTUvjzbgCx5ZWlJq3a5lQa1Ge3yTWnp64ASYqVcUoXn3Jtja2/EpRtHj89FF8Tb25ufDOwCo8/lSL0BF/eDPzcVXeA7WDAa6J9rES1VVdJqx41JHBwCE8BgA3JU9B+3AACziMwjv7MAaPQb/wgIAnP2rDpCWtpkncjm+Ro34bWgo3FkX0O6bnARARCT6hSR6YzazXa7DfLyigo7TNtObxNb/s/oB7V8JFvW/8IQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDItMDJUMTg6MTE6NTgrMDg6MDCoc6tpAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTAyLTAyVDE4OjExOjU4KzA4OjAw2S4T1QAAAGd0RVh0c3ZnOmJhc2UtdXJpAGZpbGU6Ly8vaG9tZS9hZG1pbi9pY29uLWZvbnQvdG1wL2ljb25fNWhyOG55Nmo1bWMvamluZ2RpYW5hbmxpX2tvbmd3dWppYW94aW5nX3Nob3VjYW5nLnN2Z4/vilwAAAAASUVORK5CYII='" alt="" ng-show="bm.urls">
</div>
<div class="bookmark-official">{{bm.urls}}&nbsp;·&nbsp;</div><div class="bookmark-time">{{bm.createTime|changeTime}}</div>
</div>
</div>
</div>
<el-divider class="bookmark-hr"></el-divider>
</el-col>
</el-row>
</div>
<!-- 添加或修改书签管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="书签标题" prop="title">
<el-input v-model="form.title" placeholder="请输入书签标题" />
</el-form-item>
<el-form-item label="书签地址" prop="url">
<el-input v-model="form.url" placeholder="请输入书签地址" />
</el-form-item>
<el-form-item label="书签描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入书签描述" run dev
:autosize="{minRows: 3, maxRows:4}" :style="{width: '100%'}"></el-input>
</el-form-item>
<el-form-item label="所属目录" prop="menuId">
<el-input v-model="form.menuId" placeholder="请选择上级目录" />
</el-form-item>
<el-form-item label="书签标签:" prop="label">
<el-tag
class="bookmarktag"
v-for="tag in form.sqTags"
:key="tag.tagId"
closable
type="success"
:disable-transitions="false"
@close="taghandleClose(tag.tagId)"
v-if="tag.name!='TAGDELETE'"
>
{{tag.name}}
</el-tag>
<el-input
class="input-new-tag"
v-if="inputVisible"
v-model="inputValue"
ref="saveTagInput"
size="small"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
>
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新增标签</el-button>
</el-form-item>
<!-- 0公开显示 1隐藏显示 2好友显示-->
<el-form-item label="选择状态" prop="start">
<el-radio-group v-model="form.start" size="medium">
<el-radio v-for="(item, index) in bookmarkstatus" :key="index" :label="item.value"
:disabled="item.disabled">{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
<!-- 1.未读稍后再看 2 已读 2.續看-->
<el-form-item label="选择类型" prop="type">
<el-radio-group v-model="form.type" size="medium">
<el-radio v-for="(item, index) in bookmarktype" :key="index" :label="item.value"
:disabled="item.disabled">{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listBookmark, getBookmark, delBookmark, addBookmark, updateBookmark, exportBookmark } from "@/api/bookmark/bookmark";
export default {
name: "Bookmark",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 书签管理表格数据
bookmarkList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
userid: undefined,
title: undefined,
url: undefined,
urls: undefined,
description: undefined,
image: undefined,
label: undefined,
menuId: undefined,
zcount: undefined,
idelete: undefined,
start: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
import { selectBymenuIdUserID,selectBydelete,selectByUseridList, getBookmark, delBookmark, addBookmark, updateBookmark, exportBookmark } from "@/api/bookmark/bookmark";
import { format } from 'timeago.js';
export default {
components: {
format
},
data: function () {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
showbookmark:true,
showimg:false,
loading:false,
queryParams: {
pageNum: 1,
pageSize: 15,
userid: undefined,
title: undefined,
url: undefined,
urls: undefined,
description: undefined,
image: undefined,
label: undefined,
menuId: undefined,
zcount: undefined,
idelete: undefined,
start: undefined,
sqTags:[]
},
inputVisible: false, //标签
inputValue: '', //标签
tagcount:0, //标签虚拟ID
bookmarkList:[],
urltext:'?from=yunshuqian.com',//网址域名起推广作用
// 表单参数
form: {},
// 表单校验
rules: {
},
bookmarkstatus: [{
"name": "公开",
"value": 1
}, {
"name": "私密",
"value": 2
}],
bookmarktype: [{
"name": "已阅读",
"value": 1
}, {
"name": "稍后读",
"value": 2
}, {
"name": "待续读",
"value": 3
}],
}
},
filters: {
//timeago.js插件
//计算时间,类似于几分钟前,几小时前,几天前等
changeTime(val){
let time = new Date(val); //先将接收到的json格式的日期数据转换成可用的js对象日期
return format(time, 'zh_CN'); //转换成类似于几天前的格式
}
};
},
created() {
this.getList();
},
methods: {
/** 查询书签管理列表 */
getList() {
this.loading = true;
listBookmark(this.queryParams).then(response => {
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
bookmarkId: undefined,
userid: undefined,
title: undefined,
url: undefined,
urls: undefined,
description: undefined,
image: undefined,
label: undefined,
menuId: undefined,
zcount: undefined,
idelete: undefined,
start: undefined,
createTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.bookmarkId)
this.single = selection.length!=1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加书签管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const bookmarkId = row.bookmarkId || this.ids
getBookmark(bookmarkId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改书签管理";
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.bookmarkId != undefined) {
updateBookmark(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addBookmark(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
created() {
var that=this;
var routedata=that.$route.query.menuId;
if (routedata==undefined){
that.queryParams.menuId=1;
}else {
that.queryParams.menuId=routedata;
}
});
if (routedata=='BOOKMARK'){
//全部书签
this.getBookmarkList();
}else if(routedata=='RECYCLE'){
//回收站
this.getrecycleList();
}else{
//根据menuId查询
this.getList();
}
},
mounted(){
},
/** 删除按钮操作 */
handleDelete(row) {
const bookmarkIds = row.bookmarkId || this.ids;
this.$confirm('是否确认删除书签管理编号为"' + bookmarkIds + '"的数据项?', "警告", {
methods: {
/**书签编辑设置的 标签开始**/
taghandleClose(tag) {
//1. 首先我们要得到这个对象
var tina = this.form.sqTags.filter((p) => {
return p.tagId == tag;
});
//2. 其次得到这个对象在数组中对应的索引
var index = this.form.sqTags.indexOf(tina[0]);
//3. 如果存在则将其删除index > -1 代表存在
// index > -1 && this.form.sqTags.splice(index, 1);
if (index > -1){
if (this.form.sqTags[index].tagId<0){
this.form.sqTags.splice(index, 1);
}
this.form.sqTags[index].name="TAGDELETE";
}
console.log(this.form.sqTags);
},
showInput() {
this.inputVisible = true;
this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus();
});
},
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
this.tagcount=this.tagcount-1;
//添加
var updatetag ={name: inputValue, bookmarkId: this.form.bookmarkId,tagId:this.tagcount};
this.form.sqTags.push(updatetag);
}
this.inputVisible = false;
this.inputValue = '';
console.log(this.form.sqTags);
},
/**书签编辑设置的 标签结束**/
/** 修改按钮操作 */
handleUpdate(bookmarkId) {
this.reset();
const ibookmarkId = bookmarkId || this.ids
getBookmark(ibookmarkId).then(response => {
this.form = response.data;
this.open = true;
this.title = "书签编辑管理";
});
},
/** 提交按钮 修改和新增 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.bookmarkId != undefined) {
updateBookmark(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addBookmark(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(bookmarkId) {
const bookmarkIds = bookmarkId || this.ids;
this.$confirm('是否确认删除此条书签数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
@ -380,20 +379,193 @@ export default {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有书签管理数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return exportBookmark(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function() {});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
bookmarkId: undefined,
userid: undefined,
title: undefined,
url: undefined,
urls: undefined,
description: undefined,
image: undefined,
label: undefined,
menuId: undefined,
zcount: undefined,
idelete: undefined,
start: undefined,
createTime: undefined
};
this.resetForm("form");
},
/** 回收站**/
getrecycleList() {
this.loading = true;
selectBydelete(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
/** 全部书签**/
getBookmarkList() {
this.loading = true;
selectByUseridList(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
/** 查询书签管理列表 */
getList() {
this.loading = true;
selectBymenuIdUserID(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
windowurl(url,bookmarkId){
// window.open(url+this.urltext);
window.open(url);
},
},
}
}
};
</script>
<style scoped>
/**编辑标签 开始**/
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
/**编辑标签 结束**/
.filler-tag span{
font-size: 12px;
margin-left: 5px;
background-color: #FFFFFF;
color: #399de0;
margin-bottom: 4px;
}
.filler-tag span:hover{
background-color: #E8F3FC;
color: #1988E0;
}
.bookamrk-hr{
margin-top: 0;
}
.filter-sort-dropdown{
top:65px!important;
box-shadow: 0 2px 15px 0 rgba(0,0,0,.2)!important;
font-weight: 600!important;
}
.filter-sort-dropdown div{
display: none!important;
}
.nullbookmark{
display: flex;
flex-flow: column;
margin-top: 10%;
}
.nullbookmark-img{
margin: 0 auto;
width:250px;
height: 250px;
justify-content: center;
align-content: center;
background-image: url("https://s1.ax1x.com/2020/08/22/dawFp9.png") ;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.nullbookmark-text{
margin: 0 auto;
width:250px;
text-align: center;
color: #D4D4D4!important;
}
.editBookamrk{
width: 270px;
height: 70px;
position: absolute;
background-color: #acd7ff;
right: 0;
}
.editlist{
display: flex;
width: 100%;
height: 70px;
flex-flow: wrap;
align-items: center;
}
.editlist div{
margin-left:10px;
width: 50px;
height: 35px;
align-content: center;
}
.bookmarktag{
margin-right: 5px;
}
.bookmarklist{
/*height: 400px !important;*/
}
</style>

View File

@ -1,571 +0,0 @@
<template >
<div >
<div class="filter" >
<div class="filter-sort" >
<el-dropdown trigger="click" size="small">
<span class="el-dropdown-link">
<span>按时间排序()</span> <i class="el-icon-caret-bottom"></i>
</span>
<el-dropdown-menu slot="dropdown" class="filter-sort-dropdown">
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按时间排序()</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按时间排序()</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按字母A-Z排序</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按字母A-Z排序</el-dropdown-item>
<el-dropdown-item class="filter-item"><i class="el-icon-bottom"></i>按网站A-Z排序</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div >
<el-divider direction="vertical"></el-divider>
</div>
<div class="filler-tag">
<el-tag size="small">我的最爱</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >小型标签</el-tag>
</div>
<div class="filler-tag">
<el-tag size="small" >...</el-tag>
</div>
</div>
<div class="nullbookmark" v-if="showimg">
<div class="nullbookmark-img">
</div>
<div style="color: #000000" class="nullbookmark-text">
此目录还未添加书签
</div>
</div>
<div class="bookmarklist" v-loading="loading" v-if="showbookmark" >
<el-row >
<hr class="bookamrk-hr"/>
<el-col :span="24" v-for="bm in bookmarkList">
<div class="editBookamrk">
<div class="editlist">
<div> <el-button plain size="small" @click="handleUpdate(bm.bookmarkId)">修改</el-button></div>
<div> <el-button plain size="small" @click="handleDelete(bm.bookmarkId)">删除</el-button></div>
<div> <el-button plain size="small">笔记</el-button></div>
<div> <el-button plain size="small">分享</el-button></div>
</div>
</div>
<div class="bookmark" :data-id="bm.id" @click="windowurl(bm.url,bm.bookmarkId)">
<p class="bookmark-title">{{bm.title}}</p>
<div class="">
<p class="description">{{bm.description}}</p>
</div>
<div class="info-wrap">
<div class="info">
<div class="bookmark-icon">
<!-- <img :err-src='bm.icon' :ng-src="bm.icon" :src="bm.icon" />-->
<img :ng-src="'https://favicon.lucq.fun/?url=http://'+bm.urls" :src="'https://favicon.lucq.fun/?url=http://'+bm.urls" onerror="this.src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAAmVJREFUSMftlG1IU2EUx8+5jRHzg+5OiD64WTBBjSY5ZybUJMaMiIUICUKFIGmoIIogYWKFBmtDxN1tBKIWvlS6SR+iLFDBXqSMgmzbvQ7fkAjcINmQ5u7pQwyCiOvWx/p/fPj9/5znnPM8AP+VolRTjjHhTlmZipzEk9GYao4sVaMYxXp62NgIdpLBCuLP05mZZHOYZA3p5KgMjBcUwCmw4PfVVYiBGmbW1zMzOU4QCgtTvdAeRESEyNZyJbx+dDTjVv/9YFSjSScnfabsbPYMF+AbxsYS3F5TfwPZAacpMNfUBEAljK24mMJwlLIUClTAdfwok9FXWBTtc3Phzqv7c/RWa8KnrHZM8VltbRjC92AxGkEPRpSJInjJQPpIBJoZC6nn50M19dM5J/v6/lhRxgXXDX9Qp1POcmHh2sTEQbfbvVmrUCTbr4RPaeMe8Q0eTyI36VkrW50mftjrPWCyDn9oSUuTdj4Y/1Qpl7NdzkNC98iIqsIxHdQVFaU8eWW1U1guLy1lr3Acr3O7pXi227EhDLpcCZ8UL/kK8LIYjxtDIRhEP8xGIlI8bcAKvY3FGB/zYvf81pYUL/0PvGTKoTUvjzbgCx5ZWlJq3a5lQa1Ge3yTWnp64ASYqVcUoXn3Jtja2/EpRtHj89FF8Tb25ufDOwCo8/lSL0BF/eDPzcVXeA7WDAa6J9rES1VVdJqx41JHBwCE8BgA3JU9B+3AACziMwjv7MAaPQb/wgIAnP2rDpCWtpkncjm+Ro34bWgo3FkX0O6bnARARCT6hSR6YzazXa7DfLyigo7TNtObxNb/s/oB7V8JFvW/8IQAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDItMDJUMTg6MTE6NTgrMDg6MDCoc6tpAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTAyLTAyVDE4OjExOjU4KzA4OjAw2S4T1QAAAGd0RVh0c3ZnOmJhc2UtdXJpAGZpbGU6Ly8vaG9tZS9hZG1pbi9pY29uLWZvbnQvdG1wL2ljb25fNWhyOG55Nmo1bWMvamluZ2RpYW5hbmxpX2tvbmd3dWppYW94aW5nX3Nob3VjYW5nLnN2Z4/vilwAAAAASUVORK5CYII='" alt="" ng-show="bm.urls">
</div>
<div class="bookmark-official">{{bm.urls}}&nbsp;·&nbsp;</div><div class="bookmark-time">{{bm.createTime|changeTime}}</div>
</div>
</div>
</div>
<el-divider class="bookmark-hr"></el-divider>
</el-col>
</el-row>
</div>
<!-- 添加或修改书签管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="书签标题" prop="title">
<el-input v-model="form.title" placeholder="请输入书签标题" />
</el-form-item>
<el-form-item label="书签地址" prop="url">
<el-input v-model="form.url" placeholder="请输入书签地址" />
</el-form-item>
<el-form-item label="书签描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入书签描述" run dev
:autosize="{minRows: 3, maxRows:4}" :style="{width: '100%'}"></el-input>
</el-form-item>
<el-form-item label="所属目录" prop="menuId">
<el-input v-model="form.menuId" placeholder="请选择上级目录" />
</el-form-item>
<el-form-item label="书签标签:" prop="label">
<el-tag
class="bookmarktag"
v-for="tag in form.sqTags"
:key="tag.tagId"
closable
type="success"
:disable-transitions="false"
@close="taghandleClose(tag.tagId)"
v-if="tag.name!='TAGDELETE'"
>
{{tag.name}}
</el-tag>
<el-input
class="input-new-tag"
v-if="inputVisible"
v-model="inputValue"
ref="saveTagInput"
size="small"
@keyup.enter.native="handleInputConfirm"
@blur="handleInputConfirm"
>
</el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 新增标签</el-button>
</el-form-item>
<!-- 0公开显示 1隐藏显示 2好友显示-->
<el-form-item label="选择状态" prop="start">
<el-radio-group v-model="form.start" size="medium">
<el-radio v-for="(item, index) in bookmarkstatus" :key="index" :label="item.value"
:disabled="item.disabled">{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
<!-- 1.未读稍后再看 2 已读 2.續看-->
<el-form-item label="选择类型" prop="type">
<el-radio-group v-model="form.type" size="medium">
<el-radio v-for="(item, index) in bookmarktype" :key="index" :label="item.value"
:disabled="item.disabled">{{item.name}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { selectBymenuIdUserID,selectBydelete,selectByUseridList, getBookmark, delBookmark, addBookmark, updateBookmark, exportBookmark } from "@/api/bookmark/bookmark";
import { format } from 'timeago.js';
export default {
components: {
format
},
data: function () {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
showbookmark:true,
showimg:false,
loading:false,
queryParams: {
pageNum: 1,
pageSize: 15,
userid: undefined,
title: undefined,
url: undefined,
urls: undefined,
description: undefined,
image: undefined,
label: undefined,
menuId: undefined,
zcount: undefined,
idelete: undefined,
start: undefined,
sqTags:[]
},
inputVisible: false, //标签
inputValue: '', //标签
tagcount:0, //标签虚拟ID
bookmarkList:[],
urltext:'?from=yunshuqian.com',//网址域名起推广作用
// 表单参数
form: {},
// 表单校验
rules: {
},
bookmarkstatus: [{
"name": "公开",
"value": 1
}, {
"name": "私密",
"value": 2
}],
bookmarktype: [{
"name": "已阅读",
"value": 1
}, {
"name": "稍后读",
"value": 2
}, {
"name": "待续读",
"value": 3
}],
}
},
filters: {
//timeago.js插件
//计算时间,类似于几分钟前,几小时前,几天前等
changeTime(val){
let time = new Date(val); //先将接收到的json格式的日期数据转换成可用的js对象日期
return format(time, 'zh_CN'); //转换成类似于几天前的格式
}
},
created() {
var that=this;
var routedata=that.$route.query.menuId;
if (routedata==undefined){
that.queryParams.menuId=1;
}else {
that.queryParams.menuId=routedata;
}
if (routedata=='BOOKMARK'){
//全部书签
this.getBookmarkList();
}else if(routedata=='RECYCLE'){
//回收站
this.getrecycleList();
}else{
//根据menuId查询
this.getList();
}
},
mounted(){
},
methods: {
/**书签编辑设置的 标签开始**/
taghandleClose(tag) {
//1. 首先我们要得到这个对象
var tina = this.form.sqTags.filter((p) => {
return p.tagId == tag;
});
//2. 其次得到这个对象在数组中对应的索引
var index = this.form.sqTags.indexOf(tina[0]);
//3. 如果存在则将其删除index > -1 代表存在
// index > -1 && this.form.sqTags.splice(index, 1);
if (index > -1){
if (this.form.sqTags[index].tagId<0){
this.form.sqTags.splice(index, 1);
}
this.form.sqTags[index].name="TAGDELETE";
}
console.log(this.form.sqTags);
},
showInput() {
this.inputVisible = true;
this.$nextTick(_ => {
this.$refs.saveTagInput.$refs.input.focus();
});
},
handleInputConfirm() {
let inputValue = this.inputValue;
if (inputValue) {
this.tagcount=this.tagcount-1;
//添加
var updatetag ={name: inputValue, bookmarkId: this.form.bookmarkId,tagId:this.tagcount};
this.form.sqTags.push(updatetag);
}
this.inputVisible = false;
this.inputValue = '';
console.log(this.form.sqTags);
},
/**书签编辑设置的 标签结束**/
/** 修改按钮操作 */
handleUpdate(bookmarkId) {
this.reset();
const ibookmarkId = bookmarkId || this.ids
getBookmark(ibookmarkId).then(response => {
this.form = response.data;
this.open = true;
this.title = "书签编辑管理";
});
},
/** 提交按钮 修改和新增 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.bookmarkId != undefined) {
updateBookmark(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
}
});
} else {
addBookmark(this.form).then(response => {
if (response.code === 200) {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
}
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(bookmarkId) {
const bookmarkIds = bookmarkId || this.ids;
this.$confirm('是否确认删除此条书签数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delBookmark(bookmarkIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(function() {});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
bookmarkId: undefined,
userid: undefined,
title: undefined,
url: undefined,
urls: undefined,
description: undefined,
image: undefined,
label: undefined,
menuId: undefined,
zcount: undefined,
idelete: undefined,
start: undefined,
createTime: undefined
};
this.resetForm("form");
},
/** 回收站**/
getrecycleList() {
this.loading = true;
selectBydelete(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
/** 全部书签**/
getBookmarkList() {
this.loading = true;
selectByUseridList(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
/** 查询书签管理列表 */
getList() {
this.loading = true;
selectBymenuIdUserID(this.queryParams).then(response => {
if (response.total!=0&&response.code==200){
this.bookmarkList = response.rows;
this.total = response.total;
this.loading = false;
}else {
this.showbookmark = false;
this.showimg = true;
}
});
},
windowurl(url,bookmarkId){
// window.open(url+this.urltext);
window.open(url);
},
},
}
</script>
<style scoped>
/**编辑标签 开始**/
.el-tag + .el-tag {
margin-left: 10px;
}
.button-new-tag {
margin-left: 10px;
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
margin-left: 10px;
vertical-align: bottom;
}
/**编辑标签 结束**/
.filler-tag span{
font-size: 12px;
margin-left: 5px;
background-color: #FFFFFF;
color: #399de0;
margin-bottom: 4px;
}
.filler-tag span:hover{
background-color: #E8F3FC;
color: #1988E0;
}
.bookamrk-hr{
margin-top: 0;
}
.filter-sort-dropdown{
top:65px!important;
box-shadow: 0 2px 15px 0 rgba(0,0,0,.2)!important;
font-weight: 600!important;
}
.filter-sort-dropdown div{
display: none!important;
}
.nullbookmark{
display: flex;
flex-flow: column;
margin-top: 10%;
}
.nullbookmark-img{
margin: 0 auto;
width:250px;
height: 250px;
justify-content: center;
align-content: center;
background-image: url("https://s1.ax1x.com/2020/08/22/dawFp9.png") ;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.nullbookmark-text{
margin: 0 auto;
width:250px;
text-align: center;
color: #D4D4D4!important;
}
.editBookamrk{
width: 270px;
height: 70px;
position: absolute;
background-color: #acd7ff;
right: 0;
}
.editlist{
display: flex;
width: 100%;
height: 70px;
flex-flow: wrap;
align-items: center;
}
.editlist div{
margin-left:10px;
width: 50px;
height: 35px;
align-content: center;
}
.bookmarktag{
margin-right: 5px;
}
.bookmarklist{
/*height: 400px !important;*/
}
</style>

View File

@ -273,7 +273,7 @@
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import "../ztree/jquery-1.4.4.min.js"
import "../ztree/jquery.ztree.core.js"
import "../ztree/jquery.ztree.core.js"
import "../ztree/demo.css"
import "../ztree/zTreeStyle.css"
import "../ztree/jquery.ztree.exedit.js"