Commit 3fb95eeb authored by renjintao's avatar renjintao

detailExcel

parent 26184dad
This diff is collapsed.
......@@ -25,11 +25,8 @@
"gantt-elastic": "^1.0.11",
"gantt-elastic-header": "^0.1.11",
"gojs": "^2.1.19",
"iview-loader": "^1.3.0",
"iview-pro": "file:./iview-pro",
"js-cookie": "^2.2.1",
"less": "^3.10.3",
"less-loader": "^5.0.0",
"lodash": "^4.17.15",
"lodash.chunk": "^4.2.0",
"lowdb": "^1.0.0",
......@@ -72,8 +69,8 @@
"eslint": "^7.7.0",
"eslint-plugin-node": "^11.1.0",
"iview-loader": "^1.3.0",
"less": "^2.7.3",
"less-loader": "^4.1.0",
"less": "^3.12.2",
"less-loader": "^5.0.0",
"lint-staged": "^7.2.0",
"script-loader": "^0.7.2",
"svg-sprite-loader": "^3.8.0",
......
......@@ -91,7 +91,14 @@ export default {
tabColum.forEach(el => {
el.key = el.title
})
this.columnsImport = tabColum;
this.columnsImport.unshift({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
this.excelData = arrData;
this.$emit("on-datalength", this.excelData.length)
},
......
......@@ -29,30 +29,38 @@
<div class="btns">
<Form inline>
<FormItem>
<a @click="downFile">
<Icon type="md-download" />{{entity.file}}
</a>
<Tooltip content="下载文件">
<a @click="downFile" tooltip="1111">
<Icon type="md-download" />{{entity.file}}
</a>
</Tooltip>
</FormItem>
<FormItem>
<a class="ml10 mr10" @click="resetTable">
<Icon type="md-eye" />预览
</a>
<Tooltip content="预览文件">
<a class="ml10 mr10" @click="resetTable">
<Icon type="md-eye" />预览
</a>
</Tooltip>
</FormItem>
<FormItem>
<RadioGroup v-model="excelType" type="button" @on-change="changeExcel" size="small">
<Radio label="0">
<Icon type="ios-list-box-outline" />
</Radio>
<Radio label="1">
<Icon type="ios-copy" />
</Radio>
<Tooltip content="文件数据">
<Radio label="0">
<Icon type="ios-list-box-outline" />
</Radio>
</Tooltip>
<Tooltip content="粘贴Excel数据">
<Radio label="1">
<Icon type="ios-copy" />
</Radio>
</Tooltip>
</RadioGroup>
</FormItem>
</Form>
</div>
</div>
<div class="table-main" ref="main">
<Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" ref="table" class="tableCommon" v-if="tableImport"></Table>
<Table :border="true" :columns="columnsImport" :data="excelData" :height="tdHeightExcel" :no-data-text="noDataText" ref="table" class="tableCommon" v-if="tableImport"></Table>
<component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport">
......@@ -341,6 +349,7 @@ export default {
btnIm: true,
listLength: 0,
titleInfo: '',
noDataText: '暂无数据',
};
},
props: {
......@@ -379,6 +388,7 @@ export default {
this.sheetNames = [];
this.excelData = [];
this.excelDataBack = [];
Api.openExcel({
id: v,
}).then((res) => {
......@@ -392,7 +402,11 @@ export default {
});
}
}
});
}).catch(e => {
//this.$Message.error("数据解析失败,请下载原文件后转为Excel重新进行上传!")
this.noDataText = "文件无法解析,建议下载原文件后转换为Excel文件格式重新上传!"
})
},
//加载原文件列表
dealOpenTable(val) {
......@@ -404,8 +418,9 @@ export default {
var headersNow = [];
headersNow.push({
type: 'index',
width: 60,
align: 'center'
width: 80,
align: 'right',
title: '序号'
})
tempCos.forEach((el) => {
let headObj = {};
......@@ -418,12 +433,19 @@ export default {
//重新处理colum
loadColum(columns) {
let tempCol = this.$u.clone(columns);
tempCol.unshift({
type: 'index',
width: 80,
align: 'right',
title: '序号'
})
tempCol.forEach((ele, index) => {
if (ele.key == "action") {
ele.hide = true;
}
});
this.colsIm = tempCol;
//处理原始数据和表头进行对应
let temCol = this.$u.clone(this.colsIm); //原始数据表头
let temColPage = this.$u.clone(columns); //需要显示的页面的表头
......@@ -541,8 +563,9 @@ export default {
var headersNow = [];
headersNow.push({
type: 'index',
width: 60,
align: 'center'
width: 80,
align: 'right',
title: '序号'
})
headers.forEach((elHead) => {
let headObj = {};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment