|
@@ -9,89 +9,65 @@
|
|
|
</button>
|
|
|
</div>
|
|
|
<div class="nb-table nb-table--bgc">
|
|
|
- <el-table v-loading="loading" :row-key="getRowKey" element-loading-text="数据加载中" element-loading-spinner="el-icon-loading"
|
|
|
- :data="fileLists.result" border size="mini" height="650" highlight-current-row
|
|
|
- max-height="400" tooltip-effect="dark" ref="fileListsTable"
|
|
|
- @selection-change="handleFLSelectionChange" style="width: 100%">
|
|
|
- <!-- <el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column> -->
|
|
|
- <!-- <el-table-column prop="id" class-name="id-key" label="" width="0"></el-table-column> -->
|
|
|
- <el-table-column prop="count" label="序号" width="80"></el-table-column>
|
|
|
- <el-table-column prop="filename" label="文件名称" :show-overflow-tooltip="true" min-width="120">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="modelName" label="分组名称" :show-overflow-tooltip="true" min-width="120">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="uploadDate" label="创建时间" :show-overflow-tooltip="true" min-width="120">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="generatedStr" label="类型" min-width="80">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-tag effect="dark" size="mini" :type="scope.row.generatedStr === '生成' ? 'primary' : 'success'" disable-transitions>
|
|
|
- {{scope.row.generatedStr}}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="filename" label="操作" min-width="170">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button @click="deleteLeftFile(scope.row)" type="success" round size="mini">删除</el-button>
|
|
|
- <el-button @click="viewFileById(scope.row)" type="success" round size="mini">查看</el-button>
|
|
|
- <el-button @click="downloadFileById(scope.row)" type="success" round size="mini">下载</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-table
|
|
|
+ :data="fileLists.result"
|
|
|
+ border
|
|
|
+ size="mini"
|
|
|
+ height="560"
|
|
|
+ highlight-current-row
|
|
|
+ tooltip-effect="dark"
|
|
|
+ ref="fileListsTable"
|
|
|
+ style="width: 100%">
|
|
|
+ <!-- <el-table-column type="selection" :reserve-selection="true" width="50"></el-table-column> -->
|
|
|
+ <!-- <el-table-column prop="id" class-name="id-key" label="" width="0"></el-table-column> -->
|
|
|
+ <el-table-column prop="count" label="序号" width="80"></el-table-column>
|
|
|
+ <el-table-column prop="filename" label="文件名称" :show-overflow-tooltip="true" min-width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="modelName" label="分组名称" :show-overflow-tooltip="true" min-width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="uploadDate" label="创建时间" :show-overflow-tooltip="true" min-width="120">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="generatedStr" label="类型" min-width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag effect="dark" size="mini"
|
|
|
+ :type="scope.row.generatedStr === '生成' ? 'primary' : 'success'"
|
|
|
+ disable-transitions>
|
|
|
+ {{scope.row.generatedStr}}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="filename" label="操作" min-width="170">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="deleteLeftFile(scope.row)" type="success" round size="mini">删除</el-button>
|
|
|
+ <el-button @click="viewFileById(scope.row)" type="success" round size="mini">查看</el-button>
|
|
|
+ <el-button @click="downloadFile(scope.row)" type="success" round size="mini">下载</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
- <pagination :dataList="fileLists" :upParam="beforeFLPayload" @loadMethod="loadFLTable"></pagination>
|
|
|
+ <pagination :dataList="fileLists" :upParam="beforePayload" @loadMethod="loadFLTable"></pagination>
|
|
|
</div>
|
|
|
- <el-dialog
|
|
|
- :append-to-body="true" :title="currentFileName" width="80%"
|
|
|
- :visible.sync="showFileDetail"
|
|
|
- :show-close="true" >
|
|
|
- <el-table v-loading="loading" element-loading-text="数据加载中" element-loading-spinner="el-icon-loading"
|
|
|
- :data="fileContent.result" border size="mini" height="500" max-height="700" tooltip-effect="dark"
|
|
|
- ref="detailTable" highlight-current-row style="width: 100%">
|
|
|
- <template v-for="(key, value) in fileContent.header">
|
|
|
- <el-table-column
|
|
|
- :prop="value"
|
|
|
- :label="key"
|
|
|
- :min-width="150"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- :key="value">
|
|
|
- </el-table-column>
|
|
|
- </template>
|
|
|
- </el-table>
|
|
|
- <pagination :dataList="fileContent" :upParam="beforePayload" @loadMethod="loadTableDataById"></pagination>
|
|
|
- </el-dialog>
|
|
|
+ <detail-table></detail-table>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- downloadClearStandardExcel
|
|
|
- } from "@/service/createmodel/fileService.js";
|
|
|
-
|
|
|
import pagination from "@/components/Pagination.vue";
|
|
|
+ import { downloadAndDeleteById } from '@/service/createmodel/fileService.js'
|
|
|
+ import detailTable from './DetailTable.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
- pagination
|
|
|
+ pagination,
|
|
|
+ detailTable,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- pageSizes: this.$store.getters.getpageSizes,
|
|
|
beforePayload:{
|
|
|
page:1,
|
|
|
pageSize:20
|
|
|
},
|
|
|
- loading:false,
|
|
|
- currentFileName:'',
|
|
|
- beforeFLPayload:{},
|
|
|
-
|
|
|
- currentModel:this.$store.getters.getCurrentModelGroup,
|
|
|
- showFileDetail:false,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- fileContent: {
|
|
|
- get() {
|
|
|
- return this.$store.getters.getFileContentById;
|
|
|
- }
|
|
|
- },
|
|
|
fileLists: {
|
|
|
get() {
|
|
|
let fileLists = this.$store.getters.getFilesList;
|
|
@@ -103,18 +79,12 @@
|
|
|
this.loadFLTable({ page:1,pageSize:20})
|
|
|
},
|
|
|
methods: {
|
|
|
- // 进入分析创建模型
|
|
|
createmodel(){
|
|
|
this.$router.push('/model');
|
|
|
},
|
|
|
- // 导入文件
|
|
|
- openImport(type) {
|
|
|
- this.theType = type
|
|
|
+ openImport() {
|
|
|
this.$store.commit("set_import_on", true);
|
|
|
},
|
|
|
- // 文件列表三个change
|
|
|
- handleFLSelectionChange(){
|
|
|
- },
|
|
|
loadFLTable(payload){
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
@@ -122,7 +92,7 @@
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
|
- this.beforeFLPayload = payload
|
|
|
+ this.beforePayload = payload
|
|
|
this.$store.dispatch("view_files_list", this.setModelId(payload)).then(data => {
|
|
|
loading.close();
|
|
|
if (data.code == 200) {
|
|
@@ -132,70 +102,41 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- deleteLeftFile(file){
|
|
|
- let currentModel = this.$store.getters.getCurrentModelGroup
|
|
|
- let payload = {
|
|
|
- id: file.id,
|
|
|
- modelId: currentModel.id
|
|
|
- }
|
|
|
-
|
|
|
- this.deleteFileById(payload)
|
|
|
- },
|
|
|
+ // 查看文件
|
|
|
viewFileById(file){
|
|
|
- let currentModel = this.$store.getters.getCurrentModelGroup
|
|
|
- let payload = {
|
|
|
- page:1,
|
|
|
- pageSize:20,
|
|
|
- fileId:file.id,
|
|
|
- modelId:currentModel.id
|
|
|
- }
|
|
|
-
|
|
|
- this.showFileDetail = true;
|
|
|
- this.currentFileName = file.filename;
|
|
|
- this.loadTableDataById(payload)
|
|
|
+ this.$store.commit("is_detail_table_con", true);
|
|
|
+ this.$store.commit('set_current_fileobj', file)
|
|
|
},
|
|
|
- downloadFileById(file){
|
|
|
- let currentModel = this.$store.getters.getCurrentModelGroup
|
|
|
- let payload = {
|
|
|
- id:file.id,
|
|
|
- modelId:currentModel.id
|
|
|
- }
|
|
|
- this.showFileDetail = true;
|
|
|
- this.downloadFileById(payload)
|
|
|
- },
|
|
|
-
|
|
|
- getRowKey(row) {
|
|
|
- return row.id
|
|
|
- },
|
|
|
-
|
|
|
- downloadFileById(payload){
|
|
|
+ // 下载文件
|
|
|
+ downloadFile(file){
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: "请耐心等待。。",
|
|
|
+ text: "请耐心等待,正在加载数据。。",
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
|
- this.$store.dispatch("download_file_by_id", this.setModelId(payload)).then(data => {
|
|
|
+ this.$store.dispatch("export_by_query", this.setModelId({ id: file.id, fileId: file.id })).then(data => {
|
|
|
loading.close();
|
|
|
if (data.code == 200) {
|
|
|
- let iframe = document.createElement("iframe");
|
|
|
- iframe.style.display = "none";
|
|
|
- iframe.src = downloadClearStandardExcel;
|
|
|
- iframe.id = "myIframe";
|
|
|
- document.body.appendChild(iframe);
|
|
|
+ let iframe = document.createElement('iframe');
|
|
|
+ iframe.style.display = 'none';
|
|
|
+ iframe.src = downloadAndDeleteById + '?id='+data.result;
|
|
|
+ iframe.id = 'myIframe2';
|
|
|
+ document.body.appendChild(iframe);
|
|
|
} else {
|
|
|
- this.$message({ type: "error", message: data.message ? data.message : "失败" });
|
|
|
+ this.$message({ type: "error", message: data.message ? data.message : "加载失败" });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- deleteFileById(payload){
|
|
|
+ // 删除文件
|
|
|
+ deleteLeftFile(file){
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
text: "请耐心等待。。",
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)"
|
|
|
});
|
|
|
- this.$store.dispatch("delete_file_by_id", this.setModelId(payload)).then(data => {
|
|
|
+ this.$store.dispatch("delete_file_by_id", this.setModelId({id:file.id})).then(data => {
|
|
|
loading.close();
|
|
|
if (data.code == 200) {
|
|
|
this.loadFLTable({page:1,pageSize:20})
|
|
@@ -205,24 +146,6 @@
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- loadTableDataById(payload){
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: "请耐心等待,正在加载数据。。",
|
|
|
- spinner: "el-icon-loading",
|
|
|
- background: "rgba(0, 0, 0, 0.7)"
|
|
|
- });
|
|
|
- this.beforePayload = payload
|
|
|
- this.$store.dispatch("view_file_content_by_id", this.setModelId(payload)).then(data => {
|
|
|
- loading.close();
|
|
|
- if (data.code == 200) {
|
|
|
- this.$store.commit("set_file_content_by_id", data);
|
|
|
- } else {
|
|
|
- this.$message({ type: "error", message: data.message ? data.message : "加载失败" });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
}
|
|
|
};
|
|
|
</script>
|