export_result.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div id="result">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <el-col :span="24" class="top">
  6. <el-button type="primary" size="mini" @click="$router.push('/jg/patent/index')">返回</el-button>
  7. </el-col>
  8. <el-col :span="24" class="down">
  9. <data-table :fields="fields" :opera="opera" :data="list" :total="total" @query="search" @download="toDownload"></data-table>
  10. </el-col>
  11. </el-col>
  12. </el-row>
  13. </div>
  14. </template>
  15. <script>
  16. import { mapState, createNamespacedHelpers } from 'vuex';
  17. const { mapActions: mission } = createNamespacedHelpers('mission');
  18. export default {
  19. name: 'result',
  20. props: {},
  21. components: {},
  22. data: function () {
  23. return {
  24. list: [],
  25. total: 0,
  26. opera: [
  27. {
  28. label: '下载',
  29. method: 'download',
  30. display: (i) => i.status === '2',
  31. },
  32. ],
  33. fields: [
  34. { label: '标题', model: 'title' },
  35. { label: '导出数据时间', model: 'create_time' },
  36. {
  37. label: '状态',
  38. model: 'status',
  39. format: (i) => (i == '0' ? '未开始' : i == '1' ? '进行中' : i == '2' ? '导出完成' : i == '3' ? '导出失败' : '未知状态'),
  40. },
  41. { label: '进度', model: 'progress' },
  42. { label: '备注', model: 'remark' },
  43. ],
  44. };
  45. },
  46. created() {
  47. this.search();
  48. },
  49. methods: {
  50. ...mission(['query']),
  51. async search({ skip = 0, limit = 10 } = {}) {
  52. const res = await this.query({ skip, limit, user: this.user._id });
  53. if (this.$checkRes(res)) {
  54. this.$set(this, 'list', res.data);
  55. this.$set(this, 'total', res.total);
  56. }
  57. },
  58. toDownload({ data }) {
  59. window.open(`http://broadcast.waityou24.cn/${data.uri}`);
  60. },
  61. },
  62. computed: {
  63. ...mapState(['user']),
  64. pageTitle() {
  65. return `${this.$route.meta.title}`;
  66. },
  67. },
  68. metaInfo() {
  69. return { title: this.$route.meta.title };
  70. },
  71. };
  72. </script>
  73. <style lang="less" scoped>
  74. .main {
  75. .top {
  76. text-align: right;
  77. margin: 0 0 10px 0;
  78. }
  79. }
  80. </style>