sjtb 页面修改 表格多选修改

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
扈兆增 2026-04-27 10:35:06 +08:00
parent 054adf7672
commit 0817d15258
10 changed files with 59 additions and 42 deletions

View File

@ -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 {

View File

@ -33,6 +33,7 @@ interface Props {
searchParams?: Record<string, any>;
//
defaultPageSize?: number;
getCheckboxProps?: (record: any) => any;
}
const props = withDefaults(defineProps<Props>(), {
@ -40,6 +41,7 @@ const props = withDefaults(defineProps<Props>(), {
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 ---

View File

@ -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) => {

View File

@ -7,6 +7,7 @@ export default {
// 登录页面国际化
login: {
title: '水电水利建设项目全过程环境管理信息平台',
titleSjtb: '水电水利建设项目全过程数据填报系统',
username: '用户名',
rulesUsername: '用户账号/身份证号/手机号 不能为空',
password: '密码',

View File

@ -54,7 +54,9 @@ onBeforeUnmount(() => {
href="/"
class="h-[50px] min-w-[350px] flex items-center justify-center text-white"
>
<h1 class="text-blank font-bold text-[16px]">{{ t("login.title") }}</h1></a
<!-- <h1 class="text-blank font-bold text-[16px]">{{ t("login.title") }}</h1> -->
<h1 class="text-blank font-bold text-[16px]">{{ t("login.titleSjtb") }}</h1>
</a
>
</transition>
<Sidebar />

View File

@ -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();
}
}

View File

@ -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 }
},
@ -35,7 +35,7 @@ export const constantRoutes: RouteRecordRaw[] = [
path: '/401',
component: () => import('@/views/error-page/401.vue'),
meta: { hidden: true }
},
}
];
// 创建路由

View File

@ -6,13 +6,16 @@ import { set } from 'lodash';
export const useShuJuTianBaoStore = defineStore('shuJuTianBao', () => {
// 1. 直接使用 ref 定义状态,确保响应式
const fpssOption = ref<any[]>([]);
const fpssLoading = ref(false);
const baseOption = ref<any[]>([]);
const baseLoading = ref(false);
const engOption = ref<any[]>([]);
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,

View File

@ -10,7 +10,7 @@
<!-- 左侧背景图区域 -->
<div class="left-section">
<div class="slogan">
<p>采集网站及数据管理子系统</p>
<p>{{ $t("login.titleSjtb") }}</p>
</div>
</div>

View File

@ -20,6 +20,7 @@
:list-url="getFishDraftPage"
:search-params="{}"
:enable-row-selection="true"
:get-checkbox-props="getCheckboxProps"
@selection-change="handleSelectionChange"
>
<!-- 使用 bodyCell 插槽自定义单元格渲染 -->
@ -94,7 +95,6 @@
:width="1500"
v-model:open="visible"
maskClosable="false"
@cancel="handleCancel"
:confirm-loading="fileLoading"
>
<GuoYuSheShiShuJuTianBaoTable
@ -104,9 +104,6 @@
:direction="direction"
@update:file-table-data="(val) => fileTableData = val"
/>
<template #footer>
<a-button key="back" @click="handleCustomCancel">取消导入</a-button>
<a-button
@ -475,6 +472,13 @@ const handleReject = (id: any) => {
},
});
};
//
const getCheckboxProps = (record: any) => {
console.log(record)
return {
disabled: record.status === 'SUBMITTED' || record.status === 'APPROVED',
};
};
//
const handleSelectionChange = (keys: any) => {
batchData.value = keys;
@ -559,8 +563,7 @@ const checkTableDataChanges = () => {
const handleModalOk = () => {
console.log(orgFileTableData.value)
console.log(fileTableData.value)
console.log(
modalTableRef.value.editingData)
console.log(modalTableRef.value.editingData)
if (modalTableRef.value.editingData != undefined) {
message.warning("请点击保存后提交数据!");
return
@ -572,11 +575,7 @@ const handleModalOk = () => {
message.info("数据未发生任何变化,无需提交");
return;
}
console.log(123)
// if (warnings.value.length > 0) {
// message.warning("");
// return;
// }
console.log(123)
// Modal.confirm({
// title: "?",
// onOk: async () => {
@ -669,8 +668,10 @@ const importBtn = async () => {
let res: any = await checkImportStatus();
taskId.value = "";
if (res?.code == 0) {
const { hasImportingTask ,currentTask} = res?.data || {};
const { hasImportingTask, currentTask} = res?.data || {};
if (currentTask) {
taskId.value = currentTask.id;
}
if (hasImportingTask) {
visible.value = true;
nextTick(async () => {