view list页面数据对接

摘要:
','Prompt',{confirmButtonText:'OK',cancelButtonText:'Cancel',类型:'warning'})。然后(()=˃{DelAnnouncement({id:data.id})。然后(res=˃{this.$message({type:'success',message:
<template>
<div class="app-container">
<div class="filter-container">
<el-input v-model="listQuery.title" placeholder="标题搜索" />
<el-button v-waves type="primary" @click="getList">
搜索
</el-button>
<el-button type="primary" @click="handleCreate()" v-if="areaId==2">
发布通知
</el-button>
</div>

<el-table
:key="tableKey"
:data="list"
border
fit
highlight-current-row
style=" 100%;"
>
<el-table-column label="序号" width="80">
<template slot-scope="{$index}">
<span>{{ $index+1 }}</span>
</template>
</el-table-column>


<el-table-column label="标题" align="center">
<template slot-scope="{row}">
<span>{{ row.title}}</span>
</template>
</el-table-column>

<el-table-column label="封面图" align="center">
<template slot-scope="{row}">
<el-image :src="http://t.zoukankan.com/row.picture" style=" 150px; height: 80px">

</el-image>
</template>
</el-table-column>


<el-table-column label="发布时间" align="center">
<template slot-scope="{row}">

<span>{{ row.createdtime | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
</template>
</el-table-column>
<el-table-column label="发布人" align="center">
<template slot-scope="{row}">
<span>孝南区市场监督管理局</span>
</template>
</el-table-column>
<el-table-column label="操作" min- class-name="small-padding fixed-width">
<template slot-scope="{row}">
<el-button type="primary" size="mini" @click="handleUpdate(row)">
修改
</el-button>
<el-button type="danger" size="mini" @click="del(row,$index)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="listQuery.pageNum"
:limit.sync="listQuery.pageSize"
@pagination="getList"
/>

</div>
</template>

<script>
import waves from '@/directive/waves' // waves directive
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import {getUser} from "@/utils/auth";
import {AnnouncementList,DelAnnouncement} from "@/api/supervisionNotice/supervisionNotice";
export default {
name: 'ComplexTable',
components: { Pagination },
directives: { waves },
data() {
return {
roleView:false,
tableKey: 0,
list:[],
total: 0,
user:null,
areaId:'',
listLoading: true,
listQuery: {
pageNum: 1,
pageSize: 10,
title: '',
},
name:'',
calendarTypeOptions:[],
reader:[],
temp: {
id: undefined,
remark: '',
title: '',
type: '',
readDeptName:''
},
dialogFormVisible: false,
}
},
created() {
this.areaId=JSON.parse(getUser()).areaId
this.getList();
},
methods: {
//获得页面数据
getList() {
this.listLoading = true
AnnouncementList({
pageNum:this.listQuery.pageNum,
pageSize:this.listQuery.pageSize,
title:this.listQuery.title,
}).then(response => {
this.listLoading = false
if(response.code == 200){
this.list = response.data.list,
this.total = response.data.total
}
}).catch(function(reason) {

})
},
// 删除
del(data){
this.$confirm('是否删除“ '+data.title+' ”?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
DelAnnouncement({
id: data.id
}).then(res=>{
this.$message({
type: 'success',
message: '删除成功!'
});
this.getList();
})
})
},

//发布通知方法
handleCreate() {
this.$router.push({ path: '/SupervisionNotice/AddSupervisionNotice' })
},

//修改通知方法
handleUpdate(row) {
this.$router.push({ path: '/SupervisionNotice/UpdateSupervisionNotice',query: {id:row.id} })
},
}
}
</script>
<style lang="scss" scoped>
.type_box{
margin: 0 0 10px;
}
.detailDialog{
padding:0 40px;
text-align: left;
font-size:16px;
}
.detailDialog-item-tit{
font-weight: 700;
line-height: 40px;
}
.detailDialog-item{
margin: 8px;
}
.detailDialog-item-pre{
margin :0 0 10px 0;
line-height: 25px;
}
.editDialog-wr{
margin: 30px;
}
.fafw-btn{
margin: 5px 5px 5px 0;
}
</style>

  view list页面数据对接第1张

代码全部贴出,展现的页面效果如上,里面有些无用代码,直接忽略,具体记录下我需要记住的重点

第一个:列表分页

view list页面数据对接第2张

 页面显示

view list页面数据对接第3张

 view list页面数据对接第4张

 view list页面数据对接第5张

 第二:条件查询。传参。界面条件查询,也是请求getlist()方法

view list页面数据对接第6张

 第三:删除方法

view list页面数据对接第7张

view list页面数据对接第8张

 里面没有详细记录怎么请求到后台接口的,如果想知道可以看我的另一篇文章

view 请求后台接口

免责声明:文章转载自《view list页面数据对接》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Linux获取系统时间Arch Linux 分区设定以及新增用户等命令下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

【HTML5版】导出Table数据并保存为Excel

首发我的博客 http://blog.meathill.com/tech/js/export-table-data-into-a-excel-file.html 最近接到这么个需求,要把<table>显示的数据导出成Excel表。类似的需求并不稀罕,过去我通常用PHP输出.csv文件,不过这次似乎不能这么做:数据源表格允许用户筛选和排序,与原...

mysql只显示表名和备注

查看某个数据下的表及其备注: select table_name,table_comment from information_schema.tables where table_schema='db' ; 只要改后面的table_schema为你的数据库名 结果: 查看某个表下的字段及其备注 desc 表名; show columns from表名...

HashMap

一、HashMap底层实现 简单的可以从以下两个纬度去理解HashMap的底层实现原理。 数组:充当索引 链表:处理碰撞 HashMap用一个指针数组table,离散化key的作用,当加入一个 key 的时候,通过Hash算法,计算出 key所在的数组下标 i,如果table[i]位置的对象元素为null的时候,则直接将<key, value&...

Intel daal数据预处理

https://software.intel.com/en-us/daal-programming-guide-datasource-featureextraction-py # file: datasource_featureextraction.py #=================================================...

Jquery easyui教程

目  录 1基本拖放................................................................................................................................................... 4 2构建购物车型拖放..........

MYSQL与TiDB的执行计划

前言 这里采用了tpc-h一个数据库的数据量来进行查询计划的对比。并借助tpc-h中的22条查询语句进行执行计划分析。 mysql采用的是标准安装,TiDB采用的是单机测试版,这里的性能结果不能说明其性能差异 本文章主要目的是对比Mysql与TiDB在执行sql查询时的差异。 mysql版本5.7 TiDB版本v2.0.0-rc.4 准备阶段 数据导入Ti...