Browse Source

Merge branch 'Luckysheet-mk' into luckysheet

luckysheet-xiaowang-Intelligen
mk 8 months ago
parent
commit
243c76b636
  1. 2
      src/views/modules/base/smartExcel/cpts/excel-summary.vue
  2. 36
      src/views/modules/base/smartExcel/cpts/excel-view.vue
  3. 12
      src/views/modules/base/smartExcel/filling.vue
  4. 1
      src/views/modules/base/smartExcel/index.vue

2
src/views/modules/base/smartExcel/cpts/excel-summary.vue

@ -12,7 +12,7 @@
</div>
<h3 class="title">提报的文件</h3>
<div class="flex-wrap flex">
<div class="item flex flex-y flex-center-deputy" v-for="(item, index) in list" @click="handleClickShowView('1876571135966158850')" :key="index">
<div class="item flex flex-y flex-center-deputy" v-for="(item, index) in list" @click="handleClickShowView('1877549575149813762')" :key="index">
<img :src="require(`@/assets/images/index/Excel.png`)" alt="">
<div class="agencyName">{{ item.title }}周期更新表</div>
<div>{{ item.state }}</div>

36
src/views/modules/base/smartExcel/cpts/excel-view.vue

@ -76,39 +76,34 @@ 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: {
cellEditBefore: this.handleCellEditBefore,
// cellUpdateBefore: this.handleCellUpdateBefore,
updated: this.handleCellUpdateBefore,
sheetCreateAfter: this.handleSheetCreateAfter,
cellUpdated: this.handleCellUpdated,
},
});
// } else {
// console.log(msg);
// }
},
handleSheetCreateAfter(e) {
console.log('setsheet', e);
},
isOpen(ws) {
return ws.readyState === ws.OPEN
},
initSocket() {
const {id} = this.$store.state.user;//${location.origin}
const token = localStorage.getItem("token")
this.socket = new WebSocket(`ws://192.168.1.144/api/actual/base/ws/luckysheet/${this.workbookId}/${id}`,token);
this.socket = new WebSocket(`ws://219.146.91.110:30801/api/actual/base/ws/luckysheet/${this.workbookId}/${id}`,token);
this.socket.addEventListener('open', () => {
console.log('WebSocket连接已打开');
});
@ -119,15 +114,17 @@ export default {
});
},
sendMessage(message) {
this.socket.send(JSON.stringify(message));
this.newMessage = '';
if (this.isOpen(this.socket)) {
this.socket.send(JSON.stringify(message));
} else {
console.info('链接已经断开');
}
},
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 +174,7 @@ export default {
let obj = {
r,
c,
t:'v',
...newValue
}
this.sendMessage(obj)
@ -187,8 +185,8 @@ export default {
this.selectedCell = "第" + row + "行" + "第" + column + "列";
},
handleCellUpdateBefore() {
this.selectedCell = "";
handleCellUpdateBefore(e) {
console.log(e);
},
handleTabClick(tab, event) {
console.log(tab, event);

12
src/views/modules/base/smartExcel/filling.vue

@ -143,14 +143,14 @@ export default {
},
statusArray: [
{
label: '',
value: ''
label: '1',
value: '1'
}, {
label: '',
value: ''
label: '1',
value: '2'
}, {
label: '',
value: ''
label: '1',
value: '3'
},
],
orgOptionProps,

1
src/views/modules/base/smartExcel/index.vue

@ -253,7 +253,6 @@ export default {
},
async getTableData() {
const url = "/governance/icEventOld/list";
console.log(this.formData, "formData");
if (Array.isArray(this.formData.agencyId) && this.formData.agencyId.length) {
if (this.level == "grid") {
this.formData.gridId = this.formData.agencyId[this.formData.agencyId.length - 1];

Loading…
Cancel
Save