Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1cc0122ae9
7843
pnpm-lock.yaml
generated
7843
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -27,3 +27,6 @@ export const findAllNjBjTree = async () => {
|
|||||||
export const jsConfirmJsDataApi = async (params: any) => {
|
export const jsConfirmJsDataApi = async (params: any) => {
|
||||||
return await post("/api/js/confirmJsData", params);
|
return await post("/api/js/confirmJsData", params);
|
||||||
};
|
};
|
||||||
|
export const jsdFindPageTaskApi = async (params: any) => {
|
||||||
|
return await get("/api/jsd/findPageTask", params);
|
||||||
|
};
|
||||||
|
|||||||
@ -5,15 +5,15 @@
|
|||||||
<view class="tabs-container">
|
<view class="tabs-container">
|
||||||
<view
|
<view
|
||||||
class="tab-item"
|
class="tab-item"
|
||||||
:class="{ active: currentTab === 0 }"
|
:class="{ active: currentTab === 1 }"
|
||||||
@click="changeTab(0)"
|
@click="changeTab(1)"
|
||||||
>
|
>
|
||||||
待办
|
待办
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="tab-item"
|
class="tab-item"
|
||||||
:class="{ active: currentTab === 1 }"
|
:class="{ active: currentTab === 0 }"
|
||||||
@click="changeTab(1)"
|
@click="changeTab(0)"
|
||||||
>
|
>
|
||||||
已办
|
已办
|
||||||
</view>
|
</view>
|
||||||
@ -22,10 +22,10 @@
|
|||||||
<template #default="{ data }">
|
<template #default="{ data }">
|
||||||
<view class="white-bg-color r-md p-15 mb-15 flex-row" @click="goToDetail(data)">
|
<view class="white-bg-color r-md p-15 mb-15 flex-row" @click="goToDetail(data)">
|
||||||
<view class="card-left">
|
<view class="card-left">
|
||||||
<view class="card-title">{{ data.title }}</view>
|
<view class="card-title">{{ data.rwmc }}</view>
|
||||||
<view class="card-desc">{{ data.desc }}</view>
|
<view class="card-desc" v-html="data.rwms"></view>
|
||||||
<view class="card-meta">
|
<view class="card-meta">
|
||||||
<text>{{ data.date }}</text>
|
<text>{{ data.fbsj }}</text>
|
||||||
<text>{{ data.timeAgo }}</text>
|
<text>{{ data.timeAgo }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -44,9 +44,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, watch, onMounted } from "vue";
|
import {ref, reactive, watch, onMounted} from "vue";
|
||||||
|
|
||||||
import { useLayout } from "@/components/BasicListLayout/hooks/useLayout";
|
import {useLayout} from "@/components/BasicListLayout/hooks/useLayout";
|
||||||
|
import {jsdFindPageTaskApi} from "@/api/base/server";
|
||||||
|
|
||||||
// 模拟待办列表数据
|
// 模拟待办列表数据
|
||||||
const mockTodoList = [
|
const mockTodoList = [
|
||||||
@ -75,21 +76,24 @@ const mockTodoList = [
|
|||||||
const testList = async (param: any): Promise<Requests<any>> => {
|
const testList = async (param: any): Promise<Requests<any>> => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
resolve({ message: "测试", resultCode: 1, rows: mockTodoList });
|
resolve({message: "测试", resultCode: 1, rows: mockTodoList});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const [register, { reload, setParam }] = useLayout({
|
const [register, {reload, setParam}] = useLayout({
|
||||||
api: testList,
|
api: jsdFindPageTaskApi,
|
||||||
componentProps: {},
|
componentProps: {
|
||||||
|
auto: false
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const currentTab = ref(0); // 0: 待办, 1: 已办
|
const currentTab = ref(1); // 0: 待办, 1: 已办
|
||||||
|
|
||||||
const fetchListData = async (tabIndex: number) => {
|
const fetchListData = async (tabIndex: number) => {
|
||||||
setParam({
|
setParam({
|
||||||
type: tabIndex,
|
type: tabIndex,
|
||||||
|
mobile: getUser.mobile
|
||||||
});
|
});
|
||||||
reload();
|
reload();
|
||||||
};
|
};
|
||||||
@ -100,7 +104,9 @@ const changeTab = (tabIndex: number) => {
|
|||||||
fetchListData(tabIndex);
|
fetchListData(tabIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
import {useUserStore} from "@/store/modules/user";
|
||||||
|
|
||||||
|
const {getUser} = useUserStore()
|
||||||
// 组件加载完成后,获取初始数据 (待办)
|
// 组件加载完成后,获取初始数据 (待办)
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchListData(currentTab.value);
|
fetchListData(currentTab.value);
|
||||||
@ -114,7 +120,7 @@ const goToDetail = (data: any) => {
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/base/message/detail?id=${encodedId}`
|
url: `/pages/base/message/detail?id=${encodedId}`
|
||||||
});
|
});
|
||||||
} else if (data && data.title) {
|
} else if (data && data.rwmc) {
|
||||||
// Fallback: use title if id is missing (less reliable)
|
// Fallback: use title if id is missing (less reliable)
|
||||||
console.warn("Navigating using title as ID fallback for:", data);
|
console.warn("Navigating using title as ID fallback for:", data);
|
||||||
const encodedTitle = encodeURIComponent(data.title);
|
const encodedTitle = encodeURIComponent(data.title);
|
||||||
@ -123,7 +129,7 @@ const goToDetail = (data: any) => {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.error("Cannot navigate to detail: Missing identifier (id or title) in data:", data);
|
console.error("Cannot navigate to detail: Missing identifier (id or title) in data:", data);
|
||||||
uni.showToast({ title: "无法打开详情", icon: "none" });
|
uni.showToast({title: "无法打开详情", icon: "none"});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -153,6 +159,7 @@ const goToDetail = (data: any) => {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar-actions {
|
.navbar-actions {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 15px;
|
right: 15px;
|
||||||
@ -234,6 +241,7 @@ const goToDetail = (data: any) => {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-desc {
|
.card-desc {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
color: #666;
|
color: #666;
|
||||||
@ -244,9 +252,11 @@ const goToDetail = (data: any) => {
|
|||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-meta {
|
.card-meta {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
@ -272,22 +282,27 @@ const goToDetail = (data: any) => {
|
|||||||
&.notice {
|
&.notice {
|
||||||
background-color: #447ade;
|
background-color: #447ade;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.task {
|
&.task {
|
||||||
background-color: #19be6b;
|
background-color: #19be6b;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加新的标签样式示例
|
// 添加新的标签样式示例
|
||||||
&.approval {
|
&.approval {
|
||||||
background-color: #ff9f0a; // 橙色
|
background-color: #ff9f0a; // 橙色
|
||||||
}
|
}
|
||||||
|
|
||||||
&.submit {
|
&.submit {
|
||||||
background-color: #8e8e93; // 灰色
|
background-color: #8e8e93; // 灰色
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats {
|
.stats {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user