Compare commits

..

No commits in common. "a3a2e09000259ae51c9ca2e1b6e008d6703faca2" and "7bf1378e9024c2d250b3b7c59f4dceb78d503ab0" have entirely different histories.

6 changed files with 11 additions and 29 deletions

View File

@ -144,7 +144,7 @@ export default function ArticleEditModal(props: Props) {
<div className="text-lg flex gap-10 "> <div className="text-lg flex gap-10 ">
{props.type == 'news' ? <button className="text-gray-400 hover:text-gray-800"></button> : null} {props.type == 'news' ? <button className="text-gray-400 hover:text-gray-800"></button> : null}
<button className="text-gray-400 hover:text-gray-800" onClick={() => props.onClose?.()}></button> <button className="text-gray-400 hover:text-gray-800" onClick={() => props.onClose?.()}></button>
<button onClick={handleSave} className="text-gray-800 hover:text-blue-500">{props.type == 'news' ? '确定' : '重新生成'}</button> <button className="text-gray-800 hover:text-blue-500">{props.type == 'news' ? '确定' : '重新生成'}</button>
</div> </div>
</div> </div>
</Modal>); </Modal>);

View File

@ -10,15 +10,11 @@ export default function EditSearchForm(props: {
}) { }) {
const articleTags = useArticleTags() const articleTags = useArticleTags()
const [tags, _setTags] = useState<Id[][]>([]); const [tags, _setTags] = useState<Id[][]>([]);
const [prevSearchName, setPrevSearchName] = useState<string>()
const [params, setParams] = useSetState<ApiArticleSearchParams>({ const [params, setParams] = useSetState<ApiArticleSearchParams>({
pagination: {limit: 10, page: 1}, pagination: {limit: 10, page: 1},
}); });
const handleSubmit = (_tags?:Id[][],from?:'input') => { const handleSubmit = (_tags?:Id[][]) => {
if (from == 'input' && (params.title == prevSearchName || (!params.title && !prevSearchName))) return
params.title = prevSearchName;
setParams({title: prevSearchName})
const __tags = _tags || tags; const __tags = _tags || tags;
params.tags = __tags.length == 0 ? undefined : __tags.map(it => { params.tags = __tags.length == 0 ? undefined : __tags.map(it => {
if (Array.isArray(it)) { if (Array.isArray(it)) {
@ -32,6 +28,7 @@ export default function EditSearchForm(props: {
} }
} }
}); });
console.log('tags',params.tags)
props.onSubmit({ props.onSubmit({
...params, ...params,
pagination: { pagination: {
@ -50,13 +47,14 @@ export default function EditSearchForm(props: {
return ( return (
<div className="search-form-input flex gap-2 items-center"> <div className="search-form-input flex gap-2 items-center">
<Input <Input
value={prevSearchName} onChange={(e) => {
onChange={e => setPrevSearchName(e.target.value)} setParams({title: e.target.value})
}}
allowClear
type="text" className="rounded-3xl px-3 w-[270px]" type="text" className="rounded-3xl px-3 w-[270px]"
prefix={<SearchOutlined/>} prefix={<SearchOutlined/>}
placeholder="请输入新闻标题关键词进行搜索" placeholder="请输入新闻标题关键词进行搜索"
onPressEnter={()=>handleSubmit(undefined,'input')} onPressEnter={()=>handleSubmit()}
onBlur={()=>handleSubmit(undefined,'input')}
/> />
{/*<span className="ml-5 text-sm">来源</span>*/} {/*<span className="ml-5 text-sm">来源</span>*/}
{/*<ArticleCascader*/} {/*<ArticleCascader*/}

View File

@ -44,7 +44,7 @@
} }
} }
.col{ .col{
@apply flex items-center justify-center relative pl-6; @apply flex items-center relative pl-6;
height: 54px; height: 54px;
&:after{ &:after{
@apply absolute; @apply absolute;
@ -56,7 +56,7 @@
} }
} }
.title{ .title{
@apply flex-1 pl-0 justify-start; @apply flex-1 pl-0;
&:after{ &:after{
display: none; display: none;
} }
@ -64,10 +64,6 @@
.source{ .source{
width: 150px; width: 150px;
} }
.count-picture,.count-words{
width: 120px;
text-align: center;
}
.time{ .time{
width: 150px; width: 150px;
} }

View File

@ -86,8 +86,6 @@ export default function NewEdit() {
<div className="header row flex"> <div className="header row flex">
<div className="col title"></div> <div className="col title"></div>
<div className="col source source"></div> <div className="col source source"></div>
<div className="col count-picture"></div>
<div className="col count-words"></div>
<div className="col time"></div> <div className="col time"></div>
<div className="col operations"></div> <div className="col operations"></div>
</div> </div>
@ -111,12 +109,6 @@ export default function NewEdit() {
<div className="col source"> <div className="col source">
<div className="text-sm">{item.media_name}</div> <div className="text-sm">{item.media_name}</div>
</div> </div>
<div className="col count-picture">
<div className="text-sm">{item.picture_count||'-'}</div>
</div>
<div className="col count-words">
<div className="text-sm">{item.words_count||'-'}</div>
</div>
<div className="col time"> <div className="col time">
<div <div
className="text-sm">{formatTime(item.publish_time, 'YYYY-MM-DD HH:mm')}</div> className="text-sm">{formatTime(item.publish_time, 'YYYY-MM-DD HH:mm')}</div>
@ -135,7 +127,7 @@ export default function NewEdit() {
<div className="page-action"> <div className="page-action">
<ButtonToTop visible={state.showToTop} onClick={()=>scrollerRef.current?.scrollToPosition(0)} /> <ButtonToTop visible={state.showToTop} onClick={()=>scrollerRef.current?.scrollToPosition(0)} />
{selectedRowKeys?.length >0 && <ButtonDeleteBatch ids={selectedRowKeys} onSuccess={refresh}/>} <ButtonDeleteBatch ids={selectedRowKeys} onSuccess={refresh}/>
<ButtonPush2Video ids={selectedRowKeys} onSuccess={refresh}/> <ButtonPush2Video ids={selectedRowKeys} onSuccess={refresh}/>
</div> </div>
</div> </div>

View File

@ -158,8 +158,6 @@ export default function NewsIndex() {
<div className="line-clamp-1">: <span>{item.data_source_name}</span></div> <div className="line-clamp-1">: <span>{item.data_source_name}</span></div>
<div className="extras flex items-center justify-between gap-3"> <div className="extras flex items-center justify-between gap-3">
<div><span>{formatTime(item.publish_time,'min')}</span></div> <div><span>{formatTime(item.publish_time,'min')}</span></div>
<div><span>: {item.picture_count || '-'}</span></div>
<div><span>: {item.words_count || '-'}</span></div>
<div <div
className={`checkbox mt-1`}> className={`checkbox mt-1`}>
{item.internal_article_id > 0 ? {item.internal_article_id > 0 ?

2
src/types/api.d.ts vendored
View File

@ -60,8 +60,6 @@ interface BasicArticleInfo {
summary: string; summary: string;
publish_time: string; publish_time: string;
media_name: string; media_name: string;
picture_count?: number;
words_count?: number;
media_id: number; media_id: number;
fanwen_column_id: number; fanwen_column_id: number;
} }