优化修复
This commit is contained in:
@@ -113,9 +113,36 @@ export const VisibilityRuleForm: React.FC<VisibilityRuleFormProps> = ({
|
||||
type="text"
|
||||
value={rule.value ?? ''}
|
||||
onChange={(e) => onChange({ value: e.target.value })}
|
||||
placeholder="比较目标值"
|
||||
placeholder="比较目标值,可使用 {变量名}"
|
||||
className="ps-field font-mono text-[11px] w-full mt-0.5"
|
||||
/>
|
||||
{variableOptions.length > 0 && (
|
||||
<div className="flex flex-wrap gap-1 mt-1.5">
|
||||
{variableOptions.map((v) => (
|
||||
<button
|
||||
key={v}
|
||||
type="button"
|
||||
onClick={() => {
|
||||
const token = `{${v}}`;
|
||||
const current = rule.value ?? '';
|
||||
onChange({
|
||||
value: current.includes(token)
|
||||
? current
|
||||
: current
|
||||
? `${current}${current.endsWith(' ') ? '' : ' '}${token}`
|
||||
: token,
|
||||
});
|
||||
}}
|
||||
className="ps-btn text-[9px] font-mono"
|
||||
>
|
||||
{`{${v}}`}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<p className="text-[9px] text-[#666] mt-1 leading-relaxed">
|
||||
支持字面量或 {`{变量名}`};导出时按数据行解析变量后再比较
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user