diff --git a/frontend/src/components/BasicSearch/index.vue b/frontend/src/components/BasicSearch/index.vue index 1775b01..3b8fb43 100644 --- a/frontend/src/components/BasicSearch/index.vue +++ b/frontend/src/components/BasicSearch/index.vue @@ -79,6 +79,7 @@ placeholder="请选择" @change="dataDimensionDataChange" show-search + :loading="shuJuTianBaoStore.baseLoading" :filter-option="filterOption" style="width: 135px" > @@ -96,6 +97,7 @@ placeholder="请选择电站" @change="stcdIdChange" show-search + :loading="shuJuTianBaoStore.engLoading" :filter-option="filterOption" style="width: 135px" > @@ -169,7 +171,6 @@ import { ref, computed, reactive, watch, onMounted, nextTick } from "vue"; import { useShuJuTianBaoStore } from "@/store/modules/shuJuTianBao"; const shuJuTianBaoStore = useShuJuTianBaoStore(); -// import { nextTick } from "process"; // --- 类型定义 --- export interface SearchItem { diff --git a/frontend/src/components/BasicTable/index.vue b/frontend/src/components/BasicTable/index.vue index 92e9bfd..82d4cb0 100644 --- a/frontend/src/components/BasicTable/index.vue +++ b/frontend/src/components/BasicTable/index.vue @@ -33,6 +33,7 @@ interface Props { searchParams?: Record; // 默认每页显示数量 defaultPageSize?: number; + getCheckboxProps?: (record: any) => any; } const props = withDefaults(defineProps(), { @@ -40,6 +41,7 @@ const props = withDefaults(defineProps(), { rowKey: "id", searchParams: () => ({}), defaultPageSize: 20, + getCheckboxProps: undefined }); const emit = defineEmits<{ @@ -66,9 +68,7 @@ const rowSelection = computed(() => ({ selectedRows.value = rows; emit("selection-change", keys, rows); }, - getCheckboxProps: (record: any) => ({ - // disabled: record.status === 'SUBMITTED' - }), + getCheckboxProps: props.getCheckboxProps ? props.getCheckboxProps : (record: any) => ({}) })); // --- Pagination Config --- diff --git a/frontend/src/components/fishSearch/index.vue b/frontend/src/components/fishSearch/index.vue index 2f78425..6149eb8 100644 --- a/frontend/src/components/fishSearch/index.vue +++ b/frontend/src/components/fishSearch/index.vue @@ -71,7 +71,6 @@ import { ref, onMounted, computed, watch } from "vue"; import { getFishDictoryDropdown } from "@/api/select"; import { useShuJuTianBaoStore } from "@/store/modules/shuJuTianBao"; -import { init } from "echarts"; const shuJuTianBaoStore = useShuJuTianBaoStore(); // --- Props & Emits --- @@ -170,7 +169,7 @@ const handleSelectOption = (opt: any) => { const handleChange = (val: any) => { // 当 a-select 内部触发 change 时(例如删除 Tag) // 在单选模式下,如果用户通过键盘或删除操作改变了值,这里也会捕获 - emit("update:modelValue", val, opt); + emit("update:modelValue", val, ''); }; const getFishNameById = (id: string) => { diff --git a/frontend/src/lang/zh-cn.ts b/frontend/src/lang/zh-cn.ts index c27b960..b61ac93 100644 --- a/frontend/src/lang/zh-cn.ts +++ b/frontend/src/lang/zh-cn.ts @@ -7,6 +7,7 @@ export default { // 登录页面国际化 login: { title: '水电水利建设项目全过程环境管理信息平台', + titleSjtb: '水电水利建设项目全过程数据填报系统', username: '用户名', rulesUsername: '用户账号/身份证号/手机号 不能为空', password: '密码', diff --git a/frontend/src/layout/components/Navbar.vue b/frontend/src/layout/components/Navbar.vue index 832f922..e200109 100644 --- a/frontend/src/layout/components/Navbar.vue +++ b/frontend/src/layout/components/Navbar.vue @@ -54,7 +54,9 @@ onBeforeUnmount(() => { href="/" class="h-[50px] min-w-[350px] flex items-center justify-center text-white" > -

{{ t("login.title") }}

{{ t("login.title") }} --> +

{{ t("login.titleSjtb") }}

+ diff --git a/frontend/src/permission.ts b/frontend/src/permission.ts index 87df0ea..4f9ddba 100644 --- a/frontend/src/permission.ts +++ b/frontend/src/permission.ts @@ -9,7 +9,7 @@ NProgress.configure({ showSpinner: false }); const permissionStore = usePermissionStoreHook(); // 白名单路由 -const whiteList = ['/login', '/login-sjtb']; //login +const whiteList = ['/login']; //login // 查找第一个可用路由 function findFirstAvailableRoute(routes: any[]): string | undefined { @@ -35,7 +35,7 @@ router.beforeEach(async (to, from, next) => { if (userStore.Token) { // 登录成功,跳转到首页 - if (to.path === '/login-sjtb' || to.path === '/login') {//login + if (to.path === '/login') {//login next({ path: '/' }); NProgress.done(); } else { @@ -80,7 +80,7 @@ router.beforeEach(async (to, from, next) => { } catch (error) { console.log(error); await userStore.resetToken(); - to.path === '/login-sjtb' ? next(`/login-sjtb?redirect=${to.path}`) : next(`/login?redirect=${to.path}`); + next(`/login?redirect=${to.path}`); NProgress.done(); } } @@ -91,7 +91,7 @@ router.beforeEach(async (to, from, next) => { if (whiteList.indexOf(to.path) !== -1) { next(); } else { - to.path === '/login-sjtb' ? next(`/login-sjtb?redirect=${to.path}`) : next(`/login?redirect=${to.path}`); + next(`/login?redirect=${to.path}`); NProgress.done(); } } diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 0ff5dbb..eda82d7 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -16,13 +16,13 @@ export const constantRoutes: RouteRecordRaw[] = [ } ] }, + // { + // path: '/login', + // component: () => import('@/views/login/index.vue'), + // meta: { hidden: true } + // }, { path: '/login', - component: () => import('@/views/login/index.vue'), - meta: { hidden: true } - }, - { - path: '/login-sjtb', component: () => import('@/views/login-sjtb/index.vue'), meta: { hidden: true } }, @@ -31,11 +31,11 @@ export const constantRoutes: RouteRecordRaw[] = [ component: () => import('@/views/error-page/404.vue'), meta: { hidden: true } }, - { - path: '/401', - component: () => import('@/views/error-page/401.vue'), - meta: { hidden: true } - }, + { + path: '/401', + component: () => import('@/views/error-page/401.vue'), + meta: { hidden: true } + } ]; // 创建路由 diff --git a/frontend/src/store/modules/shuJuTianBao.ts b/frontend/src/store/modules/shuJuTianBao.ts index d437d6c..49f2bd4 100644 --- a/frontend/src/store/modules/shuJuTianBao.ts +++ b/frontend/src/store/modules/shuJuTianBao.ts @@ -5,14 +5,17 @@ import { set } from 'lodash'; export const useShuJuTianBaoStore = defineStore('shuJuTianBao', () => { // 1. 直接使用 ref 定义状态,确保响应式 - const fpssOption = ref([]); + const fpssOption = ref([]); + const fpssLoading = ref(false); const baseOption = ref([]); + const baseLoading = ref(false); const engOption = ref([]); + const engLoading = ref(false); const fishOption = ref([]); - - // 2. 业务逻辑方法 + // 获取水电基地列表 const getBaseOption = async () => { try { + baseLoading.value = true; const res = await getBaseDropdown({}); if (res.data && Array.isArray(res.data)) { const list = [...res.data]; @@ -25,11 +28,14 @@ export const useShuJuTianBaoStore = defineStore('shuJuTianBao', () => { } } catch (error) { console.error('获取水电基地列表失败:', error); + } finally { + baseLoading.value = false; } }; - + // 获取电站列表 const getEngOption = async (baseId: string) => { try { + engLoading.value = true; const param = baseId === 'all' ? {} : { baseId }; const res = await getEngInfoDropdown(param); if (res.data && Array.isArray(res.data)) { @@ -38,16 +44,20 @@ export const useShuJuTianBaoStore = defineStore('shuJuTianBao', () => { } } catch (error) { console.error('获取电站列表失败:', error); + } finally { + engLoading.value = false; } }; - - + // 获取过鱼设施列表 const getFpssOption = async (baseId: string, rstcd: string) => { try { + fpssLoading.value = true; const res = await getFpssDropdown({ baseId, rstcd }); fpssOption.value = res.data; } catch (error) { console.log(error); + } finally { + fpssLoading.value = false; } }; const getFishOption = () => { @@ -63,6 +73,9 @@ export const useShuJuTianBaoStore = defineStore('shuJuTianBao', () => { baseOption, engOption, fishOption, + fpssLoading, + baseLoading, + engLoading, getBaseOption, getEngOption, getFpssOption, diff --git a/frontend/src/views/login-sjtb/index.vue b/frontend/src/views/login-sjtb/index.vue index 00fe032..7cc8bdb 100644 --- a/frontend/src/views/login-sjtb/index.vue +++ b/frontend/src/views/login-sjtb/index.vue @@ -10,7 +10,7 @@
-

采集网站及数据管理子系统

+

{{ $t("login.titleSjtb") }}

diff --git a/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue b/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue index 24f60ae..ece6e1e 100644 --- a/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue +++ b/frontend/src/views/shuJuTianBao/guoYuSheShiShuJuTianBao/index.vue @@ -20,6 +20,7 @@ :list-url="getFishDraftPage" :search-params="{}" :enable-row-selection="true" + :get-checkbox-props="getCheckboxProps" @selection-change="handleSelectionChange" > @@ -94,7 +95,6 @@ :width="1500" v-model:open="visible" maskClosable="false" - @cancel="handleCancel" :confirm-loading="fileLoading" > - - -