From 0dd41bd8cee430d3a948b89c664cb511c400993c Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Fri, 12 Aug 2022 19:11:46 +0800 Subject: [PATCH] 新增链接添加按钮,优化Dplayer播放 --- src/components/mini/box15-videoPlayBox.vue | 202 +++++++++---------- src/components/mini/box10-add.vue | 15 + src/components/mini/box13-reply.vue | 6 src/api/blogLink.js | 22 ++ src/components/mini/box5-article.vue | 4 src/components/group/tool.vue | 2 /dev/null | 12 - src/components/group/MyMessage.vue | 2 src/components/mini/mdDetail.vue | 1 src/components/swichLabel/main1-home.vue | 27 ++ src/components/group/MyVideo.vue | 7 src/components/mini/box-17-linkAdd.vue | 127 ++++++++++++ src/components/mini/box-new-article.vue | 3 src/components/group/MyLink.vue | 73 +++++++ src/components/mini/box8-panal.vue | 2 src/components/group/articleListScorll.vue | 5 src/components/mini/box16-videoDetail.vue | 26 + src/components/layouts/baseLayout.vue | 33 ++- 18 files changed, 408 insertions(+), 161 deletions(-) diff --git a/es_index.txt b/es_index.txt deleted file mode 100644 index 86b4607..0000000 --- a/es_index.txt +++ /dev/null @@ -1,180 +0,0 @@ - - - PUT /sfc_media - - { - "settings": { - "number_of_shards": "5", - "number_of_replicas": "1" - }, - "aliases": { - "sfc_media_1": {}, - - }, - "mappings": { - "dynamic": "strict", - "dynamic_date_formats": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis", - "properties": { - "fileName": { - "type": "text", - "analyzer": "ik_max_word", - "search_analyzer": "ik_max_word" - }, - "description": { - "type": "text", - "analyzer": "ik_max_word", - "search_analyzer": "ik_smart" - }, - "title": { - "type": "text", - "analyzer": "ik_max_word", - "search_analyzer": "ik_max_word" - }, - - "videoText": { - "type": "text", - "analyzer": "ik_max_word", - "search_analyzer": "ik_smart" - }, - - "tags": { - "type": "keyword" - }, - - "personTags": { - "type": "keyword" - }, - - "labelTags": { - "type": "keyword" - }, - - "deptId": { - "type": "keyword" - }, - "storeType": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - - - "typeId": { - "type": "integer" - }, - - "createTime": { - "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis", - "type": "date" - }, - - - "groupId": { - "type": "integer" - }, - "status": { - "type": "integer" - }, - "uploadStatus": { - "type": "integer" - }, - "duration": { - "type": "integer" - }, - "height": { - "type": "integer" - }, - "width": { - "type": "integer" - }, - - "dirId": { - "type": "integer" - }, - "videoBitrate": { - "type": "integer" - }, - - - "fileMd5": { - "type": "keyword" - }, - - - "programId": { - "type": "integer" - }, - - "videoId": { - "type": "integer" - }, - "userId": { - "type": "keyword" - }, - "userName": { - "type": "keyword" - }, - - "size": { - "type": "long" - }, - "cateId": { - "type": "integer" - }, - - "cateIdLeaf": { - "type": "integer" - }, - "mediaStatus": { - "type": "integer" - }, - - "decodeStatus": { - "type": "integer" - }, - "isCollect": { - "type": "integer" - }, - - - - "fps": { - "type": "integer", - "index": false - }, - "audioBitrate": { - "type": "integer", - "index": false - }, - "previewUrl": { - "type": "text", - "index": false - }, - "originalFile": { - "type": "text", - "index": false - }, - "coverUrl": { - "type": "text", - "index": false - }, - "format": { - "type": "text", - "index": false - }, - "videoCodec": { - "type": "text", - "index": false - }, - "audioCodec": { - "type": "text", - "index": false - } - - - - - } - } - } \ No newline at end of file diff --git a/src/api/blogLink.js b/src/api/blogLink.js index 37d5136..fec02ee 100644 --- a/src/api/blogLink.js +++ b/src/api/blogLink.js @@ -20,3 +20,25 @@ params: parameter }) } + + +/** + *添加链接 + */ +export function addLink(data) { + return axios({ + url: '/outside/blogLink/add', + method: 'post', + data: data + }) +} + +/** + *获取链接类型 + */ +export function getLinkType() { + return axios({ + url: '/outside/blogLink/getLinkType', + method: 'get', + }) +} diff --git a/src/assets/baby.htm b/src/assets/baby.htm deleted file mode 100644 index 8a38eed..0000000 --- a/src/assets/baby.htm +++ /dev/null @@ -1,29 +0,0 @@ -<p>Baby Song - 陈奕迅 (Eason Chan)</p> -<p>词:岑宁儿</p> -<p>曲:岑宁儿</p> -<p>你的眼睛 像颗水晶通透</p> -<p>里面有一个无穷无尽的宇宙</p> -<p>小小的你 在你小小的梦里</p> -<p>把我所有大大的事情都吹进风里</p> -<p>我为我将对你撒的谎先跟你道歉</p> -<p>当你发现黑白不是那么的分明</p> -<p>世界不是那么的公平</p> -<p>别太失望 我讲的是个梦想</p> -<p>不用太听我们的话</p> -<p>不要让任何人告诉你</p> -<p>你该怎样对待世界</p> -<p>或它该怎对你</p> -<p>要跟现在一样随心</p> -<p>让你的眼睛和心依然纯净</p> -<p>可惜世界不及你好</p> -<p>原谅我们 我们都还在找</p> -<p>而时间它只负责流动</p> -<p>不负责 育你成长</p> -<p>不过你只需要倾听</p> -<p>倾听你的心</p> -<p>你的眼睛 像颗水晶通透</p> -<p>里面有一个无穷无尽的宇宙</p> -<p>小小的你 在你小小的梦里</p> -<p>把我所有大大的事情都吹进风里</p> -<p>都吹进风里</p> -<p>-</p> \ No newline at end of file diff --git a/src/assets/es.md b/src/assets/es.md deleted file mode 100644 index 13ca26a..0000000 --- a/src/assets/es.md +++ /dev/null @@ -1,482 +0,0 @@ - -# ElasticSearch 聚合(aggregations) - -| Syntax | Description | -| ----------- | ----------- | -| Header | Title | -| Paragraph | Text | - - - | Syntax | Description | - | ----------- | ----------- | - | Header | Title | - | Paragraph | Text | - -### 特点 - -+ 聚合和搜索是使用同样的数据结构,因此聚合和搜索可以是一起执行的. - 这表示我们可以在一次json请求裡,同时对相同的数据进行 搜索/过滤 + 分析 -+ 桶 和 度量 - - 桶(bucket) - - 1.是按照某种方式对数据进行分组,但不包括计算,因此bucket中往往会嵌套另一种聚合:metrics aggregations即度量 - - 2.桶可以被嵌套在其他桶里面 - - 3.比较常用的桶划分方式有 - - Terms Aggregation:根据词条内容分组,词条内容完全匹配的为一组 - - filter:一个用来过滤的桶 和用在主查询query的 "过滤filter" 的用法是一模一样的,都是过滤 - - top_hits桶 : 在某个桶底下找出这个桶的前几笔hits,返回的hits格式和主查询query返回的hits格式一模一样 - - Date Histogram Aggregation:根据日期阶梯分组,例如给定阶梯为周,会自动每周分为一组 - - Histogram Aggregation:根据数值阶梯分组,与日期类似 - - Range Aggregation:数值和日期的范围分组,指定开始和结束,然后按段分组 - - - 度量(metrics) - - 分组完成以后,我们一般会对组中的数据进行聚合运算,例如求平均值、最大、最小、求和等,这些在ES中称为度量 - - 常用的度量集合方式有 - - Avg Aggregation:求平均值 - - Max Aggregation:求最大值 - - Min Aggregation:求最小值 - - Percentiles Aggregation:求百分比 - - Stats Aggregation:同时返回avg、max、min、sum、count等 - - Sum Aggregation:求和 - - Top hits Aggregation:求前几 - - Value Count Aggregation:求总数 - -### aggs 聚合的模板 - -+ 当query和aggs一起存在时,会先执行query的主查询,主查询query执行完后会搜出一批结果,而这些结果才会被拿去aggs拿去做聚合 - 另外要注意aggs后面会先接一层自定义的这个聚合的名字,然后才是接上要使用的聚合桶 - 如果有些情况不在意查询结果是什麽,而只在意aggs的结果,可以把size设为0,如此可以让返回的hits结果集是0,加快返回的速度 - -+ 一个aggs裡可以有很多个聚合,每个聚合彼此间都是独立的,因此可以一个聚合拿来统计数量、一个聚合拿来分析数据、一个聚合拿来计算标准差...,让一次搜索就可以把想要做的事情一次做完 - -+ aggs可以嵌套在其他的aggs裡面,而嵌套的桶能作用的文档集范围,是外层的桶所输出的结果集 - -+ 模板 -``` -GET /test/doc/_search -{ - "query": { ... }, - "size": 0, - "aggs": { - "custom_name1": { //aggs后面接著的是一个自定义的name - "桶": { ... } //再来才是接桶 - }, - "custom_name2": { //一个aggs裡可以有很多聚合 - "桶": { ... } - }, - "custom_name3": { - "桶": { - ..... - }, - "aggs": { //aggs可以嵌套在别的aggs裡面 - "in_name": { //记得使用aggs需要先自定义一个name - "桶": { ... } //in_name的桶作用的文档是custom_name3的桶的结果 - } - } - } - } -``` -+ 结果模板 -``` - { - "hits": { - "total": 8, - "max_score": 0, - "hits": [] //因为size设为0,所以没有查询结果返回 - }, - "aggregations": { - "custom_name1": { - ... - }, - "custom_name2": { - ... - }, - "custom_name3": { - ... , - "in_name": { - .... - } - } - } - } -``` - -### 数据准备 -``` -PUT /test -{ - "mappings": { - "dynamic": "strict", - "properties": { - "color": { - "type": "keyword" - }, - "price": { - "type": "long" - } - } - } -} - -POST /test/_doc/1 -{"color":"red","price":100} - -POST /test/_doc/2 -{"color":"green","price":500} - -POST /test/_doc/3 -{"color":["red","blue"],"price":1000} -``` - -### 示例 -- trems桶 - - - 找出共几组颜色和组内颜色个数 -``` -GET /test/_search -{ - "size": 0, - "aggs": { - "my_terms": { - "terms": { - "field": "color" - } - } - } -} -``` -聚合结果 -``` -{ - "aggregations" : { - "my_terms" : { - "doc_count_error_upper_bound" : 0, - "sum_other_doc_count" : 0, - "buckets" : [ - { - "key" : "red", - "doc_count" : 2 - }, - { - "key" : "blue", - "doc_count" : 1 - }, - { - "key" : "green", - "doc_count" : 1 - } - ] - } - } -} -``` - - 在示例1基础上,对分组的颜色求价格平均和最小值 -``` -GET /test/_search -{ - "size": 0, - "aggs": { - "my_terms": { - "terms": { - "field": "color" - }, - "aggs": { - "my_avg_price": { - "avg": { - "field": "price" - } - }, - "my_min_price": { - "min": { - "field": "price" - } - } - } - } - } -} -``` -聚合结果 -``` - { - "aggregations" : { - "my_terms" : { - "doc_count_error_upper_bound" : 0, - "sum_other_doc_count" : 0, - "buckets" : [ - { - "key" : "red", - "doc_count" : 2, - "my_avg_price" : { - "value" : 550.0 - }, - "my_min_price" : { - "value" : 100.0 - } - }, - { - "key" : "blue", - "doc_count" : 1, - "my_avg_price" : { - "value" : 1000.0 - }, - "my_min_price" : { - "value" : 1000.0 - } - }, - { - "key" : "green", - "doc_count" : 1, - "my_avg_price" : { - "value" : 500.0 - }, - "my_min_price" : { - "value" : 500.0 - } - } - ] - } - } -``` - -- filter桶 - 过滤只查看红颜色的分组情况 -``` -GET /test/_search -{ - "size": 0, - "aggs": { - "my_fliter": { - "filter": { - "bool": { - "must": { - "terms": { - "color": [ - "red" - ] - } - } - } - } - } - } -} -``` -聚合结果 -``` -{ - "aggregations" : { - "my_fliter" : { - "doc_count" : 2 - } - } -} -``` - - filter桶和terms桶叠加嵌套使用 - 过滤含有红颜色的文档,再对其中包含的颜色进行分组 -``` -GET /test/_search -{ - "size": 0, - "aggs": { - "my_fliter": { - "filter": { - "bool": { - "must": { - "terms": { - "color": [ - "red" - ] - } - } - } - }, - "aggs": { - "my_trems": { - "terms": { - "field": "color" - } - } - } - } - } -} -``` -聚合结果 - - 因为terms桶嵌套在filter桶内,所以query查询出来的文档们会先经过filter桶,如果符合filter桶,才会进入到terms桶内 - - 此处通过filter桶的文档只有两笔,分别是{"color": "red"}以及{"color": ["red", "blue"]},所以terms桶只会对这两笔文档做分组 - - 这也是为什麽terms桶裡没有出现color为green的分组,因为这个文档在filter桶就被挡下来了 - - 需注意的是聚合中取的是query之后文档内容,如果query中限制只查询green的文档,那么聚合将无对应内容展示 -``` -{ - "aggregations" : { - "my_fliter" : { - "doc_count" : 2, - "my_trems" : { - "doc_count_error_upper_bound" : 0, - "sum_other_doc_count" : 0, - "buckets" : [ - { - "key" : "red", - "doc_count" : 2 - }, - { - "key" : "blue", - "doc_count" : 1 - } - ] - } - } - } -} -``` - 当然也可以先进行trems桶嵌套filter桶,意义则是分组后再进行过滤 -``` -GET /test/_search -{ - "size": 0, - "aggs": { - "my_trems": { - "terms": { - "field": "color" - }, - "aggs": { - "my_fliter": { - "filter": { - "bool": { - "must": { - "terms": { - "color": [ - "red" - ] - } - } - } - } - } - } - } - } -} -``` -聚合结果 - - 在分组中进行过滤,可以看到green中my_filter中的doc_count结果为0 - - 而至于为什么bule中含有一条doc_count=1,是因为原文档是{"color":["red","blue"]} -``` -{ - - "aggregations" : { - "my_trems" : { - "doc_count_error_upper_bound" : 0, - "sum_other_doc_count" : 0, - "buckets" : [ - { - "key" : "red", - "doc_count" : 2, - "my_fliter" : { - "doc_count" : 2 - } - }, - { - "key" : "blue", - "doc_count" : 1, - "my_fliter" : { - "doc_count" : 1 - } - }, - { - "key" : "green", - "doc_count" : 1, - "my_fliter" : { - "doc_count" : 0 - } - } - ] - } - } -} -``` -- top_hits桶 - - 在某个桶底下找出这个桶的前几笔hits,返回的hits格式和主查询query返回的hits格式一模一样 - - 另外,该桶中不能再嵌套子聚合 - Aggregator [my_top_hit] of type [top_hits] cannot accept sub-aggregations - - - top_hits桶支持的参数 - - - from、size - - sort : 设置返回的hits的排序 - - 要注意,假设在主查询query裡已经对数据设置了排序sort,此sort并不会对aggs裡面的数据造成影响,也就是说主查询query查找出来的数据会先丢进aggs而非先经过sort,因此就算主查询设置了sort,也不会影响aggs数据裡的排序 - 因此如果在top_hits桶裡的返回的hits数据想要排序,需要自己在top_hits桶裡设置sort - 如果没有设置sort,默认使用主查询query所查出来的_score排序 - - _source : 设置返回的字段 - - 按价格排序,取前两条记录 -``` -GET /test/_search -{ - "size": 0, - "aggs": { - "my_top_hit": { - "top_hits": { - "size": 2, - "sort": ["price"] #默认升序asc - #"sort": {"price":"desc"}这种写法也可以 - } - } - } -} -``` -聚合结果 -``` -{ - "aggregations" : { - "my_top_hit" : { - "hits" : { - "total" : { - "value" : 3, - "relation" : "eq" - }, - "max_score" : null, - "hits" : [ - { - "_index" : "test", - "_type" : "_doc", - "_id" : "1", - "_score" : null, - "_source" : { - "color" : "red", - "price" : 100 - }, - "sort" : [ - 100 - ] - }, - { - "_index" : "test", - "_type" : "_doc", - "_id" : "2", - "_score" : null, - "_source" : { - "color" : "green", - "price" : 500 - }, - "sort" : [ - 500 - ] - } - ] - } - } - } -} -``` - - \ No newline at end of file diff --git a/src/assets/mowenwei.jpg b/src/assets/mowenwei.jpg deleted file mode 100644 index b1ed2a3..0000000 --- a/src/assets/mowenwei.jpg +++ /dev/null Binary files differ diff --git a/src/assets/shijie.htm b/src/assets/shijie.htm deleted file mode 100644 index 4c15238..0000000 --- a/src/assets/shijie.htm +++ /dev/null @@ -1,12 +0,0 @@ -<p>晚风中闪过 几帧从前啊</p> -<p> 飞驰中旋转 已不见了吗</p> -<p> 远光中走来 你一身晴朗</p> -<p> 身旁那么多人 可世界不声 不响</p> -<p> 笑声中浮过 几张旧模样</p> -<p> 留在梦田里 永远不散场</p> -<p> 暖光中醒来 好多话要讲</p> -<p> 世界那么多人 可是它不声 不响</p> -<p> 这世界有那么个人</p> -<p> 活在我 飞扬的青春</p> -<p> 在泪水里浸湿过的长吻</p> -<p> 常让我 想啊想出神</p> diff --git a/src/components/group/MyLink.vue b/src/components/group/MyLink.vue new file mode 100644 index 0000000..96cd4ee --- /dev/null +++ b/src/components/group/MyLink.vue @@ -0,0 +1,73 @@ +<template> + <div class="myModal"> + <a-modal v-model="visible" title="添加链接.." :bodyStyle="{'overflow':'overlay','maxHeight': '550px'}" + on-ok="handleOk"> + <template slot="footer"> + <a-button key="submit" type="primary" :loading="loading" @click="handleOk"> + ok + </a-button> + </template> + <LinkAdd ref="linkAddBox"></LinkAdd> + </a-modal> + </div> + +</template> + +<script> + import LinkAdd from "../mini/box-17-linkAdd.vue" + import { + addLink + } from '../../api/blogLink.js' + + export default { + components: { + LinkAdd + }, + data() { + return { + visible: false, + loading: false, + } + }, + methods: { + showModal() { + this.visible = true; + }, + handleCancel(e) { + this.visible = false; + }, + handleOk(e) { + console.log(this.$refs.linkAddBox.form); + var res; + this.$refs.linkAddBox.$refs.myForm.validate(valid => { + if (valid) { + this.$message.info("校验通过") + res = true; + } else { + this.$message.info("校验失败") + res = false; + } + }); + + if (!res) return; + this.$message.info("提交表单") + + let tempData = this.$refs.linkAddBox.form; + + + + console.log(tempData) + this.loading = true; + addLink(tempData).then((res) => { + this.$message.info("添加成功..") + this.visible = false; + this.loading = false; + }); + } + + }, + } +</script> +<style scoped> + +</style> diff --git a/src/components/group/MyMessage.vue b/src/components/group/MyMessage.vue index fca7967..67fe22a 100644 --- a/src/components/group/MyMessage.vue +++ b/src/components/group/MyMessage.vue @@ -81,7 +81,7 @@ }, beforeMount() {}, mounted() { - this.loadData() + this.loadMore() }, methods: { loadMore() { diff --git a/src/components/group/MyVideo.vue b/src/components/group/MyVideo.vue index 4efcec7..17fc80c 100644 --- a/src/components/group/MyVideo.vue +++ b/src/components/group/MyVideo.vue @@ -1,11 +1,10 @@ <template> <div class="myModal"> <a-modal v-model="visible" title="视频盒子" :footer="null" :mask="false" :maskClosable="true" - :bodyStyle="{'overflow':'overlay','maxHeight': '750px'}"> + :bodyStyle="{'overflow':'overlay','maxHeight': '750px'}" :afterClose="afterClose"> <videoDetail ref="videoDetail"></videoDetail> </a-modal> </div> - </template> <script> @@ -49,7 +48,9 @@ handleCancel(e) { this.visible = false; }, - + afterClose() { + this.$emit("closeMyVideo") + } }, } </script> diff --git a/src/components/group/articleListScorll.vue b/src/components/group/articleListScorll.vue index c4b3efb..c78c6e6 100644 --- a/src/components/group/articleListScorll.vue +++ b/src/components/group/articleListScorll.vue @@ -27,13 +27,10 @@ <script> import infiniteScroll from 'vue-infinite-scroll'; import box5 from "../mini/box5-article.vue" - import babyActicle from '../../assets/baby.htm' import newArticle from "../mini/box-new-article.vue" - import shijie from '../../assets/shijie.htm' import { queryBlogArticleList } from '../../api/blogArticle.js' - export default { @@ -55,7 +52,7 @@ total: 1, pageSize: 6, current: 1, - defaultPageSize: 10 + defaultPageSize: 10, }; }, created() { diff --git a/src/components/group/tool.vue b/src/components/group/tool.vue index cfba8a6..1e503fa 100644 --- a/src/components/group/tool.vue +++ b/src/components/group/tool.vue @@ -63,7 +63,7 @@ }, methods: { addLink() { - this.$message.info("添加友链中..") + this.$emit('addLink') }, showMessage() { this.$emit('showMessage') diff --git a/src/components/layouts/baseLayout.vue b/src/components/layouts/baseLayout.vue index 04cfdc4..f5b0b62 100644 --- a/src/components/layouts/baseLayout.vue +++ b/src/components/layouts/baseLayout.vue @@ -12,11 +12,12 @@ <a-layout-footer> <AplayerBox /> <tagFooter /> - <MyVideo ref="MyVideo" /> - <a-button v-if="miniVideoPlayData!=null" class="fadeInRight" - style="position: fixed;right: 0px;bottom: 120px;" @click="showMyVideo(miniVideoPlayData)"> - 视频盒子 - <a-icon type="youtube" /> + <MyVideo ref="MyVideo" @closeMyVideo="closeMyVideo" /> + + <a-button v-if="miniVideoPlayData!=null && showMiniBox" class="fadeInRight" + style="position: fixed;right: 0px;bottom: 130px;" @click="showMyVideo(miniVideoPlayData)"> + {{miniBoxContent}} + <a-icon type="youtube" style="transform: scale(1.5);" /> </a-button> </a-layout-footer> @@ -28,6 +29,8 @@ </template> <script> + // Dplayer Api地址 + // http://dplayer.js.org/ import tagHeader from "../fixed/header.vue" import tagFooter from "../fixed/footer.vue" import AplayerBox from "../mini/Aplayer.vue" @@ -42,22 +45,28 @@ data() { return { miniVideoPlayData: null, - showMiniBox: false + firstQuery: true, + showMiniBox: false, + miniBoxContent: "视频盒子", } }, methods: { showMyVideo(param) { this.miniVideoPlayData = param; - console.log("开启mini盒子"); - - this.$refs.MyVideo.showModal(param); - if (!this.showMiniBox) { + }, + closeMyVideo() { + if (this.firstQuery) { + this.firstQuery = !this.firstQuery; + this.showMiniBox = !this.showMiniBox; this.$notification.info({ - message: '这里是盒子的最小化啦..', + message: '视频盒子最小化啦..', placement: 'bottomRight', }); - this.showMiniBox = true; + + setTimeout(() => { + this.miniBoxContent = ""; + }, 6000); } }, // 下载文件 diff --git a/src/components/mini/box-17-linkAdd.vue b/src/components/mini/box-17-linkAdd.vue new file mode 100644 index 0000000..b263c30 --- /dev/null +++ b/src/components/mini/box-17-linkAdd.vue @@ -0,0 +1,127 @@ +<template> + <div> + <a-form-model ref="myForm" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :rules="rules"> + + <a-form-model-item label="名称" prop="name"> + <a-input v-model="form.name" placeholder="链接名称"> + </a-input> + </a-form-model-item> + + <a-form-model-item label="链接地址" prop="url"> + <a-input v-model="form.url" placeholder="https:// or http://" /> + </a-form-model-item> + + <a-form-model-item label="分类" prop="linkType"> + <a-select v-model="form.linkType" mode="default" placeholder="链接类型" + :getPopupContainer="getCalendarContainer()"> + <a-select-option v-for="(item,index) in this.linkTypeList" :key="index" :value="item.linkTypeId"> + {{ item.groupName }} + </a-select-option> + </a-select> + </a-form-model-item> + + <a-form-model-item label="avatar" prop="avatar"> + <a-input v-model="form.avatar" placeholder="链接图片地址" /> + </a-form-model-item> + + <a-form-model-item label="remark" prop="remark"> + <a-input v-model="form.remark" placeholder="备注" /> + </a-form-model-item> + + <a-form-model-item label="权重"> + <a-slider v-model="form.topValue" :default-value="50" :step="5" + :getTooltipPopupContainer="getCalendarContainer()" /> + <span class="myTip"> + 越小越靠前 + </span> + </a-form-model-item> + + </a-form-model> + </div> +</template> + +<script> + import { + getLinkType + } from '../../api/blogLink.js' + + export default { + data() { + return { + form: { + name: '', + url: '', + avatar: '', + remark: '', + linkType: '', + topValue: 50, + isNewWindowOpen: 1 + }, + linkTypeList: [], + labelCol: { + span: 7 + }, + wrapperCol: { + span: 13 + }, + rules: { + name: [{ + required: true, + message: '名称不能为空', + trigger: 'blur' + }, + { + min: 1, + max: 50, + message: '字数限制1~50', + trigger: 'blur' + }, + ], + url: [{ + required: true, + message: 'URL不能为空', + trigger: 'blur' + }, + { + min: 1, + max: 200, + message: '字数限制1~200', + trigger: 'blur' + }, + { + trigger: 'blur', + pattern: /^((https|http)?:\/\/)[^\s]+/, + message: '仅支持 https | http' + } + ], + linkType: [{ + required: true, + message: '至少选一个分类', + trigger: 'blur' + }], + avatar: [{ + required: false, + }, { + trigger: 'blur', + pattern: /^((https|http)?:\/\/)[^\s]+/, + message: '仅支持 https | http' + }], + + } + } + }, + methods: { + getCalendarContainer(trigger) { + return trigger => trigger.parentNode; + }, + }, + beforeMount() { + getLinkType({}).then((res) => { + this.linkTypeList = res.data; + }) + }, + } +</script> + +<style> +</style> diff --git a/src/components/mini/box-new-article.vue b/src/components/mini/box-new-article.vue index 7e442d8..b197f12 100644 --- a/src/components/mini/box-new-article.vue +++ b/src/components/mini/box-new-article.vue @@ -485,9 +485,10 @@ line-height: 1.7; color: #999; display: -webkit-container; - -webkit-line-clamp: 3; + -webkit-line-clamp: 2; text-overflow: ellipsis; overflow: hidden; + min-height: 20px; } } diff --git a/src/components/mini/box10-add.vue b/src/components/mini/box10-add.vue index ef07260..8800027 100644 --- a/src/components/mini/box10-add.vue +++ b/src/components/mini/box10-add.vue @@ -187,6 +187,7 @@ } from '../../api/blogArticleType.js' import myConstant from "../../config/myConstant.js" + import md5 from 'js-md5'; export default { beforeMount() { @@ -259,7 +260,7 @@ ], secret: [{ required: true, - message: '不正经的人..', + message: '好像这里错了..', trigger: 'blur' }], common: [{ @@ -293,6 +294,11 @@ }, beforeUploadCover(file, fileList) { return new Promise((resolve, reject) => { + if (this.form.secret == null || this.form.secret == "") { + this.$message.error('需要正确的授权码'); + return reject(false); + } + if (this.form.coverFileList.length >= 1) { this.$message.error('这里最多上传一个文件'); return reject(false); @@ -306,6 +312,11 @@ }, beforeUpload(file, fileList) { return new Promise((resolve, reject) => { + if (this.form.secret == null || this.form.secret == "") { + this.$message.error('需要正确的口令..'); + return reject(false); + } + if (this.form.blogFileList.length >= 1) { this.$message.error('这里最多上传一个文件'); return reject(false); @@ -360,7 +371,7 @@ const formData = new FormData() formData.append('file', option.file) formData.append('fileType', option.data.fileType) - formData.append('authCode', this.form.secret) + formData.append('authCode', this.form.secret == "" ? "" : md5(this.form.secret)) myFileInfoUpload(formData).then((res) => { if (res.success) { this.$message.success('上传成功') diff --git a/src/components/mini/box13-reply.vue b/src/components/mini/box13-reply.vue index ede92fa..6fa0307 100644 --- a/src/components/mini/box13-reply.vue +++ b/src/components/mini/box13-reply.vue @@ -18,10 +18,8 @@ </a-form-model-item> <a-form-model-item label="认证" v-show="form.nickName=='inleft'||form.nickName=='笔墨'||form.nickName=='阿墨'"> - <a-input-password v-model="form.authCode" autocomplete='new-password' type="password" - placeholder="我的授权码"> - <a-icon slot="prefix" type="lock" style="color:rgba(0,0,0,.25)" /> - </a-input-password> + <a-input v-model="form.authCode" autocomplete='new-password' type="password" placeholder="我的授权码"> + </a-input> </a-form-model-item> </a-form-model> </div> diff --git a/src/components/mini/box15-videoPlayBox.vue b/src/components/mini/box15-videoPlayBox.vue index 18ea111..fa7b0cf 100644 --- a/src/components/mini/box15-videoPlayBox.vue +++ b/src/components/mini/box15-videoPlayBox.vue @@ -1,48 +1,25 @@ <template> <div> + <div> + 正在播放: <span> {{defalutTitle}} </span> + </div> <div class="myVideo"> - <div id="videoPlay" ref="test1" class="dplayer"></div> - <!-- <div class="mark" ></div> --> - <!-- 视频 --> - <div class="player-video-state"> - <span class="bp-svgicon"> - <svg viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink"> - <defs> - <path id="pid-1-svgo-a" d="M0 0h80v80H0z"></path> - <path - d="M52.546 8.014a3.998 3.998 0 014.222 3.077c.104.446.093.808.039 1.138a2.74 2.74 0 01-.312.881c-.073.132-.16.254-.246.376l-.257.366-.521.73c-.7.969-1.415 1.926-2.154 2.866l-.015.02a240.945 240.945 0 015.986.341l1.643.123.822.066.41.034.206.018.103.008.115.012c1.266.116 2.516.45 3.677.975a11.663 11.663 0 013.166 2.114c.931.87 1.719 1.895 2.321 3.022a11.595 11.595 0 011.224 3.613c.03.157.046.316.068.474l.015.119.013.112.022.206.085.822.159 1.646c.1 1.098.19 2.198.27 3.298.315 4.4.463 8.829.36 13.255a166.489 166.489 0 01-.843 13.213c-.012.127-.034.297-.053.454a7.589 7.589 0 01-.072.475l-.04.237-.05.236a11.762 11.762 0 01-.74 2.287 11.755 11.755 0 01-5.118 5.57 11.705 11.705 0 01-3.623 1.263c-.158.024-.316.052-.475.072l-.477.053-.821.071-1.644.134c-1.096.086-2.192.16-3.288.23a260.08 260.08 0 01-6.578.325c-8.772.324-17.546.22-26.313-.302a242.458 242.458 0 01-3.287-.22l-1.643-.129-.822-.069-.41-.035-.206-.018c-.068-.006-.133-.01-.218-.02a11.566 11.566 0 01-3.7-.992 11.732 11.732 0 01-5.497-5.178 11.73 11.73 0 01-1.215-3.627c-.024-.158-.051-.316-.067-.475l-.026-.238-.013-.119-.01-.103-.07-.823-.132-1.648a190.637 190.637 0 01-.22-3.298c-.256-4.399-.358-8.817-.258-13.233.099-4.412.372-8.811.788-13.197a11.65 11.65 0 013.039-6.835 11.585 11.585 0 016.572-3.563c.157-.023.312-.051.47-.07l.47-.05.82-.07 1.643-.13a228.493 228.493 0 016.647-.405l-.041-.05a88.145 88.145 0 01-2.154-2.867l-.52-.73-.258-.366c-.086-.122-.173-.244-.246-.376a2.74 2.74 0 01-.312-.881 2.808 2.808 0 01.04-1.138 3.998 3.998 0 014.22-3.077 2.8 2.8 0 011.093.313c.294.155.538.347.742.568.102.11.19.23.28.35l.27.359.532.72a88.059 88.059 0 012.06 2.936 73.036 73.036 0 011.929 3.03c.187.313.373.628.556.945 2.724-.047 5.447-.056 8.17-.038.748.006 1.496.015 2.244.026.18-.313.364-.624.549-.934a73.281 73.281 0 011.93-3.03 88.737 88.737 0 012.059-2.935l.533-.72.268-.359c.09-.12.179-.24.281-.35a2.8 2.8 0 011.834-.881zM30.13 34.631a4 4 0 00-.418 1.42 91.157 91.157 0 00-.446 9.128c0 2.828.121 5.656.364 8.483l.11 1.212a4 4 0 005.858 3.143c2.82-1.498 5.55-3.033 8.193-4.606a177.41 177.41 0 005.896-3.666l1.434-.942a4 4 0 00.047-6.632 137.703 137.703 0 00-7.377-4.708 146.88 146.88 0 00-6.879-3.849l-1.4-.725a4 4 0 00-5.382 1.742z" - id="pid-1-svgo-d"></path> - <filter x="-15.4%" y="-16.3%" width="130.9%" height="132.5%" filterUnits="objectBoundingBox" - id="pid-1-svgo-c"> - <feOffset dy="2" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset> - <feGaussianBlur stdDeviation="1" in="shadowOffsetOuter1" result="shadowBlurOuter1"> - </feGaussianBlur> - <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0" in="shadowBlurOuter1" - result="shadowMatrixOuter1"></feColorMatrix> - <feOffset in="SourceAlpha" result="shadowOffsetOuter2"></feOffset> - <feGaussianBlur stdDeviation="3.5" in="shadowOffsetOuter2" result="shadowBlurOuter2"> - </feGaussianBlur> - <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" in="shadowBlurOuter2" - result="shadowMatrixOuter2"></feColorMatrix> - <feMerge> - <feMergeNode in="shadowMatrixOuter1"></feMergeNode> - <feMergeNode in="shadowMatrixOuter2"></feMergeNode> - </feMerge> - </filter> - </defs> - <g fill="none" fill-rule="evenodd" opacity=".8"> - <mask id="pid-1-svgo-b" fill="#fff"> - <use xlink:href="#pid-1-svgo-a"></use> - </mask> - <g mask="url(#pid-1-svgo-b)"> - <use fill="#000" filter="url(#pid-1-svgo-c)" xlink:href="#pid-1-svgo-d"></use> - <use fill="#FFF" xlink:href="#pid-1-svgo-d"></use> - </g> - </g> - </svg> - </span> + <div id="videoPlay" ref="myVdeoPlay"></div> + </div> + <div style="border-radius: 0 0 4px 4px;"> + <div style="padding: 10px 0px;"> + 音量 : + <a-slider v-model="volumeInit" :default-value="0.1" :step="0.1" :max="1" @change="changeVolume" /> </div> + <a-collapse> + <!-- v-if="playHistory.length>1" --> + <a-collapse-panel key="playList" header="播放记录"> + <div class="playItem" v-for="(item,index) in playHistory"> + {{item.title}} + <a-icon v-if="index==0" type="youtube" class="playIcon" /> + </div> + </a-collapse-panel> + </a-collapse> </div> </div> </template> @@ -54,16 +31,37 @@ export default { data() { return { + defalutImg: "http://t.inleft.com/share/media_photo/idea_beijing.jpg", + defalutTitle: "", dp: null, video: {}, - firstLoad: true + firstLoad: true, + volumeInit: 0.1, + isPlaying: false, + playHistory: [], + playHistoryId: {}, } }, + mounted() { + //弹窗初始化后先不加载视频,等待手动播放 + this.init(); + }, methods: { - myPlay() { - this.$message.info("start play..") + changeVolume(value) { + this.dp.volume(value, true, false); }, changePlay(videoData) { + console.log(111); + this.defalutTitle = videoData.title; + if (this.playHistoryId[videoData.id] != null) { + this.playHistory = this.playHistory.filter(item => item.id == videoData.id); + this.playHistory.unshift(videoData) + return + } else { + this.playHistoryId[videoData.id] = videoData; + this.playHistory.unshift(videoData) + } + // this.video = { // img: "http://t.inleft.com/share/media_photo/idea_beijing.jpg", // url: "http://t.inleft.com/share/mp3/EOPMusic%282%29.mp3", @@ -74,55 +72,51 @@ // 以下为隐藏一些作者的信息和视频播放源 如不需要可删除 // document.querySelector(".dplayer-menu").remove(); //隐藏右键菜单 - document.querySelector(".dplayer-mask").remove(); - document.querySelector(".dplayer-info-panel-item-url").remove(); //隐藏播放源 - let length = document.querySelectorAll(".dplayer-menu-item").length; - document.querySelectorAll(".dplayer-menu-item")[length - 1].remove(); // 去掉作者信息 - document.querySelectorAll(".dplayer-menu-item")[length - 2].remove(); // 去掉作者信息 + + + // document.querySelector(".dplayer-mask").remove(); + // document.querySelector(".dplayer-info-panel-item-url").remove(); //隐藏播放源 + // let length = document.querySelectorAll(".dplayer-menu-item").length; + // document.querySelectorAll(".dplayer-menu-item")[length - 1].remove(); // 去掉作者信息 + // document.querySelectorAll(".dplayer-menu-item")[length - 2].remove(); // 去掉作者信息 }, loadVideo(videoInfo) { + + }, + init() { this.dp = new DPlayer({ element: document.getElementById("videoPlay"), //logo: "https://qczh-1252727916.cos.ap-nanjing.myqcloud.com/pic/273658f508d04d488414fd2b84c9f923.png", // 在视频左上角上打一个logo - // hotkey: true, // 是否支持热键,调节音量,播放,暂停等 + hotkey: true, // 是否支持热键,调节音量,播放,暂停等 mutex: false, // 防止同时播放多个用户,在该用户开始播放时暂停其他用户 theme: "#b7daff", // 风格颜色,例如播放条,音量条的颜色 loop: false, // 是否自动循环 lang: "zh-cn", // 语言,'en', 'zh-cn', 'zh-tw' // screenshot: true, // 是否允许截图(按钮),点击可以自动将截图下载到本地 - preload: "auto", // 自动预加载 - volume: 0.1, // 初始化音量 + preload: "metadata", // 自动预加载 'none', 'metadata', 'auto' + volume: this.volumeInit, // 初始化音量 playbackSpeed: [2, 1, 0.5], //可选的播放速度,可自定义 contextmenu: [ - // 自定义上下文菜单 //右键菜单 { text: "b站", link: "https://www.bilibili.com" }, - // { - // text: "选项二", - // click: player => { - // console.log(player); - // } - // } + ], + highlight: [ //进度条上的自定义时间标记 // 进度条时间点高亮 - { - text: "10M", - time: 60 - }, - { - text: "20M", - time: 120 - } + // { + // text: "10M", + // time: 60 + // }, ], video: { - pic: videoInfo.img, // 视频封面 - url: videoInfo.url, - type: videoInfo.type, + pic: this.defalutImg, // 视频封面 + // url: videoInfo.url, + // type: videoInfo.type, customType: { customHls: function(video, player) { const hls = new Hls() @@ -132,58 +126,56 @@ } } }) - } + }, } } </script> <style lang="less" scoped> + .playItem { + border: 1px solid #d9d9d9; + padding: 10px; + border-radius: 5px; + margin: 10px; + transition: all .5s; + position: relative; + } + + .playItem:hover { + transform: scale(1.1) translate3d(0, 0, 0); + } + + .playItem:active { + transform: scale(0.85); + } + + .playIcon { + transform: scale(1.3); + position: absolute; + top: 35%; + right: 10px; + } + .myVideo { position: relative; - // width: 220px; - // height: 140px; width: 300px; height: 180px; background-color: #565656; border-radius: 10px; - margin: 10px; + margin: 20px 0px; display: flex; - - } - - .myVideo:hover { - .mark { - background-color: #000; - display: initial; - } - - .player-video-state { - // display: initial; - } + .myVideo /deep/ .dplayer-video { + height: auto; + // border-radius: 16px; } - - .dplayer { - width: 500px; + .myVideo /deep/ .dplayer { + border-radius: 5px; } - .mark { - opacity: 0.45; - width: 100%; - height: 100%; - position: absolute; - background-color: #000; - display: none; - } - - .player-video-state { - position: absolute; - left: 43%; - top: 35%; - width: 50px; - height: 50px; - display: none; + .myVideo /deep/ video { + object-fit: cover; } </style> diff --git a/src/components/mini/box16-videoDetail.vue b/src/components/mini/box16-videoDetail.vue index 8874d56..7071b88 100644 --- a/src/components/mini/box16-videoDetail.vue +++ b/src/components/mini/box16-videoDetail.vue @@ -3,7 +3,7 @@ <div class="boxMain"> <videoPlayBox ref="videoPlayBox"></videoPlayBox> </div> - <div style="padding: 20px 20px 5px;" class="myShadow"> + <div style="padding: 20px 20px 5px;margin-bottom: 20px;" class="myShadow"> <pre>{{introduce}}</pre> </div> <div class="articleComment"> @@ -57,17 +57,25 @@ videoData: { img: "http://t.inleft.com/share/media_photo/idea_beijing.jpg", url: "", - type: "normal" + type: "normal", + title: "", + id: "" } } }, methods: { showVideo(item) { + //防止重复加载 this.lastArticleId = this.articleId; this.articleId = item.id - this.isAllowedComment = item.isAllowedComment - this.introduce = item.introduce - this.loadData() + + if (this.articleId == this.lastArticleId) { + return + } + + this.isAllowedComment = item.isAllowedComment; + this.introduce = item.introduce; + this.loadData(); }, loadData() { @@ -81,7 +89,7 @@ id: this.articleId, authWord: this.secret == "" ? null : md5(this.secret) }).then((res) => { - this.myLock = true; + this.myLock = !this.myLock; if (res.code != 200) { @@ -104,6 +112,10 @@ this.isAllowedComment = res.data.isAllowedComment; this.videoData.url = res.data.articleFileURL; this.videoData.img = res.data.coverFileURL; + this.videoData.title = res.data.title; + this.videoData.id = res.data.id; + + if (res.data.articleFileURL != null && res.data.articleFileURL != "" && res.data.articleFileURL.endsWith("m3u8")) { @@ -112,7 +124,7 @@ this.videoData.type = "normal"; } - this.myLock = false; + this.myLock = !this.myLock; if (this.lastArticleId != this.articleId) { _this.$refs.videoPlayBox.changePlay(this.videoData) } diff --git a/src/components/mini/box5-article.vue b/src/components/mini/box5-article.vue index 7590f59..b4a5f01 100644 --- a/src/components/mini/box5-article.vue +++ b/src/components/mini/box5-article.vue @@ -56,11 +56,11 @@ </template> <script> - import babyActicle from '../../assets/baby.htm' + //import babyActicle from '../../assets/baby.htm' export default { props: { source: { - default: babyActicle + default: '' }, "title": { default:"陈奕迅-Body Song 歌词", diff --git a/src/components/mini/box8-panal.vue b/src/components/mini/box8-panal.vue index 76ca572..ae9839c 100644 --- a/src/components/mini/box8-panal.vue +++ b/src/components/mini/box8-panal.vue @@ -5,7 +5,7 @@ <div class="myCard" style="height: 200px;width: 220px; border-radius: 20px;"> <a-card :hoverable="true" size="small"> <template slot="cover"> - <img class="myCardCover" alt="example" src="../../assets/mowenwei.jpg" /> + <!-- <img class="myCardCover" alt="example" src="../../assets/mowenwei.jpg" /> --> </template> <template slot="actions" class="ant-card-actions"> diff --git a/src/components/mini/mdDetail.vue b/src/components/mini/mdDetail.vue index a55f3d5..541fcde 100644 --- a/src/components/mini/mdDetail.vue +++ b/src/components/mini/mdDetail.vue @@ -243,6 +243,7 @@ } .mySecretSamll { + padding: 30px 10px 10px; height: 115px; display: flex; flex-direction: column; diff --git a/src/components/swichLabel/main1-home.vue b/src/components/swichLabel/main1-home.vue index 8666551..9277329 100644 --- a/src/components/swichLabel/main1-home.vue +++ b/src/components/swichLabel/main1-home.vue @@ -2,7 +2,8 @@ <div> <MyModal ref="myModal" /> <MyPreviewModal ref="MyPreviewModal" /> - <MyMessage ref="MyMessage" /> + <MyMessage ref="MyMessage" v-if="openMessage" /> + <MyLink ref="MyLink" v-if="openLinkAdd" /> <div class="blog-drawer"> <a-drawer placement="left" :closable="false" :visible="visibleDrawer" :getContainer="'body'" @@ -14,7 +15,7 @@ </a-drawer> </div> - <div class="blog-main "> + <div class="blog-main"> <a-row> <keep-alive> @@ -42,7 +43,7 @@ <a-col v-bind="colApiRight"> <tool @showModal="showModal" @showPreview="showPreview" @showScreen="showScreen" - @showMessage="showMessage" /> + @showMessage="showMessage" @addLink="addLink" /> </a-col> </a-row> </div> @@ -57,6 +58,7 @@ import MyModal from "../group/MyModal.vue" import MyPreviewModal from "../group/MyPreviewModal.vue" import MyMessage from "../group/MyMessage.vue" + import MyLink from "../group/MyLink.vue" import screenConfig from "../../config/screenConfig.js" @@ -69,6 +71,7 @@ MyModal, MyPreviewModal, MyMessage, + MyLink, }, methods: { showScreen() { @@ -83,6 +86,12 @@ } this.scale = !this.scale; }, + addLink() { + this.openLinkAdd = true + this.$nextTick(function() { + this.$refs.MyLink.showModal(); + }) + }, showModal() { this.$refs.myModal.showModal(); }, @@ -90,7 +99,10 @@ this.$refs.MyPreviewModal.showModal(); }, showMessage() { - this.$refs.MyMessage.showModal(); + this.openMessage = true + this.$nextTick(function() { + this.$refs.MyMessage.showModal(); + }) }, afterVisibleChange(val) {}, showDrawer() { @@ -107,9 +119,12 @@ colMini: screenConfig.colMini, colApiLeft: screenConfig.colApiLeft, colApiRight: screenConfig.colApiRight, - colApiMain: screenConfig.colApiMain + colApiMain: screenConfig.colApiMain, + openLinkAdd: false, + openMessage: false, } - } + }, + } </script> -- Gitblit v1.9.1