|
@@ -5,7 +5,7 @@
|
|
|
<div v-if="type == 1">
|
|
|
<el-form :model="formData[0]" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
|
|
<el-form-item label="事件名称" prop="name">
|
|
|
- <el-autocomplete class="inline-input" v-model="formData[0].name" v-SelectLazyLoading="load"
|
|
|
+ <el-autocomplete class="inline-input" v-model="formData[0].name" value-key="name" v-SelectLazyLoading="load"
|
|
|
:fetch-suggestions="querySearchQuestion"
|
|
|
placeholder="请输入或选择事件" :trigger-on-focus="false"
|
|
|
@select="handleSelectQuestion" @blur="blur($event, { $index: 0 })" style="width: 100%;">
|
|
@@ -154,11 +154,15 @@ export default {
|
|
|
commonData: {},
|
|
|
//弹窗类型
|
|
|
type: 1,
|
|
|
- queryParams: {
|
|
|
- current: 1,
|
|
|
- size:10,
|
|
|
+ questionNameArr:{
|
|
|
+ queryParams: {
|
|
|
+ current: 1,
|
|
|
+ size:10,
|
|
|
+ },
|
|
|
+ eventInput:'',
|
|
|
+ data:[]
|
|
|
},
|
|
|
- eventInput:'',
|
|
|
+
|
|
|
//客户集合
|
|
|
clientList: [],
|
|
|
// 文件数组
|
|
@@ -400,36 +404,38 @@ export default {
|
|
|
deleteRow(row) {
|
|
|
this.formData.splice(row.$index, 1)
|
|
|
},
|
|
|
- // 懒加载方法
|
|
|
+
|
|
|
+
|
|
|
+ // 懒加载事件方法
|
|
|
load() {
|
|
|
- this.queryParams.size += 10
|
|
|
+ if(this.questionNameArr.queryParams.current * this.questionNameArr.queryParams.size>=this.questionNameArr.queryParams.total){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.questionNameArr.queryParams.current ++
|
|
|
this.questionEventList()
|
|
|
},
|
|
|
// 查询事件
|
|
|
- // 查询所有事件(不需要)
|
|
|
async questionEventList() {
|
|
|
- let searchValue={name:this.eventInput}
|
|
|
+ let searchValue={name:this.questionNameArr.eventInput}
|
|
|
let params = {
|
|
|
- ...this.queryParams,//分页信息
|
|
|
+ ...this.questionNameArr.queryParams,//分页信息
|
|
|
searchQuery:this.$commonJS.objectToString(searchValue)//输入的建议
|
|
|
}
|
|
|
await this.$api.queryEvent(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.questionNameArr = res.data.data
|
|
|
+ this.questionNameArr.data.push(...res.data.data)
|
|
|
+ this.questionNameArr.queryParams.total = res.data.total
|
|
|
+ this.questionNameArr.cb(this.questionNameArr.data);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- //获取下拉建议数据
|
|
|
+ //获取下拉建议事件数据
|
|
|
async querySearchQuestion(queryString, cb) {
|
|
|
- this.eventInput=queryString
|
|
|
+ this.questionNameArr.queryParams.current = 1
|
|
|
+ this.questionNameArr.eventInput=queryString
|
|
|
+ this.questionNameArr.data = []
|
|
|
+ this.questionNameArr.cb=cb
|
|
|
await this.questionEventList()
|
|
|
- var records=[]
|
|
|
- this.questionNameArr.forEach(item => {
|
|
|
- item.value = item.name
|
|
|
- records.push(item)
|
|
|
- })
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- cb(records);
|
|
|
},
|
|
|
|
|
|
// input框切换选择
|