fix: 🐛 修复日期筛选组件小程序回显问题和调整banner
This commit is contained in:
@@ -108,7 +108,7 @@ export interface RolePageVO {
|
|||||||
/** 角色编码 */
|
/** 角色编码 */
|
||||||
code?: string;
|
code?: string;
|
||||||
/** 角色ID */
|
/** 角色ID */
|
||||||
id?: number;
|
id: number;
|
||||||
/** 角色名称 */
|
/** 角色名称 */
|
||||||
name?: string;
|
name?: string;
|
||||||
/** 排序 */
|
/** 排序 */
|
||||||
@@ -132,7 +132,7 @@ export interface RoleForm {
|
|||||||
/** 角色名称 */
|
/** 角色名称 */
|
||||||
name?: string;
|
name?: string;
|
||||||
/** 排序 */
|
/** 排序 */
|
||||||
sort?: number;
|
sort: number;
|
||||||
/** 角色状态(1-正常;0-停用) */
|
/** 角色状态(1-正常;0-停用) */
|
||||||
status?: number;
|
status?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,19 @@ watch(
|
|||||||
(val) => {
|
(val) => {
|
||||||
if (Array.isArray(val) && val.length === 2 && val[0] && val[1]) {
|
if (Array.isArray(val) && val.length === 2 && val[0] && val[1]) {
|
||||||
dateRange.value = val.map((item) => new Date(item).getTime());
|
dateRange.value = val.map((item) => new Date(item).getTime());
|
||||||
|
} else if (typeof val === "string" && val.includes(",")) {
|
||||||
|
const [startDate, endDate] = val.split(",");
|
||||||
|
|
||||||
|
if (
|
||||||
|
startDate &&
|
||||||
|
endDate &&
|
||||||
|
!isNaN(new Date(startDate).getTime()) &&
|
||||||
|
!isNaN(new Date(endDate).getTime())
|
||||||
|
) {
|
||||||
|
dateRange.value = [new Date(startDate).getTime(), new Date(endDate).getTime()];
|
||||||
|
} else {
|
||||||
|
dateRange.value = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dateRange.value = null;
|
dateRange.value = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<view style="width: 100%; height: var(--status-bar-height)" />
|
||||||
<view class="home">
|
<view class="home">
|
||||||
<view style="width: 100%; height: var(--status-bar-height)" />
|
|
||||||
<wd-swiper
|
<wd-swiper
|
||||||
v-model:current="current"
|
v-model:current="current"
|
||||||
:list="swiperList"
|
:list="swiperList"
|
||||||
@@ -136,13 +136,7 @@ const chartData = ref({});
|
|||||||
// 日期范围
|
// 日期范围
|
||||||
const recentDaysRange = ref(7);
|
const recentDaysRange = ref(7);
|
||||||
|
|
||||||
const swiperList = ref([
|
const swiperList = ref(["https://oss.youlai.tech/blog/banner3.png"]);
|
||||||
"https://registry.npmmirror.com/wot-design-uni-assets/1.0.4/files/redpanda.jpg",
|
|
||||||
"https://registry.npmmirror.com/wot-design-uni-assets/1.0.4/files/capybara.jpg",
|
|
||||||
"https://registry.npmmirror.com/wot-design-uni-assets/1.0.4/files/panda.jpg",
|
|
||||||
"https://registry.npmmirror.com/wot-design-uni-assets/1.0.4/files/moon.jpg",
|
|
||||||
"https://registry.npmmirror.com/wot-design-uni-assets/1.0.4/files/meng.jpg",
|
|
||||||
]);
|
|
||||||
|
|
||||||
// 快捷导航列表
|
// 快捷导航列表
|
||||||
const navList = reactive([
|
const navList = reactive([
|
||||||
|
|||||||
@@ -62,22 +62,13 @@ const handleLogin = () => {
|
|||||||
loginFormRef.value.validate().then(async ({ valid }: { valid: boolean }) => {
|
loginFormRef.value.validate().then(async ({ valid }: { valid: boolean }) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
try {
|
try {
|
||||||
await userStore.login(loginFormData.value); // 等待登录和获取用户信息完成
|
await userStore.login(loginFormData.value);
|
||||||
await userStore.getInfo(); // 等待用户信息获取完成
|
await userStore.getInfo();
|
||||||
await dictStore.loadDictionaries(); // 等待字典数据加载完成
|
await dictStore.loadDictionaries();
|
||||||
uni.showToast({ title: "登录成功", icon: "success" });
|
uni.showToast({ title: "登录成功", icon: "success" });
|
||||||
const pages = getCurrentPages(); // 获取当前的页面栈
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/index",
|
||||||
console.log("pages", pages);
|
});
|
||||||
if (pages.length > 1) {
|
|
||||||
// 如果页面栈中有多个页面,则可以返回上一页
|
|
||||||
uni.navigateBack();
|
|
||||||
} else {
|
|
||||||
// 如果页面栈中只有一个页面(通常是首页),则可以跳转到指定页面,避免 navigateBack 无法返回的问题
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/index", // 替换为你想要跳转的页面路径
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log("登录失败", error.message);
|
console.log("登录失败", error.message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="work">
|
<view class="work">
|
||||||
<template v-for="item in gridList">
|
<template v-for="(item, index) in gridList" :key="index">
|
||||||
<wd-card :title="item.title">
|
<wd-card :title="item.title">
|
||||||
<wd-grid clickable :column="4">
|
<wd-grid clickable :column="4">
|
||||||
<wd-grid-item
|
<wd-grid-item
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
</wd-drop-menu>
|
</wd-drop-menu>
|
||||||
|
|
||||||
<!-- 卡片列表 -->
|
<!-- 卡片列表 -->
|
||||||
<wd-card v-for="(item, index) in pageData" class="card-list">
|
<wd-card v-for="(item, index) in pageData" :key="item.id" class="card-list">
|
||||||
<template #title>
|
<template #title>
|
||||||
{{ item.operator }}
|
{{ item.operator }}
|
||||||
</template>
|
</template>
|
||||||
@@ -70,6 +70,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||||
import { DropMenuItemExpose } from "wot-design-uni/components/wd-drop-menu-item/types";
|
import { DropMenuItemExpose } from "wot-design-uni/components/wd-drop-menu-item/types";
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
</wd-drop-menu>
|
</wd-drop-menu>
|
||||||
<!-- 卡片列表 -->
|
<!-- 卡片列表 -->
|
||||||
<view class="list-container">
|
<view class="list-container">
|
||||||
<wd-card v-for="item in dataList" class="role-card">
|
<wd-card v-for="item in dataList" :key="item.id" class="role-card">
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="flex-between">
|
<view class="flex-between">
|
||||||
<view class="flex-center">
|
<view class="flex-center">
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
position="left-bottom"
|
position="left-bottom"
|
||||||
:expandable="false"
|
:expandable="false"
|
||||||
customStyle="width: 1rem; height: 1rem; line-height: 1rem;z-index:9"
|
customStyle="width: 1rem; height: 1rem; line-height: 1rem;z-index:9"
|
||||||
@click="handleOpenDialog(null)"
|
@click="handleOpenDialog()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
|
<wd-popup v-model="dialog.visible" position="bottom" custom-class="yl-popup">
|
||||||
@@ -109,7 +109,6 @@ const total = ref(0);
|
|||||||
const queryParams = reactive<RolePageQuery>({
|
const queryParams = reactive<RolePageQuery>({
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
keywords: "",
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 用户卡片 -->
|
<!-- 用户卡片 -->
|
||||||
<wd-card v-for="item in pageData">
|
<wd-card v-for="item in pageData" :key="item.id">
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="flex-between">
|
<view class="flex-between">
|
||||||
<view class="flex-center">
|
<view class="flex-center">
|
||||||
@@ -128,6 +128,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
|
||||||
|
|
||||||
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
import { LoadMoreState } from "wot-design-uni/components/wd-loadmore/types";
|
||||||
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
import { FormRules } from "wot-design-uni/components/wd-form/types";
|
||||||
import { useMessage } from "wot-design-uni";
|
import { useMessage } from "wot-design-uni";
|
||||||
@@ -242,6 +244,7 @@ const handleQuery = () => {
|
|||||||
filterDropMenu.value?.close();
|
filterDropMenu.value?.close();
|
||||||
queryParams.pageNum = 1;
|
queryParams.pageNum = 1;
|
||||||
loadmore();
|
loadmore();
|
||||||
|
console.log("queryParams", queryParams);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user