Commit 027efe38 authored by wuhao's avatar wuhao :dart:

jkasd

parent a691fa1a
...@@ -38,6 +38,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max } ...@@ -38,6 +38,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max }
{ {
color: '#13c2c2', color: '#13c2c2',
text: inputValue, text: inputValue,
tag_name:inputValue
}, },
]); ]);
} else { } else {
...@@ -66,6 +67,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max } ...@@ -66,6 +67,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max }
background: token.colorBgContainer, background: token.colorBgContainer,
borderStyle: 'dashed', borderStyle: 'dashed',
}; };
console.log(value);
return ( return (
<Space size={[0, 8]} wrap style={{ paddingTop: 4, justifyContent: 'flex-start' }}> <Space size={[0, 8]} wrap style={{ paddingTop: 4, justifyContent: 'flex-start' }}>
{value.map((tag, index) => { {value.map((tag, index) => {
...@@ -83,7 +85,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max } ...@@ -83,7 +85,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max }
/> />
); );
} }
const isLongTag = tag.text.length > 20; const isLongTag = tag?.text?.length > 20;
const tagElem = ( const tagElem = (
<Tag <Tag
key={tag.text} key={tag.text}
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import DragModal from '@/components/DragModal'; import DragModal from '@/components/DragModal';
import IconFont from '@/components/IconFont'; import IconFont from '@/components/IconFont';
import { doFetch } from '@/utils/doFetch'; import { doFetch } from '@/utils/doFetch';
import { CloseOutlined, PlayCircleFilled } from '@ant-design/icons'; import { CloseOutlined, PlayCircleFilled, EllipsisOutlined } from '@ant-design/icons';
import { useModel } from '@umijs/max'; import { useModel } from '@umijs/max';
import { Avatar, Button, Empty, Modal, Popconfirm, Select, Tooltip } from 'antd'; import { Avatar, Button, Empty, Modal, Popconfirm, Select, Tag, Tooltip } from 'antd';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { memo, useState } from 'react'; import { memo, useState } from 'react';
import { Draggable, Droppable } from 'react-beautiful-dnd'; import { Draggable, Droppable } from 'react-beautiful-dnd';
...@@ -55,7 +55,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -55,7 +55,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
setInitialState, setInitialState,
} = useModel('@@initialState'); } = useModel('@@initialState');
const Header = ({ userList, id, noname, click }) => { const Header = ({ userList, id, noname, click, size }) => {
return ( return (
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}> <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<Tooltip title={getUserInfo(userList, id)?.user_name}> <Tooltip title={getUserInfo(userList, id)?.user_name}>
...@@ -65,7 +65,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -65,7 +65,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
e.stopPropagation(); e.stopPropagation();
noname && click(); noname && click();
}} }}
size="large" size={size ?? 'large'}
src={getUserInfo(userList, id)?.head_url} src={getUserInfo(userList, id)?.head_url}
></Avatar> ></Avatar>
) : ( ) : (
...@@ -74,7 +74,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -74,7 +74,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
e.stopPropagation(); e.stopPropagation();
noname && click(); noname && click();
}} }}
size="large" size={size ?? 'large'}
> >
{getUserInfo(userList, id)?.user_name?.charAt(0)} {getUserInfo(userList, id)?.user_name?.charAt(0)}
</Avatar> </Avatar>
...@@ -110,12 +110,33 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -110,12 +110,33 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
} }
> >
<div style={{ marginTop: 0 }}> <div style={{ marginTop: 0 }}>
<Header userList={userList} id={modal?.userid}></Header> <div className="spread">
<Header size="small" userList={userList} id={modal?.userid}></Header>
<div className="spread">
{modal?.tags?.map((it) => {
const isLongTag = it.tag_name.length > 20;
return (
<Tag
key={it?.id}
style={{
userSelect: 'none',
display: 'flex',
alignItems: 'center',
}}
color={it?.color}
>
<div></div>
<span>{isLongTag ? `${it.tag_name.slice(0, 20)}...` : it.tag_name}</span>
</Tag>
);
})}
</div>
</div>
{modal?.content ? ( {modal?.content ? (
<div dangerouslySetInnerHTML={{ __html: modal?.content }}></div> <div dangerouslySetInnerHTML={{ __html: modal?.content }}></div>
) : ( ) : (
<Empty description={false} style={{ marginTop: -12, marginBottom: 12 }}></Empty> <Empty description={false} style={{ marginTop: 12, marginBottom: 24 }}></Empty>
)} )}
<div className="center" style={{ justifyContent: 'space-between' }}> <div className="center" style={{ justifyContent: 'space-between' }}>
...@@ -133,6 +154,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -133,6 +154,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
deadline: modal?.deadline, deadline: modal?.deadline,
userid: modal?.userid, userid: modal?.userid,
id: modal?.id, id: modal?.id,
tags: modal?.tags?.map((it) => it?.id),
}); });
}} }}
> >
...@@ -167,9 +189,39 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -167,9 +189,39 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
deadline: item?.deadline, deadline: item?.deadline,
userid: item?.userid, userid: item?.userid,
id: item?.id, id: item?.id,
tags: item?.tags,
})); }));
}} }}
> >
<div className="spread">
<b style={{ fontSize: 15 }}>{item.mission_name}</b>
{currentUser?.id === item.userid && (
<Popconfirm
title="是否删除该任务?"
placement="bottomRight"
onConfirm={(e) => {
e.stopPropagation();
doFetch({
url: `/webtool/v1/item/${item.id}`,
params: {},
method: 'DELETE',
}).then((res) => {
refresh();
});
}}
onCancel={(e) => {
e.stopPropagation();
}}
>
<CloseOutlined
onClick={(e) => {
e.stopPropagation();
}}
style={{ fontSize: 12 }}
/>
</Popconfirm>
)}
</div>
<div className="spread" style={{ gap: 12 }}> <div className="spread" style={{ gap: 12 }}>
<Header <Header
userList={userList} userList={userList}
...@@ -210,34 +262,32 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -210,34 +262,32 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
}} }}
></Header> ></Header>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<div className="center" style={{ justifyContent: 'space-between' }}> <div className="center" style={{ justifyContent: 'flex-start' }}>
<b style={{ fontSize: 15 }}>{item.mission_name}</b> {item?.tags
{currentUser?.id === item.userid && ( ?.filter((it, i) => i < 3)
<Popconfirm .map((it) => {
title="是否删除该任务?" const isLongTag = it.tag_name.length > 6;
placement="bottomRight" return (
onConfirm={(e) => { <Tag
e.stopPropagation(); key={it?.id}
doFetch({ style={{
url: `/webtool/v1/item/${item.id}`, userSelect: 'none',
params: {}, display: 'flex',
method: 'DELETE', alignItems: 'center',
}).then((res) => {
refresh();
});
}}
onCancel={(e) => {
e.stopPropagation();
}} }}
color={it?.color}
> >
<CloseOutlined <div></div>
onClick={(e) => { <span>
e.stopPropagation(); {isLongTag ? `${it.tag_name.slice(0, 6)}...` : it.tag_name}
}} </span>
style={{ fontSize: 12 }} </Tag>
/> );
</Popconfirm> })}
)} {
item.tags.length>3 && <EllipsisOutlined/>
}
</div> </div>
<div <div
className="spread" className="spread"
...@@ -273,6 +323,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => { ...@@ -273,6 +323,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
)} )}
</div> </div>
<Button <Button
size="small"
onClick={async () => { onClick={async () => {
let res = {}; let res = {};
if (item.status === '0') { if (item.status === '0') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment