Commit f637e42d by crushh

update: 优化

parent b4c3f5b1
......@@ -3,13 +3,13 @@
<div class="search-wrap">
<div class="table-page-search-wrapper">
<el-input
v-model="ruleTitle"
v-model="relateForm.ruleTitle"
placeholder="请输入上架规则名称"
prefix-icon="el-icon-search"
clearable
class="w-260"
@keyup.enter.native="getList"
@clear="getList"
@keyup.enter.native="getSearchList"
@clear="getSearchList"
/>
</div>
<div class="tips" style="font-size:14px">
......@@ -18,7 +18,7 @@
</el-button>
</div>
</div>
<el-table :data="tableDate" @row-click="onRowClick">
<el-table :data="tableDate" @row-click="onRowClick" v-loading="loading">
<el-table-column width="35">
<template slot-scope="{row}">
<el-radio v-model="tableRadio" :label="row">
......@@ -79,15 +79,15 @@ export default {
},
data () {
return {
loading: false,
tableRadio: '',
tableDate: [],
relateForm: {
search: '',
ruleTitle: '',
pageSize: 5,
currentPage: 1,
},
dialogTableVisible: false,
ruleTitle: '',
};
},
watch: {
......@@ -104,7 +104,13 @@ export default {
this.dialogTableVisible = true;
this.getList();
},
getSearchList () {
this.relateForm.currentPage = 1;
this.getList();
},
getList () {
this.loading = true;
this.tableRadio = '';
request.get('/api-integral-mall/page-rule', { params: this.relateForm }).then(async (res) => {
this.tableDate = res.data.result.result || [];
this.totalCount = res.data.result.totalCount;
......@@ -116,6 +122,8 @@ export default {
}
}
this.tableDate = this.tableDate.splice(0);
}).finally(_ => {
this.loading = false;
});
},
echoData (row) {
......@@ -127,6 +135,11 @@ export default {
},
cancel () {
this.tableRadio = '';
this.relateForm = {
ruleTitle: '',
pageSize: 5,
currentPage: 1,
};
this.dialogTableVisible = false;
},
submit () {
......
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