Browse Source

导出文件,luckyshee标题使用任务标题

feture-12345
mk 6 months ago
parent
commit
73c7fb0c19
  1. 5
      package.json
  2. 1402
      src/utils/export.js
  3. 2
      src/views/modules/base/smartExcel/cpts/excel-summary.vue
  4. 7
      src/views/modules/base/smartExcel/cpts/excel-view.vue

5
package.json

@ -67,7 +67,10 @@
"vue-quill-editor": "^3.0.6", "vue-quill-editor": "^3.0.6",
"vue-router": "^3.0.7", "vue-router": "^3.0.7",
"vuex": "^3.1.1", "vuex": "^3.1.1",
"xlsx": "^0.17.1" "xlsx": "^0.17.1",
"exceljs": "^4.2.0",
"FileSaver": "^0.10.0",
"file-saver": "^2.0.5"
}, },
"devDependencies": { "devDependencies": {
"@antv/f2": "^3.8.10-beta.1", "@antv/f2": "^3.8.10-beta.1",

1402
src/utils/export.js

File diff suppressed because it is too large

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

@ -98,7 +98,7 @@ export default {
this.showView = true; this.showView = true;
this.sheetTotal = true this.sheetTotal = true
this.workbookId = val this.workbookId = val
this.infoObj = {taskTitle:this.list[0].taskTitle}
} }
}, },
components: { excelView }, components: { excelView },

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

@ -31,6 +31,7 @@
@click="handleClickCurrencyEvent('archived')"> 审核存档</el-button> @click="handleClickCurrencyEvent('archived')"> 审核存档</el-button>
<el-button type="primary" v-if="pageType === 'filling' && (taskStateName == '处理中' || taskStateName == '已驳回')" <el-button type="primary" v-if="pageType === 'filling' && (taskStateName == '处理中' || taskStateName == '已驳回')"
@click="handleClickCurrencyEvent('submit')"> 提交</el-button> @click="handleClickCurrencyEvent('submit')"> 提交</el-button>
<el-button type="primary" @click="handleClickExportExcel()"> 导出</el-button>
</div> </div>
</div> </div>
<div id="luckysheet"></div> <div id="luckysheet"></div>
@ -51,7 +52,7 @@ import options from "@/utils/luckysheetConfig.js";
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { requestPost, requestGet } from "@/js/dai/request"; import { requestPost, requestGet } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick"; import nextTick from "dai-js/tools/nextTick";
import {exportSheetExcel} from "@/utils/export";
export default { export default {
data() { data() {
@ -116,6 +117,9 @@ export default {
} }
}, },
methods: { methods: {
handleClickExportExcel(){
exportSheetExcel(luckysheet.getAllSheets(),this.infoObj.taskTitle)
},
async getTaskList() { async getTaskList() {
let parm = { let parm = {
taskId: this.workbookId,//Id taskId: this.workbookId,//Id
@ -217,6 +221,7 @@ export default {
options.loadUrl = `${process.env.VUE_APP_API_SERVER}/actual/base/luckySheet/workbook/load?workbookId=${this.currentId}` options.loadUrl = `${process.env.VUE_APP_API_SERVER}/actual/base/luckySheet/workbook/load?workbookId=${this.currentId}`
options.updateUrl = `${process.env.VUE_APP_SOCKET_SERVER}/actual/base/ws/luckysheet/${this.currentId}/${id}` options.updateUrl = `${process.env.VUE_APP_SOCKET_SERVER}/actual/base/ws/luckysheet/${this.currentId}/${id}`
options.loadSheetUrl = `${process.env.VUE_APP_API_SERVER}/actual/base/luckySheet/workbook/loadSheets` options.loadSheetUrl = `${process.env.VUE_APP_API_SERVER}/actual/base/luckySheet/workbook/loadSheets`
options.title = this.infoObj.taskTitle
window.luckysheet.create({ window.luckysheet.create({
...options, ...options,
hook: { hook: {

Loading…
Cancel
Save