创新实训博客(43)——爬取任务管理界面修改配置
2020-07-14 06:21
645 查看
任务管理界面
历史任务界面
界面设计
1. el-tab的使用
2. 在列表项显示tag的配置
[code] <el-table-column align="center" label="状态" width="120%"> <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="primary">进行中</el-tag> <el-tag v-if="scope.row.status === 2" type="success">已完成</el-tag> <el-tag v-if="scope.row.status === 3" type="danger">已取消</el-tag> </template> </el-table-column>
3. 最后的管理按钮显示配置
[code] <el-table-column align="center" label="管理" width="120%"> <template slot-scope="scope"> <el-button v-if="scope.row.status === 1" type="danger" size="mini" icon="el-icon-delete" @click="del(scope.row)">终止</el-button> <el-button v-if="scope.row.status === 3" type="primary" size="mini" icon="el-icon-refresh" @click="del(scope.row)">开始</el-button> </template> </el-table-column>
4. 底部分页的配置
[code] <el-pagination :total="currentTotal" :current-page.sync="currentPage" background layout="prev, pager, next" style="float: right; margin: 8px" @current-change="handleCurrentChange" />
api接口调用
1. 获取任务总数
[code]export function adminGetCrawlCount() { return request({ url: '/admin/crawl/task/count', method: 'get' }) }
2. 获取任务列表
[code]export function adminGetCrawlList(page, size) { return request({ url: '/admin/crawl/task/list', method: 'get', params: { page: page, size: size} }) }
3. 获取历史任务总数
[code]export function adminGetCrawlHisCount() { return request({ url: '/admin/crawl/history/count', method: 'get' }) }
4. 获取历史任务列表
[code]export function adminGetCrawlHisList(page, size) { return request({ url: '/admin/crawl/history/list', method: 'get', params: { page: page, size: size} }) }
5. 添加任务
[code]export function adminAddCrawl(id) { return request({ url: '/admin/crawl/task/add/' + id, method: 'get' }) }
在js中使用api获取信息
1. 监听任务管理界面页面变化
[code]handleCurrentChange() { var that = this that.listLoading = true adminGetCrawlCount().then(response => { const { data } = response that.currentTotal = data adminGetCrawlList(that.currentPage, 10).then(response2 => { that.list = response2.data that.listLoading = false }) }) },
2. 监听历史任务列表的页面变化
[code] handleHisChange() { var that = this that.listLoading = true adminGetCrawlHisCount().then(response => { const { data } = response that.hisTotal = data adminGetCrawlHisList(that.hisPage, 10).then(response2 => { that.hisList = response2.data that.listLoading = false }) }) },
相关文章推荐
- Spring Boot 定时任务实现后台管理动态配置(动态添加修改删除定时任务)
- 配置实现-编辑(增加、修改及工作流任务)界面配置使用
- 解决 django1.2环境中使用自带的admin管理界面,配置后访问出现“你无权限修改任何东西” 的问题
- Vmware中RedHat命令行和图形界面切换 Linux运行级别 默认界面配置 修改错误配置 修改root密码
- gradle针对版本号的管理——任务模式,直接修改build.gradle文件
- F5 BIG-IP负载均衡器配置实例与Web管理界面体验【转】
- SourceTree合并操作界面中,修改默认配置参数
- 自己动手做博客之日志管理-5.5 修改密码
- 自然语言交流系统 phxnet团队 创新实训 个人博客 (二)
- Django配置后台xadmin管理界面
- 我所认为的配置管理 [ 光影人像 东海陈光剑 的博客 ]
- 自然语言交流系统 phxnet团队 创新实训 项目博客 (七)
- 【视频】配置信息管理 的 使用方法(六):实现添加、修改、查询
- spring + ibatis 多数据源事务(分布式事务)管理配置方法 - 博海软件 - ITeye博客
- 攻破JNDI连接池(Tomcat5.5下通过管理界面配置连接池)
- 不修改listener.ora 配置,通过界面怎么配置?
- 修改csdn博客配置(昵称/显示名)
- 自然语言交流系统 phxnet团队 创新实训 项目博客 (二)
- 防火墙配置十大任务之七,防火墙的日志管理
- 自然语言交流系统 phxnet团队 创新实训 项目博客 (六)