Commit 872dc7c4 authored by daniel's avatar daniel

fix(gunRule): 发枪预约联调

parent 91debcea
......@@ -111,7 +111,7 @@
</n-card>
<!-- 搜索框 -->
<div class="w-full flex flex-row items-start gap-x-3">
<div class="bg-white flex flex-col gap-y-2 p-3">
<div class="bg-white flex flex-col gap-y-2 p-3" style="min-width:200px;max-width:250px;">
<h4 class="flex flex-row items-center justify-between w-full">
分类列表
<n-button type="primary" @click="onEditCategory(null)" size="tiny">
......@@ -138,7 +138,8 @@
</div>
<div class="flex-1">
<n-data-table :columns="columns" :loading="loading" :data="feedbacks" :pagination="pagination"
:bordered="false" @update:page="handlePageChange"/>
:bordered="false"
:remote="true"/>
</div>
</div>
<n-modal :mask-closable="false" :loading="loading" style="width: 400px" :title="categoryFormValue.id?'编辑分类':'新增分类'"
......@@ -382,7 +383,9 @@
if (data.code === 200) {
feedbackCategories.value = data.content.content
showCategoryModal.value = false
getFeedBacks()
if (data.content.content.length) {
getFeedBacks()
}
} else {
message.error(data.msg)
}
......@@ -512,7 +515,25 @@
}
}
]
const pagination = ref({ pageSize: 20, page: 1 })
// 分页
const pagination = reactive({
pageSize: 20,
page: 1,
pageCount: 0,
showSizePicker: true,
itemCount: 0,
pageSizes: [20, 50, 200, 500],
prefix: (info) => "共" + info.itemCount + "条数据",
onChange: (page) => {
pagination.page = page
getFeedBacks()
},
onUpdatePageSize: (pageSize) => {
pagination.pageSize = pageSize
pagination.page = 1
getFeedBacks()
}
})
const keyword = ref('')
// 文件列表
const fileList = ref([])
......@@ -569,7 +590,7 @@
const status = ref('')
// 状态更新
const updateStatus = (value) => {
pagination.value.page = 1
pagination.page = 1
status.value = value
getFeedBacks()
}
......@@ -708,7 +729,14 @@
}
// 获取反馈分页列表
const getFeedBacks = async () => {
if (!feedbackCategories.value.length) {
pagination.itemCount = 0
pagination.page = 1
feedbacks.value = []
return;
}
loading.value = true
// 发起请求
const [err, data] = await to(fetch(F_BASE_URL + '/page', {
method: "POST",
......@@ -718,8 +746,8 @@
body: JSON.stringify({
cmptId: getCId(),
currentStatus: status.value ? undefined : status.value,
pageNum: pagination.value.page,
pageSize: pagination.value.pageSize,
pageNum: pagination.page,
pageSize: pagination.pageSize,
keyword: keyword.value,
categoryId: feedbackCategories.value[categoryIndex.value].id
})
......@@ -727,16 +755,11 @@
loading.value = false
if (data.code === 200) {
feedbacks.value = data.content.content
pagination.itemCount = res.data.total
} else {
message.error(data.msg)
}
}
// 分页切换
const handlePageChange = (page) => {
pagination.value.page = page
getFeedBacks()
}
// 日期处理
const updateFormattedValue = (val) => {
feedbackFormValue.resolvedAt = val
......@@ -762,7 +785,6 @@
fileList,
feedbacks,
pagination,
handlePageChange,
columns,
deleteFeedback,
editFeedback,
......
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