|
|
@@ -217,9 +217,25 @@ const onRightClick = async (pkeyId, event, KeyName, pid) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// 深度优先查找第一个带有 clearFormula 属性的节点
|
|
|
+function getClearFormula(el) {
|
|
|
+ if (!el) return null
|
|
|
+
|
|
|
+ const val = el.getAttribute?.('clearFormula')
|
|
|
+ if (val != null) return val
|
|
|
+
|
|
|
+ const children = el.children || []
|
|
|
+ for (let i = 0; i < children.length; i++) {
|
|
|
+ const childVal = getClearFormula(children[i])
|
|
|
+ if (childVal != null) return childVal
|
|
|
+ }
|
|
|
+ return null
|
|
|
+}
|
|
|
+
|
|
|
const setShiftTableForm = async (key, pid, pkeyId, event) => {
|
|
|
const dom = event.target
|
|
|
- const clearFormula = dom.getAttribute('clearFormula') || null
|
|
|
+ const clearFormula = getClearFormula(dom)
|
|
|
+
|
|
|
emit('focusTap', { clearFormula, key, pkeyId })
|
|
|
|
|
|
if (isCtrlKey.value) {
|