|
|
@ -76,19 +76,14 @@ export default { |
|
|
|
}, |
|
|
|
watch: {}, |
|
|
|
mounted() { |
|
|
|
// this.initSocket() |
|
|
|
this.initSocket() |
|
|
|
this.loadWorkBook() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
loadWorkBook() { |
|
|
|
// const { data, code, msg } = await requestGet(`/actual/base/luckySheet/workbook/load?workbookId=${this.workbookId}`) |
|
|
|
// if (code === 0) { |
|
|
|
async loadWorkBook() { |
|
|
|
const data = await this.$http.post(`/actual/base/luckySheet/workbook/load?workbookId=${this.workbookId}`) |
|
|
|
window.luckysheet.destroy(); |
|
|
|
// options.data = data.sheets; |
|
|
|
// options.title = data.fileName; |
|
|
|
const {id} = this.$store.state.user; |
|
|
|
options.loadUrl = `http://219.146.91.110:30801/api/actual/base/luckySheet/workbook/load?wordbookId=${this.workbookId}` |
|
|
|
options.updateUrl = `ws://219.146.91.110:30801/api/actual/base/ws/luckysheet/${this.workbookId}/${id}` |
|
|
|
options.data = data.data |
|
|
|
window.luckysheet.create({ |
|
|
|
...options, |
|
|
|
hook: { |
|
|
@ -98,9 +93,6 @@ export default { |
|
|
|
cellUpdated: this.handleCellUpdated, |
|
|
|
}, |
|
|
|
}); |
|
|
|
// } else { |
|
|
|
// console.log(msg); |
|
|
|
// } |
|
|
|
}, |
|
|
|
handleSheetCreateAfter(e) { |
|
|
|
console.log('setsheet', e); |
|
|
@ -120,14 +112,12 @@ export default { |
|
|
|
}, |
|
|
|
sendMessage(message) { |
|
|
|
this.socket.send(JSON.stringify(message)); |
|
|
|
this.newMessage = ''; |
|
|
|
}, |
|
|
|
handleClickMenu(i) { |
|
|
|
this.menuActive = i; |
|
|
|
}, |
|
|
|
loadExcel() { |
|
|
|
var url = 'http://localhost:9001/epmet-work-pc/test.xlsx' |
|
|
|
|
|
|
|
var that = this |
|
|
|
fetch(url).then(response => response.blob()) // 将响应转换为Blob |
|
|
|
.then(blob => { |
|
|
@ -177,6 +167,7 @@ export default { |
|
|
|
let obj = { |
|
|
|
r, |
|
|
|
c, |
|
|
|
t:'v', |
|
|
|
...newValue |
|
|
|
} |
|
|
|
this.sendMessage(obj) |
|
|
|