Commit ce61be0a authored by WBY1026's avatar WBY1026

完善对空表的处理

parent 554b8492
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
<div class="list"> <div class="list" v-show="haveInfo">
<el-table :data="mytableList" v-loading="loading" @cell-click="cellClick"> <el-table :data="mytableList" v-loading="loading" @cell-click="cellClick">
<el-table-column fixed label="用户" prop="ccc" width="100px"></el-table-column> <el-table-column fixed label="用户" prop="ccc" width="100px"></el-table-column>
<!-- 月 --> <!-- 月 -->
...@@ -109,14 +109,23 @@ ...@@ -109,14 +109,23 @@
<img src='./404.png' alt='暂无数据,稍后重试' /> <img src='./404.png' alt='暂无数据,稍后重试' />
</template> </template>
</el-table> </el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
:page-sizes="[30, 40, 100, 200]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
:total="totalPage">
</el-pagination>
</div>
<div v-show="!haveInfo" style=" width: 100%;height: 300px; display: flex;" >
<img style="margin: auto;" src='./404.png' alt='暂无数据,稍后重试' />
</div> </div>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
:page-sizes="[30, 40, 100, 200]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
:total="totalPage">
</el-pagination>
<!-- <button @click="test">2222</button> --> <!-- <button @click="test">2222</button> -->
...@@ -230,6 +239,8 @@ export default { ...@@ -230,6 +239,8 @@ export default {
inputddd: '', inputddd: '',
inputdddd: '', inputdddd: '',
haveInfo: true,
// 弹窗控制 // 弹窗控制
dialogTableVisible: false, dialogTableVisible: false,
gridData: [], gridData: [],
...@@ -353,17 +364,23 @@ export default { ...@@ -353,17 +364,23 @@ export default {
this.totalPage = res.data this.totalPage = res.data
}) })
searchTableList(data).then(res => { searchTableList(data).then(res => {
console.log(res); if (res.data.length != 0) {
this.mytableList = res.data this.haveInfo = true
// 判断返回的数据,然后调用渲染方法 console.log(res);
if (this.myCheckBox.length <= 1) { this.mytableList = res.data
this.getDateType1() // 判断返回的数据,然后调用渲染方法
} else if (this.myCheckBox.length == 2) { if (this.myCheckBox.length <= 1) {
this.getDateType2() this.getDateType1()
} else if (this.myCheckBox.length == 2) {
this.getDateType2()
} else {
this.getDateType3()
}
this.loading = false
} else { } else {
this.getDateType3() this.haveInfo = false
} }
this.loading = false
}); });
}, },
...@@ -677,46 +694,49 @@ export default { ...@@ -677,46 +694,49 @@ export default {
this.clickKey = key this.clickKey = key
console.log('高亮赋值' + this.clickKey); console.log('高亮赋值' + this.clickKey);
if (value) {
this.dialogTempData = {
aaa: this.lockaaa,
bbb: this.lockbbb,
cccc: this.lockcccc,
ddd: this.lockddd,
dddd: this.lockdddd,
eee: this.lockeee,
fff: this.lockfff,
ggg: this.lockggg,
hhh: this.lockhhh,
iii: this.lockiii,
jjj: this.lockjjj,
kkk: this.lockkkk,
pageSize: this.pageSizeInDialog,
pageNo: this.currentPageInDialog,
clickAaa: aaa,
clickKey: key,
clickValue: value,
clickCcc: ccc,
}
this.dialogTempData = { // 获取总条数
aaa: this.lockaaa, getClickInformationPageNum(this.dialogTempData)
bbb: this.lockbbb, .then(res => {
cccc: this.lockcccc, console.log(res);
ddd: this.lockddd, this.totalPageInDialog = res.data
dddd: this.lockdddd, })
eee: this.lockeee,
fff: this.lockfff,
ggg: this.lockggg,
hhh: this.lockhhh,
iii: this.lockiii,
jjj: this.lockjjj,
kkk: this.lockkkk,
pageSize: this.pageSizeInDialog,
pageNo: this.currentPageInDialog,
clickAaa: aaa, // 获取信息
clickKey: key, getClickInformation(this.dialogTempData)
clickValue: value, .then(res => {
clickCcc: ccc, this.gridData = res.data
console.log(res.data);
this.dialogTableVisible = true
})
} }
// 获取总条数
getClickInformationPageNum(this.dialogTempData)
.then(res => {
console.log(res);
this.totalPageInDialog = res.data
})
// 获取信息
getClickInformation(this.dialogTempData)
.then(res => {
this.gridData = res.data
console.log(res.data);
this.dialogTableVisible = true
})
}, },
......
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