Commit 5a46ceba authored by daniel's avatar daniel

fix(pageHelper): 分页插件依赖更新

parent 3d8b0a0b
...@@ -70,13 +70,19 @@ ...@@ -70,13 +70,19 @@
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis-spring-boot.version}</version> <version>${mybatis-spring-boot.version}</version>
</dependency> </dependency>
<!--PageHelper插件分页-->
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper -->
<dependency> <dependency>
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId> <artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.13</version> <version>2.1.0</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/com.github.pagehelper/pagehelper -->
<!-- <dependency>-->
<!-- <groupId>com.github.pagehelper</groupId>-->
<!-- <artifactId>pagehelper-spring-boot-starter</artifactId>-->
<!-- <version>2.1.0</version>-->
<!-- </dependency>-->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
......
...@@ -458,7 +458,7 @@ ...@@ -458,7 +458,7 @@
// 查询的参数 // 查询的参数
const query = reactive({ const query = reactive({
keyword: undefined, keyword: undefined,
isPickUp: undefined, isPickUp: 1,
markNo: undefined, markNo: undefined,
}) })
const keyword = ref('') const keyword = ref('')
...@@ -471,13 +471,12 @@ ...@@ -471,13 +471,12 @@
// 状态更新 // 状态更新
const updateStatus = (value) => { const updateStatus = (value) => {
pagination.page = 1 pagination.page = 1
query.status = value query.isPickUp = value
fetchData() fetchData()
} }
// 状态tab // 状态tab
const updateTab = (value) => { const updateTab = (value) => {
tabIndex.value = value tabIndex.value = value
console.log(isPlayerList.value)
fetchData() fetchData()
} }
// 上传完成 // 上传完成
...@@ -516,7 +515,7 @@ ...@@ -516,7 +515,7 @@
current: pagination.page, current: pagination.page,
size: pagination.pageSize, size: pagination.pageSize,
cmptId: getCId(), cmptId: getCId(),
keyword: keyword.value keyword: keyword.value,
} }
// 发起请求 // 发起请求
const url = isPlayerList.value ? PLAYERS_URL : MARK_NO_URL const url = isPlayerList.value ? PLAYERS_URL : MARK_NO_URL
...@@ -535,11 +534,7 @@ ...@@ -535,11 +534,7 @@
if (res.code === 200) { if (res.code === 200) {
list.value = res.data.records list.value = res.data.records
pagination.itemCount = res.data.total pagination.itemCount = res.data.total
if (isPlayerList.value) { // // 全部状态下不获取统计
statusOptions.value[2].total = res.data.total
} else {
statusOptions.value[1].total = res.data.total
}
getStats() getStats()
} else { } else {
message.error(res.message) message.error(res.message)
...@@ -574,30 +569,31 @@ ...@@ -574,30 +569,31 @@
size: 1, size: 1,
cmptId: getCId(), cmptId: getCId(),
} }
let paramsList = [1, 0].map(v => ({
...params,
isPickUp: v,
}))
const requests = paramsList.map(v => {
// 发起请求 // 发起请求
const url = isPlayerList.value ? MARK_NO_URL : PLAYERS_URL const url = isPlayerList.value ? PLAYERS_URL : MARK_NO_URL
const [err, res] = await to(fetch(url, { return fetch(url, {
method: "POST", method: "POST",
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
body: JSON.stringify(params) body: JSON.stringify(v)
}).then(res => res.json())) }).then(res => res.json())
})
const res = await Promise.all(requests)
loading.value = false loading.value = false
if (err) {
message.error(err)
return
}
if (res.code === 200) {
if (isPlayerList.value) { if (isPlayerList.value) {
statusOptions.value[1].total = res.data.total statusOptions.value[1].total = res[0].data.total
statusOptions.value[2].total = res[1].data.total
} else { } else {
statusOptions.value[2].total = res.data.total statusOptions.value[1].total = res[0].data.total
statusOptions.value[2].total = res[1].data.total
} }
statusOptions.value[0].total = statusOptions.value[2].total + statusOptions.value[1].total statusOptions.value[0].total = statusOptions.value[2].total + statusOptions.value[1].total
} else {
message.error(res.message)
}
} }
// 名单导出 // 名单导出
const exportExcel = (type) => { const exportExcel = (type) => {
......
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