点击呼叫:
diff --git a/src/pages/patrol/index.tsx b/src/pages/patrol/index.tsx
index 7ef88e8..3297cf4 100644
--- a/src/pages/patrol/index.tsx
+++ b/src/pages/patrol/index.tsx
@@ -1,4 +1,4 @@
-import { Button, Space, Modal, FormInstance } from "antd";
+import { Button, Space, Modal, FormInstance, Form } from "antd";
import { inject, observer } from "mobx-react";
import type { ColumnsType } from "antd/es/table";
import BTable from "@/components/b_table";
@@ -10,15 +10,21 @@ import React from "react";
import { FormType } from "@/components/form/interface";
import baseHttp from "@/service/base";
import dayjs from "dayjs";
-
+import DebounceSelect from "@/components/form/featch_select";
+interface UserValue {
+ label: string;
+ value: string;
+}
const Patrol = (props: Store) => {
- const { patrolStore } = props;
+ const { patrolStore, usrStore } = props;
const [isModalOpen, setIsModalOpen] = useState
(false);
const [projectConfig, setProjectConfig] = useState([]);
const formRef = React.useRef(null);
const [record, setRecord] = useState(null);
const [tagId, setId] = useState(null);
const [userList, setUserList] = useState>([]);
+ const [value, setValue] = useState([]);
+
const columns: ColumnsType = [
{ title: "任务标题", dataIndex: "title" },
{ title: "任务描述", dataIndex: "patrol_desc" },
@@ -54,7 +60,10 @@ const Patrol = (props: Store) => {
type="dashed"
size="small"
onClick={() => {
- patrolStore.deleteItem(record.id);
+ patrolStore.putItem(record.id, {
+ ...record,
+ status: 1,
+ });
}}
>
完成
@@ -64,7 +73,7 @@ const Patrol = (props: Store) => {
danger
size="small"
onClick={() => {
- patrolStore.deleteItem(record.id);
+ patrolStore.deleteItem(record.identity);
}}
>
删除
@@ -89,6 +98,7 @@ const Patrol = (props: Store) => {
let data = {
...values,
score: Number(values.score ?? 0),
+ user_identity: values.user_identity.map((item) => item.value),
};
if (!tagId) {
patrolStore.add(data);
@@ -102,7 +112,7 @@ const Patrol = (props: Store) => {
baseHttp.get("/user/list", null).then((res) => {
let data = res.data?.record ?? [];
data.forEach((item) => {
- item.label = item.account;
+ item.label = item.user_name;
item.value = item.identity;
});
setUserList(data ?? []);
@@ -121,7 +131,6 @@ const Patrol = (props: Store) => {
label: "任务描述",
name: "patrol_desc",
value: "",
- rules: [{ required: true, message: "请输入任务描述!" }],
},
{
type: FormType.input,
@@ -151,16 +160,24 @@ const Patrol = (props: Store) => {
value: "",
rules: [{ required: true, message: "请输入任务积分!" }],
},
- {
- type: FormType.cehckboxGroup,
- label: "任务参与人",
- name: "user_identity",
- value: [],
- checkboxData: userList,
- rules: [{ required: true, message: "请选择参与人!" }],
- },
+ // {
+ // type: FormType.cehckboxGroup,
+ // label: "任务参与人",
+ // name: "user_identity",
+ // value: [],
+ // checkboxData: userList,
+ // rules: [{ required: true, message: "请选择参与人!" }],
+ // },
];
const onFinishFailed = () => {};
+ async function fetchUserList(username: string): Promise {
+ return usrStore.serchUser(username).then((res) => {
+ return res.data.record.map((item) => ({
+ label: item.user_name,
+ value: item.identity,
+ }));
+ });
+ }
// 用户选择回调
return (
@@ -208,11 +225,29 @@ const Patrol = (props: Store) => {
onFinish={onFinish}
initialValues={true}
onFinishFailed={onFinishFailed}
- />
+ childrenPosi={true}
+ >
+ <>
+
+
+
+ >
+
);
};
-export default inject("patrolStore")(observer(Patrol));
+export default inject("patrolStore", "usrStore")(observer(Patrol));
diff --git a/src/pages/user/user_config.tsx b/src/pages/user/user_config.tsx
index 70b719c..eb1d0b4 100644
--- a/src/pages/user/user_config.tsx
+++ b/src/pages/user/user_config.tsx
@@ -2,6 +2,7 @@ import { FormType } from "@/components/form/interface";
import { UserDataType } from "@/model/userModel";
import { ColumnsType } from "antd/lib/table";
import { Image } from "antd";
+import Config from "@/util/config";
export const defaultConfig =(team,per)=>
[
{
@@ -315,7 +316,9 @@ export const columns: ColumnsType = [
title: "头像",
dataIndex: "head_img",
width: 150,
- render: (headImg) => ,
+ render: (headImg) =>{
+ return
+ },
},
{
diff --git a/src/util/config.ts b/src/util/config.ts
index 0cbcda6..acca640 100644
--- a/src/util/config.ts
+++ b/src/util/config.ts
@@ -1,12 +1,10 @@
class Config {
- // static baseUrl = "https://rw.quwanya.cn/";
+ static baseUrl = "https://rw.quwanya.cn/";
static uploadUrl = "https://rw.quwanya.cn/";
- // static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
+ static ws = "wss://rw.quwanya.cn/wsadmin?id=admin";
static rtc = "wss://rw.quwanya.cn/ws";
- static ws = "ws://127.0.0.1:12214/ws?id=admin";
- static baseUrl = "http://127.0.0.1:12214/";
- // static uploadUrl = "http://127.0.0.1:12214/";
-
+ static userStatic = "https://rw.quwanya.cn/uploads/user/";
+ // https://rw.quwanya.cn/uploads/user/%E5%B4%94%E6%96%87%E8%8C%9C.jpg
}
export default Config;