Browse Source

1.剧本列表Tips维护按钮跳转优化;2.Tips列表搜索优化

dev
liuzewei 3 years ago
parent
commit
cc9ac540d4
1 changed files with 48 additions and 20 deletions
  1. 68
      src/views/sce/tips/index.vue

68
src/views/sce/tips/index.vue

@ -23,12 +23,15 @@
<el-form-item label="剧本标题" prop="leaderId">
<el-select filterable remote reserve-keyword
@change="queryLc"
v-model="queryParams.query.scenarioId" placeholder="请输入剧本标题" :remote-method="remoteMethod" :loading="loading">
<el-option v-for="item in jbData" :key="item.id" :label="item.title" :value="item.id"></el-option>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage"
:page-size="pagesize" layout="total, prev, pager, next" :total="totalnum">
</el-pagination>
v-model="queryParams.query.scenarioId"
placeholder="请输入剧本标题"
@focus.once="queryLcAll"
:remote-method="remoteMethod"
:loading="loading">
<el-option v-for="item in jbData" :key="item.id" :label="item.title" :value="item.id"></el-option>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage"
:page-size="pagesize" layout="total, prev, pager, next" :total="totalnum">
</el-pagination>
</el-select>
</el-form-item>
@ -219,6 +222,7 @@ export default {
},
tableData: [],
jbData: [],
jbDataAll: [],
lcData: [],
total: 0,
type: "add",
@ -240,8 +244,16 @@ export default {
// }
// },
//
queryLcAll(){
this.remoteMethod('');
},
remoteMethod(e) {
this.title = e;
if( this.queryParams.query.scenarioId != this.title){
this.currentPage = 1;//
console.log(this.currentPage);
}
queryJbInfo({
pageSize: this.pagesize,
pageNum: this.currentPage,
@ -250,26 +262,32 @@ export default {
},
}).then((res) => {
if (res.code == 200) {
var arr = [];
arr = res.data.rows.map((item) => {
return {
value: item.id,
title: item.title,
id : item.id
};
});
this.jbData = arr;
this.totalnum = parseInt(res.data.total);
}
var arr = [];
arr = res.data.rows.map((item) => {
return {
value: item.id,
title: item.title,
id : item.id
};
});
this.jbData = arr;
this.totalnum = parseInt(res.data.total);
}
});
},
handleSizeChange(val) {
this.pagesize = val;
this.remoteMethod();
this.queryParams.query.scenarioId = this.title;
if( this.queryParams.query.scenarioId != this.title){
this.currentPage = 1;//
console.log(this.currentPage);
}
this.remoteMethod(this.title);
},
handleCurrentChange(val) {
this.currentPage = val;
this.remoteMethod();
this.queryParams.query.scenarioId = this.title;
this.remoteMethod(this.title);
},
//
async queryFindList() {
@ -302,7 +320,17 @@ export default {
async queryTipsList() {
this.loading = true;
if (this.$route.query.type == "sceinfo") {
this.queryParams.query.scenarioId = this.$route.query.scenarioId;
this.remoteMethod(''); //
let res = await queryTipsList(this.queryParams);
this.jbData.forEach(item=>{
if(item.id == this.$route.query.scenarioId){
this.queryParams.query.scenarioId = this.$route.query.scenarioId
this.data = {
scenarioId: this.$route.query.scenarioId
};
this.queryFindList();
}
})
}
try {
let res = await queryTipsList(this.queryParams);

Loading…
Cancel
Save