Commit 027efe38 authored by wuhao's avatar wuhao 🎯

jkasd

parent a691fa1a
......@@ -38,6 +38,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max }
{
color: '#13c2c2',
text: inputValue,
tag_name:inputValue
},
]);
} else {
......@@ -66,6 +67,7 @@ const Tagadder = ({ value = [{ color: '#13c2c2', text: '123' }], onChange, max }
background: token.colorBgContainer,
borderStyle: 'dashed',
};
console.log(value);
return (
<Space size={[0, 8]} wrap style={{ paddingTop: 4, justifyContent: 'flex-start' }}>
{value.map((tag, index) => {
......@@ -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 = (
<Tag
key={tag.text}
......
......@@ -2,9 +2,9 @@
import DragModal from '@/components/DragModal';
import IconFont from '@/components/IconFont';
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 { 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 { memo, useState } from 'react';
import { Draggable, Droppable } from 'react-beautiful-dnd';
......@@ -55,7 +55,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
setInitialState,
} = useModel('@@initialState');
const Header = ({ userList, id, noname, click }) => {
const Header = ({ userList, id, noname, click, size }) => {
return (
<div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
<Tooltip title={getUserInfo(userList, id)?.user_name}>
......@@ -65,7 +65,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
e.stopPropagation();
noname && click();
}}
size="large"
size={size ?? 'large'}
src={getUserInfo(userList, id)?.head_url}
></Avatar>
) : (
......@@ -74,7 +74,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
e.stopPropagation();
noname && click();
}}
size="large"
size={size ?? 'large'}
>
{getUserInfo(userList, id)?.user_name?.charAt(0)}
</Avatar>
......@@ -110,12 +110,33 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
}
>
<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 ? (
<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' }}>
......@@ -133,6 +154,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
deadline: modal?.deadline,
userid: modal?.userid,
id: modal?.id,
tags: modal?.tags?.map((it) => it?.id),
});
}}
>
......@@ -167,9 +189,39 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
deadline: item?.deadline,
userid: item?.userid,
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 }}>
<Header
userList={userList}
......@@ -210,34 +262,32 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
}}
></Header>
<div style={{ flex: 1 }}>
<div className="center" style={{ justifyContent: 'space-between' }}>
<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 className="center" style={{ justifyContent: 'flex-start' }}>
{item?.tags
?.filter((it, i) => i < 3)
.map((it) => {
const isLongTag = it.tag_name.length > 6;
return (
<Tag
key={it?.id}
style={{
userSelect: 'none',
display: 'flex',
alignItems: 'center',
}}
color={it?.color}
>
<div></div>
<span>
{isLongTag ? `${it.tag_name.slice(0, 6)}...` : it.tag_name}
</span>
</Tag>
);
})}
{
item.tags.length>3 && <EllipsisOutlined/>
}
</div>
<div
className="spread"
......@@ -273,6 +323,7 @@ const QuoteList = ({ listId, datas, add, edit, userList, refresh }) => {
)}
</div>
<Button
size="small"
onClick={async () => {
let res = {};
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