|
@@ -129,7 +129,6 @@
|
|
|
if(!data || !data.length){
|
|
|
return false
|
|
|
}
|
|
|
- console.log(data,'data')
|
|
|
let param = {
|
|
|
data: {
|
|
|
DataSourceId: this.datasourceId,
|
|
@@ -140,7 +139,6 @@
|
|
|
type: this.protocolType
|
|
|
}
|
|
|
getPointValue(param,res => {
|
|
|
- console.log(res,'res')
|
|
|
if(!!res.Content && res.Content.length){
|
|
|
data.map(item => {
|
|
|
res.Content.map(child => {
|
|
@@ -170,7 +168,6 @@
|
|
|
ProjectId: this.projectId
|
|
|
}
|
|
|
}
|
|
|
- console.log(param, 'param')
|
|
|
axios(param).then(function(res) {
|
|
|
var blob = new Blob([res.data], {
|
|
|
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
@@ -191,7 +188,6 @@
|
|
|
navigator.msSaveBlob(blob, fileName)
|
|
|
}
|
|
|
}).catch(function(err) {
|
|
|
- console.dirxml(err);
|
|
|
})
|
|
|
},
|
|
|
//删除点位
|
|
@@ -202,12 +198,10 @@
|
|
|
}),
|
|
|
type: this.protocolType
|
|
|
}
|
|
|
- console.log(param, 'param')
|
|
|
if (!param.length) {
|
|
|
return false
|
|
|
}
|
|
|
this.$confirm('你确定要删除点位吗?').then(_ => {
|
|
|
- console.log(param, 'param')
|
|
|
deletePoint(param, res => {
|
|
|
this.$message.success("删除成功")
|
|
|
this.getData()
|
|
@@ -249,13 +243,11 @@
|
|
|
navigator.msSaveBlob(blob, fileName)
|
|
|
}
|
|
|
}).catch(function(err) {
|
|
|
- console.dirxml(err);
|
|
|
})
|
|
|
},
|
|
|
//点击表格
|
|
|
clickTable(info, row) {
|
|
|
let activeCell = this.hot.getActiveEditor()
|
|
|
- console.log(activeCell, 'activeCell')
|
|
|
if(activeCell.prop == "Used"){
|
|
|
info.Used = !info.Used
|
|
|
}
|
|
@@ -276,7 +268,10 @@
|
|
|
maxRows: data.length
|
|
|
})
|
|
|
} else {
|
|
|
- this.allData = [{}]
|
|
|
+ this.allData = [{
|
|
|
+ Used: true,
|
|
|
+ LocationFlag: []
|
|
|
+ }]
|
|
|
this.createHot()
|
|
|
}
|
|
|
},
|
|
@@ -348,10 +343,8 @@
|
|
|
if (!this.allData.length) {
|
|
|
return false
|
|
|
}
|
|
|
- console.log(settings, 'settings')
|
|
|
this.$nextTick(_ => {
|
|
|
this.hot = this.$refs.handsontable.init(settings)
|
|
|
- console.log(this.hot)
|
|
|
})
|
|
|
},
|
|
|
//修改提示
|
|
@@ -364,14 +357,13 @@
|
|
|
//保存
|
|
|
saveData() {
|
|
|
if (!!this.hot) {
|
|
|
- console.log(this.hot.getSourceData())
|
|
|
+ console.log(this.hot.getSourceData(),'getSourceData')
|
|
|
let data = this.hot.getSourceData(),
|
|
|
updateList = [],
|
|
|
arr1 = [],
|
|
|
createList = [];
|
|
|
data.map(item => {
|
|
|
if (!!item.Id) {
|
|
|
- console.log(item)
|
|
|
delete item.CreateTime
|
|
|
delete item.LastUpdate
|
|
|
if(item.hasOwnProperty('pointDate')){
|
|
@@ -386,7 +378,7 @@
|
|
|
createList.push(item)
|
|
|
}
|
|
|
})
|
|
|
- console.log(updateList, arr1, "updateList")
|
|
|
+ console.log(updateList,createList, arr1, "updateList")
|
|
|
if (updateList.length) {
|
|
|
this.update(updateList)
|
|
|
}
|
|
@@ -398,7 +390,6 @@
|
|
|
}
|
|
|
},
|
|
|
async createList(createList) {
|
|
|
- console.log(createList)
|
|
|
let i = 0;
|
|
|
for (i; i < createList.length; i++) {
|
|
|
if (createList[i].hasOwnProperty("Description")) {
|
|
@@ -423,7 +414,6 @@
|
|
|
data: obj,
|
|
|
type: this.protocolType
|
|
|
}, res => {
|
|
|
- console.log(res)
|
|
|
obj.Id = res.Id
|
|
|
})
|
|
|
},
|
|
@@ -439,7 +429,6 @@
|
|
|
},
|
|
|
type: this.protocolType
|
|
|
}, res => {
|
|
|
- console.log(res)
|
|
|
this.getData()
|
|
|
})
|
|
|
},
|
|
@@ -450,7 +439,6 @@
|
|
|
//上传文件
|
|
|
changeFile(file) {
|
|
|
this.file = file[0] || ''
|
|
|
- console.log(file, 'file')
|
|
|
},
|
|
|
//确定上传
|
|
|
sureOfUpload() {
|