Compare commits
2 Commits
7bf1378e90
...
a3a2e09000
Author | SHA1 | Date | |
---|---|---|---|
a3a2e09000 | |||
91c7563cc6 |
@ -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 className="text-gray-800 hover:text-blue-500">{props.type == 'news' ? '确定' : '重新生成'}</button>
|
<button onClick={handleSave} className="text-gray-800 hover:text-blue-500">{props.type == 'news' ? '确定' : '重新生成'}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>);
|
</Modal>);
|
||||||
|
@ -10,11 +10,15 @@ 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[][]) => {
|
const handleSubmit = (_tags?:Id[][],from?:'input') => {
|
||||||
|
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)) {
|
||||||
@ -28,7 +32,6 @@ export default function EditSearchForm(props: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('tags',params.tags)
|
|
||||||
props.onSubmit({
|
props.onSubmit({
|
||||||
...params,
|
...params,
|
||||||
pagination: {
|
pagination: {
|
||||||
@ -47,14 +50,13 @@ 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
|
||||||
onChange={(e) => {
|
value={prevSearchName}
|
||||||
setParams({title: e.target.value})
|
onChange={e => setPrevSearchName(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()}
|
onPressEnter={()=>handleSubmit(undefined,'input')}
|
||||||
|
onBlur={()=>handleSubmit(undefined,'input')}
|
||||||
/>
|
/>
|
||||||
{/*<span className="ml-5 text-sm">来源</span>*/}
|
{/*<span className="ml-5 text-sm">来源</span>*/}
|
||||||
{/*<ArticleCascader*/}
|
{/*<ArticleCascader*/}
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.col{
|
.col{
|
||||||
@apply flex items-center relative pl-6;
|
@apply flex items-center justify-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;
|
@apply flex-1 pl-0 justify-start;
|
||||||
&:after{
|
&:after{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -64,6 +64,10 @@
|
|||||||
.source{
|
.source{
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
.count-picture,.count-words{
|
||||||
|
width: 120px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.time{
|
.time{
|
||||||
width: 150px;
|
width: 150px;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,8 @@ 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>
|
||||||
@ -109,6 +111,12 @@ 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>
|
||||||
@ -127,7 +135,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)} />
|
||||||
<ButtonDeleteBatch ids={selectedRowKeys} onSuccess={refresh}/>
|
{selectedRowKeys?.length >0 && <ButtonDeleteBatch ids={selectedRowKeys} onSuccess={refresh}/>}
|
||||||
<ButtonPush2Video ids={selectedRowKeys} onSuccess={refresh}/>
|
<ButtonPush2Video ids={selectedRowKeys} onSuccess={refresh}/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -158,6 +158,8 @@ 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
2
src/types/api.d.ts
vendored
@ -60,6 +60,8 @@ 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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user