|
|
|
@ -71,6 +71,7 @@ |
|
|
|
<el-button size="mini" :disabled="currentIndex===null" @click="deltCurrent(currentIndex)"><i class="iconfont icon-shanchu" />删除</el-button> |
|
|
|
<el-button size="mini" icon="el-icon-top" :disabled="currentIndex === 0" @click="moveUp(currentIndex)">上移</el-button> |
|
|
|
<el-button size="mini" icon="el-icon-bottom" :disabled="currentIndex === conditionData.length - 1" @click="moveDown(currentIndex)">下移</el-button> |
|
|
|
<el-button size="mini" :disabled="conditionData.length === 0" @click="clearAll"><i class="iconfont icon-shanchu" />清空</el-button> |
|
|
|
</div> |
|
|
|
<ul id="condition-container" class="condition-content"> |
|
|
|
<li v-for="(item, index) in conditionData" :id="'element-id-' + index" :key="index" :class="currentIndex===index ? 'active': ''" @click="selectCurrent(index)"> |
|
|
|
@ -208,7 +209,15 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
resetQuery() { |
|
|
|
this.$refs.form.resetFields() |
|
|
|
if (this.$refs.form) { |
|
|
|
this.$refs.form.resetFields() |
|
|
|
} |
|
|
|
// 手动重置表单数据,确保 resetFields 失效时也能清空 |
|
|
|
this.form = { |
|
|
|
field: null, |
|
|
|
symbol: null, |
|
|
|
keyWord: null |
|
|
|
} |
|
|
|
}, |
|
|
|
addConditionData() { |
|
|
|
this.$refs.form.validate((valid) => { |
|
|
|
@ -253,6 +262,11 @@ export default { |
|
|
|
const targetElement = document.getElementById('element-id-' + this.currentIndex) |
|
|
|
targetElement.scrollIntoView({ behavior: 'smooth', block: 'nearest' }) |
|
|
|
}, |
|
|
|
clearAll() { |
|
|
|
this.conditionData = [] |
|
|
|
this.currentIndex = null |
|
|
|
this.resetQuery() |
|
|
|
}, |
|
|
|
deltCurrent(index) { |
|
|
|
this.conditionData.splice(index, 1) |
|
|
|
this.currentIndex = null |
|
|
|
|