Commit ce7e7ae4 by 郁子恒

解决合并冲突

parents ed7cc5a6 1cd31a30
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</div> </div>
<!-- 全部表格信息 --> <!-- 全部表格信息 -->
<div style="width: 498px;overflow: auto;"> <div style="width: 498px;overflow: auto;">
<vxe-table :data="SelectTableData" ref="xTableColumn" border class="mytable-scrollbar" height="220" v-if="isSelectTable" style="margin-bottom: 20px;"> <vxe-table :data="SelectTableData" ref="xTableColumn" border class="mytable-scrollbar" height="240" v-if="isSelectTable" style="margin-bottom: 5px;">
<vxe-column field="" title="列配置"> <vxe-column field="" title="列配置">
<template v-slot="{ row }"> <template v-slot="{ row }">
<!-- {{ row.text }} --> <!-- {{ row.text }} -->
...@@ -16,11 +16,11 @@ ...@@ -16,11 +16,11 @@
<div style="display: flex;"> <span style="width: 68px;">属性名:</span> <vxe-input v-model="row.name" placeholder="请填写属性名" size="mini"></vxe-input> <div style="display: flex;"> <span style="width: 68px;">属性名:</span> <vxe-input v-model="row.name" placeholder="请填写属性名" size="mini"></vxe-input>
</div> </div>
<div style="display: flex;"> <span style="width: 68px;line-height: 12px;"> <div style="display: flex;"> <span style="width: 68px;line-height: 12px;">
类型:</span> <vxe-select v-model="row.type" placeholder="选择值类型" placement="top"> 类型:</span> <vxe-select v-model="row.type" placeholder="选择值类型" placement="top" v-if="row.typeOptions.length > 1">
<vxe-option v-for="num in row.typeOptions" :key="num.xpath" :value="num.value" :label="num.label"></vxe-option> <vxe-option v-for="num in row.typeOptions" :key="num.xpath" :value="num.value" :label="num.label"></vxe-option>
</vxe-select> </vxe-select>
<vxe-input v-model="row.type" :placeholder="row.typeOptions[0].label" size="mini" v-else disabled></vxe-input>
</div> </div>
</template> </template>
</vxe-column> </vxe-column>
<vxe-column field="" title="当前选中单元格文本值"> <vxe-column field="" title="当前选中单元格文本值">
...@@ -187,23 +187,40 @@ export default { ...@@ -187,23 +187,40 @@ export default {
validateNames(arr) { validateNames(arr) {
let _this = this; let _this = this;
let names = new Set(); let names = new Set();
// 检查表名是否为空
if (_this.tableName == '') { if (_this.tableName == '') {
this.$message.error("请填写表名"); this.$message.error("请填写表名");
return; // 找到重复后退出函数 return; // 找到重复后退出函数
} }
// 检查元素是否为空
if (_this.Xpaths.length == 0) {
this.$message.error("还未选择元素");
return
}
// 遍历 arr
for (const item of arr) { for (const item of arr) {
// 检查 name 是否为空
if (!item.name) {
this.$message.error("属性名不能为空");
return; // 如果 name 为空,则退出函数
}
// 检查 name 是否重复
if (names.has(item.name)) { if (names.has(item.name)) {
this.$message.error("属性名不能一样: " + item.name); this.$message.error("属性名不能一样: " + item.name);
return; // 找到重复后退出函数 return; // 找到重复后退出函数
} }
if (item.type == '') { // 检查类型是否为空
if (item.typeOptions.length == 1) {
this.$message.error("类型值不能为空"); item.type = item.typeOptions[0].value
return; } else if (item.typeOptions.length > 1) {
if (item.type == '') {
this.$message.error("类型值不能为空");
return;
}
} }
names.add(item.name); names.add(item.name);
} }
// 遍历 Xpaths
for (let i = 0; i < _this.Xpaths.length; i++) { for (let i = 0; i < _this.Xpaths.length; i++) {
// _this.Xpaths[i].name = 'ID' + i // _this.Xpaths[i].name = 'ID' + i
_this.table.newCell(_this.Xpaths[i].xpath, _this.Xpaths[i].name, _this.Xpaths[i].type, _this.Xpaths[i].title) _this.table.newCell(_this.Xpaths[i].xpath, _this.Xpaths[i].name, _this.Xpaths[i].type, _this.Xpaths[i].title)
...@@ -213,13 +230,13 @@ export default { ...@@ -213,13 +230,13 @@ export default {
_this.tableColumn = [] _this.tableColumn = []
_this.tableData = [] _this.tableData = []
_this.tableData = _this.table.getData() _this.tableData = _this.table.getData()
// 检查数据是否为空
if (_this.tableData.length == 0) return if (_this.tableData.length == 0) return
// 遍历 Xpaths
for (let i = 0; i < _this.Xpaths.length; i++) { for (let i = 0; i < _this.Xpaths.length; i++) {
let objs = {} let objs = {}
objs.field = _this.Xpaths[i].name objs.field = _this.Xpaths[i].name
objs.title = _this.Xpaths[i].title objs.title = _this.Xpaths[i].title
// objs.width = 145
_this.tableColumn.push(objs) _this.tableColumn.push(objs)
} }
......
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