Skip to content

Commit

Permalink
Merge pull request #46 from victorLV214/dev/YFCui
Browse files Browse the repository at this point in the history
2024/11/26 finish download function for all Project Pages
  • Loading branch information
SarekCuimian authored Nov 26, 2024
2 parents 62671ce + 3dd02fa commit f791f10
Show file tree
Hide file tree
Showing 16 changed files with 178 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public TableDataInfo list(SysWorkItem sysWorkItem) {
@ApiOperation("导出工作项")
@Log(title = "工作项", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SysWorkItem sysWorkItem) {
public void export(HttpServletResponse response, @RequestBody SysWorkItem sysWorkItem) {
List<SysWorkItem> list = sysWorkItemService.selectSysWorkItemList(sysWorkItem);
ExcelUtil<SysWorkItem> util = new ExcelUtil<SysWorkItem>(SysWorkItem.class);
util.exportExcel(response, list, "工作项数据");
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/api/project/defect.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function delDefect(defectIds) {
export function exportDefect(query) {
return request({
url: '/dev-api/project/defect/export',
method: 'get',
params: query
method: 'post',
data: query,
responseType: "blob"
})
}
5 changes: 3 additions & 2 deletions frontend/src/api/project/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function delItem(workItemIds) {
export function exportItem(query) {
return request({
url: '/dev-api/project/item/export',
method: 'get',
params: query
method: 'post',
data: query,
responseType: 'blob'
})
}
11 changes: 11 additions & 0 deletions frontend/src/api/project/iteration.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,15 @@ export function deleteIteration(iterationId) {
url: '/dev-api/project/iteration/' + iterationId,
method: 'delete'
})
}


// 导出迭代列表
export function exportIteration(query) {
return request({
url: `/dev-api/project/iteration/export`,
method: 'post',
data: query,
responseType: 'blob' ,
})
}
5 changes: 3 additions & 2 deletions frontend/src/api/project/member.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export function delProjectMember(projectMemberIds) {
export function exportProjectMember(query) {
return request({
url: '/dev-api/project/member/export',
method: 'get',
params: query
method: 'post',
data: query,
responseType: "blob"
})
}
9 changes: 5 additions & 4 deletions frontend/src/api/project/requirements.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ export function delRequirement(requirementId) {
}

// 导出需求列表
export function exportRequirement(projectId, query) {
export function exportRequirement(query) {
return request({
url: `/dev-api/project/${projectId}/requirement/export`,
method: 'get',
params: query
url: `/dev-api/project/requirement/export`,
method: 'post',
data: query,
responseType: 'blob' ,
})
}
10 changes: 10 additions & 0 deletions frontend/src/api/project/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@ export function delTask(taskId) {
url: '/dev-api/project/task/' + taskId,
method: 'delete'
})
}

// 导出缺陷
export function exportTask(query) {
return request({
url: '/dev-api/project/task/export',
method: 'post',
data: query,
responseType: "blob"
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const downloadProject = async (row) => {
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `project_${row.projectName}.xlsx`
link.download = `project_list.xlsx`
link.click()
}
Expand Down
32 changes: 26 additions & 6 deletions frontend/src/views/project/project/defects.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<template>
<el-card class="r-cards">
<template #header><div class="card-header">
<div class="header-left"><span class="title">Defects List</span><el-tag class="count-tag" type="info">total {{ total }} defectId</el-tag>
<template #header>
<div class="card-header">
<div class="header-left">
<span class="title">Defects List</span>
<el-tag class="count-tag" type="info">total {{ total }} entries</el-tag>
</div>
<div class="addR">
<el-button type="primary" :icon="Plus" @click="addReq">New</el-button>
<el-button type="primary" :icon="Download" @click="downloadDefectList()">Download</el-button>
</div>
</div>
<div class="addR">
<el-button type="primary" :icon="Plus" @click="addReq"></el-button>
</div></div></template>
</template>

<div class="search"><el-form :inline="true" :model="Params" class="sF"><el-form-item label="">
<el-input v-model="Params.title" placeholder="" clearable style="width: 200px"/>
Expand Down Expand Up @@ -154,7 +160,7 @@ import { ElMessage, ElMessageBox } from "element-plus"
import useUserStore from "@/store/modules/user.js"
import { getUser } from "@/api/system/user.js"
import {addDefect, delDefect, getDefect, listDefect, updateDefect} from "@/api/project/defect.js";
import {addDefect, delDefect, exportDefect, getDefect, listDefect, updateDefect} from "@/api/project/defect.js";
const userStore = useUserStore()
const route = useRoute()
const projectId = route.params.id
Expand Down Expand Up @@ -363,9 +369,23 @@ const rule1 = {
title: [
{ required: true, message: 'title', trigger: 'blur' }
]
}
// 下载项目缺陷列表
const downloadDefectList = async () => {
const query = {
projectId: projectId
}
const res = await exportDefect(query)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `project_defect_list.xlsx`
link.click()
}
</script>

<style scoped>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/views/project/project/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<div class="project-detail-container">

<div class="top-navbar">
<el-menu :default-active="setC" class="project-menu" mode="horizontal" @select="doTrans"
>
<el-menu :default-active="setC" class="project-menu" mode="horizontal" @select="doTrans">
<el-menu-item index="overview">
<el-icon><DataBoard /></el-icon>
<span>Overview</span>
Expand Down
22 changes: 18 additions & 4 deletions frontend/src/views/project/project/iterations.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<template>
<div class="app-container">
<div class="mb-20">
<el-button type="primary" @click="doDiga">Add Iteration</el-button>
<el-button type="primary" :icon="Plus" @click="doDiga">Add Iteration</el-button>
<el-button type="primary" :icon="Download" @click="downloadIterationList()" class="download-button">Download</el-button>
</div>


<el-table :data="list" v-loading="loading" border>
<el-table-column label="Iteration Name" prop="name" />
<el-table-column label="Start Date" prop="startDate" />
Expand Down Expand Up @@ -81,10 +81,10 @@
import { ref, onMounted, watch } from 'vue'
import { useRoute } from 'vue-router'
import {ElMessage, ElMessageBox} from 'element-plus'
import { listIteration, addIteration, updateIteration } from '@/api/project/iteration'
import {listIteration, addIteration, updateIteration, exportIteration} from '@/api/project/iteration'
import { listItem } from '@/api/project/item'
import * as echarts from 'echarts'
import {Delete, Edit, TrendCharts} from "@element-plus/icons-vue";
import {Delete, Download, Edit, Plus, TrendCharts} from "@element-plus/icons-vue";
import {delDefect} from "@/api/project/defect.js";
import {listRole} from "@/api/system/role.js";
Expand Down Expand Up @@ -338,6 +338,20 @@ const rF1 = () => {
}
}
// 下载项目迭代列表
const downloadIterationList = async () => {
const query = {
projectId: projectId
}
const res = await exportIteration(query)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `project_iteration_list.xlsx`
link.click()
}
onMounted(() => {
getList()
checkRoles()
Expand Down
22 changes: 11 additions & 11 deletions frontend/src/views/project/project/my-project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,6 @@ const getList = async () => {
projectList.value = allProject.rows
}
// 下载项目列表
const downloadProjectList = async () => {
const query = {}
const res = await exportMyProjectList(query)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `project_list.xlsx`
link.click()
}
const subF = async () => {
if (!formRef.value) return
Expand Down Expand Up @@ -526,6 +515,17 @@ const doDelete = async (row) => {
await getList() // 刷新列表
}
// 下载项目列表
const downloadProjectList = async () => {
const query = {}
const res = await exportMyProjectList(query)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `my_project_list.xlsx`
link.click()
}
onMounted(() => {
getList()
Expand Down
22 changes: 19 additions & 3 deletions frontend/src/views/project/project/releases.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<el-card class="box-card">
<template #header>
<div class="card-header">
<el-button type="primary" @click="doAdd">Add Task</el-button>
<el-button type="primary" :icon="Plus" @click="doAdd">Add Task</el-button>
<el-button type="primary" :icon="Download" @click="downloadTaskList">Download</el-button>
</div>
</template>

Expand Down Expand Up @@ -114,10 +115,10 @@

<script setup>
import { ref, reactive, onMounted } from 'vue'
import { listTask, getTask, addTask, updateTask, delTask } from '@/api/project/tasks'
import {listTask, getTask, addTask, updateTask, delTask, exportTask} from '@/api/project/tasks'
import { useRoute } from 'vue-router'
import { ElMessage, ElMessageBox } from 'element-plus'
import {Delete, Edit} from "@element-plus/icons-vue";
import {Delete, Download, Edit, Plus} from "@element-plus/icons-vue";
const route = useRoute()
const taskFormRef = ref(null)
Expand All @@ -128,6 +129,7 @@ const treeD = ref([])
const buttonVis = ref(false)
const butTit = ref('')
const booladmin = ref(false)
const projectId = route.params.id
const queryParams = reactive({
projectId: route.params.id
})
Expand Down Expand Up @@ -241,6 +243,20 @@ const del = async (row) => {
getList()
}
// 下载项目任务列表
const downloadTaskList = async () => {
const query = {
projectId: projectId
}
const res = await exportTask(query)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `project_task_list.xlsx`
link.click()
}
// 页面加载时获取列表
onMounted(() => {
getList()
Expand Down
22 changes: 18 additions & 4 deletions frontend/src/views/project/project/requirements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
</div>
<div class="addR">
<el-button type="primary" :icon="Plus" @click="addReq">New</el-button>
<el-button type="primary" @click="showGantt">Gantt Chart</el-button>
<el-button type="primary" :icon="Download" @click="downloadReq(row)">Download</el-button>
<el-button type="success" :icon="TrendCharts" @click="showGantt">Gantt Chart</el-button>
<el-button type="primary" :icon="Download" @click="downloadRequirementList()">Download</el-button>
</div>
</div>
</template>
Expand Down Expand Up @@ -179,13 +179,13 @@

<script setup>
import {ref, onMounted, onUnmounted, watch, nextTick} from 'vue'
import {Search, Refresh, Plus, Download, Edit, Delete} from '@element-plus/icons-vue'
import {Search, Refresh, Plus, Download, Edit, Delete, TrendCharts} from '@element-plus/icons-vue'
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css'
import 'dhtmlx-gantt/codebase/dhtmlxgantt.js'
import {useRoute} from "vue-router"
import {
addRequirement,
delRequirement,
delRequirement, exportRequirement,
getRequirementDetail,
listRequirement,
updateRequirement
Expand Down Expand Up @@ -492,6 +492,20 @@ watch(ganttButten, (newVal) => {
}
})
// 下载项目列表
const downloadRequirementList = async () => {
const query = {
projectId: projectId
}
const res = await exportRequirement(query)
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const href = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = href
link.download = `project_requirement_list.xlsx`
link.click()
}
onUnmounted(() => {
if (gantt) {
gantt.clearAll()
Expand Down
Loading

0 comments on commit f791f10

Please sign in to comment.