添加文档注释,方便生成技术文档

This commit is contained in:
wzy-warehouse
2026-04-13 22:28:56 +08:00
parent 8ef7d36d26
commit 27fba7ce12
34 changed files with 520 additions and 160 deletions
+27 -8
View File
@@ -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;
}
+7 -2
View File
@@ -6,9 +6,14 @@ import {
waterLoggingIcon,
} from '@/assets';
// 引入图例钩子函数
/**
* 暴雨图例钩子函数
* @returns 图例数据列表
*/
export const useRainLegend = () => {
// 图例数据
/**
* 图例数据
*/
const legendList = [
{ name: '滑坡隐患点', link: landslideIcon },
{ name: '泥石流隐患点', link: debrisFlowIcon },