This commit is contained in:
扈兆增 2026-05-05 22:38:49 +08:00
commit 5743077bdd
12 changed files with 36 additions and 54 deletions

View File

@ -63,6 +63,9 @@ const page = ref(1);
const size = ref(props.defaultPageSize);
const selectedRowKeys = ref<string[]>([]);
const selectedRows = ref<any[]>([]);
//使 filter
const lastFilter = ref<Record<string, any> | undefined>(undefined);
//
const scrollConfig = computed(() => ({
@ -100,13 +103,17 @@ const paginationConfig = computed(() => ({
*/
const getList = async (filter?: Record<string, any>) => {
loading.value = true;
// filter
if (filter !== undefined) {
lastFilter.value = filter;
}
try {
//
const params = {
...props.searchParams,
skip: page.value,
take: size.value,
filter: filter,
filter: lastFilter.value,
// skip/take
// skip: (page.value - 1) * size.value,

View File

@ -11,7 +11,6 @@ import Sidebar from "./Sidebar/index.vue";
import { useTagsViewStore } from "@/store/modules/tagsView";
import { useUserStore } from "@/store/modules/user";
import {getPath,removePath } from '@/utils/auth';
// const url = import.meta.env.VITE_APP_BASE_API;
@ -32,9 +31,7 @@ function logout() {
tagsViewStore.delAllViews();
})
.then(() => {
// router.push(`/login?redirect=${route.fullPath}`);
router.push(`${getPath()}?redirect=${route.fullPath}`);
removePath()
router.push(`/login`);
});
});
}

View File

@ -80,7 +80,7 @@ router.beforeEach(async (to, from, next) => {
} catch (error) {
console.log(error);
await userStore.resetToken();
next(`/login?redirect=${to.path}`);
next(`/login`);
NProgress.done();
}
}
@ -91,7 +91,7 @@ router.beforeEach(async (to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) {
next();
} else {
next(`/login?redirect=${to.path}`);
next(`/login`);
NProgress.done();
}
}

View File

@ -1,4 +1,4 @@
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router';
import { usePermissionStoreHook } from '@/store/modules/permission';
export const Layout = () => import('@/layout/index.vue');
@ -45,7 +45,7 @@ export const constantRoutes: RouteRecordRaw[] = [
// 创建路由
const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
routes: constantRoutes as RouteRecordRaw[],
// 刷新时,滚动条位置还原
scrollBehavior: () => ({ left: 0, top: 0 })

View File

@ -1,16 +1,4 @@
.ant-model {
.ant-modal-content {
border-radius: 2px;
}
.ant-modal-header {
padding: 16px 24px;
color: rgba(0, 0, 0, 0.85);
border-bottom: 1px solid #f0f0f0;
border-radius: 2px 2px 0 0;
background-color: #005293;
}
}
:where(.css-dev-only-do-not-override-ekaqbe).ant-modal {
.ant-modal {
.ant-modal-content {
border-radius: 2px;
padding: 0 !important;
@ -37,7 +25,7 @@
}
}
}
:where(.css-dev-only-do-not-override-ekaqbe).ant-btn > span {
.ant-btn > span {
display: inline-flex;
}
.ant-image-preview-root {

View File

@ -13,12 +13,3 @@ export function setToken(token: any) {
export function removeToken() {
return Cookies.remove(TokenKey);
}
export function setPath(path:any) {
Cookies.set(PathKey,path);
}
export function getPath() {
return Cookies.get(PathKey);
}
export function removePath() {
return Cookies.remove(PathKey);
}

View File

@ -187,7 +187,7 @@ import loginImg from "@/assets/images/logo.png";
import { UserOutlined, LockOutlined, MobileOutlined } from "@ant-design/icons-vue";
import { getCaptcha, sendSmsCode, smsLoginApi, resetPassword } from "@/api/auth";
import { message } from "ant-design-vue";
import { setPath, setToken } from "@/utils/auth";
import { setToken } from "@/utils/auth";
//
import router from "@/router";
@ -371,7 +371,6 @@ function onFinish() {
userStore
.login(user)
.then(() => {
setPath("/login-sjtb");
router.push({ path: "/" });
state.loading = false;
message.success("登录成功");
@ -457,7 +456,6 @@ const onSmsLogin = async () => {
});
// ========== ==========
setPath("/login-sjtb");
router.push({ path: accessRoutes[0].children[0].opturl });
message.success("登录成功");

View File

@ -240,7 +240,6 @@
</template>
<script setup lang="ts">
import { setPath } from '@/utils/auth';
import { onMounted, reactive, ref, toRefs, watch } from "vue";
import loginImg from "@/assets/images/logo.png";
import { UserOutlined, LockOutlined, MobileOutlined } from "@ant-design/icons-vue";
@ -363,7 +362,6 @@ function onFinish() {
.login(user)
.then(() => {
router.push({ path: "/" });
setPath('/login')
state.loading = false;
})
.catch(() => {

View File

@ -557,7 +557,7 @@ const onRegister = async () => {
//
setTimeout(() => {
router.push({ path: "/login-sjtb" });
router.push({ path: "/login" });
}, 1500);
} catch (error: any) {
@ -574,7 +574,7 @@ const onRegister = async () => {
//
const backToLogin = () => {
router.push({ path: "/login-sjtb" });
router.push({ path: "/login" });
};
//

View File

@ -164,6 +164,8 @@
v-model:value="formData.fcnt"
style="width: 100%"
placeholder="数量"
:step="1"
:precision="0"
:min="0"
:disabled="isView"
/>
@ -234,7 +236,6 @@
v-model:value="formData.wt"
style="width: 100%"
placeholder="水温"
:min="0"
:disabled="isView"
/>
</a-form-item>
@ -543,12 +544,12 @@ const beforeVideoUpload: UploadProps["beforeUpload"] = (file) => {
const isMp4 = file.type === "video/mp4" || file.name.toLowerCase().endsWith(".mp4");
if (!isMp4) {
message.error("只能上传 MP4 格式的视频!");
return false;
return Upload.LIST_IGNORE;
}
const isLt50M = file.size / 1024 / 1024 < 10; // 50M
if (!isLt50M) {
message.error("视频大小不能超过 10MB!");
return false;
return Upload.LIST_IGNORE;
}
// false
return false;

View File

@ -183,15 +183,16 @@
<a-input-number
v-model:value="editingData[column.dataIndex]"
style="width: 100%"
@change="(val) => delWarning(val, column.dataIndex)"
:step="1"
:precision="0"
:min="0"
@change="(val) => delWarning(val, column.dataIndex)"
/>
</template>
<template v-else-if="['wt'].includes(column.dataIndex)">
<a-input-number
v-model:value="editingData[column.dataIndex]"
style="width: 100%"
:min="0"
/>
</template>

View File

@ -302,6 +302,7 @@ interface ColumnConfig {
}
const fileInputRef = ref<any>(null);
const tableRef = ref<any>(null);
const searchRef = ref<any>(null);
//
const direction = ref<any>([]);
const guoyuStatus = ref<any>([]);
@ -460,7 +461,7 @@ const handleDelete = (ids: any[]) => {
let res: any = await delFishDraft(ids);
if (res && res?.code == 0) {
message.success("删除成功");
tableRef.value?.getList();
tableRef.value?.refresh();
}
},
});
@ -477,7 +478,7 @@ const handleSubmit = (ids: any[]) => {
let res: any = await submitFishDraft(ids);
if (res && res?.code == 0) {
message.success("提交成功");
tableRef.value?.getList();
tableRef.value?.refresh();
}
},
});
@ -521,7 +522,7 @@ const handleSuccess = (ids: any[]) => {
let res: any = await successFishDraft({ ids: ids, approveComment: rejectReason });
if (res && res?.code == 0) {
message.success("审批成功");
tableRef.value?.getList();
tableRef.value?.refresh();
}
},
});
@ -571,7 +572,7 @@ const handleReject = (id: any) => {
let res: any = await rejectFishDraft({ id: id, rejectReason: rejectReason });
if (res && res?.code == 0) {
message.success("驳回成功");
tableRef.value?.getList();
tableRef.value?.refresh();
}
},
});
@ -602,7 +603,7 @@ const handleEditSubmit = async (values: FormData) => {
if (res && res?.code == 0) {
message.success("编辑成功");
editModalVisible.value = false;
tableRef.value?.getList();
tableRef.value?.refresh();
}
editModalRef.value.localLoading = false;
} else {
@ -613,7 +614,7 @@ const handleEditSubmit = async (values: FormData) => {
if (res && res?.code == 0) {
message.success("新增成功");
editModalVisible.value = false;
tableRef.value?.getList();
tableRef.value?.refresh();
}
editModalRef.value.localLoading = false;
}
@ -684,7 +685,7 @@ const handleModalOk = () => {
});
if (res && res?.code == 0) {
message.success("导入成功");
tableRef.value?.getList();
tableRef.value?.refresh();
visible.value = false;
await markImportTaskSuccess({ id: taskId.value });
} else {
@ -705,7 +706,7 @@ const handleCustomCancel = () => {
let res: any = await cancelImportTask({ taskId: taskId.value });
if (res && res?.code == 0) {
message.success("取消成功");
tableRef.value?.getList();
tableRef.value?.refresh();
visible.value = false;
} else {
message.error("取消失败");
@ -863,13 +864,13 @@ const handleSearchFinish = (values: any) => {
value: values.ftp,
},
{
field: "TM",
field: "strdt",
operator: "gte",
dataType: "date",
value: values.strdt[0],
},
{
field: "TM",
field: "strdt",
operator: "lte",
dataType: "date",
value: values.strdt[1],