|
|
|
@ -20,27 +20,25 @@ |
|
|
|
@on-load="onLoad" |
|
|
|
@on-load="onLoad" |
|
|
|
> |
|
|
|
> |
|
|
|
<template #menu-left> |
|
|
|
<template #menu-left> |
|
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-download" @click="handleExport">导出 </el-button> |
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" |
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete">删除 </el-button> |
|
|
|
>删除 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #menu-right> |
|
|
|
<template #menu-right> |
|
|
|
<el-button type="primary" icon="el-icon-upload" @click="handleImport" |
|
|
|
<el-button type="primary" icon="el-icon-upload" @click="handleImport">导入 </el-button> |
|
|
|
>导入 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
<el-button type="primary" icon="el-icon-download" @click="handleExport" |
|
|
|
|
|
|
|
>导出 |
|
|
|
|
|
|
|
</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template #menu> </template> |
|
|
|
<template #menu> </template> |
|
|
|
</avue-crud> |
|
|
|
</avue-crud> |
|
|
|
<!-- 导入 --> |
|
|
|
<!-- 导入 --> |
|
|
|
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" |
|
|
|
<basic-import |
|
|
|
|
|
|
|
v-if="isShowImport" |
|
|
|
|
|
|
|
title="导入" |
|
|
|
|
|
|
|
:isShow="isShowImport" |
|
|
|
templateUrl="/blade-desk/QA/CycleTestItem/download-excel-template" |
|
|
|
templateUrl="/blade-desk/QA/CycleTestItem/download-excel-template" |
|
|
|
templateName="试验项目模板.xls" |
|
|
|
templateName="试验项目模板.xls" |
|
|
|
importUrl="/blade-desk/QA/CycleTestItem/import-excel" |
|
|
|
importUrl="/blade-desk/QA/CycleTestItem/import-excel" |
|
|
|
@closeDialog="closeDialog"></basic-import> |
|
|
|
@closeDialog="closeDialog" |
|
|
|
|
|
|
|
></basic-import> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
@ -56,6 +54,8 @@ export default { |
|
|
|
selectionList: [], |
|
|
|
selectionList: [], |
|
|
|
query: {}, |
|
|
|
query: {}, |
|
|
|
search: {}, |
|
|
|
search: {}, |
|
|
|
|
|
|
|
loading: false, |
|
|
|
|
|
|
|
data: [], |
|
|
|
option: { |
|
|
|
option: { |
|
|
|
height: "auto", |
|
|
|
height: "auto", |
|
|
|
calcHeight: 32, |
|
|
|
calcHeight: 32, |
|
|
|
@ -261,51 +261,94 @@ export default { |
|
|
|
selectionChange(list) { |
|
|
|
selectionChange(list) { |
|
|
|
this.selectionList = list; |
|
|
|
this.selectionList = list; |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
onLoad(page, params = {}) { |
|
|
|
this.loading = true; |
|
|
|
|
|
|
|
console.log('=== onLoad 开始 ==='); |
|
|
|
console.log('=== onLoad 开始 ==='); |
|
|
|
console.log('请求参数:', { |
|
|
|
console.log('请求参数:', { |
|
|
|
current: this.page.currentPage, |
|
|
|
current: this.page.currentPage, |
|
|
|
size: this.page.pageSize, |
|
|
|
size: this.page.pageSize, |
|
|
|
type: 1 |
|
|
|
type: 1, |
|
|
|
|
|
|
|
...params |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.loading = true; |
|
|
|
pageList( |
|
|
|
pageList( |
|
|
|
this.page.currentPage, |
|
|
|
this.page.currentPage, |
|
|
|
this.page.pageSize, |
|
|
|
this.page.pageSize, |
|
|
|
{ type: 1 } |
|
|
|
{ type: 1, ...params } |
|
|
|
).then(res => { |
|
|
|
).then(res => { |
|
|
|
console.log('API返回数据:', res); |
|
|
|
console.log('API 响应:', res); |
|
|
|
console.log('res.data:', res.data); |
|
|
|
console.log('res.data:', res.data); |
|
|
|
console.log('res.data.data:', res.data.data); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res.data && res.data.data) { |
|
|
|
if (res.data && res.data.data) { |
|
|
|
this.data = res.data.data.records || []; |
|
|
|
this.data = res.data.data.records || []; |
|
|
|
this.page.total = res.data.data.total || 0; |
|
|
|
this.page.total = res.data.data.total || 0; |
|
|
|
console.log('最终数据:', { |
|
|
|
console.log('数据处理成功:', { |
|
|
|
records: this.data, |
|
|
|
records: this.data, |
|
|
|
total: this.page.total, |
|
|
|
total: this.page.total, |
|
|
|
dataLength: this.data.length |
|
|
|
dataLength: this.data.length |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
console.error('响应数据格式不正确:', res); |
|
|
|
console.warn('响应数据格式不正确:', res); |
|
|
|
this.data = []; |
|
|
|
this.data = []; |
|
|
|
this.page.total = 0; |
|
|
|
this.page.total = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 使用 nextTick 确保 loading 状态更新 |
|
|
|
console.log('准备设置 loading = false'); |
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
setTimeout(() => { |
|
|
|
console.log('loading 状态:', this.loading); |
|
|
|
this.selectionClear(); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
// 强制更新视图 |
|
|
|
}); |
|
|
|
this.$forceUpdate(); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
console.error('请求失败:', err); |
|
|
|
console.error('请求失败:', err); |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
|
|
|
|
this.data = []; |
|
|
|
|
|
|
|
this.page.total = 0; |
|
|
|
}); |
|
|
|
}); |
|
|
|
console.log('=== onLoad 结束 ==='); |
|
|
|
console.log('=== onLoad 结束 ==='); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// onLoad() { |
|
|
|
|
|
|
|
// this.loading = true; |
|
|
|
|
|
|
|
// console.log('=== onLoad 开始 ==='); |
|
|
|
|
|
|
|
// console.log('请求参数:', { |
|
|
|
|
|
|
|
// current: this.page.currentPage, |
|
|
|
|
|
|
|
// size: this.page.pageSize, |
|
|
|
|
|
|
|
// type: 1 |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// pageList( |
|
|
|
|
|
|
|
// this.page.currentPage, |
|
|
|
|
|
|
|
// this.page.pageSize, |
|
|
|
|
|
|
|
// { type: 1 } |
|
|
|
|
|
|
|
// ).then(res => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (res.data && res.data.data) { |
|
|
|
|
|
|
|
// this.data = res.data.data.records || []; |
|
|
|
|
|
|
|
// this.page.total = res.data.data.total || 0; |
|
|
|
|
|
|
|
// console.log('最终数据:', { |
|
|
|
|
|
|
|
// records: this.data, |
|
|
|
|
|
|
|
// total: this.page.total, |
|
|
|
|
|
|
|
// dataLength: this.data.length |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// console.error('响应数据格式不正确:', res); |
|
|
|
|
|
|
|
// this.data = []; |
|
|
|
|
|
|
|
// this.page.total = 0; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 使用 nextTick 确保 loading 状态更新 |
|
|
|
|
|
|
|
// this.$nextTick(() => { |
|
|
|
|
|
|
|
// this.loading = false; |
|
|
|
|
|
|
|
// setTimeout(() => { |
|
|
|
|
|
|
|
// this.selectionClear(); |
|
|
|
|
|
|
|
// }, 500); |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// }).catch(err => { |
|
|
|
|
|
|
|
// console.error('请求失败:', err); |
|
|
|
|
|
|
|
// this.loading = false; |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
// console.log('=== onLoad 结束 ==='); |
|
|
|
|
|
|
|
// }, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|