设备管理和用户管理相关功能页面
This commit is contained in:
189
src/views/biz/help/index.vue
Normal file
189
src/views/biz/help/index.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<div class="p-2 app-container help-user-index-page">
|
||||
<div class="search-wrap">
|
||||
<el-card shadow="hover" class="search-panel" :class="{ 'is-collapsed': !showSearch }">
|
||||
<template #header>
|
||||
<div class="panel-heading search-panel-toggle" @click.stop="showSearch = !showSearch">
|
||||
<div>
|
||||
<span class="panel-kicker">Search Filters</span>
|
||||
<h3>筛选条件</h3>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" class="query-form">
|
||||
<el-form-item label="帮助标题" prop="title">
|
||||
<el-input v-model="queryParams.title" placeholder="请输入帮助标题" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类" prop="category">
|
||||
<el-select v-model="queryParams.category" placeholder="请选择分类" clearable>
|
||||
<el-option v-for="item in categoryOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<el-card shadow="hover" class="table-panel">
|
||||
<template #header>
|
||||
<div class="toolbar-shell">
|
||||
<div class="table-heading">
|
||||
<span class="panel-kicker">Help Dataset</span>
|
||||
<h3>用户帮助</h3>
|
||||
<p>共 {{ total }} 条记录,支持按分类和状态筛选。</p>
|
||||
</div>
|
||||
<div class="toolbar-actions">
|
||||
<!-- 帮助模块的接口与菜单尚未建立,权限标识待后端约定后再补 v-hasPermi -->
|
||||
<el-button type="primary" plain icon="Plus" @click="notImplemented">新增</el-button>
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="notImplemented">修改</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="notImplemented">删除</el-button>
|
||||
<right-toolbar v-model:show-search="showSearch" :search="false" @query-table="getList"></right-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="helpList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="帮助标题" prop="title" align="center" min-width="220" show-overflow-tooltip />
|
||||
<el-table-column label="分类" prop="category" align="center" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="categoryOptions" :value="scope.row.category" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" prop="sortNo" align="center" width="90" />
|
||||
<el-table-column label="状态" prop="status" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="statusOptions" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" prop="updateTime" align="center" width="170" />
|
||||
<el-table-column label="备注" prop="remark" align="center" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="150" fixed="right">
|
||||
<template #default>
|
||||
<el-tooltip content="详情" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="notImplemented"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="notImplemented"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="notImplemented"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="HelpUser" lang="ts">
|
||||
import { useLoading } from '@/hooks/async/useLoading';
|
||||
import { useSearchReset } from '@/hooks/form/useSearchReset';
|
||||
import { useSearchToggle } from '@/hooks/form/useSearchToggle';
|
||||
import { useTableSelection } from '@/hooks/table/useTableSelection';
|
||||
import modal from '@/plugins/modal';
|
||||
|
||||
/** 用户帮助(面向住户端的说明文档) */
|
||||
interface HelpVO {
|
||||
/** 帮助ID */
|
||||
helpId?: string;
|
||||
/** 帮助标题 */
|
||||
title?: string;
|
||||
/** 分类(1充值说明 2故障报修 3水费电价 4其他) */
|
||||
category?: string;
|
||||
/** 排序 */
|
||||
sortNo?: number;
|
||||
/** 状态(0发布 1停用) */
|
||||
status?: string;
|
||||
/** 更新时间 */
|
||||
updateTime?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
interface HelpQuery extends PageQuery {
|
||||
title?: string;
|
||||
category?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
// 帮助字典后端尚未建立,先用本地兜底选项
|
||||
const categoryOptions: DictDataOption[] = [
|
||||
{ label: '充值说明', value: '1', elTagType: 'primary' },
|
||||
{ label: '故障报修', value: '2', elTagType: 'warning' },
|
||||
{ label: '水费电价', value: '3', elTagType: 'success' },
|
||||
{ label: '其他', value: '4', elTagType: 'info' }
|
||||
];
|
||||
const statusOptions: DictDataOption[] = [
|
||||
{ label: '发布', value: '0', elTagType: 'success' },
|
||||
{ label: '停用', value: '1', elTagType: 'danger' }
|
||||
];
|
||||
|
||||
const helpList = ref<HelpVO[]>([]);
|
||||
const total = ref(0);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const { showSearch } = useSearchToggle();
|
||||
const { loading, withLoading } = useLoading(true);
|
||||
const { single, multiple, handleSelectionChange } = useTableSelection<HelpVO>(item => item.helpId);
|
||||
|
||||
const queryParams = ref<HelpQuery>({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: '',
|
||||
category: '',
|
||||
status: ''
|
||||
});
|
||||
|
||||
/** 查询用户帮助列表 */
|
||||
const getList = async () => {
|
||||
// TODO: 帮助接口就绪后替换为真实请求,例如 listHelp(queryParams.value) 取 res.data.rows / res.data.total
|
||||
await withLoading(async () => {
|
||||
helpList.value = [];
|
||||
total.value = 0;
|
||||
});
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
const { resetQuery } = useSearchReset({
|
||||
queryFormRef,
|
||||
queryParams,
|
||||
pageNumKey: 'pageNum',
|
||||
afterReset: () => {
|
||||
handleQuery();
|
||||
}
|
||||
});
|
||||
|
||||
/** 尚未接入的写操作统一提示,避免静默失败 */
|
||||
const notImplemented = () => modal.msgWarning('帮助接口待接入,暂不支持该操作');
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@use '@/assets/styles/components/page-shell' as pageShell;
|
||||
|
||||
@include pageShell.table-crud-page;
|
||||
</style>
|
||||
Reference in New Issue
Block a user