From c80b7b014355644cb96e64523cdc21bd5482a27a Mon Sep 17 00:00:00 2001 From: ZLY Date: Mon, 25 Aug 2025 09:12:04 +0800 Subject: [PATCH] =?UTF-8?q?delete:=20=E5=88=A0=E9=99=A4=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=AD=E6=97=A0=E7=94=A8=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/form/group/index.tsx | 281 ------------------ src/pages/form/group/locale/index.ts | 84 ------ src/pages/form/group/mock/index.ts | 11 - src/pages/form/group/style/index.module.less | 23 -- src/pages/form/step/index.tsx | 257 ---------------- src/pages/form/step/locale/index.ts | 94 ------ src/pages/form/step/mock/index.ts | 11 - src/pages/form/step/style/index.module.less | 39 --- src/pages/list/card/card-add.tsx | 28 -- src/pages/list/card/card-block.tsx | 255 ---------------- src/pages/list/card/index.tsx | 95 ------ src/pages/list/card/interface.ts | 13 - src/pages/list/card/locale/index.ts | 66 ---- src/pages/list/card/mock/index.ts | 106 ------- src/pages/list/card/style/index.module.less | 156 ---------- src/pages/list/card/useRequest.ts | 21 -- src/pages/list/search-table/constants.tsx | 91 ------ src/pages/list/search-table/form.tsx | 135 --------- .../list/search-table/icons/horizontal.svg | 20 -- src/pages/list/search-table/icons/text.svg | 41 --- .../list/search-table/icons/vertical.svg | 24 -- src/pages/list/search-table/index.tsx | 120 -------- src/pages/list/search-table/locale/index.ts | 52 ---- src/pages/list/search-table/mock/index.ts | 99 ------ .../list/search-table/style/index.module.less | 50 ---- src/pages/profile/basic/index.tsx | 164 ---------- src/pages/profile/basic/item.tsx | 128 -------- src/pages/profile/basic/locale/index.ts | 82 ----- src/pages/profile/basic/mock/index.ts | 52 ---- .../profile/basic/style/index.module.less | 12 - src/pages/result/error/index.tsx | 53 ---- src/pages/result/error/locale/index.ts | 33 -- .../result/error/style/index.module.less | 18 -- src/pages/result/success/index.tsx | 61 ---- src/pages/result/success/locale/index.ts | 36 --- .../result/success/style/index.module.less | 19 -- 36 files changed, 2830 deletions(-) delete mode 100644 src/pages/form/group/index.tsx delete mode 100644 src/pages/form/group/locale/index.ts delete mode 100644 src/pages/form/group/mock/index.ts delete mode 100644 src/pages/form/group/style/index.module.less delete mode 100644 src/pages/form/step/index.tsx delete mode 100644 src/pages/form/step/locale/index.ts delete mode 100644 src/pages/form/step/mock/index.ts delete mode 100644 src/pages/form/step/style/index.module.less delete mode 100644 src/pages/list/card/card-add.tsx delete mode 100644 src/pages/list/card/card-block.tsx delete mode 100644 src/pages/list/card/index.tsx delete mode 100644 src/pages/list/card/interface.ts delete mode 100644 src/pages/list/card/locale/index.ts delete mode 100644 src/pages/list/card/mock/index.ts delete mode 100644 src/pages/list/card/style/index.module.less delete mode 100644 src/pages/list/card/useRequest.ts delete mode 100644 src/pages/list/search-table/constants.tsx delete mode 100644 src/pages/list/search-table/form.tsx delete mode 100644 src/pages/list/search-table/icons/horizontal.svg delete mode 100644 src/pages/list/search-table/icons/text.svg delete mode 100644 src/pages/list/search-table/icons/vertical.svg delete mode 100644 src/pages/list/search-table/index.tsx delete mode 100644 src/pages/list/search-table/locale/index.ts delete mode 100644 src/pages/list/search-table/mock/index.ts delete mode 100644 src/pages/list/search-table/style/index.module.less delete mode 100644 src/pages/profile/basic/index.tsx delete mode 100644 src/pages/profile/basic/item.tsx delete mode 100644 src/pages/profile/basic/locale/index.ts delete mode 100644 src/pages/profile/basic/mock/index.ts delete mode 100644 src/pages/profile/basic/style/index.module.less delete mode 100644 src/pages/result/error/index.tsx delete mode 100644 src/pages/result/error/locale/index.ts delete mode 100644 src/pages/result/error/style/index.module.less delete mode 100644 src/pages/result/success/index.tsx delete mode 100644 src/pages/result/success/locale/index.ts delete mode 100644 src/pages/result/success/style/index.module.less diff --git a/src/pages/form/group/index.tsx b/src/pages/form/group/index.tsx deleted file mode 100644 index 3bcb17e..0000000 --- a/src/pages/form/group/index.tsx +++ /dev/null @@ -1,281 +0,0 @@ -import React, { useState, useRef } from 'react'; -import { - Typography, - Card, - Form, - Select, - Input, - Grid, - Space, - Button, - Message, -} from '@arco-design/web-react'; -import { FormInstance } from '@arco-design/web-react/es/Form'; -import axios from 'axios'; -import useLocale from '@/utils/useLocale'; -import locale from './locale'; -import styles from './style/index.module.less'; -import './mock'; - -function GroupForm() { - const t = useLocale(locale); - const formRef = useRef(); - const [loading, setLoading] = useState(false); - - function submit(data) { - setLoading(true); - axios - .post('/api/groupForm', { - data, - }) - .then(() => { - Message.success(t['groupForm.submitSuccess']); - }) - .finally(() => { - setLoading(false); - }); - } - - function handleSubmit() { - formRef.current.validate().then((values) => { - submit(values); - }); - } - - function handleReset() { - formRef.current.resetFields(); - } - - return ( -
-
- - - {t['groupForm.title.video']} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {t['groupForm.title.audio']} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {t['groupForm.title.explanation']} - - - - - -
-
- - - - -
-
- ); -} - -export default GroupForm; diff --git a/src/pages/form/group/locale/index.ts b/src/pages/form/group/locale/index.ts deleted file mode 100644 index 04c8396..0000000 --- a/src/pages/form/group/locale/index.ts +++ /dev/null @@ -1,84 +0,0 @@ -const i18n = { - 'en-US': { - 'menu.form': 'Form', - 'menu.form.group': 'Group Form', - 'groupForm.title.video': 'Video Parameters', - 'groupForm.title.audio': 'Audio Parameters', - 'groupForm.title.explanation': 'Enter Explanation', - 'groupForm.form.label.video.mode': 'Match Mode', - 'groupForm.form.label.video.acquisition.resolution': - 'Acquisition Resolution', - 'groupForm.form.label.video.acquisition.frameRate': - 'Acquisition Frame Rate', - 'groupForm.form.label.video.encoding.resolution': 'Encoding Resolution', - 'groupForm.form.label.video.encoding.rate.min': 'Encoding Min Rate', - 'groupForm.form.label.video.encoding.rate.max': 'Encoding Max Rate', - 'groupForm.form.label.video.encoding.rate.default': 'Encoding Default Rate', - 'groupForm.form.label.video.encoding.frameRate': 'Encoding Frame Rate', - 'groupForm.form.label.video.encoding.profile': 'Encoding Profile', - 'groupForm.placeholder.video.mode': 'Please Select', - 'groupForm.placeholder.video.acquisition.resolution': 'Please Select', - 'groupForm.placeholder.video.acquisition.frameRate': 'Enter Range [1, 30]', - 'groupForm.placeholder.video.encoding.resolution': 'Please Select', - 'groupForm.placeholder.video.encoding.rate.min': 'Enter Range [150, 1800]', - 'groupForm.placeholder.video.encoding.rate.max': 'Enter Range [150, 1800]', - 'groupForm.placeholder.video.encoding.rate.default': - 'Enter Range [150, 1800]', - 'groupForm.placeholder.video.encoding.frameRate': 'Enter Range [1, 30]', - 'groupForm.placeholder.video.encoding.profile': 'Enter Range [150, 1800]', - 'groupForm.form.label.audio.mode': 'Match Mode', - 'groupForm.form.label.audio.acquisition.channels': 'Acquisition Channels', - 'groupForm.form.label.audio.encoding.rate': 'Encoding Rate', - 'groupForm.form.label.audio.encoding.profile': 'Encoding Profile', - 'groupForm.placeholder.audio.mode': 'Please Select', - 'groupForm.placeholder.audio.acquisition.channels': 'Please Select', - 'groupForm.placeholder.audio.encoding.rate': 'Enter Range [150, 1800]', - 'groupForm.placeholder.audio.encoding.profile': 'Enter Range [150, 1800]', - 'groupForm.form.label.explanation': 'Explanation', - 'groupForm.placeholder.explanation': - 'Please fill in the parameter description, no more than 200 characters', - 'groupForm.submit': 'Submit', - 'groupForm.reset': 'Reset', - 'groupForm.submitSuccess': 'Submit Success', - }, - 'zh-CN': { - 'menu.form': '表单页', - 'menu.form.group': '分组表单', - 'groupForm.title.video': '视频参数', - 'groupForm.title.audio': '音频参数', - 'groupForm.title.explanation': '填写说明', - 'groupForm.form.label.video.mode': '匹配模式', - 'groupForm.form.label.video.acquisition.resolution': '采集分辨率', - 'groupForm.form.label.video.acquisition.frameRate': '采集帧率', - 'groupForm.form.label.video.encoding.resolution': '编码分辨率', - 'groupForm.form.label.video.encoding.rate.min': '编码码率最小值', - 'groupForm.form.label.video.encoding.rate.max': '编码码率最大值', - 'groupForm.form.label.video.encoding.rate.default': '编码码率默认值', - 'groupForm.form.label.video.encoding.frameRate': '编码帧率', - 'groupForm.form.label.video.encoding.profile': '编码profile', - 'groupForm.placeholder.video.mode': '请选择', - 'groupForm.placeholder.video.acquisition.resolution': '请选择', - 'groupForm.placeholder.video.acquisition.frameRate': '输入范围[1, 30]', - 'groupForm.placeholder.video.encoding.resolution': '请选择', - 'groupForm.placeholder.video.encoding.rate.min': '输入范围[150, 1800]', - 'groupForm.placeholder.video.encoding.rate.max': '输入范围[150, 1800]', - 'groupForm.placeholder.video.encoding.rate.default': '输入范围[150, 1800]', - 'groupForm.placeholder.video.encoding.frameRate': '输入范围[1, 30]', - 'groupForm.placeholder.video.encoding.profile': '输入范围[150, 1800]', - 'groupForm.form.label.audio.mode': '配置模式', - 'groupForm.form.label.audio.acquisition.channels': '采集声道数', - 'groupForm.form.label.audio.encoding.rate': '编码码率', - 'groupForm.form.label.audio.encoding.profile': '编码profile', - 'groupForm.placeholder.audio.mode': '请选择', - 'groupForm.placeholder.audio.acquisition.channels': '请选择', - 'groupForm.placeholder.audio.encoding.rate': '输入范围[150, 1800]', - 'groupForm.placeholder.audio.encoding.profile': '输入范围[150, 1800]', - 'groupForm.form.label.explanation': '参数说明', - 'groupForm.placeholder.explanation': '请填写参数说明,最多不超多200字', - 'groupForm.submit': '提交', - 'groupForm.reset': '重置', - 'groupForm.submitSuccess': '提交成功', - }, -}; - -export default i18n; diff --git a/src/pages/form/group/mock/index.ts b/src/pages/form/group/mock/index.ts deleted file mode 100644 index 27047ac..0000000 --- a/src/pages/form/group/mock/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Mock from 'mockjs'; -import setupMock from '@/utils/setupMock'; - -setupMock({ - setup: () => { - // 保存表单数据 - Mock.mock(new RegExp('/api/groupForm'), () => { - return true; - }); - }, -}); diff --git a/src/pages/form/group/style/index.module.less b/src/pages/form/group/style/index.module.less deleted file mode 100644 index ca271d0..0000000 --- a/src/pages/form/group/style/index.module.less +++ /dev/null @@ -1,23 +0,0 @@ -.container { - overflow: hidden; - - :global(.arco-card-body) { - padding: 20px 20px 10px; - } - - :global(.arco-card) { - margin-bottom: 16px; - } -} - -.actions { - padding: 12px 40px; - background-color: var(--color-bg-2); - display: flex; - flex-direction: row-reverse; - position: fixed; - left: 0; - right: 0; - bottom: 0; - box-shadow: 0 -3px 12px rgb(0 0 0 / 10%); -} diff --git a/src/pages/form/step/index.tsx b/src/pages/form/step/index.tsx deleted file mode 100644 index 6ba10f5..0000000 --- a/src/pages/form/step/index.tsx +++ /dev/null @@ -1,257 +0,0 @@ -import React, { useState } from 'react'; -import { - Steps, - Form, - Input, - Select, - DatePicker, - InputTag, - Button, - Typography, - Space, - Card, - Switch, - Result, -} from '@arco-design/web-react'; -import useLocale from '@/utils/useLocale'; -import locale from './locale'; -import styles from './style/index.module.less'; - -const { Title, Paragraph } = Typography; -function StepForm() { - const t = useLocale(locale); - const [current, setCurrent] = useState(1); - - const [form] = Form.useForm(); - - const viewForm = () => { - const values = form.getFields(); - form.setFields(values); - setCurrent(1); - }; - - const reCreateForm = () => { - form.resetFields(); - setCurrent(1); - }; - - const toNext = async () => { - try { - await form.validate(); - setCurrent(current + 1); - } catch (_) {} - }; - return ( -
- - {t['stepForm.desc.basicInfo']} -
- - - - - -
- {current === 1 && ( - - { - if (!/^[\u4e00-\u9fa5a-zA-Z0-9]{1,20}$/g.test(value)) { - callback(t['stepForm.basicInfo.name.placeholder']); - } - }, - }, - ]} - > - - - - - - - - - - - - - )} - {current === 2 && ( - - - - - - - - - - - - - - - - - - - )} - {current !== 3 ? ( - - - {current === 2 && ( - - )} - {current !== 3 && ( - - )} - - - ) : ( - - - {t['stepForm.created.success.view']} - , - , - ]} - /> - - )} -
-
- {current === 3 && ( -
- {t['stepForm.created.extra.title']} - - {t['stepForm.created.extra.desc']} - - -
- )} -
-
- ); -} - -export default StepForm; diff --git a/src/pages/form/step/locale/index.ts b/src/pages/form/step/locale/index.ts deleted file mode 100644 index 3821b76..0000000 --- a/src/pages/form/step/locale/index.ts +++ /dev/null @@ -1,94 +0,0 @@ -const i18n = { - 'en-US': { - 'menu.form': 'Form', - 'menu.form.step': 'Step Form', - 'stepForm.title': 'Create a channel form', - 'stepForm.next': 'Next', - 'stepForm.prev': 'Prev', - 'stepForm.title.basicInfo': 'Basic Information', - 'stepForm.desc.basicInfo': 'Create event channel', - 'stepForm.title.channel': 'Channel Information', - 'stepForm.desc.channel': 'Enter detailed channel content', - 'stepForm.title.created': 'Complete creation', - 'stepForm.desc.created': 'Created successfully', - 'stepForm.basicInfo.name': 'Event name', - 'stepForm.basicInfo.name.required': 'Please enter the event name', - 'stepForm.basicInfo.name.placeholder': - 'Enter Chinese characters, letters or numbers, up to 20 characters', - 'stepForm.basicInfo.channelType': 'Channel Type', - 'stepForm.basicInfo.channelType.required': 'Please select the channel type', - 'stepForm.basicInfo.time': 'Promotion time', - 'stepForm.basicInfo.time.required': 'Please select the promotion time', - 'stepForm.basicInfo.link': 'Promotion URL', - 'stepForm.basicInfo.link.placeholder': - 'Please enter the promotion page address', - 'stepForm.basicInfo.link.tips': - 'Such as Android or iOS download address, intermediate redirect URL, the URL must start with http:// or https://', - 'stepForm.channel.source': 'Advertising source', - 'stepForm.channel.source.required': 'Please enter the advertising source', - 'stepForm.channel.source.placeholder': 'Referral address: sohu, sina', - 'stepForm.channel.media': 'Advertising medium', - 'stepForm.channel.media.required': 'Please enter the advertising medium', - 'stepForm.channel.media.placeholder': 'Marketing media: cpc, bannner, edm', - 'stepForm.channel.keywords': 'Key words', - 'stepForm.channel.remind': 'Push reminder', - 'stepForm.channel.content': 'Advertising content', - 'stepForm.channel.content.required': 'Please enter the advertising content', - 'stepForm.channel.content.placeholder': - 'Please enter the description of the advertisement content, no more than 200 words', - 'stepForm.created.success.title': 'Created successfully', - 'stepForm.created.success.desc': 'Form created successfully', - 'stepForm.created.success.view': 'View form', - 'stepForm.created.success.again': 'Create again', - 'stepForm.created.extra.title': 'Channel form description', - 'stepForm.created.extra.desc': - 'Advertiser channel promotion supports the tracking of users who place ads on third-party advertisers to download App users, such as launching App download advertisements on Toutiao channels, and tracking users who activate App by downloading on channels. ', - 'stepForm.created.extra.detail': 'Details', - }, - 'zh-CN': { - 'menu.form': '表单页', - 'menu.form.step': '分布表单', - 'stepForm.title': '创建渠道表单', - 'stepForm.next': '下一步', - 'stepForm.prev': '上一步', - 'stepForm.title.basicInfo': '基本信息', - 'stepForm.desc.basicInfo': '创建活动渠道', - 'stepForm.title.channel': '输入渠道信息', - 'stepForm.desc.channel': '输入详细的渠道内容', - 'stepForm.title.created': '完成创建', - 'stepForm.desc.created': '创建成功', - 'stepForm.basicInfo.name': '活动名称', - 'stepForm.basicInfo.name.required': '请输入活动名称', - 'stepForm.basicInfo.name.placeholder': '输入汉字、字母或数字,最多20字符', - 'stepForm.basicInfo.channelType': '渠道类型', - 'stepForm.basicInfo.channelType.required': '请选择渠道类型', - 'stepForm.basicInfo.time': '推广时间', - 'stepForm.basicInfo.time.required': '请选择推广时间', - 'stepForm.basicInfo.link': '推广地址', - 'stepForm.basicInfo.link.placeholder': '请输入推广页面地址', - 'stepForm.basicInfo.link.tips': - '如 Android 或 iOS 的下载地址、中间跳转URL,网址必须以 http:// 或 https:// 开头', - 'stepForm.channel.source': '广告来源', - 'stepForm.channel.source.required': '请输入广告来源', - 'stepForm.channel.source.placeholder': '引荐来源地址:sohu、sina', - 'stepForm.channel.media': '广告媒介', - 'stepForm.channel.media.required': '请输入广告媒介', - 'stepForm.channel.media.placeholder': '营销媒介:cpc、bannner、edm', - 'stepForm.channel.keywords': '关键词', - 'stepForm.channel.remind': '推送提醒', - 'stepForm.channel.content': '广告内容', - 'stepForm.channel.content.required': '请输入广告内容', - 'stepForm.channel.content.placeholder': - '请输入广告内容介绍,最多不超过200字', - 'stepForm.created.success.title': '创建成功', - 'stepForm.created.success.desc': '表单创建成功', - 'stepForm.created.success.view': '查看表单', - 'stepForm.created.success.again': '再次创建', - 'stepForm.created.extra.title': '渠道表单说明', - 'stepForm.created.extra.desc': - '广告商渠道推广支持追踪在第三方广告商投放广告下载App用户的场景,例如在今日头条渠道投放下载App广告,追踪通过在渠道下载激活App的用户。', - 'stepForm.created.extra.detail': '查看详情', - }, -}; - -export default i18n; diff --git a/src/pages/form/step/mock/index.ts b/src/pages/form/step/mock/index.ts deleted file mode 100644 index 27047ac..0000000 --- a/src/pages/form/step/mock/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Mock from 'mockjs'; -import setupMock from '@/utils/setupMock'; - -setupMock({ - setup: () => { - // 保存表单数据 - Mock.mock(new RegExp('/api/groupForm'), () => { - return true; - }); - }, -}); diff --git a/src/pages/form/step/style/index.module.less b/src/pages/form/step/style/index.module.less deleted file mode 100644 index 191ea60..0000000 --- a/src/pages/form/step/style/index.module.less +++ /dev/null @@ -1,39 +0,0 @@ -.container { - :global(.arco-card-body) { - > h5 { - margin: 0; - } - - padding: 20px; - } -} - -.wrapper { - width: 624px; - margin: 0 auto; - padding-top: 56px; - padding-bottom: 70px; -} - -.form { - width: 100%; - box-sizing: border-box; - margin-top: 76px; - padding-right: 76px; -} - -.form-extra { - width: 895px; - margin: 54px auto; - background-color: var(--color-fill-1); - padding: 20px; - margin-bottom: 120px; - - > h6 { - margin-top: 0; - } - - > div { - margin-bottom: 0; - } -} diff --git a/src/pages/list/card/card-add.tsx b/src/pages/list/card/card-add.tsx deleted file mode 100644 index c0517f6..0000000 --- a/src/pages/list/card/card-add.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import React from 'react'; -import { Card } from '@arco-design/web-react'; -import cs from 'classnames'; -import { IconPlus } from '@arco-design/web-react/icon'; -import styles from './style/index.module.less'; - -interface AddCardProps { - description?: string; -} -function AddCard(props: AddCardProps) { - return ( - -
-
- -
-
{props.description}
-
-
- ); -} - -export default AddCard; diff --git a/src/pages/list/card/card-block.tsx b/src/pages/list/card/card-block.tsx deleted file mode 100644 index ab39e93..0000000 --- a/src/pages/list/card/card-block.tsx +++ /dev/null @@ -1,255 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import cs from 'classnames'; -import { - Button, - Switch, - Tag, - Card, - Descriptions, - Typography, - Dropdown, - Menu, - Skeleton, -} from '@arco-design/web-react'; -import { - IconStarFill, - IconThumbUpFill, - IconSunFill, - IconFaceSmileFill, - IconPenFill, - IconCheckCircleFill, - IconCloseCircleFill, - IconMore, -} from '@arco-design/web-react/icon'; -import PermissionWrapper from '@/components/PermissionWrapper'; -import useLocale from '@/utils/useLocale'; -import locale from './locale'; -import { QualityInspection, BasicCard } from './interface'; -import styles from './style/index.module.less'; - -interface CardBlockType { - type: 'quality' | 'service' | 'rules'; - card: QualityInspection & BasicCard; - loading?: boolean; -} - -const IconList = [ - IconStarFill, - IconThumbUpFill, - IconSunFill, - IconFaceSmileFill, - IconPenFill, -].map((Tag, index) => ); - -const { Paragraph } = Typography; - -function CardBlock(props: CardBlockType) { - const { type, card = {} } = props; - const [visible, setVisible] = useState(false); - const [status, setStatus] = useState(card.status); - const [loading, setLoading] = useState(props.loading); - - const t = useLocale(locale); - const changeStatus = async () => { - setLoading(true); - await new Promise((resolve) => - setTimeout(() => { - setStatus(status !== 1 ? 1 : 0); - resolve(null); - }, 1000) - ).finally(() => setLoading(false)); - }; - - useEffect(() => { - setLoading(props.loading); - }, [props.loading]); - - useEffect(() => { - if (card.status !== status) { - setStatus(card.status); - } - }, [card.status]); - - const getTitleIcon = () => { - if (type === 'service' && typeof card.icon === 'number') { - return ( -
- {IconList[card.icon % IconList.length]} -
- ); - } - return null; - }; - - const getButtonGroup = () => { - if (type === 'quality') { - return ( - <> - - - - - - - - - ); - } - - if (type === 'service') { - return ( - <> - {status === 1 ? ( - - ) : ( - - )} - - ); - } - - return ( - - ); - }; - - const getStatus = () => { - if (type === 'rules' && status) { - return ( - } - className={styles.status} - size="small" - > - {t['cardList.tag.activated']} - - ); - } - switch (status) { - case 1: - return ( - } - className={styles.status} - size="small" - > - {t['cardList.tag.opened']} - - ); - case 2: - return ( - } - className={styles.status} - size="small" - > - {t['cardList.tag.expired']} - - ); - default: - return null; - } - }; - - const getContent = () => { - if (loading) { - return ( - - ); - } - if (type !== 'quality') { - return {card.description}; - } - return ( - - ); - }; - - const className = cs(styles['card-block'], styles[`${type}-card`]); - - return ( - - ) : ( - <> -
- {getTitleIcon()} - {card.title} - {getStatus()} - - {['操作1', '操作2'].map((item, key) => ( - {item} - ))} - - } - trigger="click" - onVisibleChange={setVisible} - popupVisible={visible} - > -
- -
-
-
-
{card.time}
- - ) - } - > -
{getContent()}
-
{getButtonGroup()}
-
- ); -} - -export default CardBlock; diff --git a/src/pages/list/card/index.tsx b/src/pages/list/card/index.tsx deleted file mode 100644 index 0d12633..0000000 --- a/src/pages/list/card/index.tsx +++ /dev/null @@ -1,95 +0,0 @@ -import React, { useEffect, useState } from 'react'; -import axios from 'axios'; -import { Tabs, Card, Input, Typography, Grid } from '@arco-design/web-react'; -import useLocale from '@/utils/useLocale'; -import locale from './locale'; -import styles from './style/index.module.less'; -import CardBlock from './card-block'; -import AddCard from './card-add'; -import { QualityInspection, BasicCard } from './interface'; -import './mock'; - -const { Title } = Typography; -const { Row, Col } = Grid; - -const defaultList = new Array(10).fill({}); -export default function ListCard() { - const t = useLocale(locale); - const [loading, setLoading] = useState(true); - const [data, setData] = useState({ - quality: defaultList, - service: defaultList, - rules: defaultList, - }); - - const [activeKey, setActiveKey] = useState('all'); - - const getData = () => { - axios - .get('/api/cardList') - .then((res) => { - setData(res.data); - }) - .finally(() => setLoading(false)); - }; - - useEffect(() => { - getData(); - }, []); - 7; - const getCardList = ( - list: Array, - type: keyof typeof data - ) => { - return ( - - {type === 'quality' && ( - - - - )} - {list.map((item, index) => ( - - - - ))} - - ); - }; - - return ( - - {t['menu.list.card']} - - } - > - - - - - -
- {activeKey === 'all' ? ( - Object.entries(data).map(([key, list]) => ( -
- {t[`cardList.tab.title.${key}`]} - {getCardList(list, key as keyof typeof data)} -
- )) - ) : ( -
- {getCardList(data[activeKey], activeKey as keyof typeof data)} -
- )} -
-
- ); -} diff --git a/src/pages/list/card/interface.ts b/src/pages/list/card/interface.ts deleted file mode 100644 index 9e79387..0000000 --- a/src/pages/list/card/interface.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface QualityInspection { - title?: string; - time?: string; - qualityCount?: number; - randomCount?: number; - duration?: number; -} - -export interface BasicCard { - icon?: number; - status?: 0 | 1 | 2; - description?: string; -} diff --git a/src/pages/list/card/locale/index.ts b/src/pages/list/card/locale/index.ts deleted file mode 100644 index aa52403..0000000 --- a/src/pages/list/card/locale/index.ts +++ /dev/null @@ -1,66 +0,0 @@ -const i18n = { - 'en-US': { - 'menu.list': 'List', - 'menu.list.card': 'Card List', - 'cardList.tab.title.all': 'All', - 'cardList.tab.title.quality': 'Content quality', - 'cardList.tab.title.service': 'Service opening', - 'cardList.tab.title.rules': 'Rule presets', - 'cardList.tab.all.placeholder': 'Search', - 'cardList.tab.quality.placeholder': 'Search queue', - 'cardList.tab.service.placeholder': 'Search service', - 'cardList.tab.rules.placeholder': 'Search rule', - 'cardList.searchInput.placeholder': 'Search service', - 'cardList.add.quality': 'Create quality inspection queue', - 'cardList.enable': 'Enable', - 'cardList.disable': 'Disable', - 'cardList.action': 'action', - 'cardList.detail': 'Detail', - 'cardList.tab.title.announcement': 'Recent Announcement', - 'cardList.announcement.noData': 'No announcement', - 'cardList.statistic.enable': 'Enable', - 'cardList.statistic.disable': 'Disable', - 'cardList.statistic.applicationNum': 'Applications', - 'cardList.options.qualityInspection': 'Quality inspection', - 'cardList.options.remove': 'Remove', - 'cardList.options.cancel': 'Cancel', - 'cardList.options.subscribe': 'Subscribe', - 'cardList.options.renewal': 'Renewal', - 'cardList.tag.activated': 'Activated', - 'cardList.tag.opened': 'Already Opened', - 'cardList.tag.expired': 'Expired', - }, - 'zh-CN': { - 'menu.list': '列表页', - 'menu.list.card': '卡片列表', - 'cardList.tab.title.all': '全部', - 'cardList.tab.title.quality': '内容质检', - 'cardList.tab.title.service': '服务开通', - 'cardList.tab.title.rules': '规则预置', - 'cardList.tab.all.placeholder': '搜索', - 'cardList.tab.quality.placeholder': '搜索队列', - 'cardList.tab.service.placeholder': '搜索服务', - 'cardList.tab.rules.placeholder': '搜索规则', - 'cardList.searchInput.placeholder': '搜索服务', - 'cardList.add.quality': '点击创建质检内容队列', - 'cardList.enable': '启用', - 'cardList.disable': '禁用', - 'cardList.action': '操作', - 'cardList.detail': '详细信息', - 'cardList.tab.title.announcement': '最近公告', - 'cardList.announcement.noData': '暂无公告', - 'cardList.statistic.enable': '已启用', - 'cardList.statistic.disable': '未启用', - 'cardList.statistic.applicationNum': '应用数', - 'cardList.options.qualityInspection': '质检', - 'cardList.options.remove': '删除', - 'cardList.options.cancel': '取消开通', - 'cardList.options.subscribe': '开通服务', - 'cardList.options.renewal': '续约服务', - 'cardList.tag.activated': '已启用', - 'cardList.tag.opened': '已开通', - 'cardList.tag.expired': '已过期', - }, -}; - -export default i18n; diff --git a/src/pages/list/card/mock/index.ts b/src/pages/list/card/mock/index.ts deleted file mode 100644 index 321188d..0000000 --- a/src/pages/list/card/mock/index.ts +++ /dev/null @@ -1,106 +0,0 @@ -import Mock from 'mockjs'; -import dayjs from 'dayjs'; -import setupMock from '@/utils/setupMock'; - -const qualityCategory = ['视频类', '图文类', '纯文本']; -const qualityName = ['历史导入', '内容版权', '敏感内容', '商业品牌']; - -const serviceName = [ - '漏斗分析', - '用户分布', - '资源分发', - '用户画像分析', - '事件分析', -]; - -const serviceDescriptions = [ - '用户行为分析之漏斗分析模型是企业实现精细化运营、进行用户行为分析的重要数据分析模型。 ', - '快速诊断用户人群,地域细分情况,了解数据分布的集中度,以及主要的数据分布的区间段是什么。', - '移动端动态化资源分发解决方案。提供稳定大流量服务支持、灵活定制的分发圈选规则,通过离线化预加载。 ', - '用户画像就是将典型用户信息标签化,根据用户特征、业务场景和用户行为等信息,构建一个标签化的用户模型。 ', - '事件分析即可进行筛选、分组、聚合的灵活多维数据分析。详情请点击卡片。', -]; - -const rulesName = [ - '内容屏蔽规则', - '内容置顶规则', - '内容加权规则', - '内容分发规则', - '多语言文字符号识别', -]; - -const rulesDescription = [ - '用户在执行特定的内容分发任务时,可使用内容屏蔽规则根据特定标签,过滤内容集合。 ', - '该规则支持用户在执行特定内容分发任务时,对固定的几条内容置顶。', - '选定内容加权规则后可自定义从不同内容集合获取内容的概率。', - '内容分发时,对某些内容需要固定在C端展示的位置。', - '精准识别英语、维语、藏语、蒙古语、朝鲜语等多种语言以及emoji表情形态的语义识别。', -]; -const getQualityCard = () => { - const { list } = Mock.mock({ - 'list|10': [ - { - title: () => - `${Mock.Random.pick(qualityCategory)}-${Mock.Random.pick( - qualityName - )}`, - time: () => - dayjs() - .subtract(Mock.Random.natural(0, 30), 'days') - .format('YYYY-MM-DD HH:mm:ss'), - qualityCount: () => Mock.Random.natural(100, 500), - randomCount: () => Mock.Random.natural(0, 100), - duration: () => Mock.Random.natural(0, 200), - }, - ], - }); - return list; -}; - -const getServiceCard = () => { - const { list } = Mock.mock({ - 'list|10': [ - { - icon: () => Mock.Random.natural(0, serviceName.length - 1), - title: function () { - return serviceName[this.icon]; - }, - description: function () { - return serviceDescriptions[this.icon]; - }, - status: () => Mock.Random.natural(0, 2), - }, - ], - }); - return list; -}; - -const getRulesCard = () => { - const { list } = Mock.mock({ - 'list|10': [ - { - index: () => Mock.Random.natural(0, rulesName.length - 1), - title: function () { - return rulesName[this.index]; - }, - description: function () { - return rulesDescription[this.index]; - }, - status: () => Mock.Random.natural(0, 1), - }, - ], - }); - return list; -}; - -setupMock({ - setup: () => { - Mock.mock(new RegExp('/api/cardList'), () => { - return { - quality: getQualityCard(), - service: getServiceCard(), - rules: getRulesCard(), - }; - }); - }, -}); diff --git a/src/pages/list/card/style/index.module.less b/src/pages/list/card/style/index.module.less deleted file mode 100644 index f653ef8..0000000 --- a/src/pages/list/card/style/index.module.less +++ /dev/null @@ -1,156 +0,0 @@ -.container { - :global(.arco-list-content) { - overflow-x: hidden; - } - - :global(.arco-card-meta-title) { - font-size: 14px; - } - - h6 { - font-size: 14px; - margin-top: 16px; - margin-bottom: 12px; - } - - .card-content { - min-height: 180px; - width: 100%; - } - - .single-content { - margin-top: 30px; - } -} - -.card-block { - margin-bottom: 16px; - - :global(.arco-card-header) { - border-bottom: none; - height: auto; - padding: 16px; - padding-bottom: 0; - } - - .title { - display: flex; - line-height: 24px; - align-items: center; - font-size: 14px; - font-weight: 500; - - .icon { - height: 24px; - width: 24px; - color: var(--color-white); - background: #626aea; - text-align: center; - line-height: 24px; - border-radius: 50%; - margin-right: 8px; - } - - .status { - margin-left: 12px; - } - - .more { - color: var(--color-text-4); - font-size: 16px; - position: absolute; - right: 16px; - cursor: pointer; - opacity: 0; - } - } - - .title-more { - .more { - opacity: 1; - } - } - - .time, - .content > :global(.arco-typography), - :global(.arco-descriptions-item-label), - :global(.arco-descriptions-item-value) { - font-size: 12px; - font-weight: 400; - color: var(--color-text-3); - padding: 0; - line-height: 20px; - } - - :global(.arco-descriptions-item-value) { - color: var(--color-text-2); - padding-left: 6px; - } - - .content { - height: 48px; - } - - .extra { - display: flex; - flex-direction: row-reverse; - } - - &-skeleton { - :global(.arco-skeleton-content .arco-skeleton-text-row:not(:last-child)) { - height: 14px; - margin-bottom: 8px; - } - } -} - -.card-block:hover { - box-shadow: 4px 4px 10px rgba(0, 0, 0, 10%); - - .title { - .more { - opacity: 1; - } - } -} - -.add-card { - text-align: center; - cursor: pointer; - - .add-icon { - font-size: 22px; - } - - .description { - margin-top: 16px; - color: var(--color-text-3); - font-weight: 400; - } - - :global(.arco-card-body) { - padding-top: 52px; - padding-bottom: 64px; - } -} - -.service-card { - :global(.arco-card-body) { - padding: 12px 16px 16px 48px; - } - - .content { - margin-bottom: 10px; - height: 60px; - } -} - -.rules-card { - :global(.arco-card-body) { - padding: 12px 16px 16px; - } - - .content { - margin-bottom: 14px; - } -} diff --git a/src/pages/list/card/useRequest.ts b/src/pages/list/card/useRequest.ts deleted file mode 100644 index c085cf4..0000000 --- a/src/pages/list/card/useRequest.ts +++ /dev/null @@ -1,21 +0,0 @@ -import axios from 'axios'; -import { useEffect, useState } from 'react'; - -export default (url: string, defaultValue: T[]): [boolean, T[]] => { - const [loading, setLoading] = useState(false); - const [data, setData] = useState(defaultValue); - - useEffect(() => { - setLoading(true); - axios - .get(url) - .then((res) => { - setData(res.data); - }) - .finally(() => { - setLoading(false); - }); - }, [url]); - - return [loading, data]; -}; diff --git a/src/pages/list/search-table/constants.tsx b/src/pages/list/search-table/constants.tsx deleted file mode 100644 index 8beb00c..0000000 --- a/src/pages/list/search-table/constants.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import React from 'react'; -import { Button, Typography, Badge } from '@arco-design/web-react'; -import IconText from './icons/text.svg'; -import IconHorizontalVideo from './icons/horizontal.svg'; -import IconVerticalVideo from './icons/vertical.svg'; -import dayjs from 'dayjs'; -import styles from './style/index.module.less'; - -const { Text } = Typography; - -export const ContentType = ['图文', '横版短视频', '竖版短视频']; -export const FilterType = ['规则筛选', '人工']; -export const Status = ['未上线', '已上线']; - -const ContentIcon = [ - , - , - , -]; - -export function getColumns( - t: any, - callback: (record: Record, type: string) => Promise -) { - return [ - { - title: t['searchTable.columns.id'], - dataIndex: 'id', - render: (value) => {value}, - }, - { - title: t['searchTable.columns.name'], - dataIndex: 'name', - }, - { - title: t['searchTable.columns.contentType'], - dataIndex: 'contentType', - render: (value) => ( -
- {ContentIcon[value]} - {ContentType[value]} -
- ), - }, - { - title: t['searchTable.columns.filterType'], - dataIndex: 'filterType', - render: (value) => FilterType[value], - }, - { - title: t['searchTable.columns.contentNum'], - dataIndex: 'count', - sorter: (a, b) => a.count - b.count, - render(x) { - return Number(x).toLocaleString(); - }, - }, - { - title: t['searchTable.columns.createdTime'], - dataIndex: 'createdTime', - render: (x) => dayjs().subtract(x, 'days').format('YYYY-MM-DD HH:mm:ss'), - sorter: (a, b) => b.createdTime - a.createdTime, - }, - { - title: t['searchTable.columns.status'], - dataIndex: 'status', - render: (x) => { - if (x === 0) { - return ; - } - return ; - }, - }, - { - title: t['searchTable.columns.operations'], - dataIndex: 'operations', - headerCellStyle: { paddingLeft: '15px' }, - render: (_, record) => ( - - ), - }, - ]; -} - -export default () => ContentIcon; diff --git a/src/pages/list/search-table/form.tsx b/src/pages/list/search-table/form.tsx deleted file mode 100644 index 07f6d11..0000000 --- a/src/pages/list/search-table/form.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import React, { useContext } from 'react'; -import dayjs from 'dayjs'; -import { - Form, - Input, - Select, - DatePicker, - Button, - Grid, -} from '@arco-design/web-react'; -import { GlobalContext } from '@/context'; -import locale from './locale'; -import useLocale from '@/utils/useLocale'; -import { IconRefresh, IconSearch } from '@arco-design/web-react/icon'; -import { ContentType, FilterType, Status } from './constants'; -import styles from './style/index.module.less'; - -const { Row, Col } = Grid; -const { useForm } = Form; - -function SearchForm(props: { - onSearch: (values: Record) => void; -}) { - const { lang } = useContext(GlobalContext); - - const t = useLocale(locale); - const [form] = useForm(); - - const handleSubmit = () => { - const values = form.getFieldsValue(); - props.onSearch(values); - }; - - const handleReset = () => { - form.resetFields(); - props.onSearch({}); - }; - - const colSpan = lang === 'zh-CN' ? 8 : 12; - - return ( -
-
- - - - - - - - - - - - - - ({ - label: item, - value: index, - }))} - mode="multiple" - allowClear - /> - - - - - dayjs(date).isAfter(dayjs())} - /> - - - - -