Commit 0e7c5761 authored by dragondean@qq.com's avatar dragondean@qq.com

下载

parent 3517b025
import request from '@/utils/request'
// 下载日志分页
export function downloadPage(params) {
return request({
url: '/system/download-log/page',
method: 'get',
params
})
}
......@@ -20,6 +20,9 @@
<el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unreadMessage" @click="notRead"></el-image>
</el-badge>
<el-badge :value="notDownload ? notDownload : '' " class="right-menu-item badge">
<el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unDownload" @click="handleDownload"></el-image>
</el-badge>
<search id="header-search" class="right-menu-item" />
......@@ -80,17 +83,22 @@ import RuoYiDoc from '@/components/RuoYi/Doc'
import {getLocale, saveLocale} from "@/utils/db";
import unreadMessage from "@/assets/images/unread-message.png"
import helpIcon from "@/assets/images/help.png"
import unDownload from "@/assets/images/download.png"
import i18n from '@/i18n'
export default {
data() {
return {
unreadMessage,
helpIcon,
unDownload,
// locale: getLocale(),
// 枚举
// langDatas: LangEnum.LANG,
notReadTotal:0,//要去取VUEX里面的未读数据总数,我不会,登录之后要调得到当前人未读记录总数接口放到VUEX中
lang: i18n.locale, // 当前语言
// 未下载文件数量
notDownload: 0
}
},
created() {
......@@ -150,6 +158,9 @@ export default {
}
},
methods: {
handleDownload(){
this.$router.push('/system/download')
},
updateMessage(){
this.$store.dispatch('getNotMessage');
this.$store.dispatch('getToDoList');
......
<template>
<div class="app-container">
<div class="mb-10">
<h2 class="page-title mb-5">下载队列</h2>
<div>*{{$t('文件生成成功后,保留12小时,12小时后自动删除')}}</div>
</div>
<!--el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
<el-form-item :label="$t('文件名称')" prop="fileName">
<el-input v-model="queryParams.fileName" :placeholder="$t('请输入文件名称')" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">{{$t('搜索')}}</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form-->
<el-table v-loading="loading" :data="list">
<el-table-column :label="$t('下载编号')" align="center" prop="id" width="100" />
<el-table-column :label="$t('分类')" align="center" prop="type" :show-overflow-tooltip="true"/>
<!--<el-table-column :label="$t('业务编号')" align="center" prop="type" width="100" /-->
<el-table-column :label="$t('下载内容')" align="center" prop="fileName" width="100" />
<el-table-column :label="$t('开始下载时间')" align="center" prop="createTime" width="150">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column :label="$t('下载状态')" align="center" prop="createBy" width="150">
<template v-slot:default="{row}">
{{statusMap[row.status]}}
</template>
</el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width" width="200">
<template slot-scope="scope" >
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleDownload(scope.row)"
v-hasPermi="['system:notice:update']">{{$t('下载')}}</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
</div>
</template>
<script>
import {downloadPage} from "@/api/system/download";
import {parseTime} from "../../../utils/ruoyi";
import Template from "@/views/cms/template/index.vue";
export default {
name: "Download",
components: {Template},
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
list: [],
queryParams: {
pageNo: 1,
pageSize: 10
},
statusMap: {
0: "待处理",
1:"处理中",
2: "处理成功",
3: "处理失败"
}
};
},
created() {
this.getList();
},
methods: {
parseTime,
handleDownload(row){
console.log('下载', row)
},
/** 查询公告列表 */
getList() {
this.loading = true;
downloadPage(this.queryParams).then(response => {
this.noticeList = response.data.list;
this.total = response.data.total;
this.loading = false;
}).finally(() => {
this.loading = false;
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
}
}
};
</script>
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