Commit 75a6b6dc by 高源

sdk-table 重构

parent 4d941edf
......@@ -50,7 +50,8 @@
<script>
import VXETable, { t } from 'vxe-table'
import { getTableData } from '../sdk'
// import { getTableData } from '../sdk'
import { cell, checkTableFromXpaths } from '../sdk-table'
export default {
name: 'collectionTable',
components: {},
......@@ -64,7 +65,9 @@ export default {
firstXpath: [],
somePath: '',
index: 0,
Xpaths:[]
Xpaths: [],
sdkXPath: [],
checkTableFrom: null
}
},
created () {
......@@ -76,8 +79,25 @@ export default {
computed: {},
methods: {
getTable () {
//表格展示配置
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.tableColumn = []
_this.tableData = getTableData(_this.Xpaths)
......@@ -94,7 +114,6 @@ export default {
console.log(_this.tableData)
return
},
......@@ -148,6 +167,14 @@ export default {
_this.SelectTableData.push(obj)
_this.firstXpath.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);
}
......
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