Commit 75a6b6dc by 高源

sdk-table 重构

parent 4d941edf
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
<script> <script>
import VXETable, { t } from 'vxe-table' import VXETable, { t } from 'vxe-table'
import { getTableData } from '../sdk' // import { getTableData } from '../sdk'
import { cell, checkTableFromXpaths } from '../sdk-table'
export default { export default {
name: 'collectionTable', name: 'collectionTable',
components: {}, components: {},
...@@ -64,7 +65,9 @@ export default { ...@@ -64,7 +65,9 @@ export default {
firstXpath: [], firstXpath: [],
somePath: '', somePath: '',
index: 0, index: 0,
Xpaths:[] Xpaths: [],
sdkXPath: [],
checkTableFrom: null
} }
}, },
created () { created () {
...@@ -76,8 +79,25 @@ export default { ...@@ -76,8 +79,25 @@ export default {
computed: {}, computed: {},
methods: { methods: {
getTable () { getTable () {
//表格展示配置
let _this = this let _this = this
console.log(_this.sdkXPath)
_this.checkTableFrom = checkTableFromXpaths(_this.sdkXPath)
console.log(_this.checkTableFrom)
_this.tableData = _this.checkTableFrom.tableData
console.log(_this.tableData)
this.tableColumn = []
for (let i = 0; i < _this.tableData.length; i++) {
let objs = {}
objs.field = ('content' + i) + '.content'
objs.title = '请填写标题'
objs.width = 145
_this.tableColumn.push(objs)
}
_this.isSelectTable = false
return
//表格展示配置
_this.tableData = [] _this.tableData = []
_this.tableColumn = [] _this.tableColumn = []
_this.tableData = getTableData(_this.Xpaths) _this.tableData = getTableData(_this.Xpaths)
...@@ -94,7 +114,6 @@ export default { ...@@ -94,7 +114,6 @@ export default {
console.log(_this.tableData) console.log(_this.tableData)
return
}, },
...@@ -148,6 +167,14 @@ export default { ...@@ -148,6 +167,14 @@ export default {
_this.SelectTableData.push(obj) _this.SelectTableData.push(obj)
_this.firstXpath.push(elementInfo.Xpath) _this.firstXpath.push(elementInfo.Xpath)
_this.Xpaths.push(elementInfo.Xpath) _this.Xpaths.push(elementInfo.Xpath)
// sdkTable--------------------------------------------------------------------------------------------------------
var selectCell = new cell(elementInfo.Xpath, 'cellName', 'text', 'title')
// console.log(selectCell)
_this.sdkXPath.push(selectCell)
// sdkTable--------------------------------------------------------------------------------------------------------
// 移除事件监听器 // 移除事件监听器
document.removeEventListener('contextmenu', contextMenuHandler); document.removeEventListener('contextmenu', contextMenuHandler);
} }
...@@ -172,7 +199,7 @@ export default { ...@@ -172,7 +199,7 @@ export default {
} }
} }
}, },
}, },
} }
</script> </script>
......
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