提交
This commit is contained in:
1 parent
417d6c9c51
commit
c8fe0cdc20
102 files changed
+19847
-12224
No files matched your search
@@ -68,6 +68,16 @@
|
||||
:disabled="disabled"
|
||||
@update:model-value="(v) => onValueChange(idx, coerceValue(rule.field, v))"
|
||||
/>
|
||||
<el-button
|
||||
class="cond-rule-editor__del"
|
||||
text
|
||||
type="danger"
|
||||
:disabled="disabled || localRules.length <= 1"
|
||||
title="删除条件"
|
||||
@click="removeRule(idx)"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-if="idx < localRules.length - 1" class="cond-rule-editor__and">且(AND)</div>
|
||||
</div>
|
||||
@@ -86,7 +96,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, watch } from 'vue'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { Delete, Plus } from '@element-plus/icons-vue'
|
||||
import {
|
||||
opsForFieldType,
|
||||
type ConditionCandidate,
|
||||
@@ -207,6 +217,12 @@
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
function removeRule(idx: number) {
|
||||
if (localRules.value.length <= 1) return
|
||||
const next = localRules.value.filter((_, i) => i !== idx)
|
||||
emitRules(next)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -230,11 +246,16 @@
|
||||
|
||||
.cond-rule-editor__row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
grid-template-columns: 1fr auto 1fr auto;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.cond-rule-editor__del {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.cond-rule-editor__and {
|
||||
margin: 0 0 6px;
|
||||
color: var(--mint-text-muted, #94a3b8);
|
||||
|
||||
Reference in new issue
Block a user