Commit a26f01c8 by 郁子恒

优化数据传递

parent 3e1ffeb4
......@@ -28,7 +28,7 @@
export default {
name: 'elOutput',
components: {},
props: ['actionName', 'actionType'],
props: ['actionName', 'actionType', 'dynamicTagObj'],
data () {
return {
elementInfos: {}, // 存储当前选中元素的信息
......@@ -46,7 +46,11 @@ export default {
},
};
},
created () { },
created () {
console.log(this.dynamicTagObj);
if (Object.keys(this.dynamicTagObj.actionConfigs).length == 0) return
this.actionConfig = this.dynamicTagObj.actionConfigs
},
mounted () {
// 在组件挂载后调用selectElement来添加事件监听器
this.selectElement();
......@@ -77,7 +81,7 @@ export default {
};
this.elementInfos = elementInfo;
this.actionConfig.Target.Xpath = elementInfo.Xpath;
this.actionConfig.Attributes.innerText = element.innerText;
this.actionConfig.Attributes.innerText = elementInfo.Text;
// 移除事件监听器
document.removeEventListener('contextmenu', this.contextMenuHandler);
},
......
......@@ -12,7 +12,7 @@
<el-input v-model="actionConfig.Target.Type" disabled></el-input>
</el-form-item>
<el-form-item label="内容">
<el-input v-model="elementInfos.Text" disabled></el-input>
<el-input v-model="actionConfig.Target.InnerText" disabled></el-input>
</el-form-item>
<el-form-item label="查询时间">
<el-input v-model="actionConfig.Target.Timeout"></el-input>
......@@ -29,7 +29,7 @@
export default {
name: 'elClick',
components: {},
props: ['actionName', 'actionType'],
props: ['actionName', 'actionType', 'dynamicTagObj'],
data () {
return {
elementInfos: {}, // 存储当前选中元素的信息
......@@ -37,6 +37,7 @@ export default {
"Target": {
"Type": "xpath",
"Xpath": "",
"InnerText": "",
"Timeout": 5000
},
"Name": this.actionName,
......@@ -44,7 +45,11 @@ export default {
},
};
},
created () { },
created () {
console.log(this.dynamicTagObj);
if (Object.keys(this.dynamicTagObj.actionConfigs).length == 0) return
this.actionConfig = this.dynamicTagObj.actionConfigs
},
mounted () { },
beforeDestroy () {
// 在组件销毁前移除事件监听器
......@@ -72,6 +77,8 @@ export default {
};
this.elementInfos = elementInfo;
this.actionConfig.Target.Xpath = elementInfo.Xpath;
this.actionConfig.Target.InnerText = elementInfo.Text;
console.log(element.innerText);
// 移除事件监听器
document.removeEventListener('contextmenu', this.contextMenuHandler);
},
......
......@@ -18,7 +18,7 @@
export default {
name: 'sysSleep',
components: {},
props: ['actionName', 'actionType'],
props: ['actionName', 'actionType', 'dynamicTagObj'],
data () {
return {
actionConfig: {
......@@ -28,7 +28,11 @@ export default {
},
};
},
created () { },
created () {
console.log(this.dynamicTagObj);
if (Object.keys(this.dynamicTagObj.actionConfigs).length == 0) return
this.actionConfig = this.dynamicTagObj.actionConfigs
},
mounted () { },
watch: {},
computed: {},
......
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