|
@@ -460,7 +460,8 @@ import {
|
|
delete_items,
|
|
delete_items,
|
|
update_items,
|
|
update_items,
|
|
rateScope,
|
|
rateScope,
|
|
- sequence
|
|
|
|
|
|
+ sequence,
|
|
|
|
+ projectList
|
|
} from '@/api/knowledge'
|
|
} from '@/api/knowledge'
|
|
import {
|
|
import {
|
|
searchProject,
|
|
searchProject,
|
|
@@ -612,7 +613,7 @@ export default {
|
|
previewLoading: false,
|
|
previewLoading: false,
|
|
previewContent: '',
|
|
previewContent: '',
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
- pageSize: 10
|
|
|
|
|
|
+ pageSize: 30
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -1507,6 +1508,7 @@ export default {
|
|
|
|
|
|
// 修改获取数据的方法
|
|
// 修改获取数据的方法
|
|
async fetchGsprData() {
|
|
async fetchGsprData() {
|
|
|
|
+ this.gsprTableData=[]
|
|
if (!this.selectedProjectId) {
|
|
if (!this.selectedProjectId) {
|
|
this.$message.warning('请先选择项目')
|
|
this.$message.warning('请先选择项目')
|
|
return
|
|
return
|
|
@@ -1522,7 +1524,7 @@ export default {
|
|
try {
|
|
try {
|
|
const params = {
|
|
const params = {
|
|
project_id: this.selectedProjectId,
|
|
project_id: this.selectedProjectId,
|
|
- page: this.currentPage,
|
|
|
|
|
|
+ current_page: this.currentPage,
|
|
page_size: this.pageSize
|
|
page_size: this.pageSize
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1535,7 +1537,7 @@ export default {
|
|
const responseData = response.data
|
|
const responseData = response.data
|
|
|
|
|
|
// 过滤掉 tech_report_locations 为空的数据
|
|
// 过滤掉 tech_report_locations 为空的数据
|
|
- const filteredItems = responseData.items
|
|
|
|
|
|
+ /* const filteredItems = responseData.items
|
|
.filter(item => item.tech_report_locations)
|
|
.filter(item => item.tech_report_locations)
|
|
.map(item => ({
|
|
.map(item => ({
|
|
id: item.id,
|
|
id: item.id,
|
|
@@ -1551,9 +1553,8 @@ export default {
|
|
create_time: item.create_time || '',
|
|
create_time: item.create_time || '',
|
|
update_time: item.update_time || '',
|
|
update_time: item.update_time || '',
|
|
score: item.score || 0
|
|
score: item.score || 0
|
|
- }))
|
|
|
|
-
|
|
|
|
- this.gsprTableData = filteredItems
|
|
|
|
|
|
+ })) */
|
|
|
|
+ this.gsprTableData = responseData.items//filteredItems
|
|
this.gsprTotal = responseData.total // 使用API返回的总数
|
|
this.gsprTotal = responseData.total // 使用API返回的总数
|
|
this.hasExistingData = this.gsprTableData.length > 0
|
|
this.hasExistingData = this.gsprTableData.length > 0
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -1576,9 +1577,43 @@ export default {
|
|
|
|
|
|
handleGsprSearch() {
|
|
handleGsprSearch() {
|
|
this.currentPage = 1 // 搜索时重置到第一页
|
|
this.currentPage = 1 // 搜索时重置到第一页
|
|
- this.fetchGsprData()
|
|
|
|
|
|
+ this.searchList()
|
|
|
|
+ },
|
|
|
|
+ /* 搜索 */
|
|
|
|
+ async searchList(){
|
|
|
|
+ this.gsprTableData=[]
|
|
|
|
+ const loading = this.$loading({
|
|
|
|
+ lock: true,
|
|
|
|
+ text: '加载中...',
|
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
+ })
|
|
|
|
+ try {
|
|
|
|
+ const params = {
|
|
|
|
+ project_id: this.selectedProjectId,
|
|
|
|
+ page: this.currentPage,
|
|
|
|
+ page_size: this.pageSize,
|
|
|
|
+ sort_field: this.sort_field,
|
|
|
|
+ sort_order: this.sort_order,
|
|
|
|
+ ...this.gsprPageForm,
|
|
|
|
+ ...this.gsprSearchForm,
|
|
|
|
+ start_date: this.gsprSearchForm.dateRange?.[0] || null,
|
|
|
|
+ end_date: this.gsprSearchForm.dateRange?.[1] || null,
|
|
|
|
+ }
|
|
|
|
+ const response = await projectList(params)
|
|
|
|
+ response.data.list.map(el=>{
|
|
|
|
+ if(el.score==null){
|
|
|
|
+ el.score=0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.gsprTableData = response.data.list//filteredItems
|
|
|
|
+ this.gsprTotal = response.data.total // 使用API返回的总数
|
|
|
|
+ this.hasExistingData = this.gsprTableData.length > 0
|
|
|
|
+ console.log(response);
|
|
|
|
+ } finally {
|
|
|
|
+ loading.close()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-
|
|
|
|
handleGsprReset() {
|
|
handleGsprReset() {
|
|
this.gsprSearchForm = {
|
|
this.gsprSearchForm = {
|
|
keyword: '',
|
|
keyword: '',
|