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> </div>
<h3 class="title">提报的文件</h3> <h3 class="title">提报的文件</h3>
<div class="flex-wrap flex"> <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=""> <img :src="require(`@/assets/images/index/Excel.png`)" alt="">
<div class="agencyName">{{ item.title }}周期更新表</div> <div class="agencyName">{{ item.title }}周期更新表</div>
<div>{{ item.state }}</div> <div>{{ item.state }}</div>

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

@ -76,39 +76,34 @@ export default {
}, },
watch: {}, watch: {},
mounted() { mounted() {
// this.initSocket() this.initSocket()
this.loadWorkBook() this.loadWorkBook()
}, },
methods: { methods: {
loadWorkBook() { async loadWorkBook() {
// const { data, code, msg } = await requestGet(`/actual/base/luckySheet/workbook/load?workbookId=${this.workbookId}`) const data = await this.$http.post(`/actual/base/luckySheet/workbook/load?workbookId=${this.workbookId}`)
// if (code === 0) {
window.luckysheet.destroy(); window.luckysheet.destroy();
// options.data = data.sheets; options.data = data.data;
// 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}`
window.luckysheet.create({ window.luckysheet.create({
...options, ...options,
hook: { hook: {
cellEditBefore: this.handleCellEditBefore, cellEditBefore: this.handleCellEditBefore,
// cellUpdateBefore: this.handleCellUpdateBefore, updated: this.handleCellUpdateBefore,
sheetCreateAfter: this.handleSheetCreateAfter, sheetCreateAfter: this.handleSheetCreateAfter,
cellUpdated: this.handleCellUpdated, cellUpdated: this.handleCellUpdated,
}, },
}); });
// } else {
// console.log(msg);
// }
}, },
handleSheetCreateAfter(e) { handleSheetCreateAfter(e) {
console.log('setsheet', e); console.log('setsheet', e);
}, },
isOpen(ws) {
return ws.readyState === ws.OPEN
},
initSocket() { initSocket() {
const {id} = this.$store.state.user;//${location.origin} const {id} = this.$store.state.user;//${location.origin}
const token = localStorage.getItem("token") 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', () => { this.socket.addEventListener('open', () => {
console.log('WebSocket连接已打开'); console.log('WebSocket连接已打开');
}); });
@ -119,15 +114,17 @@ export default {
}); });
}, },
sendMessage(message) { sendMessage(message) {
this.socket.send(JSON.stringify(message)); if (this.isOpen(this.socket)) {
this.newMessage = ''; this.socket.send(JSON.stringify(message));
} else {
console.info('链接已经断开');
}
}, },
handleClickMenu(i) { handleClickMenu(i) {
this.menuActive = i; this.menuActive = i;
}, },
loadExcel() { loadExcel() {
var url = 'http://localhost:9001/epmet-work-pc/test.xlsx' var url = 'http://localhost:9001/epmet-work-pc/test.xlsx'
var that = this var that = this
fetch(url).then(response => response.blob()) // Blob fetch(url).then(response => response.blob()) // Blob
.then(blob => { .then(blob => {
@ -177,6 +174,7 @@ export default {
let obj = { let obj = {
r, r,
c, c,
t:'v',
...newValue ...newValue
} }
this.sendMessage(obj) this.sendMessage(obj)
@ -187,8 +185,8 @@ export default {
this.selectedCell = "第" + row + "行" + "第" + column + "列"; this.selectedCell = "第" + row + "行" + "第" + column + "列";
}, },
handleCellUpdateBefore() { handleCellUpdateBefore(e) {
this.selectedCell = ""; console.log(e);
}, },
handleTabClick(tab, event) { handleTabClick(tab, event) {
console.log(tab, event); console.log(tab, event);

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

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

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

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

Loading…
Cancel
Save