添加文档注释,方便生成技术文档
This commit is contained in:
@@ -3,15 +3,22 @@ import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots';
|
||||
import { HiddenPointType } from '@/types/common/DisasterType';
|
||||
import type { PaginationType } from '@/types/common/PaginationType';
|
||||
|
||||
// 灾害链影响点列表钩子函数
|
||||
/**
|
||||
* 暴雨灾害链影响点列表钩子函数
|
||||
* @returns 搜索条件、表格数据、分页配置及相关方法
|
||||
*/
|
||||
export const useRainDisasterChain = () => {
|
||||
// 搜索条件
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
const conditions = ref({
|
||||
tableData: '',
|
||||
hiddenPoint: HiddenPointType.LANDSLIDE,
|
||||
});
|
||||
|
||||
// 下拉选项
|
||||
/**
|
||||
* 下拉选项
|
||||
*/
|
||||
const selectOptions = [
|
||||
{ value: HiddenPointType.LANDSLIDE, label: '滑坡' },
|
||||
{ value: HiddenPointType.DEBRIS_FLOW, label: '泥石流' },
|
||||
@@ -19,10 +26,14 @@ export const useRainDisasterChain = () => {
|
||||
{ value: HiddenPointType.WATERLOGGING, label: '内涝' },
|
||||
];
|
||||
|
||||
// 表格数据
|
||||
/**
|
||||
* 表格数据
|
||||
*/
|
||||
const tableDatas = ref<XianHiddenDangerSpots[]>([]);
|
||||
|
||||
// 表头
|
||||
/**
|
||||
* 表头配置
|
||||
*/
|
||||
const tableColumns = [
|
||||
{ title: '名称', key: 'disasterName' },
|
||||
{ title: '位置', key: 'position' },
|
||||
@@ -30,7 +41,9 @@ export const useRainDisasterChain = () => {
|
||||
{ title: '险情等级', key: 'riskGrade' },
|
||||
];
|
||||
|
||||
// 分页配置
|
||||
/**
|
||||
* 分页配置
|
||||
*/
|
||||
const paginationConfig = ref<PaginationType>({
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
@@ -38,7 +51,10 @@ export const useRainDisasterChain = () => {
|
||||
totalPage: 1,
|
||||
});
|
||||
|
||||
// 修改条件
|
||||
/**
|
||||
* 修改搜索条件
|
||||
* @param value - 新的搜索条件
|
||||
*/
|
||||
function changeConditions(value: {
|
||||
tableData: string;
|
||||
hiddenPoint: HiddenPointType;
|
||||
@@ -46,7 +62,10 @@ export const useRainDisasterChain = () => {
|
||||
conditions.value = value;
|
||||
}
|
||||
|
||||
// 修改页码
|
||||
/**
|
||||
* 修改页码
|
||||
* @param value - 新的页码
|
||||
*/
|
||||
function changeCurrentPage(value: number) {
|
||||
paginationConfig.value.currentPage = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user