+
数据列表导出
- 取消
提交
+ @click="handleClickCurrencyEvent('submit')"> 导出
@@ -21,7 +19,7 @@
+ :btnLoading="btnLoading" :pageType='`report`'>
@@ -45,37 +43,11 @@ export default {
currentTable: null,
currentId: '',
btnLoading: false,
+ sheetR:0
};
},
props: {
- workbookId: {
- type: String,
- default: ''
- },
- pageType: {
- type: String,
- default: ''
- },
- sheetTotal: {
- type: Boolean,
- default: false
- },
- infoObj: {
- type: Object,
- default: () => { }
- },
- mergeObj: {
- type: Object,
- default: () => { }
- },
- userId: {
- type: String,
- default: ''
- },
- taskStateName: {
- type: String,
- default: ""
- },
+
},
computed: {
tableHeight() {
@@ -83,72 +55,25 @@ export default {
},
...mapGetters(['clientHeight', 'resolution']),
},
- async created() {
+ created() {
},
watch: {},
async mounted() {
- console.log( "dskjlfsdklf");
- // if (this.sheetTotal) {
- // this.currentId = this.workbookId;
- // this.loadWorkBook()
- // } else {
- // this.getTaskList()
- // }
this.loadWorkBook()
},
methods: {
handleClickCurrencyEvent(){
- var objsheet = luckysheet.getAllSheets()[0] // 得到表的数据
- console.log(objsheet,"打算离开房间四点零分");
-
- // this.options = objsheet // 将表的数据保存本地
- // this.postsheet()
+ exportSheetExcel(luckysheet.getAllSheets(),'导出文件')
},
- // async postsheet() {
- // var strsheet = await JSON.stringify(this.options)// 对象转化为字符串
- // const sheetinfo = { id: 1, filename: strsheet }// 拼接成对象
- // // await updata(sheetinfo)// 传递对象后台
- // },
-
async handleClickInspect() {
- // 获取celldata并转换为list
- const list = luckysheet.getAllSheets()[0].celldata.map(item => ({
- r: item.r,
- c: item.c,
- v: item.v.v || ''
- }));
- // 发送请求获取异常数据
- let { data, code, msg } = await requestPost('/actual/base/intelligentImportData/checkData', list);
- if (code === 0) {
- if (data && data.length > 0) {
- for (const { r, c } of data) {
- luckysheet.setCellFormat(r, c, 'bg', '#f5504a');
- }
- const findArr = this.findUniqueElements(luckysheet.getAllSheets()[0].celldata, data);
- findArr.forEach(({ r, c, v }) => {
- if (v.bg === "#f5504a") {
- luckysheet.setCellFormat(r, c, 'bg', '#ffffff');
- }
- });
- } else {
- this.$message.success('没有找到异常');
- }
- }
- },
-
- findUniqueElements(A, B) {
- // 创建B中r和c组合的键集合
- const bCombinations = new Set(B.map(item => `${item.r},${item.c}`));
- // 过滤A中不存在于B的组合
- return A.filter(item => !bCombinations.has(`${item.r},${item.c}`));
+
},
onClickUplond() {
this.showUploadData = true;
let list = luckysheet.getAllSheets()
this.currentTable = list.filter(item => item.status == '1')
-
},
async handleUploadDataHide(val) {
this.showUploadData = false;
@@ -188,11 +113,6 @@ export default {
}
return letter;
},
- handleCellEditBefore(){
- console.log("sdfk;s.dkf");
-
- },
-
loadWorkBook() {
window.luckysheet.destroy();
const { id } = this.$store.state.user;
@@ -201,25 +121,13 @@ export default {
options.container = 'luckysheet'
// 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.loadSheetUrl = `${process.env.VUE_APP_API_SERVER}/actual/base/luckySheet/workbook/loadSheets`
window.luckysheet.create({
...options,
- hook: {
- cellEditBefore: this.handleCellEditBefore,
- sheetCreateAfter: this.handleSheetCreateAfter,
- },
});
},
- handleSheetCreateAfter(e) {
- console.log('setsheet', e);
- },
handelClickBack() {
this.$emit('close')
},
-
- },
- components: {
- excelUploadData
},
components: {
excelUploadData
diff --git a/src/views/modules/base/smartExcel/report.vue b/src/views/modules/base/smartExcel/report.vue
index a7b23ff56..41012c1b3 100644
--- a/src/views/modules/base/smartExcel/report.vue
+++ b/src/views/modules/base/smartExcel/report.vue
@@ -190,7 +190,7 @@
handleRecord() {
this.showRecord="ture"
},
- async handleCancel(item) {
+ handleCancel(item) {
let parms = {
id: item.id,
};
@@ -230,18 +230,14 @@
},
handleAdd() {
this.pageType = 'add';
- console.log("dsfdsf");
-
},
handleInfo(item) {
- console.log(item, "dkljsfdlk");
this.task = item.id
this.pageType = 'info'
},
getLastItem(list, vals, key) {
let LIST = list || [];
for (let item of LIST) {
- // console.log(item[key]);
for (let i of vals) {
if (item[key] === i) {
this.sarr.push(item);
@@ -283,7 +279,7 @@
this.pageNo = 1;
this.getTableData();
},
- async handleDel(item) {
+ handleDel(item) {
let parms = {
id: item.id,
};
@@ -304,7 +300,7 @@
}
});
},
- async resetSearch() {
+ resetSearch() {
this.$refs.ref_searchform.resetFields();
this.pageNo = 1;
const user = this.$store.state.user;