|
|
@ -11,26 +11,30 @@ |
|
|
|
</template> |
|
|
|
</ElTableColumn> |
|
|
|
|
|
|
|
<ElTableColumn prop="phrases2" width="260"> |
|
|
|
<ElTableColumn prop="searchRule" width="260"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-if="scope.row.deviceType == 1" v-model="scope.row.phrases2" placeholder="检索规则条件"> |
|
|
|
<el-select v-if="scope.row.deviceType == 1" v-model="scope.row.searchRule" placeholder="检索规则条件"> |
|
|
|
<el-option v-for="item in zyOptions" :key="item.value" :label="item.label" :value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
<div v-if="scope.row.deviceType == 2" class="plhx"> |
|
|
|
<el-select v-model="scope.row.phrases1" placeholder=""> |
|
|
|
<el-option label="事发上游最近" :value="1"></el-option> |
|
|
|
<el-select v-model="scope.row.searchRule" placeholder=""> |
|
|
|
<el-option v-for="item in zyOptions" :key="item.value" :label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-input-number v-model="scope.row.phrases2" :min="0" :max="9999" |
|
|
|
<el-input-number v-model="scope.row.number" :min="0" :max="9999" |
|
|
|
style="width: 130px;"></el-input-number>个 |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="scope.row.deviceType == 3 || scope.row.deviceType == 4" class="plhx"> |
|
|
|
<el-select v-model="scope.row.phrases1" placeholder=""> |
|
|
|
<el-option label="最近公里数" :value="1"></el-option> |
|
|
|
<el-select v-model="scope.row.searchRule" placeholder=""> |
|
|
|
<el-option v-for="item in zyOptions" :key="item.value" :label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-input-number v-model="scope.row.phrases2" :min="0" :max="9999" |
|
|
|
<el-input-number v-model="scope.row.number" :min="0" :max="9999" |
|
|
|
style="width: 130px;"></el-input-number> |
|
|
|
<p style="width: 56px;">公里</p> |
|
|
|
</div> |
|
|
@ -38,42 +42,42 @@ |
|
|
|
</template> |
|
|
|
</ElTableColumn> |
|
|
|
|
|
|
|
<ElTableColumn prop="phrases3" width="370"> |
|
|
|
<ElTableColumn prop="deviceList" width="370"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.deviceType == 1" class="mjs"> |
|
|
|
<el-select v-model="scope.row.phrases3" placeholder="" multiple collapse-tags> |
|
|
|
<el-select v-model="scope.row.deviceList" placeholder="" multiple collapse-tags> |
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<el-input placeholder="请选择" v-model="scope.row.phrases4" readonly> |
|
|
|
<el-input placeholder="请选择" v-model="scope.row.qbb" readonly> |
|
|
|
<i slot="suffix" class="el-input__icon el-icon-search"></i> |
|
|
|
</el-input> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="scope.row.deviceType == 2" class="mjs"> |
|
|
|
<el-select v-model="scope.row.phrases4" placeholder=""> |
|
|
|
<el-select v-model="scope.row.gzms" placeholder=""> |
|
|
|
<el-option label="工作模式" :value="1"></el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="scope.row.phrases6" placeholder=""> |
|
|
|
<el-select v-model="scope.row.czsc" placeholder=""> |
|
|
|
<el-option label="操作时长" :value="1"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="scope.row.deviceType == 3" class="mjs"> |
|
|
|
<el-select v-model="scope.row.phrases4" placeholder=""> |
|
|
|
<el-select v-model="scope.row.kzms" placeholder=""> |
|
|
|
<el-option label="控制模式" :value="1"></el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="scope.row.phrases5" placeholder=""> |
|
|
|
<el-select v-model="scope.row.sj" placeholder=""> |
|
|
|
<el-option label="选择时间" :value="1"></el-option> |
|
|
|
</el-select> |
|
|
|
<el-select v-model="scope.row.phrases6" placeholder=""> |
|
|
|
<el-select v-model="scope.row.gzzt" placeholder=""> |
|
|
|
<el-option label="工作状态" :value="1"></el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="scope.row.deviceType == 4" class="mjs"> |
|
|
|
<el-input v-model="scope.row.phrases4" placeholder="请输入发布内容"></el-input> |
|
|
|
<el-input v-model="scope.row.fbnr" placeholder="请输入发布内容"></el-input> |
|
|
|
</div> |
|
|
|
|
|
|
|
</template> |
|
|
@ -112,20 +116,24 @@ export default { |
|
|
|
props: { |
|
|
|
visible: Boolean, |
|
|
|
eventType: Number, |
|
|
|
// process: { |
|
|
|
// type: Array, |
|
|
|
// default: () => [] |
|
|
|
// } |
|
|
|
tableData: { |
|
|
|
type: Array, |
|
|
|
default: () => [{ |
|
|
|
deviceType: 1, |
|
|
|
searchRule: 1, |
|
|
|
qbb: '安全行驶' |
|
|
|
}] |
|
|
|
} |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableData: [ |
|
|
|
{ |
|
|
|
deviceType: 1, |
|
|
|
phrases2: 1, |
|
|
|
phrases4: '安全行驶' |
|
|
|
} |
|
|
|
], |
|
|
|
// tableData: [ |
|
|
|
// { |
|
|
|
// deviceType: 1, |
|
|
|
// searchRule: 1, |
|
|
|
// qbb: '安全行驶' |
|
|
|
// } |
|
|
|
// ], |
|
|
|
deviceOptions: [ |
|
|
|
{ |
|
|
|
value: 1, |
|
|
@ -208,53 +216,14 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getProcess() { |
|
|
|
this.tableData = []; |
|
|
|
request({ |
|
|
|
url: `/business/dcEventType/${this.eventType}`, |
|
|
|
method: "get", |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return Message.error(result.msg); |
|
|
|
//流程列表 |
|
|
|
this.process = []; |
|
|
|
this.tableData = []; |
|
|
|
result.data.processConfigList?.forEach((it, index) => { |
|
|
|
let commonPhrasesArr = it.commonPhrases ? it.commonPhrases.split(',') : ['']; |
|
|
|
let phrs = []; |
|
|
|
commonPhrasesArr?.forEach(phr => { |
|
|
|
phrs.push({ id: it.id, phrases: phr }) |
|
|
|
}) |
|
|
|
this.process.push({ |
|
|
|
...it, |
|
|
|
phrs: phrs, |
|
|
|
label: it.processNode, |
|
|
|
isActive: index == 0 ? true : false, |
|
|
|
}) |
|
|
|
if (index == 0) { |
|
|
|
this.id = it.id; |
|
|
|
this.tableData = phrs; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
changeDeviceType(value) { |
|
|
|
this.deviceType = value; |
|
|
|
}, |
|
|
|
getTableData() { |
|
|
|
let rows = this.process.find(item => item.id == this.id); |
|
|
|
return rows?.phrs || []; |
|
|
|
}, |
|
|
|
updateTableData(id = 1) { |
|
|
|
this.id = id; |
|
|
|
this.tableData = []; |
|
|
|
let pros = this.process.find(item => item.id == id); |
|
|
|
this.tableData = pros.phrs; |
|
|
|
}, |
|
|
|
onAdd(id) { |
|
|
|
this.tableData.push({ |
|
|
|
id: id, |
|
|
|
phrases: '' |
|
|
|
deviceType: 1, |
|
|
|
// searchRule: 1, |
|
|
|
// qbb: '安全行驶' |
|
|
|
}) |
|
|
|
}, |
|
|
|
onDel(index) { |
|
|
@ -263,35 +232,6 @@ export default { |
|
|
|
} |
|
|
|
this.tableData.splice(index, 1) |
|
|
|
}, |
|
|
|
submitTable() { |
|
|
|
let data = [] |
|
|
|
this.process.forEach((lc) => { |
|
|
|
let commonPhrases = []; |
|
|
|
lc.phrs.forEach(phr => { if (phr.phrases) commonPhrases.push(phr.phrases) }) |
|
|
|
data.push({ |
|
|
|
commonPhrases: commonPhrases.join(','), |
|
|
|
id: lc.id, |
|
|
|
eventType: lc.eventType, |
|
|
|
nodeNode: lc.nodeNode, |
|
|
|
processNode: lc.processNode |
|
|
|
}) |
|
|
|
}) |
|
|
|
console.log('data', data) |
|
|
|
// return; |
|
|
|
request({ |
|
|
|
url: `/business/dcEventType/updateDcProcessConfig`, |
|
|
|
method: "post", |
|
|
|
data: { |
|
|
|
eventType: this.eventType, |
|
|
|
processConfigList: data |
|
|
|
} |
|
|
|
}).then(result => { |
|
|
|
if (result.code != 200) return Message.error(result.msg); |
|
|
|
Message.success(result.msg); |
|
|
|
this.modelVisible = false; |
|
|
|
this.$emit('reInitData', true) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|