feat:细节问题修改

This commit is contained in:
CN32479-詹红柱 2021-08-14 12:00:50 +08:00
parent 01d07d2f03
commit 1f216d9324
13 changed files with 6533 additions and 33 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 MiB

53
package-lock.json generated
View File

@ -1239,6 +1239,11 @@
"to-fast-properties": "^2.0.0"
}
},
"@element-plus/icons": {
"version": "0.0.11",
"resolved": "https://registry.nlark.com/@element-plus/icons/download/@element-plus/icons-0.0.11.tgz",
"integrity": "sha1-mxh8ACd0VIuRGFDRf6X8L5pRX1c="
},
"@hapi/address": {
"version": "2.1.4",
"resolved": "https://registry.npm.taobao.org/@hapi/address/download/@hapi/address-2.1.4.tgz",
@ -1305,6 +1310,11 @@
"integrity": "sha1-K1o6s/kYzKSKjHVMCBaOPwPrphs=",
"dev": true
},
"@popperjs/core": {
"version": "2.9.3",
"resolved": "https://registry.nlark.com/@popperjs/core/download/@popperjs/core-2.9.3.tgz",
"integrity": "sha1-i2jaHr1/xgOZnPbr7jSkiZoUuI4="
},
"@soda/friendly-errors-webpack-plugin": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/@soda/friendly-errors-webpack-plugin/download/@soda/friendly-errors-webpack-plugin-1.8.0.tgz?cache=0&sync_timestamp=1607927418007&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40soda%2Ffriendly-errors-webpack-plugin%2Fdownload%2F%40soda%2Ffriendly-errors-webpack-plugin-1.8.0.tgz",
@ -2802,6 +2812,11 @@
"integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=",
"dev": true
},
"async-validator": {
"version": "3.5.2",
"resolved": "https://registry.nlark.com/async-validator/download/async-validator-3.5.2.tgz",
"integrity": "sha1-aOhmqWgk6LJpT/eoMcGiXETV5QA="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.nlark.com/asynckit/download/asynckit-0.4.0.tgz",
@ -4543,6 +4558,11 @@
"assert-plus": "^1.0.0"
}
},
"dayjs": {
"version": "1.10.6",
"resolved": "https://registry.nlark.com/dayjs/download/dayjs-1.10.6.tgz",
"integrity": "sha1-KIsqqC8thBimydTfWJjAc3rQKmM="
},
"debug": {
"version": "3.2.7",
"resolved": "https://registry.nlark.com/debug/download/debug-3.2.7.tgz?cache=0&sync_timestamp=1618847016785&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdebug%2Fdownload%2Fdebug-3.2.7.tgz",
@ -5043,6 +5063,21 @@
"integrity": "sha1-sNZS03aDFHCkwjC6ch2iQnv7mWo=",
"dev": true
},
"element-plus": {
"version": "1.0.2-beta.70",
"resolved": "https://registry.nlark.com/element-plus/download/element-plus-1.0.2-beta.70.tgz?cache=0&sync_timestamp=1628175083345&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felement-plus%2Fdownload%2Felement-plus-1.0.2-beta.70.tgz",
"integrity": "sha1-EwWPTnjF5zsZqRVATXEHahOiYW4=",
"requires": {
"@element-plus/icons": "^0.0.11",
"@popperjs/core": "^2.4.4",
"async-validator": "^3.4.0",
"dayjs": "1.x",
"lodash": "^4.17.20",
"mitt": "^2.1.0",
"normalize-wheel": "^1.0.1",
"resize-observer-polyfill": "^1.5.1"
}
},
"elliptic": {
"version": "6.5.4",
"resolved": "https://registry.nlark.com/elliptic/download/elliptic-6.5.4.tgz",
@ -8106,8 +8141,7 @@
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.21.tgz",
"integrity": "sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw=",
"dev": true
"integrity": "sha1-Z5WRxWTDv/quhFTPCz3zcMPWkRw="
},
"lodash.camelcase": {
"version": "4.3.0",
@ -8702,6 +8736,11 @@
"through2": "^2.0.0"
}
},
"mitt": {
"version": "2.1.0",
"resolved": "https://registry.nlark.com/mitt/download/mitt-2.1.0.tgz",
"integrity": "sha1-90BXfCMXbGIFsSGylzUU6t4bIjA="
},
"mixin-deep": {
"version": "1.3.2",
"resolved": "https://registry.nlark.com/mixin-deep/download/mixin-deep-1.3.2.tgz",
@ -9065,6 +9104,11 @@
"integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=",
"dev": true
},
"normalize-wheel": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz",
"integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
},
"npm-run-path": {
"version": "2.0.2",
"resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz",
@ -11064,6 +11108,11 @@
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=",
"dev": true
},
"resize-observer-polyfill": {
"version": "1.5.1",
"resolved": "https://registry.nlark.com/resize-observer-polyfill/download/resize-observer-polyfill-1.5.1.tgz",
"integrity": "sha1-DpAg3T0hAkRY1OvSfiPkAmmBBGQ="
},
"resolve": {
"version": "1.20.0",
"resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.20.0.tgz?cache=0&sync_timestamp=1613054862388&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.20.0.tgz",

View File

@ -9,6 +9,7 @@
"dependencies": {
"axios": "^0.21.0",
"core-js": "^3.6.5",
"element-plus": "^1.0.2-beta.70",
"granim": "^2.0.0",
"gsap": "^3.7.0",
"vue": "^3.0.0"

1870
server/bookmarks.html Normal file

File diff suppressed because one or more lines are too long

37
server/index.py Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from flask import Flask,render_template, request, send_from_directory,jsonify, redirect
import os
from bs4 import BeautifulSoup
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = os.getcwd()
download_floder = app.config['UPLOAD_FOLDER'] + '/upload'
def allow_file(filename):
allow_list = ['png', 'PNG', 'jpg', 'doc', 'docx', 'txt', 'pdf', 'PDF', 'xls', 'rar', 'exe', 'md', 'zip','html']
a = filename.split('.')[1]
if a in allow_list:
return True
else:
return False
@app.route('/upload', methods=['POST', 'GET'])
def upload():
file = request.files['file']
if not file:
return render_template('index.html', status='null')
#print(file)
if allow_file(file.filename):
Soup = BeautifulSoup(file,'lxml'); #将要解析的文件传入
#print(Soup); #打印读入Soup中的内容
types = Soup.select('DL > p > DT > H3');
hrefs = Soup.select('DL > p > DT > DL > p > DT > A');
print(types,hrefs)
file.save(os.path.join(app.config['UPLOAD_FOLDER']+'/upload/', file.filename))
return render_template('index.html', status='OK')
else:
return 'NO'
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')

View File

@ -1,17 +1,18 @@
<template>
<div class="bg"></div>
<div id="app">
<div class="bookmark">
<div class="bookmark" id="bookmark">
<div class="tool-bar">
<div class="tool-logo">
<a href="" target="_blank"><img src="./assets/svg/logo.svg" title="更多数据" class="tool-icon" />红隼书签</a>
</div>
<div>
<!-- <img src="./assets/svg/more.svg" class="tool-icon" /> -->
<div class="search-box">
<img src="./assets/svg/search.svg">
<input type="text" placeholder="请输入书签名称" v-model="searchVal" />
</div>
<img src="./assets/svg/add.svg" class="tool-icon" @click="add" />
<a title="我的博客" href="https://zhanhongzhu.top" target="_blank"><img src="./assets/svg/blog.svg" class="tool-icon" /></a>
<a title="在线翻译" href="https://translate.google.cn" target="_blank"><img src="./assets/svg/translate.svg" class="tool-icon" /></a>
<a title="我的码云" href="https://gitee.com/zhanhongzhu/kestrel-bookmark" target="_blank"><img src="./assets/svg/gitee.svg" class="tool-icon" /></a>
@ -52,29 +53,26 @@
</div>
</div>
</div>
</div>
</div>
<Dialog v-model="isDetailVisible" @closeViews="closeViews" />
</template>
<script>
import { reactive, toRefs } from '@vue/reactivity'
import { myData } from './assets/Json/印象笔记.js'
import { watch } from '@vue/runtime-core'
import Dialog from './components/Dialog.vue'
import gsap from 'gsap'
var rowData = myData
export default {
components: { Dialog },
name: 'kestrel-bookmark',
setup() {
const { selectType, navigate } = MyFunction()
//
function flatten(arr, result = []) {
const flatten = (arr, result = []) => {
for (const item of arr) {
if (Array.isArray(item.children)) {
flatten(item.children, result)
} else {
result.push(item)
}
Array.isArray(item.children) ? flatten(item.children, result) : result.push(item)
}
return result
}
@ -83,37 +81,39 @@ export default {
data: rowData,
bookMark: rowData[0].children,
searchVal: '',
allData: flatten(rowData)
allData: flatten(rowData),
isDetailVisible: false
})
//
//
watch(
() => data.searchVal,
() => {
data.bookMark = data.allData.filter((v) => v.title.toLowerCase().indexOf(data.searchVal.toLowerCase()) > -1
data.bookMark = data.allData.filter(
(v) =>
v.title.toLowerCase().indexOf(data.searchVal.toLowerCase()) > -1
)
}
)
//
function MyFunction() {
//
function selectType(item, index) {
data.bookMark = item.children
data.activeIndex = index
}
//
function navigate(card) {
window.open(card.url, '_target')
}
return {
selectType,
navigate
}
//
const selectType = (item, index) => {
data.bookMark = item.children
data.activeIndex = index
}
//
const navigate = (v) => window.open(v.url, '_target')
//
const add = () => (data.isDetailVisible = !data.isDetailVisible)
//
const closeViews = (v) => (data.isDetailVisible = v)
return {
...toRefs(data),
selectType,
navigate
navigate,
add,
closeViews
}
},
methods: {

4418
src/assets/Json/index.js Normal file

File diff suppressed because one or more lines are too long

1
src/assets/svg/add.svg Normal file
View File

@ -0,0 +1 @@
<?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="1626099491673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2195" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M560.54 553.96m-300.58 0a300.58 300.58 0 1 0 601.16 0 300.58 300.58 0 1 0-601.16 0Z" fill="#E03B5D" p-id="2196"></path><path d="M515.4 954A448 448 0 0 1 198.56 189.1a448 448 0 1 1 633.68 633.68A445.14 445.14 0 0 1 515.4 954z m0-844.14c-218.4 0-396 177.66-396 396s177.68 396 396 396 396-177.68 396-396-177.6-395.98-396-395.98z" fill="#231815" p-id="2197"></path><path d="M487.06 212.12m24 0l8.7 0q24 0 24 24l0 539.62q0 24-24 24l-8.7 0q-24 0-24-24l0-539.62q0-24 24-24Z" fill="#231815" p-id="2198"></path><path d="M519.74 800.76h-8.68a25.02 25.02 0 0 1-25-25V236.12a25.02 25.02 0 0 1 25-25h8.68a25.02 25.02 0 0 1 25 25v539.64a25.02 25.02 0 0 1-25 25z m-8.68-587.64a23.02 23.02 0 0 0-23 23v539.64a23.02 23.02 0 0 0 23 23h8.68a23.02 23.02 0 0 0 23-23V236.12a23.02 23.02 0 0 0-23-23z" fill="#231815" p-id="2199"></path><path d="M809.22 476.22m0 24l0 8.7q0 24-24 24l-539.62 0q-24 0-24-24l0-8.7q0-24 24-24l539.62 0q24 0 24 24Z" fill="#231815" p-id="2200"></path><path d="M785.22 534H245.58a25.02 25.02 0 0 1-25-25v-8.68a25.02 25.02 0 0 1 25-25h539.64a25.02 25.02 0 0 1 25 25v8.68a25.02 25.02 0 0 1-25 25z m-539.64-56.78a23.02 23.02 0 0 0-23 23v8.68a23.02 23.02 0 0 0 23 23h539.64a23.02 23.02 0 0 0 23-23v-8.68a23.02 23.02 0 0 0-23-23z" fill="#231815" p-id="2201"></path></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

1
src/assets/svg/edit.svg Normal file
View File

@ -0,0 +1 @@
<?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="1626099545795" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2353" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M615.98 575.08m-300.58 0a300.58 300.58 0 1 0 601.16 0 300.58 300.58 0 1 0-601.16 0Z" fill="#E03B5D" p-id="2354"></path><path d="M285.68 779.24a48.82 48.82 0 0 1-48.56-53.44l10.18-107.4a83.08 83.08 0 0 1 23.88-50.78L668.86 170A82.94 82.94 0 0 1 786 170l60.16 60.16a82.8 82.8 0 0 1 0 117.16L448.5 744.94a83.04 83.04 0 0 1-50.76 23.9l-107.4 10.18c-1.56 0.14-3.12 0.22-4.66 0.22z m109.6-36.44zM727.44 198a30.44 30.44 0 0 0-21.6 8.92L308.16 604.6a30.64 30.64 0 0 0-8.8 18.72l-9.78 103.24 103.22-9.78a30.62 30.62 0 0 0 18.72-8.82L809.2 310.28a30.52 30.52 0 0 0 0-43.2l-60.16-60.16a30.36 30.36 0 0 0-21.6-8.92z" fill="#231815" p-id="2355"></path><path d="M207.88 824.22m28.34 0l657.66 0q28.34 0 28.34 28.34l0 0.02q0 28.34-28.34 28.34l-657.66 0q-28.34 0-28.34-28.34l0-0.02q0-28.34 28.34-28.34Z" fill="#231815" p-id="2356"></path><path d="M893.86 882H236.22a29.36 29.36 0 0 1 0-58.7h657.64a29.36 29.36 0 0 1 0 58.7z m-657.64-56.78a27.36 27.36 0 0 0 0 54.7h657.64a27.36 27.36 0 0 0 0-54.7z" fill="#231815" p-id="2357"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -1 +0,0 @@
<?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="1625141535771" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2346" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M614.8 618.7m-300.58 0a300.58 300.58 0 1 0 601.16 0 300.58 300.58 0 1 0-601.16 0Z" fill="#E03B5D" p-id="2347"></path><path d="M679.68 943.04H367.14a143.42 143.42 0 0 1-123.86-71.5L87.02 600.86a143.32 143.32 0 0 1 0-143l156.26-270.68a143.42 143.42 0 0 1 123.86-71.5h312.54a143.42 143.42 0 0 1 123.86 71.5l156.26 270.68a143.32 143.32 0 0 1 0 143l-156.26 270.68a143.42 143.42 0 0 1-123.86 71.5z m-312.54-768a84 84 0 0 0-72.54 41.88L138.34 487.48a84 84 0 0 0 0 83.76L294.6 842a84 84 0 0 0 72.54 41.88h312.54A84 84 0 0 0 752.22 842l156.26-270.66a84 84 0 0 0 0-83.76l-156.26-270.76a84 84 0 0 0-72.54-41.88z" fill="#231815" p-id="2348"></path><path d="M539.36 703.56a174.2 174.2 0 1 1 174.18-174.2 174.38 174.38 0 0 1-174.18 174.2z m0-289.12a114.94 114.94 0 1 0 114.92 114.92 115.06 115.06 0 0 0-114.92-114.92z" fill="#231815" p-id="2349"></path></svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

120
src/components/Dialog.vue Normal file
View File

@ -0,0 +1,120 @@
<template>
<el-dialog title="提示" :visible="isDetailVisible" width="30%" :before-close="handleClose">
<span>这是一段信息</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeViews"> </el-button>
<el-button type="primary" @click="closeViews"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import gsap from 'gsap'
export default {
model: {
value: 'isDetailVisible',
events: 'closeViews'
},
props: {
isDetailVisible: {
type: Boolean,
default: false
}
},
setup(props, context) {
const closeViews = () => {
context.emit('closeViews', false)
}
return {
closeViews
}
},
methods: {
beforeEnter(el) {
el.style.opacity = 0
el.style.height = 0
},
enter(el, done) {
gsap.to(el, {
opacity: 1,
height: '1.6em',
delay: el.dataset.index * 0.15,
onComplete: done
})
},
leave(el, done) {
gsap.to(el, {
opacity: 0,
height: 0,
delay: el.dataset.index * 0.15,
onComplete: done
})
}
}
}
</script>
<style scoped lang="scss">
.card-s {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 2000;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
overflow: auto;
display: flex;
justify-content: center;
align-items: center;
}
.tel-cont {
width: 40%;
min-width: 600px;
min-height: 440px;
position: relative;
margin-top: 0px;
background: #fff;
border-radius: 8px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
box-sizing: border-box;
.el-dialog__header {
padding: 20px 20px 10px;
width: 100%;
border-bottom: 1px solid #eee;
.el-dialog__title {
line-height: 24px;
font-size: 18px;
color: #303133;
}
.el-dialog__headerbtn {
position: absolute;
top: 20px;
right: 20px;
padding: 0;
background: transparent;
border: none;
outline: none;
cursor: pointer;
font-size: 16px;
}
}
}
.list-complete-item {
transition: all 0.8s ease;
display: inline-block;
margin-right: 10px;
}
.list-complete-enter-from,
.list-complete-leave-to {
opacity: 0;
transform: translateY(30px);
}
.list-complete-leave-active {
position: absolute;
}
</style>

View File

@ -1,5 +1,9 @@
import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')

View File

@ -5,7 +5,7 @@ module.exports = {
proxy: {
// 配置前端代理转发地址
'/api': {
target: 'http://127.0.0.1:8080',
target: 'http://192.168.1.5:5000',
changeOrigin: true,
pathRewrite: {
'^/api': '/api'