diff --git a/src/App.tsx b/src/App.tsx index d41109d..518d485 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,10 +1,11 @@ import { Outlet } from "react-router"; import MyComponent from "./components/errorComp"; -import MapUtl from "./components/map/mapUtil"; +// import MapUtl from "./components/map/mapUtil"; +import { useEffect } from "react"; const { socket } = require("./util/socket"); socket.init(); socket.onmessage((e) => { - const data = JSON.parse(e.data); + // const data = JSON.parse(e.data); // if (data.type === "heartbeat") { // MapUtl.makerList[0].setPosition([103.55, 30.342]); // var m = MapUtl.amap; @@ -17,6 +18,9 @@ socket.onmessage((e) => { // } }); const App = () => { + useEffect(() => { + console.log("app mounted"); + }, []); return ( <> diff --git a/src/components/b_table.tsx b/src/components/b_table.tsx index d623646..f363abd 100644 --- a/src/components/b_table.tsx +++ b/src/components/b_table.tsx @@ -28,6 +28,7 @@ const BTable = (props: any) => { checkboxData?: Array, + radioData?: Array, rules: Array } diff --git a/src/components/form/simple_form.tsx b/src/components/form/simple_form.tsx index 0d5556d..1314628 100644 --- a/src/components/form/simple_form.tsx +++ b/src/components/form/simple_form.tsx @@ -1,4 +1,4 @@ -import { Checkbox, DatePicker, Form, Input, Radio } from "antd"; +import { Checkbox, DatePicker, Form, Input, InputNumber, Radio } from "antd"; import { useEffect } from "react"; import { FormType, SimpleFormData } from "./interface"; import { FormSelect } from "./select"; @@ -43,6 +43,17 @@ const SimpleForm = (props: SimpleFormData) => { ); + case FormType.inputNumber: + return ( + + + + ); case "password": return ( { rules={v.rules} > - - + {v.radioData?.map((item) => ( + {item.key} + ))} ); @@ -173,9 +185,11 @@ const SimpleForm = (props: SimpleFormData) => { name={v.name} rules={v.rules} > - { - form.setFieldValue(v.name, m); - }}/> + { + form.setFieldValue(v.name, m); + }} + /> ); default: diff --git a/src/index.less b/src/index.less index fa7db9a..364a0c0 100644 --- a/src/index.less +++ b/src/index.less @@ -1,17 +1,17 @@ -html{ +html { width: 100%; height: 100%; } body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; height: 100%; } -#root{ +#root { height: 100%; } .projectContent { @@ -23,10 +23,10 @@ body { overflow: hidden; } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } -.layout{ +.layout { height: 100%; } @@ -70,37 +70,39 @@ code { } } .btn-dp { - color: #00EF97 !important; - border-color: #00EF97 !important; + color: #00ef97 !important; + border-color: #00ef97 !important; } -.owner_model{ +.owner_model { padding-bottom: 0px !important; - .ant-modal-content{ - background: url("static/frame_s@1x.png") ; + .ant-modal-content { + background: url("static/frame_s@1x.png"); background-size: 100% 100%; background-position: center center; /* 可选,确保图片在容器中居中 */ background-repeat: no-repeat; /* 确保图片不会重复 */ padding-bottom: 0px; - .ant-modal-close{ - display: none; - } - .ant-modal-header{ + .ant-modal-header { padding: 30px 30px; color: rgba(0, 0, 0, 0.85); background: none; border-bottom: 0px solid #f0f0f0; - min-height: 80px; - display: flex; align-items: center; - padding-left:40px ; - .ant-modal-title{ + padding-left: 40px; + position: relative; + top: -38px; + left: -30px; + .ant-modal-title { color: #fff; } } - .ant-modal-body{ - min-height: 300px; + .ant-modal-close{ + color: #fff; } - .ant-modal-footer{ + .ant-modal-body { + min-height: 300px; + overflow: auto; + } + .ant-modal-footer { padding: 30px 30px; text-align: center; background: transparent; @@ -108,4 +110,4 @@ code { background: none; } } -} \ No newline at end of file +} diff --git a/src/pages/OrgChart.tsx b/src/pages/OrgChart.tsx new file mode 100644 index 0000000..dd8923a --- /dev/null +++ b/src/pages/OrgChart.tsx @@ -0,0 +1,329 @@ +import "./org_chart.less"; +const OrgChart = () => { + const data = [ + { + depName: "镇武装部党委", + depId: 1, + userList: [ + { + position: "武装部长", + userName: "李部长", + userId: 1, + }, + { + position: "教导员", + userName: "王教导", + userId: 2, + }, + ], + children: [ + { + depName: " 武装力量党支部", + depId: 2, + children: [ + { + depName: " 文武社区支部", + depId: 3, + children: [ + { + depName: " 一小组", + depId: 6, + userList: [ + { + position: "一小组长", + userName: "一小组长", + userId: 6, + }, + { + position: "二小组长", + userName: "二小组长", + userId: 8, + }, + { + position: "战士", + userName: "王小三", + userId: 11, + }, + { + position: "战士", + userName: "王小四", + userId: 12, + }, + { + position: "二小组长", + userName: "二小组长", + userId: 8, + }, + { + position: "战士", + userName: "王小三", + userId: 11, + }, + { + position: "战士", + userName: "王小四", + userId: 13, + }, + ], + }, + { + depName: " 二小组", + depId: 7, + userList: [ + { + position: "二小组长", + userName: "二小组长", + userId: 7, + }, + { + position: "二小组长", + userName: "二小组长", + userId: 8, + }, + { + position: "战士", + userName: "王小三", + userId: 11, + }, + { + position: "战士", + userName: "王小四", + userId: 12, + }, + ], + }, + ], + userList: [ + { + position: "文武社区支部书记", + userName: "书记名称", + userId: 3, + }, + ], + }, + { + depName: " 花龙村支部", + depId: 4, + children: [ + { + depName: " 一小组", + depId: 7, + userList: [ + { + position: "一小组长", + userName: "一小组长", + userId: 7, + }, + { + position: "二小组长", + userName: "二小组长", + userId: 8, + }, + { + position: "战士", + userName: "王小三", + userId: 11, + }, + { + position: "战士", + userName: "王小四", + userId: 12, + }, + { + position: "二小组长", + userName: "二小组长", + userId: 8, + }, + + { + position: "战士", + userName: "王小四", + userId: 12, + }, + ], + }, + { + depName: " 二小组", + depId: 8, + userList: [ + { + position: "二小组长", + userName: "二小组长", + userId: 8, + }, + { + position: "战士", + userName: "王小三", + userId: 11, + }, + { + position: "战士", + userName: "王小四", + userId: 12, + }, + { + position: "战士", + userName: "王小五", + userId: 13, + }, + ], + }, + ], + userList: [ + { + position: "花龙村支部书记", + userName: "书记名称", + userId: 4, + }, + ], + }, + { + depName: " 云华社区支部", + depId: 5, + children: [ + { + depName: " 一小组", + depId: 8, + userList: [ + { + position: "一小组长", + userName: "小组长", + userId: 8, + }, + { + position: "战士", + userName: "王喜哦", + userId: 12, + }, + { + position: "战士", + userName: "王喜吃", + userId: 13, + }, + ], + }, + { + depName: " 二小组", + depId: 9, + userList: [ + { + position: "二小组长", + userName: "小组长", + userId: 9, + }, + { + position: "战士", + userName: "王小二", + userId: 10, + }, + { + position: "战士", + userName: "王小三", + userId: 11, + }, + { + position: "战士", + userName: "王小四", + userId: 12, + }, + { + position: "战士", + userName: "王小五", + userId: 13, + }, + ], + }, + ], + userList: [ + { + position: "云华社区支部书记", + userName: "书记名称", + userId: 5, + }, + ], + }, + ], + }, + ], + }, + ]; + + const renderTree = (list: Array) => { + return ( +
+ {list?.map((v, _) => { + if (v.children) { + return ( +
+ {v.depId !== 2 ? ( + + {v.depName} + + ) : null} + {v.depId === 1 ? ( +
+ {v.userList?.map((v1, _) => { + return ( +
+ + {v1.userName} +
+ ); + })} +
+ ) : ( + v.userList?.map((v1, _) => { + return ( +
+ + {v1.userName} +
+ ); + }) + )} + {v.depId !== 2 ? ( +
+ ) : null} + {renderTree(v.children)} +
+ ); + } + return ( +
+ {v.userList?.map((v1, _) => { + return ( +
+ + {v1.userName} +
+ ); + })} +
+ ); + })} +
+ ); + }; + return
{renderTree(data)}
; +}; + +export default OrgChart; diff --git a/src/pages/archives/archivesCat_clumn.tsx b/src/pages/archives/archivesCat_clumn.tsx index f9e86d4..a52f220 100644 --- a/src/pages/archives/archivesCat_clumn.tsx +++ b/src/pages/archives/archivesCat_clumn.tsx @@ -24,21 +24,22 @@ export const defaultConfig = [ { type: FormType.input, label: "档案名称", - name: "category_name", + name: "archives_name", value: "", rules: [{ required: true, message: "请输入分类名称!" }], }, { type: FormType.input, label: "档案描述", - name: "category_desc", + name: "archives_desc", value: "", }, { type: FormType.upload, label: "档案文件", name: "file_url", - value: "", + rules: [{ required: true, message: "请输入分类名称!" }], + value: [], }, ]; diff --git a/src/pages/archives/preview.tsx b/src/pages/archives/preview.tsx index 1ec19b2..fcf9b4d 100644 --- a/src/pages/archives/preview.tsx +++ b/src/pages/archives/preview.tsx @@ -1,16 +1,22 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import "./preview.less"; +import Config from "@/util/config"; const Preview = (props: any) => { const { list } = props; const [selectIndex, setSelectIndex] = useState(0); + useEffect(() => { + return () => { + setSelectIndex(0); + }; + }, []); return (
- {list.map((item: any, index: number) => ( + {list?.map((item: any, index: number) => ( setSelectIndex(index)} - key={item} + key={item.archives_name} > {item.archives_name} @@ -18,7 +24,13 @@ const Preview = (props: any) => {
-

预览查看

+ {list && list.length > 0 ? ( + {list[selectIndex].file_url} + ) : null}
); diff --git a/src/pages/dep/index.tsx b/src/pages/dep/index.tsx index b169019..ffe42d9 100644 --- a/src/pages/dep/index.tsx +++ b/src/pages/dep/index.tsx @@ -1,4 +1,4 @@ -import { Button, Space, Modal, FormInstance } from "antd"; +import { Button, Space, Modal, FormInstance, Form, Select } from "antd"; import { inject, observer } from "mobx-react"; import type { ColumnsType } from "antd/es/table"; import BTable from "@/components/b_table"; @@ -7,7 +7,8 @@ import { UserDataType } from "@/model/userModel"; import { Store } from "antd/lib/form/interface"; import SimpleForm from "@/components/form/simple_form"; import React from "react"; - +import { FormType } from "@/components/form/interface"; +const { Option } = Select; const Dep = (props: Store) => { const { depStore } = props; const [isModalOpen, setIsModalOpen] = useState(false); @@ -15,6 +16,7 @@ const Dep = (props: Store) => { const formRef = React.useRef(null); const [record, setRecord] = useState(null); const [tagId, setId] = useState(null); + const [stoList, setStolist] = useState([]); const columns: ColumnsType = [ { title: "部门名称", dataIndex: "dep_name" }, { title: "部门描述", dataIndex: "remark" }, @@ -23,47 +25,46 @@ const Dep = (props: Store) => { dataIndex: "id", render: (any, record) => (
- - - - - + + +
), }, ]; const edit = (record) => { - record = { + + let data = { ...record, - imageUrl: [{ url: record.imageUrl }], + head_img: [{ url: record.head_img }], }; setProjectConfig(defaultConfig); setIsModalOpen(true); - formRef.current?.setFieldsValue(record); - setRecord(record); + formRef.current?.setFieldsValue(data); + setRecord(data); setId(record.id); }; const onFinish = (values: any) => { - let data = values - data.head_img = values.head_img[0].url + let data = values; + data.head_img = values.head_img[0].url; if (!tagId) { depStore.add(data); } else { @@ -72,17 +73,11 @@ const Dep = (props: Store) => { setIsModalOpen(false); }; useEffect(() => { - depStore.getlist(); + depStore.getlist().then(() => { + setStolist(depStore.list); + }); }, [depStore]); const defaultConfig = [ - { - type: "select", - label: "上级部门名称", - name: "pdep_id", - value: "", - selectUrl: "dep/list", - rules: [{ required: false, message: "请输入上级部门!" }], - }, { type: "input", label: "部门名称", @@ -97,6 +92,23 @@ const Dep = (props: Store) => { value: "", rules: [{ required: true, message: "请输入部门描述" }], }, + { + type: FormType.radio, + label: "第三方机构", + name: "other", + radioData: [ + { + key: "是", + val: 1, + }, + { + key: "否", + val: 2, + }, + ], + value: "", + rules: [{ required: true, message: "请输入部门描述" }], + }, { type: "upload", label: "头像", @@ -146,7 +158,25 @@ const Dep = (props: Store) => { onFinish={onFinish} initialValues={true} onFinishFailed={onFinishFailed} - /> + > + <> + + + + + diff --git a/src/pages/home/home.less b/src/pages/home/home.less index e90e9a7..294e0b3 100644 --- a/src/pages/home/home.less +++ b/src/pages/home/home.less @@ -1,83 +1,127 @@ -.contents_center { - width: 100%; - height: 100%; - overflow: hidden; - position: relative; - .map_container_t{ - position: absolute; - height: 80px; - top: 0; - width: 100%; - background-image: url("../../static/head.png"); - background-repeat: no-repeat; - left: 0; - right: 0; - z-index: 1; - display: flex; - align-items: center; - .title_img{ - margin-left: 10px; - width: 20px; - height: 20px; - } - .twp{ - width: 160px; - height: 30px; - } - >span{ - margin-left: 15px; - margin-right: 15px; - color: #fff; - font-size: 38px; - font-weight: normal; - line-height: normal; - letter-spacing: 0.1em; - font-variation-settings: "opsz" auto; - color: #FFFFFF; - text-shadow: 0px 0px 10px #29ECB4; - } - } - .map_container_l{ - position: absolute; - left: 0px; - top: 80px; - width: 20%; - bottom: 0px; - z-index: 2; - opacity: 1; - background: rgba(37, 52, 70, 0.4); - backdrop-filter: blur(10px); - } - .map_container_r{ - position: absolute; - right: 0px; - top: 80px; - bottom: 0px; - width: 20%; - z-index: 2; - opacity: 1; - background: rgba(37, 52, 70, 0.4); - backdrop-filter: blur(10px); - } - .map_container_b{ - position: absolute; - bottom: 0px; - background: rgba(37, 52, 70, 0.4); - height: 80px; - width: 100%; - z-index: 1; - text-align: center; - .bottom_content{ - display: inline-block; - padding-top: 15px; - >span{ - background: linear-gradient(180deg, rgba(0, 193, 153, 0.1) 0%, rgba(0, 239, 151, 0.8) 100%); - padding: 5px 10px ; - color: #fff; - margin: 0 10px; - cursor: pointer; - font-size: 18px; - } - } - } +@keyframes scroll { + 0% { + transform: translateX(100%); + } + 100% { + transform: translateX(-100%); + } +} +.contents_center { + width: 100%; + height: 100%; + overflow: hidden; + position: relative; + .map_container_t { + position: absolute; + height: 60px; + top: 0; + width: 100%; + background-image: url("../../static/head.png"); + background-repeat: no-repeat; + backdrop-filter: blur(10px); + left: 0; + right: 0; + z-index: 1; + display: flex; + align-items: center; + justify-content: space-between; + .map_container_t_l { + display: flex; + align-items: center; + flex: 1; + .title_img { + margin-left: 10px; + width: 20px; + height: 20px; + } + .twp { + width: 160px; + height: 30px; + } + > span { + margin-left: 15px; + margin-right: 15px; + color: #fff; + font-size: 30px; + font-weight: normal; + line-height: normal; + letter-spacing: 0.1em; + font-variation-settings: "opsz" auto; + color: #ffffff; + text-shadow: 0px 0px 10px #29ecb4; + } + } + + .scr { + flex: 1; + overflow: hidden; + .scrolling-text { + white-space: nowrap; + display: block; + animation: scroll 10s linear infinite; + color: #fff; + > span { + display: inline-block; + animation: scrollText 10s linear infinite; /* 动画 */ + } + :hover >span{ + animation-play-state: paused; + } + } + } + + .map_container_t_r { + flex: 1; + text-align: right; + padding-right: 10px; + } + } + .map_container_l { + position: absolute; + left: 0px; + top: 60px; + width: 20%; + bottom: 0px; + z-index: 2; + opacity: 1; + background: rgba(37, 52, 70, 0.4); + backdrop-filter: blur(10px); + } + .map_container_r { + position: absolute; + right: 0px; + top: 60px; + bottom: 0px; + width: 20%; + z-index: 2; + opacity: 1; + background: rgba(37, 52, 70, 0.4); + backdrop-filter: blur(10px); + } + .map_container_b { + position: absolute; + bottom: 0px; + backdrop-filter: blur(10px); + background: rgba(37, 52, 70, 0.4); + height: 80px; + width: 100%; + z-index: 1; + text-align: center; + .bottom_content { + display: inline-block; + padding-top: 15px; + > span { + background: linear-gradient( + 180deg, + rgba(0, 193, 153, 0.1) 0%, + rgba(0, 239, 151, 0.8) 100% + ); + padding: 5px 10px; + color: #fff; + margin: 0 10px; + cursor: pointer; + font-size: 18px; + } + } + } } diff --git a/src/pages/home/home.tsx b/src/pages/home/home.tsx index eb2b955..4be2a66 100644 --- a/src/pages/home/home.tsx +++ b/src/pages/home/home.tsx @@ -4,15 +4,35 @@ import MapContainer from "@/components/map/MapComponent"; import HomeLeft from "@/pages/home/homeLeft/home_left"; import HomeRight from "@/pages/home/homeRigrt/home_right"; import HomeBottom from "@/pages/home/homeBottom/home_bottom"; -import image1 from "@/static/title_jiantou@1x.png" -import image2 from "@/static/title_line@1x.png" +import image1 from "@/static/title_jiantou@1x.png"; +import image2 from "@/static/title_line@1x.png"; +import { SettingOutlined } from "@ant-design/icons"; +import { useNavigate } from "react-router"; const Home = observer(() => { + const navigate = useNavigate(); return (
+
黄水镇武装平台 - + +
+
+
+ + 仓库3,2号货架,单兵装备,即将临期, + 仓库4,1号货架,单兵装备,即将临期, + 仓库2,3号货架,单兵装备,即将临期 + +
+
+
+ {navigate("admin/user");}} + style={{ fontSize: "20px", color: "#f9f9f9", cursor: "pointer" }} + /> +
diff --git a/src/pages/home/homeBottom/bot.less b/src/pages/home/homeBottom/bot.less new file mode 100644 index 0000000..6fe27bb --- /dev/null +++ b/src/pages/home/homeBottom/bot.less @@ -0,0 +1,101 @@ +.bottom_container { + width: 100%; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + height: 100%; +} + +.owner_model { + background-color: #000; +} + +.disPatch { + #card_basic { + .ant-form-item { + color: #fff; + .ant-row { + color: #fff; + .ant-col { + color: #fff; + > label { + color: #fff; + } + .ant-form-item-control-input { + background: rgba(37, 52, 70, 0.4); + color: #fff; + .ant-select-selector { + background: rgba(37, 52, 70, 0.4); + color: #fff; + } + .ant-input { + background: rgba(37, 52, 70, 0.4); + color: #fff; + } + .ant-picker { + background: rgba(37, 52, 70, 0.4); + + .ant-picker-input { + color: #fff; + ::placeholder { + color: #fff; /* 设置为灰色 */ + } + } + } + .ant-form-item-control-input-content { + color: #fff; /* 设置为灰色 */ + .ant-checkbox-group { + color: #fff; /* 设置为灰色 */ + .ant-checkbox-wrapper { + color: #fff; + } + } + } + } + } + } + } + } +} + +.ec_container { + display: flex; + align-items: start; + justify-content: space-around; + width: 100%; + height: 600px; + overflow: hidden; + .ec_left { + width: 25%; + height: 90%; + overflow-y: auto; + padding: 10px; + background: rgba(37, 52, 70, 0.4); + color: #fff; + text-align: start; + .ec_left_title { + color: #fff; + } + .u-item{ + cursor: pointer; + } + } + .ec_right { + width: 75%; + height: 100%; + position: relative; + #rtcVideo{ + height: 90%; + width: 100%; + } + .ec_right_end{ + position: absolute; + left: 0; + right: 0; + bottom: 20px; + color: #fff; + text-align: center; + } + } +} diff --git a/src/pages/home/homeBottom/dispath.tsx b/src/pages/home/homeBottom/dispath.tsx new file mode 100644 index 0000000..f33f875 --- /dev/null +++ b/src/pages/home/homeBottom/dispath.tsx @@ -0,0 +1,128 @@ +import SimpleForm from "@/components/form/simple_form"; +import { TrainingConfig } from "@/pages/training/traning_config"; +import { Button, Form, FormInstance, Modal, Select } from "antd"; +import React, { useEffect } from "react"; +import { useState } from "react"; +import baseHttp from "@/service/base"; +import "./bot.less"; +import { Store } from "antd/es/form/interface"; +import { inject, observer } from "mobx-react"; +import { FormType } from "@/components/form/interface"; +const { Option } = Select; + +const Dispath = (props: Store) => { + const { trainingStore, trainingCatStore } = props; + const openDispatch = () => { + setIsModalOpen(true); + setProjectConfig([ + ...TrainingConfig, + { + type: FormType.cehckboxGroup, + label: "参与人员选择", + name: "user_id", + value: [], + checkboxData: userList, + rules: [{ required: true, message: "请选择参与人员!" }], + }, + ]); + }; + const handleCancle = () => { + setIsModalOpen(false); + }; + const handleSubmit = () => { + setIsModalOpen(false); + }; + const formRef = React.useRef(null); + const [isModalOpen, setIsModalOpen] = useState(false); + const [projectConfig, setProjectConfig] = useState([]); + const [stashList, setStashList] = useState([]); + const [userList, setUserList] = useState([]); + + useEffect(() => { + trainingCatStore.getlist().then(() => { + setStashList(trainingCatStore.list); + }); + baseHttp.get("/user/list", null).then((res) => { + let data = res.data?.record ?? []; + data.forEach((item) => { + item.label = item.account; + item.value = item.identity; + }); + setUserList(data ?? []); + }); + }, [trainingCatStore]); + + const onFinish = (values: any) => { + let data = { + ...values, + score: Number(values.score), + count: Number(values.count), + }; + trainingStore.add(data); + setIsModalOpen(false); + }; + return ( + <> + 巡防调度 + {}} + onOk={() => {}} + footer={[ + , + , + ]} + onCancel={() => { + setIsModalOpen(false); + }} + > +
+ {}} + formName="card_basic" + colProps={25} + subBtnName="提交" + formDatas={projectConfig} + onFinish={onFinish} + initialValues={true} + onFinishFailed={() => {}} + > + <> + + + + + +
+
+ + ); +}; +export default inject("trainingStore", "trainingCatStore")(observer(Dispath)); diff --git a/src/pages/home/homeBottom/ec.tsx b/src/pages/home/homeBottom/ec.tsx new file mode 100644 index 0000000..4c80b8a --- /dev/null +++ b/src/pages/home/homeBottom/ec.tsx @@ -0,0 +1,71 @@ +import { Modal } from "antd"; +import { Store } from "antd/es/form/interface"; +import { inject, observer } from "mobx-react"; +import { useEffect, useState } from "react"; +import "./bot.less"; +import { PhoneTwoTone } from "@ant-design/icons"; +import { webRTC } from "@/util/webRtc"; + +const Ec = (props: Store) => { + const [isModalOpen, setIsModalOpen] = useState(false); + const { usrStore } = props; + const [userList, setUserList] = useState([]); + useEffect(() => { + usrStore.getlist().then(() => { + setUserList(usrStore.list); + }); + }, [usrStore]); + const openDispatch = () => { + setIsModalOpen(true); + }; + const callphone=(record:any)=>{ + webRTC.init() + webRTC.calls() + } + return ( + <> + 应急连线 + {}} + onOk={() => {}} + footer={null} + onCancel={() => { + setIsModalOpen(false); + }} + > +
+
+
+

应急连线

+
+
+ {userList.map((item: any) => { + return ( +
+
姓名:{item.account} : 未在线
+

+
+ 点击呼叫:{callphone(item)}} /> +
+
+ ); + })} +
+
+
+ +

{ + webRTC.close() + }}>结束通话

+
+
+
+ + ); +}; + +export default inject("usrStore")(observer(Ec)); diff --git a/src/pages/home/homeBottom/emr.tsx b/src/pages/home/homeBottom/emr.tsx new file mode 100644 index 0000000..bfa2861 --- /dev/null +++ b/src/pages/home/homeBottom/emr.tsx @@ -0,0 +1,28 @@ +import { Modal } from "antd"; +import { useState } from "react"; + +const Emr = () => { + const [isModalOpen, setIsModalOpen] = useState(false); + const openDispatch = () => { + setIsModalOpen(true); + }; + return ( + <> + 应急处突 + {}} + onOk={() => {}} + footer={null} + onCancel={() => { + setIsModalOpen(false); + }} + > + + ); +}; + +export default Emr; diff --git a/src/pages/home/homeBottom/home_bottom.tsx b/src/pages/home/homeBottom/home_bottom.tsx index fb07355..1ed0ee4 100644 --- a/src/pages/home/homeBottom/home_bottom.tsx +++ b/src/pages/home/homeBottom/home_bottom.tsx @@ -1,56 +1,17 @@ -import { useState } from "react"; -import { Button, Modal } from "antd"; -import "./right.less"; -import { webRTC } from "@/util/webRtc"; +import Dispath from "./dispath"; +import WhichVideo from "./which_video"; +import Ec from "./ec"; +import Emr from "./emr"; +import "./bot.less"; const HomeBottom = () => { - const [isModalOpen, setIsModalOpen] = useState(false); - const openDispatch = () => { - setIsModalOpen(true); - webRTC.init(); - }; - const handleCancle = () => { - setIsModalOpen(false); - }; - const handleSubmit = () => { - setIsModalOpen(false); - }; return (
- 巡防调度 - 应急处突 - 应急连线 - 视频查看 + + + +
- {}} - onOk={() => {}} - footer={[ - , - , - ]} - onCancel={() => { - setIsModalOpen(false); - }} - > -
- -
-
); }; diff --git a/src/pages/home/homeBottom/right.less b/src/pages/home/homeBottom/right.less deleted file mode 100644 index 5f07335..0000000 --- a/src/pages/home/homeBottom/right.less +++ /dev/null @@ -1,13 +0,0 @@ -.bottom_container{ - width: 100%; - color: #fff; - display: flex; - align-items: center; - justify-content: center; - height: 100%; - -} - -.owner_model{ - background-color: #000; -} \ No newline at end of file diff --git a/src/pages/home/homeBottom/which_video.tsx b/src/pages/home/homeBottom/which_video.tsx new file mode 100644 index 0000000..6441b0c --- /dev/null +++ b/src/pages/home/homeBottom/which_video.tsx @@ -0,0 +1,28 @@ +import { Modal } from "antd"; +import { useState } from "react"; + +const WhichVideo = () => { + const [isModalOpen, setIsModalOpen] = useState(false); + const openDispatch = () => { + setIsModalOpen(true); + }; + return ( + <> + 视频查看 + {}} + onOk={() => {}} + footer={null} + onCancel={() => { + setIsModalOpen(false); + }} + > + + ); +}; + +export default WhichVideo; diff --git a/src/pages/home/homeLeft/home_left.tsx b/src/pages/home/homeLeft/home_left.tsx index d7f895f..7f23ce5 100644 --- a/src/pages/home/homeLeft/home_left.tsx +++ b/src/pages/home/homeLeft/home_left.tsx @@ -1,13 +1,12 @@ import { useEffect, useState } from "react"; import { Modal } from "antd"; import "./left.less"; -import { useNavigate } from "react-router"; -import MapUtl from "@/components/map/mapUtil"; + import * as echarts from "echarts"; import Orgin from "./orgin"; +import Pover from "./pover"; const HomeLeft = () => { const [isModalOpen, setIsModalOpen] = useState(false); - const navigate = useNavigate(); const initChart = () => { var myChart = echarts.init(document.getElementById("xunlian")); var option = { @@ -55,46 +54,11 @@ const HomeLeft = () => { option && myChart.setOption(option); }; - const initChart2 = () => { - var myChart = echarts.init(document.getElementById("orgin1")); - var option = { - xAxis: { - type: 'category', - data: ['基干民兵', '普通民兵', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], - axisLabel: { - show: true, - interval: 0, - rotate: 30, - }, - }, - grid: { - top: "10%", - bottom: "45%", - right: "5%", - }, - yAxis: { - type: 'value', - splitLine: { - show: false, // 去除网格线 - }, - }, - series: [ - { - data: [120, 200, 150, 80, 70, 110, 130], - type: 'bar' - } - ] - }; - option && myChart.setOption(option); - }; useEffect(() => { initChart(); }, []); - useEffect(() => { - initChart2(); - }, []); - const openDispatch = () => { + // const openDispatch = () => { // 位置移动 // MapUtl.makerList[0].setPosition([103.55, 30.342]); // var m = MapUtl.amap; @@ -104,26 +68,23 @@ const HomeLeft = () => { // anchor: new m.Pixel(12, 32), // 图标锚点 // }); // MapUtl.makerList[0].setIcon(newIcon); - }; - const jumpToUser = () => { - navigate("admin/user"); - }; + // }; return (
-
+

组织架构

-
+

武装力量

-
+
-
+

年度训练

diff --git a/src/pages/home/homeLeft/left.less b/src/pages/home/homeLeft/left.less index 91f0628..0c0b4b8 100644 --- a/src/pages/home/homeLeft/left.less +++ b/src/pages/home/homeLeft/left.less @@ -3,7 +3,7 @@ color: #fff; height: 100%; display: flex; - flex-direction: column; + flex-direction: column; .org{ flex:1; width: 100%; @@ -36,6 +36,11 @@ >img{ width: 100%; } + >p{ + font-size: 13px; + padding-bottom: 0px; + margin-bottom: 0px; + } } } } diff --git a/src/pages/home/homeLeft/orgin.tsx b/src/pages/home/homeLeft/orgin.tsx index 5707e8f..de8d988 100644 --- a/src/pages/home/homeLeft/orgin.tsx +++ b/src/pages/home/homeLeft/orgin.tsx @@ -1,17 +1,41 @@ +import OrgChart from "@/pages/OrgChart"; import origin from "@/static/orgin.png"; import origin2 from "@/static/orgin2.png"; +import { Modal } from "antd"; +import { useState } from "react"; const Orgin = () => { + const [isModalOpen, setIsModalOpen] = useState(false); + const showModal = () => { + setIsModalOpen(true); + }; + const handleCancel = () => { + setIsModalOpen(false); + }; return ( -
-
- 234 - + <> +
+
+ 234 + +

党组织数量

+
+
+ 238 + +

党员数量

+
-
- 238 - -
-
+ + + + ); }; diff --git a/src/pages/home/homeLeft/pover.tsx b/src/pages/home/homeLeft/pover.tsx new file mode 100644 index 0000000..17f050b --- /dev/null +++ b/src/pages/home/homeLeft/pover.tsx @@ -0,0 +1,79 @@ +import PoverPage from "@/pages/poverPage"; +import { Modal } from "antd"; +import * as echarts from "echarts"; +import { useEffect, useState } from "react"; + +const Pover = () => { + const [isModalOpen, setIsModalOpen] = useState(false); + const initChart = () => { + var myChart = echarts.init(document.getElementById("pover")); + var option = { + xAxis: { + type: "category", + data: ["基干民兵", "普通民兵", "Wed", "Thu", "Fri", "Sat", "Sun"], + axisLabel: { + show: true, + interval: 0, + rotate: 30, + }, + }, + grid: { + top: "10%", + bottom: "45%", + right: "5%", + left: "12%", + }, + yAxis: { + type: "value", + splitLine: { + show: false, // 去除网格线 + }, + }, + series: [ + { + data: [120, 200, 150, 80, 70, 110, 130], + type: "bar", + barWidth: 10, // 设置柱子粗细 + itemStyle: { + normal: { + barBorderRadius: [5, 5, 0, 0], + }, + }, + }, + ], + }; + option && myChart.setOption(option); + }; + useEffect(() => { + initChart(); + }, []); + const openPoverHander = () => { + setIsModalOpen(true); + }; + return ( + <> +
+ {}} + onOk={() => {}} + footer={null} + onCancel={() => { + setIsModalOpen(false); + }} + > + + {/*

cascsa

*/} +
+ + ); +}; + +export default Pover; diff --git a/src/pages/home/homeRigrt/home_right.tsx b/src/pages/home/homeRigrt/home_right.tsx index 4cadc53..585ed5e 100644 --- a/src/pages/home/homeRigrt/home_right.tsx +++ b/src/pages/home/homeRigrt/home_right.tsx @@ -1,4 +1,5 @@ import "./right.less"; +import Wz from "./wz"; const HomeRight = () => { return (
@@ -6,6 +7,7 @@ const HomeRight = () => {

物资管理

+
diff --git a/src/pages/home/homeRigrt/right.less b/src/pages/home/homeRigrt/right.less index cace495..9f8ed02 100644 --- a/src/pages/home/homeRigrt/right.less +++ b/src/pages/home/homeRigrt/right.less @@ -1,13 +1,13 @@ .right_container { width: 100%; - color: #fff; - height: 100%; - width: 100%; - color: #fff; - height: auto; + color: #fff; + height: 100%; + display: flex; + flex-direction: column; .org { + flex:1; width: 100%; - min-height: 200px; + overflow-y: hidden; text-align: center; .org_head { width: 100%; diff --git a/src/pages/home/homeRigrt/wz.tsx b/src/pages/home/homeRigrt/wz.tsx new file mode 100644 index 0000000..d4d2cd2 --- /dev/null +++ b/src/pages/home/homeRigrt/wz.tsx @@ -0,0 +1,89 @@ +import * as echarts from "echarts"; +import { useEffect } from "react"; +const Wz = () => { + const initChart = () => { + var myChart = echarts.init(document.getElementById("wz")); + var option = { + tooltip: { + trigger: "item", + formatter: "{a}
{b}: {c} ({d}%)", + }, + + series: [ + { + center: ["50%", "40%"], + name: "Access From", + type: "pie", + selectedMode: "single", + radius: [0, "30%"], + label: { + position: "inner", + fontSize: 10, + }, + labelLine: { + show: false, + }, + data: [ + { value: 1548, name: "Search Engine" }, + { value: 775, name: "Direct" }, + { value: 679, name: "Marketing", selected: true }, + ], + }, + { + center: ["50%", "40%"], + name: "Access From", + type: "pie", + radius: ["45%", "60%"], + labelLine: { + length: 30, + show: false, + }, + label: { + formatter: "{a|{a}}{abg|}\n{hr|}\n {b|{b}:}{c} {per|{d}%} ", + backgroundColor: "#F6F8FC", + borderColor: "#8C8D8E", + borderWidth: 0, + show: false, + borderRadius: 4, + rich: { + a: { + color: "#6E7079", + lineHeight: 22, + align: "center", + }, + b: { + color: "#4C5058", + fontSize: 14, + fontWeight: "bold", + lineHeight: 33, + }, + per: { + color: "#fff", + backgroundColor: "#4C5058", + padding: [3, 4], + borderRadius: 4, + }, + }, + }, + data: [ + { value: 1048, name: "Baidu" }, + { value: 335, name: "Direct" }, + { value: 310, name: "Email" }, + { value: 251, name: "Google" }, + { value: 234, name: "Union Ads" }, + { value: 147, name: "Bing" }, + { value: 135, name: "Video Ads" }, + { value: 102, name: "Others" }, + ], + }, + ], + }; + option && myChart.setOption(option); + }; + useEffect(() => { + initChart(); + }, []); + return
; +}; + +export default Wz; diff --git a/src/pages/leaveApproval/levcat_column.tsx b/src/pages/leaveApproval/levcat_column.tsx index ebab0f7..a3eae0a 100644 --- a/src/pages/leaveApproval/levcat_column.tsx +++ b/src/pages/leaveApproval/levcat_column.tsx @@ -8,6 +8,7 @@ export const columns: ColumnsType = [ }, ]; + export const leaveColumns: ColumnsType = [ { title: "请假人", @@ -59,6 +60,16 @@ export const defaultConfig = [ value: "", rules: [{ required: true, message: "请输入驳回原因!" }], }, - ]; + +export const defaultCatConfig = [ + + { + type: FormType.input, + label: "分类名称", + name: "name", + value: "", + rules: [{ required: true, message: "请输入分类名称!" }], + }, +]; diff --git a/src/pages/leaveApproval/levelCat.tsx b/src/pages/leaveApproval/levelCat.tsx index adba966..51fad5d 100644 --- a/src/pages/leaveApproval/levelCat.tsx +++ b/src/pages/leaveApproval/levelCat.tsx @@ -5,7 +5,7 @@ import { useEffect, useState } from "react"; import { Store } from "antd/lib/form/interface"; import SimpleForm from "@/components/form/simple_form"; import React from "react"; -import { columns, defaultConfig } from "./levcat_column"; +import { columns, defaultCatConfig } from "./levcat_column"; const LeaveCat = (props: Store) => { const { leaveCategoryStore } = props; @@ -15,7 +15,7 @@ const LeaveCat = (props: Store) => { const [record, setRecord] = useState(null); useEffect(() => { leaveCategoryStore.getlist(); - setProjectConfig(defaultConfig); + setProjectConfig(defaultCatConfig); }, [leaveCategoryStore]); const column_widget = (any, record) => { return ( @@ -69,7 +69,7 @@ const LeaveCat = (props: Store) => { type="default" onClick={() => { setRecord(null); - setProjectConfig(defaultConfig); + setProjectConfig(defaultCatConfig); setIsModalOpen(true); }} > diff --git a/src/pages/materialMgmt/material_column.tsx b/src/pages/materialMgmt/material_column.tsx index 2c502ba..161ba08 100644 --- a/src/pages/materialMgmt/material_column.tsx +++ b/src/pages/materialMgmt/material_column.tsx @@ -26,6 +26,10 @@ export const columns: ColumnsType = [ title: "所属仓库", dataIndex: "stash_name", }, + { + title: "数量", + dataIndex: "num", + }, ]; export const defaultConfig = [ @@ -52,6 +56,13 @@ export const defaultConfig = [ value: "", rules: [{ required: true, message: "请输入物资描述!" }], }, + { + type: FormType.inputNumber, + label: "物资数量", + name: "num", + value: "", + rules: [{ required: true, message: "请输入物资数量!" }], + }, { type: FormType.date, label: "过期时间", diff --git a/src/pages/org_chart.less b/src/pages/org_chart.less new file mode 100644 index 0000000..9feef25 --- /dev/null +++ b/src/pages/org_chart.less @@ -0,0 +1,63 @@ +.orgs { + margin-left: 10; + margin-bottom: 10; + display: flex; + align-items: center; +} +.orgsBox{ + overflow: auto; + margin: 10px; +} +.line { + position: relative; + height: 3px; /* 线的高度 */ +} +.line::after { + content: ""; + position: absolute; + left: 0; + right: 0; + top: 0; + border-top: 1px solid #fff; /* 线的颜色和宽度 */ +} +.line:before{ + content: ''; + position: absolute; + top: 50%; + left: 100%; + transform: translate(-50%, -50%); + width: 100%; + height: 50%; + background: #fff; /* 设置线的颜色 */ +} +.line:after { + content: ''; + position: absolute; + top: 50%; + left:50%; + transform: translate(-50%, -50%); + width: 100%; + height: 50%; + background: #fff; /* 设置线的颜色 */ +} + +.line:before { + transform: translate(-50%, -50%) rotate(90deg); +} + +.line:after { + width: 100%; /* 设置短线宽度 */ + background: transparent; /* 设置短线透明 */ +} +.userNmaeBox{ + margin-left: 10px; + margin-bottom: 10px; + color: #fff; + text-align: center; + .userNmae{ + display: block; + padding: 5px 5px; + background: rgba(75, 176, 152, 0.2); + font-size: 13px; + } +} diff --git a/src/pages/poverDetail/index.tsx b/src/pages/poverDetail/index.tsx new file mode 100644 index 0000000..a6af1cc --- /dev/null +++ b/src/pages/poverDetail/index.tsx @@ -0,0 +1,68 @@ +import "./pvd.less"; +const PoverDetail = () => { + return ( +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
姓名王永平性别所属队伍
出生年月2024-09-12贯籍广州
政治面貌中共党员民族汉族
通讯地址四川省成都市双流区
联系电话13208266337邮箱wang_yp2023@qq.com
学历本科专业应急消防
服役部队中国人民武装警察部队四川省总队凉山消防支队
工作单位及职务中国人民武装警察部队四川省总队凉山消防支队
立功受奖情况中国人民武装警察部队四川省总队凉山消防支队
专业情况中国人民武装警察部队四川省总队凉山消防支队
个人证书中国人民武装警察部队四川省总队凉山消防支队
+ + ); +}; + +export default PoverDetail; diff --git a/src/pages/poverDetail/pvd.less b/src/pages/poverDetail/pvd.less new file mode 100644 index 0000000..b59d733 --- /dev/null +++ b/src/pages/poverDetail/pvd.less @@ -0,0 +1,17 @@ +.pvd_table { + .table { + width: 100%; + border-collapse: collapse; + overflow-x: auto; + > thead { + > tr { + box-sizing: border-box; + > td { + min-width: 70px; + padding: 10px 10px; + } + } + } + } + } + \ No newline at end of file diff --git a/src/pages/poverPage/index.tsx b/src/pages/poverPage/index.tsx new file mode 100644 index 0000000..692ca6d --- /dev/null +++ b/src/pages/poverPage/index.tsx @@ -0,0 +1,134 @@ +import { useEffect } from "react"; +import * as echarts from "echarts"; +import "./pv.less"; +import { SnippetsTwoTone } from "@ant-design/icons"; +import { inject, observer } from "mobx-react"; +import { Store } from "antd/es/form/interface"; +import PvTable from "./pvTable"; +const PoverPage = (props:Store) => { + const initChart = (id: string) => { + var myChart = echarts.init(document.getElementById(id)); + var option = { + title: { + text: "10%", + left: "center", + top: "center", + textStyle: { + color: "#fff", + fontSize: "18px", + }, + }, + series: [ + { + type: "pie", + radius: ["70%", "100%"], + center: ["50%", "50%"], + color: "#000", + data: [ + // itemSyle是单项的背景颜色设置。 + { + value: 30, + itemStyle: { color: "#254e99", borderRadius: 100 }, + emphasis: { scale: false }, + }, + { + value: 100, + itemStyle: { color: "#f5f5f5" }, + emphasis: { scale: false }, + }, + ], + label: { + show: false, + }, + animationDelay: function (idx) { + return Math.random() * 200; + }, + }, + ], + }; + option && myChart.setOption(option); + }; + useEffect(() => { + initChart("pover_jg"); + initChart("pover_jgs"); + initChart("pover1"); + initChart("pover2"); + }, []); + + return ( +
+
+
+
+ 机关单位 +
+
+ +
+
120人
+ 基干民兵 +
+
+
+ +
+
120人
+ 基干民兵 +
+
+
+ +
+
120人
+ 普通民兵 +
+
+
+ +
+
120人
+ 退役军人 +
+
+
+ +
+
120人
+ 社干力量 +
+
+
+ +
+
120人
+ 三方力量 +
+
+
+
+
+
+
+ 机关单位 +
+

+
+
+ 企事业单位 +
+

+
+
+ 专业队伍 +
+
+
+

双流区黄水镇人民武装部基干民兵力量

+ +
+
+
+ ); +}; + +export default inject("usrStore")(observer(PoverPage)); diff --git a/src/pages/poverPage/pv.less b/src/pages/poverPage/pv.less new file mode 100644 index 0000000..691e6eb --- /dev/null +++ b/src/pages/poverPage/pv.less @@ -0,0 +1,63 @@ +.nav-header { + min-height: 50px; + padding: 10px; + display: flex; +} +.nav-content { + width: 100%; + height: 100%; + min-height: 500px; + display: flex; + align-items: start; + justify-content: space-around; + .content-left { + width: 15%; + height: 100%; + } + .content-right { + width: 85%; + height: 100%; + text-align: center; + color: #fff; + } +} + +.pv-head-item { + display: flex; + width: 120px; + height: 80px; + align-items: center; + background: rgba(37, 52, 70, 0.4); + color: #fff; + border: 1px solid #000; + border-radius: 10px; + border-bottom-left-radius: 0px; + border-top-left-radius: 20px; + border-bottom-right-radius: 40px; + border-top-right-radius: 0px; + margin-right: 10px; + padding: 5px; + > div { + margin-left: 10px; + } +} +.pv_table { + .table { + width: 100%; + overflow-x: auto; + background: rgba(37, 52, 70, 0.4); + border: 0.5px solid rgba(37, 52, 70, 0.4); + > thead { + background: rgba(37, 52, 70, 0.4); + > tr { + background: #000; + box-sizing: border-box; + > td { + background: rgba(37, 52, 70, 0.4); + min-width: 70px; + padding: 0px 10px; + } + } + } + } +} diff --git a/src/pages/poverPage/pvTable.tsx b/src/pages/poverPage/pvTable.tsx new file mode 100644 index 0000000..a2eb815 --- /dev/null +++ b/src/pages/poverPage/pvTable.tsx @@ -0,0 +1,45 @@ +const PvTable = () => { + return ( +
+ + + + + + + + + + + + + + + + + + + + + + + console.log(e)}> + + + + + + + + + + + + + + +
序号姓名政治面貌所属集结点所属队伍个人身份
消防救援灭火处突企事业治保社区退役
111111111111
+
+ ); +}; +export default PvTable; diff --git a/src/pages/training/training.tsx b/src/pages/training/training.tsx index 0de3f93..c9e5156 100644 --- a/src/pages/training/training.tsx +++ b/src/pages/training/training.tsx @@ -12,8 +12,6 @@ import baseHttp from "@/service/base"; import dayjs from "dayjs"; const { Option } = Select; - - const Trainings = (props: Store) => { const { trainingStore, trainingCatStore } = props; const [isModalOpen, setIsModalOpen] = useState(false); @@ -92,6 +90,7 @@ const Trainings = (props: Store) => { let data = { ...values, score: Number(values.score), + count: Number(values.count), }; if (!tagId) { trainingStore.add(data); @@ -146,6 +145,13 @@ const Trainings = (props: Store) => { value: "", rules: [{ required: true, message: "请输入任务积分设置!" }], }, + { + type: FormType.input, + label: "训练次数", + name: "count", + value: 0, + rules: [{ required: true, message: "请输入训练次数!" }], + }, { type: FormType.cehckboxGroup, label: "参与人员选择", diff --git a/src/pages/training/traning_config.ts b/src/pages/training/traning_config.ts new file mode 100644 index 0000000..07802ec --- /dev/null +++ b/src/pages/training/traning_config.ts @@ -0,0 +1,54 @@ +import { FormType } from "@/components/form/interface"; + +export const TrainingConfig = [ + { + type: FormType.input, + label: "任务标题", + name: "title", + value: "", + rules: [{ required: true, message: "请输入任务标题!" }], + }, + { + type: FormType.input, + label: "任务描述", + name: "desc", + value: "", + rules: [{ required: true, message: "请输入任务描述!" }], + }, + { + type: FormType.input, + label: "任务地点", + name: "address", + value: "", + rules: [{ required: true, message: "请输入任务地点!" }], + }, + { + type: FormType.date, + label: "任务开始时间", + name: "start_time", + value: "", + rules: [{ required: true, message: "请输入任务开始时间!" }], + }, + { + type: FormType.date, + label: "任务结束时间", + name: "end_time", + value: "", + rules: [{ required: true, message: "请输入任务结束时间!" }], + }, + { + type: FormType.input, + label: "任务积分设置", + name: "score", + value: "", + rules: [{ required: true, message: "请输入任务积分设置!" }], + }, + { + type: FormType.input, + label: "训练次数", + name: "count", + value: 0, + rules: [{ required: true, message: "请输入训练次数!" }], + }, + + ] diff --git a/src/pages/user/user.tsx b/src/pages/user/user.tsx index 3583e37..b33c1eb 100644 --- a/src/pages/user/user.tsx +++ b/src/pages/user/user.tsx @@ -1,14 +1,12 @@ -import { Button, Image, Space, Modal, FormInstance } from "antd"; +import { Button, Space, Modal, FormInstance } from "antd"; import { inject, observer } from "mobx-react"; -import type { ColumnsType } from "antd/es/table"; import BTable from "@/components/b_table"; import { useEffect, useState } from "react"; -import { UserDataType } from "@/model/userModel"; import { Store } from "antd/lib/form/interface"; -import "./user.less"; import SimpleForm from "@/components/form/simple_form"; import React from "react"; -import { FormType } from "@/components/form/interface"; +import { columns, defaultConfig } from "./user_config"; +import "./user.less"; const User = (props: Store) => { const { usrStore } = props; @@ -17,69 +15,33 @@ const User = (props: Store) => { const formRef = React.useRef(null); const [record, setRecord] = useState(null); const [userId, setId] = useState(null); - const columns: ColumnsType = [ - { - title: "用户名", - dataIndex: "user_name", - }, - { - title: "年龄", - dataIndex: "age", - }, - { - title: "性别", - dataIndex: "sex", - render: (sex) => {sex === "0" ? "男" : "女"}, - }, - { - title: "头像", - dataIndex: "head_img", - render: (headImg) => , - }, - { - title: "职位", - dataIndex: "position", - }, - { - title: "备注", - dataIndex: "remark", - }, - { - title: "操作", - dataIndex: "id", - ellipsis: { - showTitle: false, - }, - render: (any, record) => ( -
- - - + const actionWidget = (any, record) => { + return ( + + + + + + ); + }; - - - -
- ), - }, - ]; const edit = (record) => { record = { ...record, @@ -105,61 +67,35 @@ const User = (props: Store) => { useEffect(() => { usrStore.getlist(); }, [usrStore]); - const defaultConfig = [ - { - type: FormType.input, - label: "用户名", - name: "acount", - value: "", - rules: [{ required: true, message: "请输入人物名称!" }], - }, - { - type: FormType.input, - label: "年龄", - name: "age", - value: "", - rules: [{ required: true, message: "请输入卡片内容" }], - }, - { - type: FormType.input, - label: "居住地", - name: "address", - value: "", - rules: [{ required: true, message: "请输入卡片内容" }], - }, - { - type: FormType.radio, - label: "性别", - name: "sex", - value: 0, - rules: [{ required: true, message: "请输入卡片内容" }], - }, - { - type: FormType.upload, - label: "头像", - name: "headImg", - value: [], - rules: [{ required: true, message: "请上传头像" }], - }, - ]; + + const addHandler = () => { + setProjectConfig(defaultConfig); + setId(null); + setIsModalOpen(true); + }; const onFinishFailed = () => {}; return (
- - - + actionWidget(any, record), + }, + ]} + dataSource={usrStore.list} + /> = [ + { + title: "用户名", + dataIndex: "user_name", + width:150, + fixed:"left" + }, + { + title: "性别", + dataIndex: "sex", + width:150, + render: (sex) => {sex === "0" ? "男" : "女"}, + fixed:"left" + }, + { + title: "年龄", + width:150, + dataIndex: "age", + }, + { + title: "头像", + dataIndex: "head_img", + width:150, + render: (headImg) => , + }, + + { + title: "登录账号", + width:150, + dataIndex: "account", + }, + { + title: "家庭住址", + width:150, + dataIndex: "home_addr", + }, + { + title: "身份证", + width:150, + dataIndex: "id_card", + }, + { + title: "担任职务", + width:150, + dataIndex: "pos_held", + }, + { + title: "通讯地址", + width:150, + dataIndex: "mail_addr", + }, + { + title: "服役部队", + width:150, + dataIndex: "serv_unit", + }, + { + title: "贯籍", + width:150, + dataIndex: "porig", + }, + { + title: "专业特长", + width:150, + dataIndex: "spec", + }, + { + title: "邮箱", + width:150, + dataIndex: "email", + }, + { + title: "联系电话", + width:150, + dataIndex: "tel", + }, + { + title: "民族", + width:150, + dataIndex: "eth", + }, + { + title: "是否党员", + width:150, + dataIndex: "p_member", + }, + { + title: "是否退役军人", + width:150, + dataIndex: "vet", + }, + { + title: "备注", + width:150, + dataIndex: "remark", + }, +]; diff --git a/src/pages/whseMgmt/whseMgmt_column.tsx b/src/pages/whseMgmt/whseMgmt_column.tsx index 449f6ab..c4e1f60 100644 --- a/src/pages/whseMgmt/whseMgmt_column.tsx +++ b/src/pages/whseMgmt/whseMgmt_column.tsx @@ -55,16 +55,27 @@ export const defaultConfig = [ value: "", rules: [{ required: true, message: "请输入仓库描述" }], }, - { - type: FormType.input, - label: "监控链接", - name: "monitoring_url", - value: "", - }, { type: FormType.radio, label: "是否为第三方仓库", name: "is_other", + value: 1, + radioData: [ + { + key: "是", + val: 1, + }, + { + key: "否", + val: 2, + }, + ], + rules: [{ required: true, message: "请选择是否为第三方仓库" }], + }, + { + type: FormType.input, + label: "监控链接", + name: "monitoring_url", value: "", }, { diff --git a/src/router/routers/home_router.tsx b/src/router/routers/home_router.tsx index 714aa43..617f0a3 100644 --- a/src/router/routers/home_router.tsx +++ b/src/router/routers/home_router.tsx @@ -16,6 +16,9 @@ import WhseMgmtRoute from "@/pages/whseMgmt/whseMgmt_route"; import Emergency from "@/pages/emergency"; import Patrol from "@/pages/patrol"; import Training from "@/pages/training"; +import OrgChart from "@/pages/OrgChart"; +import PoverPage from "@/pages/poverPage"; +import PoverDetail from "@/pages/poverDetail"; export const homeRouter = [ { path: "/", @@ -31,6 +34,21 @@ export const homeRouter = [ path: "/admin", element: , children: [ + { + path: "/admin/orgChart", + index: true, + element: , + }, + { + path: "/admin/poverDetail", + index: true, + element: , + }, + { + path: "/admin/pover", + index: true, + element: , + }, { path: "/admin/user", index: true, diff --git a/src/static/frame_s@1x.png b/src/static/frame_s@1x.png index 5c6abdd..0684199 100644 Binary files a/src/static/frame_s@1x.png and b/src/static/frame_s@1x.png differ diff --git a/src/util/webRtc.ts b/src/util/webRtc.ts index b6edf75..45f9947 100644 --- a/src/util/webRtc.ts +++ b/src/util/webRtc.ts @@ -1,46 +1,23 @@ -import { message } from 'antd/lib'; -import WebRTC from 'webrtc'; class WebRtc { - private rtc: WebRTC + private mediaStream: MediaStream | Blob | null = null; + private video: HTMLVideoElement | null = null; + async init() { - this.rtc = new WebRTC({debug: true}); - try { - let strem = await navigator.mediaDevices.getUserMedia({ audio: true, video: true }) - var localVideo = document.getElementById('localVideo') as HTMLVideoElement; - localVideo.srcObject = strem; - console.log('localVideo', this.rtc?.addStream); - - // this.rtc?.addStream(strem); - - } catch (error) { - console.log(error); - - // message.error(`error ${JSON.stringify(message)}`) - } + let constraints = { audio: false, video: true }; + this.video = document.getElementById('rtcVideo') as HTMLVideoElement; + this.mediaStream = await navigator.mediaDevices.getUserMedia(constraints) as MediaStream | Blob } calls() { - this.rtc.createOffer() - .then((offer) => { - // ... - }) - .catch((error) => { - console.log('Error creating offer: ', error); - }); - - // 接听呼叫 - this.rtc.createAnswer() - .then((answer) => { - // 发送answer信令等操作 - // ... - }) - .catch((error) => { - console.log('Error creating answer: ', error); - }); + if (this.video) { + this.video.srcObject = this.mediaStream; + this.video.autoplay = true; + } } close() { - this.rtc.close(); + this.video?.pause(); + (this.mediaStream as MediaStream)?.getTracks().forEach(track => track.stop()); } }