|
@@ -170,6 +170,7 @@
|
|
|
<check-ele-html
|
|
|
:key="pkeyId"
|
|
|
:pkeyId="pkeyId"
|
|
|
+ @element-selected="handleElementSelected"
|
|
|
></check-ele-html>
|
|
|
</div>
|
|
|
<div class="dialog-footer">
|
|
@@ -213,15 +214,15 @@ export default {
|
|
|
|
|
|
addDialogVisible: false,
|
|
|
tableData: [
|
|
|
- { date: '2016-05-02', name: '王小明', address: '上海市普陀区金沙江路 1518 弄' },
|
|
|
- { date: '2016-05-04', name: '张三', address: '北京市朝阳区建国路 88 号' },
|
|
|
- { date: '2016-05-01', name: '李四', address: '广州市天河区体育西路 100 号' },
|
|
|
- { date: '2016-05-03', name: '赵六', address: '深圳市南山区科技园北路 200 号' }
|
|
|
+
|
|
|
],
|
|
|
tableTypelist: [],
|
|
|
pkeyId: '', // 主键ID
|
|
|
id:'',
|
|
|
- projectid:''
|
|
|
+ projectid:'',
|
|
|
+ checkTableRow: {}, // 当前选中的表单行数据
|
|
|
+ checkEleList: [], // 存储选中的元素
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -295,7 +296,33 @@ export default {
|
|
|
this.$message.success('删除成功')
|
|
|
},
|
|
|
confirmAdd() {
|
|
|
+ if (this.checkEleList.length === 0) {
|
|
|
+ this.$message.error('请先选择元素');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.checkTableRow.pkeyId === undefined || this.checkTableRow.pkeyId === '') {
|
|
|
+ this.$message.error('请先选择表单');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // const selectedCodes = this.checkEleList.map(ele => ({
|
|
|
+ // codeName: ele.keyName,
|
|
|
+ // codeValue: ele.elementId
|
|
|
+ // }));
|
|
|
+ // const newCondition = {
|
|
|
+ // paramName: this.checkTableRow.tableName,
|
|
|
+ // codeList: selectedCodes
|
|
|
+ // };
|
|
|
+ // this.paramList[this.activeIndex].codeList.push(newCondition);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
+ this.addDialogVisible = false;
|
|
|
+ this.$message.success('添加成功');
|
|
|
+ },
|
|
|
+ handleElementSelected(val) {
|
|
|
+ console.log(val, '选中的元素');
|
|
|
+ this.checkEleList = val;
|
|
|
+
|
|
|
},
|
|
|
//保存条件
|
|
|
saveEle(){
|
|
@@ -319,7 +346,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.pkeyId = row.pkeyId; // 更新主键ID
|
|
|
-
|
|
|
+ this.checkTableRow = row; // 更新当前选中的表单行数据
|
|
|
|
|
|
// 设置当前行选中状态
|
|
|
this.$set(row, 'isSelected', true)
|
|
@@ -327,6 +354,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleCancelSelect(row) {
|
|
|
+ this.checkTableRow = {}; // 清除当前选中的表单行数据
|
|
|
this.pkeyId = ''; // 清除主键ID
|
|
|
// 取消选中状态
|
|
|
this.$set(row, 'isSelected', false)
|