update: 跳过异常后加载新闻列表
This commit is contained in:
parent
3ec2ae6d0e
commit
90bd5cbde6
@ -35,6 +35,7 @@ export default function ButtonPush2Video(props: PushVideoProps) {
|
|||||||
const skip = action === ProcessResult.Skip && state.errorIds.length > 0
|
const skip = action === ProcessResult.Skip && state.errorIds.length > 0
|
||||||
const ids = !skip ? props.ids : props.ids.filter(id => !state.errorIds.includes(id));
|
const ids = !skip ? props.ids : props.ids.filter(id => !state.errorIds.includes(id));
|
||||||
push2video(ids).then(() => {
|
push2video(ids).then(() => {
|
||||||
|
setState({modalVisible: false})
|
||||||
if (skip) {
|
if (skip) {
|
||||||
props.onResult?.(ProcessResult.Skip, state.errorIds || [])
|
props.onResult?.(ProcessResult.Skip, state.errorIds || [])
|
||||||
return;
|
return;
|
||||||
@ -72,45 +73,10 @@ export default function ButtonPush2Video(props: PushVideoProps) {
|
|||||||
// check article content
|
// check article content
|
||||||
const result = checkArticleContent()
|
const result = checkArticleContent()
|
||||||
setState({modalVisible: true, errorTitle: result.errors, errorIds: result.ids})
|
setState({modalVisible: true, errorTitle: result.errors, errorIds: result.ids})
|
||||||
//
|
|
||||||
// const instance = modal.confirm({
|
|
||||||
// title: <div className="text-base pt-0.5">{t('modal.warning')}</div>,
|
|
||||||
// wrapClassName: 'root-modal-confirm',
|
|
||||||
// centered: true,
|
|
||||||
// width: 440,
|
|
||||||
// icon: <span className="anticon anticon-exclamation-circle"><IconWarningCircle/></span>,
|
|
||||||
// content: <div className="confirm-message-wrapper pl-7">
|
|
||||||
// <div className="message text-gray-600">
|
|
||||||
// {t(
|
|
||||||
// errors && errors.length > 0
|
|
||||||
// ? (props.ids.length == 1 ? 'modal.push_article.content_error_single' : 'modal.push_article.content_error')
|
|
||||||
// : (props.ids.length == 1 ? 'modal.push_article.content_normal_single' : 'modal.push_article.content_normal'),
|
|
||||||
// {count: props.ids.length, error_count: errors?.length})}
|
|
||||||
// </div>
|
|
||||||
// {errors && errors.length > 0 && <div className="error-list text-red-400 mt-6">
|
|
||||||
// <div className="title">{t('modal.push_article.error_title')}:</div>
|
|
||||||
// <div className="max-h-[100px] overflow-auto" style={{lineHeight: '20px'}}>
|
|
||||||
// {errors.map(s => <div
|
|
||||||
// className="error-item overflow-hidden text-nowrap overflow-ellipsis">{s}</div>)}
|
|
||||||
// </div>
|
|
||||||
// </div>}
|
|
||||||
// </div>,
|
|
||||||
// footer: <div className="flex justify-end mt-6">
|
|
||||||
// <Space>
|
|
||||||
// <Button onClick={() => {
|
|
||||||
// instance.destroy()
|
|
||||||
// }}>{t('modal.push_article.action_cancel')}</Button>
|
|
||||||
// <Button type="primary">{t('modal.push_article.action_skip')}</Button>
|
|
||||||
// <Button>{t('modal.push_article.action_all')}</Button>
|
|
||||||
// </Space>
|
|
||||||
// </div>,
|
|
||||||
// })
|
|
||||||
// handlePush();
|
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
disabled={loading}
|
|
||||||
className='bg-[#4096ff] hover:bg-blue-600 text-white'
|
className='bg-[#4096ff] hover:bg-blue-600 text-white'
|
||||||
onClick={onPushClick}
|
onClick={onPushClick}
|
||||||
>
|
>
|
||||||
@ -152,13 +118,13 @@ export default function ButtonPush2Video(props: PushVideoProps) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex justify-end mt-6">
|
<div className="flex justify-end mt-6">
|
||||||
<Space>
|
<Space>
|
||||||
<Button onClick={() => {
|
<Button disabled={loading} onClick={() => {
|
||||||
setState({modalVisible: false})
|
setState({modalVisible: false})
|
||||||
}}>{t('modal.push_article.action_cancel')}</Button>
|
}}>{t('modal.push_article.action_cancel')}</Button>
|
||||||
{state.errorIds?.length > 0 && <Button type="primary"
|
{state.errorIds?.length > 0 && <Button disabled={loading} type="primary"
|
||||||
onClick={() => handlePush(ProcessResult.Skip)}>{t('modal.push_article.action_skip')}</Button>}
|
onClick={() => handlePush(ProcessResult.Skip)}>{t('modal.push_article.action_skip')}</Button>}
|
||||||
<Button type={state.errorIds.length == 0 ? 'primary' : 'default'}
|
<Button disabled={loading} type={state.errorIds.length == 0 ? 'primary' : 'default'}
|
||||||
onClick={() => handlePush(ProcessResult.All)}>{t('modal.push_article.action_all')}</Button>
|
onClick={() => handlePush(ProcessResult.All)} >{t('modal.push_article.action_all')}</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user