Commit dc75ae7f by lxyang

feat: 测试

parent 35801b85
......@@ -7,9 +7,9 @@ import request from '@/utils/request'
})
}
// 查询文档差异接口
export function doctaskFinddifferenceSearch({ id, context, pageindex, pagesize }) {
export function documentFindDocument({ name, pageindex, pagesize }) {
return request({
url: '/api/doc/doctask/finddifference/' + id + '?context=' + context + '&pageindex=' + pageindex + '&pagesize=' + pagesize,
method: 'get'
url: '/api/doc/document/findDocument/?name=' + name + '&pageindex=' + pageindex + '&pagesize=' + pagesize,
method: 'post'
})
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -19,14 +19,14 @@
<div class="left-content" v-for="(item, index) in listLeft" :key="index">
<div class="left-content-title">
<div class="logo"><img src="../../../assets/image/juliang.png" alt="" class="logo-img"></div>
<span class="media text">{{item.media}}</span>
<span class="text">更新日期:{{item.data}}</span>
<span class="media text">{{item.name}}</span>
<span class="text">更新日期:{{dateFilter(item.createTime)}}</span>
</div>
<div class="content-text-header">
<a class="link" v-if="item.link" :href="item.link" target="_blank">{{item.title}}</a>
<span v-else>{{item.title}}</span>
</div>
<p v-for="(items, index) in item.content" :key="index" class="content-text" v-html="items.contentText"></p>
<p class="content-text" v-html="item.docContent"></p>
</div>
<pagination v-show="queryParamsLeft.pageContent>0 && loadMoreLeft && listLeft.length"
:total="queryParamsLeft.pageContent"
......@@ -44,7 +44,7 @@
<script>
// 接口调用方法
import {
doctaskFinddifferenceSearch
documentFindDocument
} from "@/api/system/product";
export default {
data() {
......@@ -91,87 +91,54 @@ export default {
localStorage.setItem("searchDocument", this.search.trim())
this.seatchInitLeft()
},
dateFilter(time) {
if (!time) {
// 当时间是null或者无效格式时我们返回空
return '-'
} else {
const date = new Date(time) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
const dateNumFun = (num) => num < 10 ? `0${num}` : num // 使用箭头函数和三目运算以及es6字符串的简单操作。因为只有一个操作不需要{} ,目的就是数字小于10,例如9那么就加上一个0,变成09,否则就返回本身。 // 这是es6的解构赋值。
const [Y, M, D, h, m, s] = [
date.getFullYear(),
dateNumFun(date.getMonth() + 1),
dateNumFun(date.getDate()),
dateNumFun(date.getHours()),
dateNumFun(date.getMinutes()),
dateNumFun(date.getSeconds())
]
return `${Y}-${M}-${D} ${h}:${m}:${s}` // 一定要注意是反引号,否则无效。
}
},
// 搜索左侧
seatchInitLeft() {
this.loadingLeft = true
doctaskFinddifferenceSearch({
})
let name = this.search
let pageindex = this.queryParamsLeft.pageNo
let pagesize = this.queryParamsLeft.pageSize
documentFindDocument({ name, pageindex, pagesize })
.then(response => {
if (this.queryParamsLeft.pageContent === 0) {
this.queryParamsLeft.pageContent = 0
for (let i = 0; i < 10; i++) {
let data = {
media: '巨量引擎',
title: '巨量引擎开放平台' + (i + 1),
data: '2022-10-18',
link: 'https://ad.oceanengine.com/pages/login/index.html?source=oceanengine',
content: [
{
contentText: '通常情况下,应当处理 input 事件,并更新组件的绑定值(或使用v-model)。否则,输入框内显示的值将不会改变。1234', // 这是完整的一段话
contentChange:[ // 这段话里有多少变化以及链接出处
{
text: '或使用v-model',
url: 'https://www.baidu.com/'
},
{
text: '输入框内显示的值',
url: 'https://www.cnblogs.com/1234wu/p/11055005.html'
},
]
},
{
contentText: '视频或直播加热的功能,提升视频或直播间热度。121212', // 这是完整的一段话
contentChange: [
{
text: '提升视频或直播间热度',
url: 'https://element.eleme.io/#/zh-CN/component/pagination#events'
},
]
}
]
}
let content = data.content
for (let a = 0; a < content.length; a++) {
let contentChange = content[a].contentChange
for (let b = 0; b < contentChange.length; b++) {
let text = contentChange[b].text
let url = contentChange[b].url
if (content[a].contentText.indexOf(text) >= 0) {
let values = content[a].contentText.split(text);
content[a].contentText = values.join(
`<a style="color: rgba(250, 0, 0, 1);" href="${url}" target="_blank">${text}</a>`
)
}
}
}
this.listLeft.push(data)
if (response.code === 200) {
let pageContent = this.queryParamsLeft.pageContent
if (response.content.totalSize !== pageContent) {
this.queryParamsLeft.pageContent = response.content.totalSize || 0
}
let data = response.content.value
for (let i = 0; i < data.length; i++) {
let difWordAfter = data[i].difWordAfter || ''
let url = data[i].docUrl
if (data[i].docContent.indexOf(difWordAfter) >= 0 && difWordAfter) {
let values = data[i].docContent.split(difWordAfter);
data[i].docContent = values.join(
`<a style="color: rgba(250, 0, 0, 1);" href="${url}" target="_blank">${difWordAfter}</a>`
)
}
}
} else {
let page = this.queryParamsLeft.pageNo + 1
let orderSize = this.queryParamsLeft.pageNo * this.queryParamsLeft.pageSize
let number = page * this.queryParamsLeft.pageSize
let content = this.queryParamsLeft.pageContent
if (number >= content) {
this.loadMoreLeft = false
} else {
this.loadMoreLeft = true
}
this.listLeft = []
for (let i = orderSize; i < number; i++) {
this.listLeft.push({
media: '巨量' + (i + 1),
title: '巨量引擎开放平台' + (i + 1),
data: '2022-10-18',
link: 'https://ad.oceanengine.com/pages/login/index.html?source=oceanengine',
content: ['视频或直播加热的功能,提升视频或直播间热度。','视频或直播加热的功能,提升视频或直播间热度。']
})
}
this.queryParamsLeft.pageNo = page
this.$set(this, 'listLeft', data)
}
this.loadingLeft = false
})
.catch(error => {
this.loading = false;
this.loadingLeft = false;
});
setTimeout(() => {
this.loadingLeft = false
......
......@@ -38,11 +38,18 @@ export default {
return
}
this.$router.push({
name: 'tailAfter',
params: {
search: this.search
}
})
path: 'taskListIndex',
query: {
id: 1,
name: 121212
}
})
// this.$router.push({
// name: 'tailAfter',
// params: {
// search: this.search
// }
// })
}
},
computed: {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment