Commit ae58854c by 郁子恒

优化

parent 6ad9d76e
......@@ -276,31 +276,10 @@ export default {
// 将新动作添加到动作列表中
parent.actions.push(rtns);
// 返回新动作
return rtns;
},
initActionParent (action) {
if (action.actions === null || action.actions === undefined || action.actions.length === 0) return;
action.actions.forEach(a => {
a.parent = action;
this.initActionParent(a);
});
},
getActionParents (action) {
let parents = [];
parents.push(action);
while (action.parent) {
parents.push(action.parent);
action = action.parent;
if (this.currentAction.actions.length >= 15) {
alert('创建动作上限');
this.state = true;
}
return parents.reverse();
},
createNewAction (parent) {
let rtns = {};
rtns.Name = "新建动作";
rtns.parent = parent;
rtns.tagId = this.tagId++;
parent.actions = parent.actions || [];
parent.actions.push(rtns);
return rtns;
},
// 新建动作
......
......@@ -8,7 +8,7 @@
</div>
<!-- 全部表格信息 -->
<div style="overflow: auto;height: 230px;" :style="{ width: widthResize + 'px' }">
<vxe-table :data="SelectFormData" ref="xTableColumn" border class="mytable-scrollbar" height="220" auto-resize style="margin-bottom: 5px;" @current-change="currentChangeEvent" highlight-hover-row highlight-current-row>
<vxe-table :data="SelectFormData" ref="xFormColumn" border class="mytable-scrollbar" height="220" auto-resize style="margin-bottom: 5px;" @current-change="currentChangeEvent" highlight-hover-row highlight-current-row>
<vxe-column field="" min-width="150">
<template #header>
<span style="font-size: 13px;">属性名</span>
......@@ -87,6 +87,13 @@ export default {
return;
// 移除监听器的代码已经移动到函数开头
}
if (event.target.id == 'closeimg') {
_this.setElementBackgroundColor(_this.selectedRow.xpath, '');
_this.selectedRow = null;
document.removeEventListener('click', handleClick);
return;
// 移除监听器的代码已经移动到函数开头
}
});
},
watch: {
......@@ -116,7 +123,7 @@ export default {
_this.setElementBackgroundColor(row.xpath, '')
// 将表格最后一个选中,添加背景色
if (_this.SelectFormData.length > 0) {
_this.$refs.xTableColumn.setCurrentRow(_this.SelectFormData[_this.SelectFormData.length - 1])
_this.$refs.xFormColumn.setCurrentRow(_this.SelectFormData[_this.SelectFormData.length - 1])
_this.setElementBackgroundColor(_this.SelectFormData[_this.SelectFormData.length - 1].xpath, '#68C23A')
}
if (_this.table == null) return
......@@ -201,7 +208,9 @@ export default {
info.type = ''
_this.SelectFormData.push(info)
// 将新加入的tableData添加高亮
_this.$refs.xTableColumn.setCurrentRow(_this.SelectFormData[_this.SelectFormData.length - 1])
if (_this.$refs.xFormColumn != undefined) {
_this.$refs.xFormColumn.setCurrentRow(_this.SelectFormData[_this.SelectFormData.length - 1])
}
// 移除先前元素的背景色(如果有)
if (window.currentlyHighlighted) {
window.currentlyHighlighted.style.backgroundColor = '';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment