prod
lily.zhang 3 years ago
parent 6dbdef9aa0
commit c47ffe692f

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-10-08 09:26:42
* @LastEditTime: 2021-10-25 09:09:47
* @LastEditTime: 2021-10-25 10:48:19
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/permission.js
@ -11,10 +11,10 @@ import NProgress from "nprogress"
import "nprogress/nprogress.css"
const whitePath = ['/', '/login', '/industryDataExport','/index']
const token = sessionStorage.getItem('token');
// console.log(token)
router.beforeEach((to, from, next) => {
NProgress.start()
NProgress.start();
const token = sessionStorage.getItem('token');
if(!token && !whitePath.includes(to.path)) {
next('/login');
} else {

@ -1,7 +1,7 @@
<!--
* @Author: xw
* @Date: 2021-10-09 16:57:27
* @LastEditTime: 2021-10-25 09:37:12
* @LastEditTime: 2021-10-25 10:45:46
* @LastEditors: Please set LastEditors
* @Description: 个人中心
* @FilePath: /data-show/src/views/Myself/index.vue
@ -45,7 +45,7 @@
<div class="ms-d2">
<v-label-div title="数据导出管理"></v-label-div>
<div class="ms-d2-inner">
<v-table :columns="columns" :data="tbData" row-key="id">
<v-table :columns="columns" :data="tbData" :loading="tableLoading" row-key="id" :pagination="pagination" @change="handlerPage">
<span slot="action" slot-scope="text, record">
<a :href="record.FilePath">下载</a>
</span>
@ -84,7 +84,7 @@
<script>
import phoneForm from "./phoneForm";
import modifyForm from "./modifyForm";
import {getMyFileInfoExcel} from "@/api/mySelf"
import { getMyFileInfoExcel } from "@/api/mySelf";
export default {
name: "Myself",
components: {
@ -101,13 +101,19 @@ export default {
accout: {
sPhone: "",
iCode: "",
token: ""
token: "",
},
nextStr: "下一步",
nextType: 1,
form: {
iPageIndex: 1,
iPageSize: 20
iPageIndex: 1,
iPageSize: 20,
},
tableLoading: false,
pagination: {
total: 0,
current: 1,
pageSize: 20,
},
columns: [
{
@ -132,13 +138,11 @@ export default {
scopedSlots: { customRender: "action" },
},
],
tbData: [
],
tbData: [],
};
},
created() {
this.getTable()
this.getTable();
},
methods: {
handlerPwd() {
@ -154,7 +158,7 @@ export default {
} else if (this.nextType === 2) {
this.$refs.modifyForm.onSuccess();
} else {
this.$router.push('/login')
this.$router.push("/login");
}
},
//
@ -172,22 +176,30 @@ export default {
},
//
getTable() {
this.form.token = this.getToken;
getMyFileInfoExcel(this.form).then(res => {
let table = res.data.Table;
table.forEach(ele => {
if(ele.Status === 0) {
ele.statuStr = '未完成'
} else if(ele.Status === 1) {
ele.statuStr = '正在生成'
} else {
ele.statuStr = '已完成'
}
})
this.tbData = table;
})
}
this.tableLoading = true;
this.form.token = this.getToken;
getMyFileInfoExcel(this.form).then((res) => {
let table = res.data.Table;
this.pagination.total = res.totalNum;
table.forEach((ele) => {
if (ele.Status === 0) {
ele.statuStr = "未完成";
} else if (ele.Status === 1) {
ele.statuStr = "正在生成";
} else {
ele.statuStr = "已完成";
}
});
this.tbData = table;
this.tableLoading = false;
});
},
handlerPage(p) {
let iPageIndex = p.current;
this.form.iPageIndex = iPageIndex;
this.pagination.current = iPageIndex;
this.getData();
},
},
};
</script>
@ -263,20 +275,17 @@ export default {
cursor: pointer;
}
.stepEst {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.m1 {
width: 80px;
height: 80px;
}
.s1 {
display: block;
margin-top: 12px;
}
}
/deep/ .ant-table-body {
height: 600px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.m1 {
width: 80px;
height: 80px;
}
.s1 {
display: block;
margin-top: 12px;
}
}
</style>
Loading…
Cancel
Save