(() => {
Vue.component('uploadPointclound', {
props: [],
name: 'uploadPointclound',
template: `
{{item.title}}
数据集:{{item.id}}
添加到场景
已添加的数据集
`,
data() {
return {
dataList: [],
options: [{
id: 1,
name: "港2",
}, {
id: 2,
name: "港2",
}, {
id: 3,
name: "港2",
}, {
id: 4,
name: "港2",
}, {
id: 5,
name: "港2",
}, {
id: 6,
title: "港2",
}],
value: '',
}
},
methods: {
getSceneData() {
let params = {
"pageNum": 0,
"pageSize": 999,
"searchKey": "",
}
axios({
headers: {
'X-Authorization': this.$parent.token
},
method: 'post',
url: '/indoor/scene/list',
data: params
}).then(res => {
console.log(res)
this.dataList = res.data.data.content
this.options = res.data.data.content
}).catch(err => {
})
},
searchScene(e) {
console.log(e)
let res = this.dataList.filter(i => {
if (i.id.indexOf(e) != -1 || i.title.indexOf(e) != -1) {
return i
}
})
console.log(res)
this.options = res
},
openUpload() {
//
this.$parent.showLoading('上传中...')
axios.post(`/indoor/${sceneNum}/api/merge/${this.value}`).then(res => {
this.$parent.hideLoading()
this.value = ''
if (res.data.code == 0) {
this.$message({
message: '数据集添加成功',
type: 'success',
duration: 2000,
});
IV.api.AuthenticationService.sendAuthenticationChanged()
} else {
this.$message({
message: '数据集添加失败',
type: 'error',
duration: 2000,
});
}
}).catch(err => {
this.value = ''
this.$parent.hideLoading()
this.$message({
message: '数据集添加失败',
type: 'error',
duration: 2000,
});
})
},
delConfirm() {
console.log(1)
},
back() {
this.$parent.showType = 0
}
},
computed: {
},
destroyed() {
},
mounted() {
// window.eventBus.off('openMap', openMap);
// window.eventBus.on('openMap', openMap);
// function openMap() {
// IV.swapScenes()
// }
this.getSceneData()
},
})
})();