Browse Source

法律查询

dev
parent
commit
cd21f9572e
  1. 3
      zdxt-web-client/zdxt-efcode-enterprise-app/src/api/enterprise/index.js
  2. 8
      zdxt-web-client/zdxt-efcode-enterprise-app/src/components/enterprise/footerNav.vue
  3. 63
      zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/law/lawQuery.vue

3
zdxt-web-client/zdxt-efcode-enterprise-app/src/api/enterprise/index.js

@ -87,6 +87,9 @@ export const queryDict = (params, success, error) => _get("/system/dict/data/dic
//查询系统配置值(如 gps.check:1 开启定位,0 不开启)
export const getSystemConfigByKey = (configKey, params, success, error) => _get(`/system/config/configKey/${configKey}`, params, success, error)
//法律法规列表(企业端)
export const queryLawListApi = (params, success, error) => _get(enterpriseAppBaseUrl + "/flfg/msg/list", params, success, error)
//执法单位(部门)列表
export const getDeptList = (params, success, error) => _get("/enforcementcode/virtualUnit/list",params,success,error)

8
zdxt-web-client/zdxt-efcode-enterprise-app/src/components/enterprise/footerNav.vue

@ -4,12 +4,12 @@
<van-tabbar-item name="Home" replace icon="wap-home" to="/enterprise/enterpriseHome">{{
$t("common.lang_home")
}}</van-tabbar-item>
<!-- <van-tabbar-item name="Classify" replace icon="bell">
法律查询
</van-tabbar-item> -->
<van-tabbar-item name="Classify" replace icon="notes-o" to="/enterprise/lawQuery">
<van-tabbar-item name="Classify" replace icon="bell">
法律查询
</van-tabbar-item>
<!-- <van-tabbar-item name="Classify" replace icon="notes-o" to="/enterprise/lawQuery">
法律查询
</van-tabbar-item> -->
<van-tabbar-item name="Classify" push to="/enterprise/nos">
<template #icon>
<img src="@/assets/images/nos/off_site_bottom_icon.png" class="nos-icon" alt="" />

63
zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/law/lawQuery.vue

@ -64,6 +64,7 @@
import { ref } from 'vue';
import { showToast } from 'vant';
import 'vant/es/toast/style';
import { queryLawListApi } from '@/api/enterprise';
const router = useRouter();
@ -78,32 +79,51 @@ const refreshing = ref(false);
const pageNum = ref(1);
const pageSize = ref(10);
// 模拟数据(与截图一致)
const mockData = [
{ title: '渔业行政处罚规定', status: '有效', publishDate: '2026-08-08', implementDate: '2026-08-18', department: '农业农村部' },
{ title: '渔业行政处罚规定', status: '尚未生效', publishDate: '2026-08-08', implementDate: '2026-08-18', department: '农业农村部' },
{ title: '渔业行政处罚规定', status: '有效', publishDate: '2026-08-08', implementDate: '2026-08-18', department: '农业农村部' },
{ title: '渔业行政处罚规定', status: '有效', publishDate: '2026-08-08', implementDate: '2026-08-18', department: '农业农村部' },
{ title: '渔业行政处罚规定', status: '有效', publishDate: '2026-08-08', implementDate: '2026-08-18', department: '农业农村部' },
{ title: '渔业行政处罚规定', status: '有效', publishDate: '2026-08-08', implementDate: '2026-08-18', department: '农业农村部' },
];
// 日期统一显示为 yyyy-MM-dd(后端可能返回 yyyy-MM-dd HH:mm:ss 或时间戳)
const formatDate = (val) => {
if (!val) return '';
const str = String(val);
if (/^\d{4}-\d{2}-\d{2}/.test(str)) return str.slice(0, 10);
const d = new Date(str);
if (Number.isNaN(d.getTime())) return str;
const pad = (n) => String(n).padStart(2, '0');
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
};
// 后端字段 → 页面字段
const normalizeItem = (item = {}) => ({
id: item.id,
title: item.lawName || '',
status: item.timeliness || '',
publishDate: formatDate(item.promulgation),
implementDate: formatDate(item.implementation),
department: item.organ || '',
});
// 加载数据
const fetchList = () => {
// TODO: 替换为真实接口调用
// const params = { pageNum: pageNum.value, pageSize: pageSize.value, searchValue: searchKeyword.value };
// 模拟异步请求
setTimeout(() => {
if (refreshing.value) {
lawList.value = [];
refreshing.value = false;
}
lawList.value = [...lawList.value, ...mockData];
// 模拟只有一页数据
const params = {
pageNum: pageNum.value,
pageSize: pageSize.value,
};
const keyword = searchKeyword.value.trim();
if (keyword) params.lawName = keyword;
queryLawListApi(params, (res) => {
const rows = (res?.rows || []).map(normalizeItem);
const total = Number(res?.total || 0);
lawList.value = pageNum.value === 1 ? rows : lawList.value.concat(rows);
finished.value = lawList.value.length >= total || rows.length < pageSize.value;
pageNum.value += 1;
loading.value = false;
refreshing.value = false;
}, (err) => {
console.error('[lawQuery] 法律法规列表加载失败:', err);
finished.value = true;
loading.value = false;
}, 300);
refreshing.value = false;
showToast('法律法规加载失败');
});
};
// 触底加载
@ -140,6 +160,7 @@ const onLawClick = (item) => {
router.push({
path: '/enterprise/lawDetail',
query: {
id: item.id,
title: item.title,
publishDate: item.publishDate,
implementDate: item.implementDate,

Loading…
Cancel
Save