|
@@ -3,13 +3,13 @@
|
|
|
|
|
|
|
|
<el-form :model="queryForm" inline size="small">
|
|
<el-form :model="queryForm" inline size="small">
|
|
|
<el-form-item label="标题">
|
|
<el-form-item label="标题">
|
|
|
- <el-input v-model="queryForm.title" placeholder="标题" />
|
|
|
|
|
|
|
+ <el-input v-model="queryForm.title" placeholder="标题"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="监控词">
|
|
<el-form-item label="监控词">
|
|
|
- <el-input v-model="queryForm.keywords" placeholder="监控词" />
|
|
|
|
|
|
|
+ <el-input v-model="queryForm.keywords" placeholder="监控词"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="监控网站">
|
|
<el-form-item label="监控网站">
|
|
|
- <el-input v-model="queryForm.siteUrl" placeholder="监控网站" />
|
|
|
|
|
|
|
+ <el-input v-model="queryForm.siteUrl" placeholder="监控网站"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<el-row class="action-bar-container" type="flex" justify="end">
|
|
<el-row class="action-bar-container" type="flex" justify="end">
|
|
@@ -18,7 +18,11 @@
|
|
|
<el-button v-permission="['popular.feelings.add']" size="small" @click.native="$refs.dialogForm.open({})">
|
|
<el-button v-permission="['popular.feelings.add']" size="small" @click.native="$refs.dialogForm.open({})">
|
|
|
添加
|
|
添加
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button v-permission="['popular.feelings.delete']" size="small" @click.native="deleteByIds(multipleSelection)">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-permission="['popular.feelings.delete']"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click.native="deleteByIds(multipleSelection)"
|
|
|
|
|
+ >
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-button-group>
|
|
</el-button-group>
|
|
@@ -31,15 +35,23 @@
|
|
|
highlight-current-row
|
|
highlight-current-row
|
|
|
@selection-change="selectionChange"
|
|
@selection-change="selectionChange"
|
|
|
>
|
|
>
|
|
|
- <el-table-column type="selection" width="55" />
|
|
|
|
|
- <el-table-column label="ID" prop="id" width="150" />
|
|
|
|
|
|
|
+ <el-table-column type="selection" width="55"/>
|
|
|
|
|
+ <el-table-column label="ID" prop="id" width="150"/>
|
|
|
<el-table-column label="网站名称" prop="siteName">
|
|
<el-table-column label="网站名称" prop="siteName">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button type="text" @click.native="$refs.detailPage.open(scope.row)">{{ scope.row.siteName }}</el-button>
|
|
<el-button type="text" @click.native="$refs.detailPage.open(scope.row)">{{ scope.row.siteName }}</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="监控舆论词" prop="keywords" />
|
|
|
|
|
- <el-table-column label="监控域名" prop="domain" />
|
|
|
|
|
|
|
+ <el-table-column label="监控舆论词" prop="keywords"/>
|
|
|
|
|
+ <el-table-column label="监控域名" prop="domain"/>
|
|
|
|
|
+ <el-table-column label="爬取数量" prop="spiderCount"/>
|
|
|
|
|
+ <el-table-column label="状态" prop="status">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-tag v-if="scope.row.status===0" type="info"> 未启动</el-tag>
|
|
|
|
|
+ <el-tag v-if="scope.row.status===1" type="success"> 运行中</el-tag>
|
|
|
|
|
+ <el-tag v-if="scope.row.status===2" type="danger"> 已停止</el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="启动地址" prop="startUrls">
|
|
<el-table-column label="启动地址" prop="startUrls">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-tag v-for="tag in scope.row.startUrls" :key="tag"> {{ tag }}</el-tag>
|
|
<el-tag v-for="tag in scope.row.startUrls" :key="tag"> {{ tag }}</el-tag>
|
|
@@ -49,12 +61,35 @@
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-dropdown>
|
|
<el-dropdown>
|
|
|
<el-button type="text">
|
|
<el-button type="text">
|
|
|
- 操作<i class="el-icon-arrow-down el-icon--right" />
|
|
|
|
|
|
|
+ 操作<i class="el-icon-arrow-down el-icon--right"/>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item v-permission="['popular.feelings.edit']" type="text" @click.native="$refs.dialogForm.open(scope.row)">编辑</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item v-permission="['popular.feelings.delete']" @click.native="deleteByIds([scope.row.id])"> 删除</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item v-permission="['popular.feelings.delete']" @click.native="startSpider([scope.row.id])"> 启动</el-dropdown-item>
|
|
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ v-permission="['popular.feelings.edit']"
|
|
|
|
|
+ type="text"
|
|
|
|
|
+ @click.native="$refs.dialogForm.open(scope.row)"
|
|
|
|
|
+ >编辑
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ v-permission="['popular.feelings.delete']"
|
|
|
|
|
+ @click.native="deleteByIds([scope.row.id])"
|
|
|
|
|
+ >
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ v-if="scope.row.status!==1"
|
|
|
|
|
+ v-permission="['popular.feelings.start']"
|
|
|
|
|
+ @click.native="startSpider([scope.row.id])"
|
|
|
|
|
+ >
|
|
|
|
|
+ 启动
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item
|
|
|
|
|
+ v-if="scope.row.status===1"
|
|
|
|
|
+ v-permission="['popular.feelings.stop']"
|
|
|
|
|
+ @click.native="stopSpider([scope.row.id])"
|
|
|
|
|
+ >
|
|
|
|
|
+ 停止
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
</template>
|
|
</template>
|
|
@@ -68,13 +103,13 @@
|
|
|
:page-size="pageData.pageSize"
|
|
:page-size="pageData.pageSize"
|
|
|
@current-change="paginationChange"
|
|
@current-change="paginationChange"
|
|
|
/>
|
|
/>
|
|
|
- <dialog-form ref="dialogForm" @ok="fetchData" />
|
|
|
|
|
- <detail-page ref="detailPage" />
|
|
|
|
|
|
|
+ <dialog-form ref="dialogForm" @ok="fetchData"/>
|
|
|
|
|
+ <detail-page ref="detailPage"/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { deleteByIds, findPage, startSpider } from '@/api/statistics/popular_feelings'
|
|
|
|
|
|
|
+import { deleteByIds, findPage, startSpider, stopSpider } from '@/api/statistics/popular_feelings'
|
|
|
import { dateTimeFormatter } from '@/utils/formater'
|
|
import { dateTimeFormatter } from '@/utils/formater'
|
|
|
import DialogForm from './DialogForm'
|
|
import DialogForm from './DialogForm'
|
|
|
import DetailPage from './DetailPage'
|
|
import DetailPage from './DetailPage'
|
|
@@ -98,7 +133,28 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
dateTimeFormatter,
|
|
dateTimeFormatter,
|
|
|
- startSpider,
|
|
|
|
|
|
|
+ startSpider(ids) {
|
|
|
|
|
+ this.$confirm('确认要启动吗?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ startSpider(ids).then(() => {
|
|
|
|
|
+ this.fetchData()
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ stopSpider(ids) {
|
|
|
|
|
+ this.$confirm('确认要停止吗?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ stopSpider(ids).then(() => {
|
|
|
|
|
+ this.fetchData()
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
deleteByIds(ids) {
|
|
deleteByIds(ids) {
|
|
|
this.$confirm('确认要删除吗?', '提示', {
|
|
this.$confirm('确认要删除吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|