diff --git a/src/views/sce/tips/index.vue b/src/views/sce/tips/index.vue index 6881e59..184f7b8 100644 --- a/src/views/sce/tips/index.vue +++ b/src/views/sce/tips/index.vue @@ -23,12 +23,15 @@ - - - - + v-model="queryParams.query.scenarioId" + placeholder="请输入剧本标题" + @focus.once="queryLcAll" + :remote-method="remoteMethod" + :loading="loading"> + + + @@ -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);