(null)
+
+export default function DailyContext({children}:DailyContextProps){
+ // 获取当前单位下的所有staff的记录
+ const {data:staffs,isLoading:staffsLoading} = api.staff.findByDept.useQuery({
+ deptId:"cm84jt1gv000do5gqsxx68iko"
+ })
+ const staffsMsg = staffs?.map((staff)=>{
+ return {
+ id:staff.id,
+ showname:staff.showname,
+ username:staff.username
+ }
+ })
+ useEffect(()=>{
+ console.log(staffs)
+ },[staffs])
+ return
+ {children}
+
+}
+
+export function useDaily(){
+ const daily = useContext(DailyContextProvider)
+ if(!daily) {throw new Error("useParams must be used within a ParamsProvider");}
+ return daily
+}
\ No newline at end of file
diff --git a/apps/web/src/components/models/daily/DailyLayout.tsx b/apps/web/src/components/models/daily/DailyLayout.tsx
new file mode 100644
index 0000000..6d7ab8e
--- /dev/null
+++ b/apps/web/src/components/models/daily/DailyLayout.tsx
@@ -0,0 +1,11 @@
+import DailyMsgDisplayLayout from "./dailyMsgDisplay/DailyMsgDisplayLayout";
+import { DailyMsgFormLayout } from "./dailyMsgForm/DailyMsgFormLayout";
+
+export default function DailyLayout(){
+ return (
+
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx b/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx
new file mode 100644
index 0000000..48ce306
--- /dev/null
+++ b/apps/web/src/components/models/daily/dailyMsgDisplay/DailyMsgDisplayLayout.tsx
@@ -0,0 +1,5 @@
+export default function DailyMsgDisplayLayout(){
+ return (
+
+ )
+}
\ No newline at end of file
diff --git a/apps/web/src/components/models/daily/dailyMsgForm/DailyMsgFormLayout.tsx b/apps/web/src/components/models/daily/dailyMsgForm/DailyMsgFormLayout.tsx
new file mode 100644
index 0000000..e52010d
--- /dev/null
+++ b/apps/web/src/components/models/daily/dailyMsgForm/DailyMsgFormLayout.tsx
@@ -0,0 +1,23 @@
+import { Form, QRCode, Select } from "antd";
+import StaffSelect from "../../staff/staff-select";
+import { useDaily } from "../DailyContext";
+
+export function DailyMsgFormLayout() {
+ const [form] = Form.useForm()
+ const { staffsMsg } = useDaily()
+ const handleChange = (value: string | string[]) => {
+ console.log(value)
+ }
+ return (
+
+
+
+ )
+}
\ No newline at end of file
diff --git a/apps/web/src/components/models/staff/staff-select.tsx b/apps/web/src/components/models/staff/staff-select.tsx
index 5881f2a..ee46458 100755
--- a/apps/web/src/components/models/staff/staff-select.tsx
+++ b/apps/web/src/components/models/staff/staff-select.tsx
@@ -9,6 +9,13 @@ interface StaffSelectProps {
multiple?: boolean;
domainId?: string;
placeholder?: string;
+ staffsMsg?: StaffsMsgProps[];
+}
+
+interface StaffsMsgProps {
+ id: string;
+ showname: string;
+ username: string;
}
export default function StaffSelect({
@@ -18,6 +25,7 @@ export default function StaffSelect({
style,
multiple,
domainId,
+ staffsMsg,
}: StaffSelectProps) {
const [keyword, setQuery] = useState("");
@@ -50,7 +58,7 @@ export default function StaffSelect({
},
select: { id: true, showname: true, username: true },
- take: 30,
+ //take: 30,
orderBy: { order: "asc" }
});
@@ -59,6 +67,13 @@ export default function StaffSelect({
};
const options: SelectProps["options"] =
+ staffsMsg ?
+ staffsMsg.map((staff)=>{
+ return {
+ value:staff.id,
+ label:staff.showname || staff.username
+ }
+ }) :
data?.map((staff: any) => ({
value: staff.id,
label: staff?.showname || staff?.username,
diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx
index 85a7d84..326bc27 100755
--- a/apps/web/src/routes/index.tsx
+++ b/apps/web/src/routes/index.tsx
@@ -10,6 +10,7 @@ import LoginPage from "../app/login";
import HomePage from "../app/main/home/page";
import StaffMessage from "../app/main/staffpage/page";
import MainLayout from "../app/main/layout/MainLayout";
+import DailyPage from "../app/main/dailyPage/page";
interface CustomIndexRouteObject extends IndexRouteObject {
name?: string;
breadcrumb?: string;
@@ -51,6 +52,10 @@ export const routes: CustomRouteObject[] = [
path: "/staff",
element: ,
},
+ {
+ path:"/daily",
+ element:
+ }
],
},