|
@@ -37,7 +37,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="事件" prop="event" v-if="!ruleForm.id">
|
|
|
+ <el-form-item label="事件" prop="event" >
|
|
|
<mySelectButton size='large' style="width:100%" @click="addEvent" >
|
|
|
<div style="width:100%">
|
|
|
<el-select style="width:100%" v-model="ruleForm.eventId" @change="changeEvent" filterable remote :disabled="eventList.disabled" clearable placeholder="请选择"
|
|
@@ -51,7 +51,7 @@
|
|
|
</span>
|
|
|
</mySelectButton>
|
|
|
</el-form-item>
|
|
|
- <template v-if="(ruleForm.id && !(ruleForm.eventIds && ruleForm.eventIds.length)) || !ruleForm.id">
|
|
|
+ <template>
|
|
|
<div>
|
|
|
<el-form-item label="应用场景" prop="scenarioIds">
|
|
|
<el-checkbox-group v-model="ruleForm.scenarioIds" @change="onChange" :disabled="Boolean(ruleForm.eventId)">
|
|
@@ -337,17 +337,20 @@ export default {
|
|
|
this.ruleForm.scenarioIds = []
|
|
|
this.show=false
|
|
|
}
|
|
|
-
|
|
|
- if(!this.ruleForm.id){
|
|
|
- this.eventList.data = []
|
|
|
- this.eventList.name = ''
|
|
|
- this.eventList.disabled = false
|
|
|
+ this.eventList.data = []
|
|
|
+ this.eventList.name = ''
|
|
|
+ this.eventList.disabled = false
|
|
|
+ var hasEvent = false
|
|
|
+ if(this.ruleForm.eventId){
|
|
|
+ this.eventList.disabled = true
|
|
|
+ hasEvent = true
|
|
|
+ }
|
|
|
+ if(this.ruleForm.eventIds){
|
|
|
+ this.ruleForm.eventId = this.ruleForm.eventIds[0]
|
|
|
+ hasEvent = true
|
|
|
+ }
|
|
|
+ if(hasEvent){
|
|
|
if(this.ruleForm.eventId){
|
|
|
- this.eventList.disabled = true
|
|
|
- // this.eventList.data.push({
|
|
|
- // id:this.ruleForm.eventId,
|
|
|
- // name:this.ruleForm.eventName,
|
|
|
- // })
|
|
|
let params = {
|
|
|
current:1,
|
|
|
size:1,
|
|
@@ -453,10 +456,10 @@ export default {
|
|
|
this.eventList.data=[]
|
|
|
this.eventList.queryParams.current = 1
|
|
|
this.eventList.name = query
|
|
|
- this.getEventList()
|
|
|
+ this.getEventList(1)
|
|
|
},
|
|
|
//获取事件列表
|
|
|
- async getEventList(){
|
|
|
+ async getEventList(type){
|
|
|
this.eventList.loading = true;
|
|
|
let params = {
|
|
|
...this.eventList.queryParams,//分页信息
|
|
@@ -471,8 +474,19 @@ export default {
|
|
|
await this.$api.queryEvent(params).then(response => {
|
|
|
if(response.code == 200){
|
|
|
this.eventList.loading = false;
|
|
|
+ if (!type) {
|
|
|
+ if (this.ruleForm.eventId) {
|
|
|
+ var index = response.data.data.findIndex(item => {
|
|
|
+ return item.id == this.ruleForm.eventId
|
|
|
+ })
|
|
|
+ if (index != -1) {
|
|
|
+ response.data.data.splice(index, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.eventList.queryParams.total = response.data.total
|
|
|
+ }
|
|
|
this.eventList.data.push(...response.data.data)
|
|
|
- this.eventList.queryParams.total = response.data.total
|
|
|
+ // this.eventList.queryParams.total = response.data.total
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -508,7 +522,7 @@ export default {
|
|
|
this.personnelList.data=[]
|
|
|
this.personnelList.queryParams.current = 1
|
|
|
this.personnelList.queryParams.name = query
|
|
|
- this.getPersonnelList()
|
|
|
+ this.getPersonnelList(1)
|
|
|
},
|
|
|
|
|
|
|