Commit b74de5ba authored by renjintao's avatar renjintao

listLength

parent 4627c6ac
...@@ -75,10 +75,7 @@ export default { ...@@ -75,10 +75,7 @@ export default {
handleSuccess(tableData) { handleSuccess(tableData) {
//初始化数据 //初始化数据
this.excelData = []; this.excelData = [];
this.excelDataBack = [];
this.columnsImport = []; this.columnsImport = [];
this.sheetNames = [];
this.pageType = undefined;
//处理colum和data //处理colum和data
let tabColum = tableData.columns let tabColum = tableData.columns
let tabData = tableData.data let tabData = tableData.data
...@@ -96,7 +93,7 @@ export default { ...@@ -96,7 +93,7 @@ export default {
}) })
this.columnsImport = tabColum; this.columnsImport = tabColum;
this.excelData = arrData; this.excelData = arrData;
this.excelDataBack = arrData; this.$emit("on-datalength", this.excelData.length)
}, },
//粘贴excel失败 //粘贴excel失败
handleError(tableData, errorIndex) { handleError(tableData, errorIndex) {
...@@ -104,10 +101,7 @@ export default { ...@@ -104,10 +101,7 @@ export default {
this.$Message.error("表格数据有误"); this.$Message.error("表格数据有误");
}, },
//粘贴excel相关end //粘贴excel相关end
l(key) {
key = "import_center" + "." + key;
return this.$t(key);
},
}, },
watch: { watch: {
eid(v) { eid(v) {
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<dictionary code="import.im.page" style="width:160px" @on-change="pageChange" v-model="pageType"></dictionary> <dictionary code="import.im.page" style="width:160px" @on-change="pageChange" v-model="pageType"></dictionary>
</FormItem> </FormItem>
<FormItem> <FormItem>
<div class="tip mr20">{{excelData.length}}条数据</div> <div class="tip mr20">{{listLength}}条数据</div>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button> <Button type="primary" @click="openInfoModal" :disabled="btnIm">导入</Button>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</div> </div>
<div class="table-main" ref="main"> <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" ref="table" class="tableCommon" v-if="tableImport"></Table>
<component :is="detailExcel" ref="comExcel" /> <component :is="detailExcel" ref="comExcel" @on-datalength="datalength" />
</div> </div>
<FooterToolbar v-if="sheetNames.length>1&&tableImport"> <FooterToolbar v-if="sheetNames.length>1&&tableImport">
<Form inline> <Form inline>
...@@ -338,6 +338,7 @@ export default { ...@@ -338,6 +338,7 @@ export default {
dataIm: [], dataIm: [],
excelType: '0', excelType: '0',
btnIm: true, btnIm: true,
listLength: 0,
}; };
}, },
props: { props: {
...@@ -395,6 +396,7 @@ export default { ...@@ -395,6 +396,7 @@ export default {
dealOpenTable(val) { dealOpenTable(val) {
this.excelData = this.openDatas[val].dataTable; this.excelData = this.openDatas[val].dataTable;
this.excelDataBack = this.openDatas[val].dataTable; this.excelDataBack = this.openDatas[val].dataTable;
this.listLength = this.excelData.length
var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题 var tempCos = Object.keys(this.openDatas[val].dataTable[0]); //获取列表标题
this.columnsImport = []; this.columnsImport = [];
var headersNow = []; var headersNow = [];
...@@ -690,9 +692,13 @@ export default { ...@@ -690,9 +692,13 @@ export default {
this.tableImport = true; this.tableImport = true;
this.pageType = undefined this.pageType = undefined
this.excelType = '0'; this.excelType = '0';
this.listLength = this.excelData.length;
} }
}, },
datalength(val) {
this.listLength = val
},
l(key) { l(key) {
key = "user" + "." + key; key = "user" + "." + key;
return this.$t(key); return this.$t(key);
......
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