feat(ui): 余下两页接入主题 + 清理后台模板 demo(1+2)
【1. 主题补全】 - pwuniapp/pages/expert/workspace.vue(大神工作台):根节点加 theme class,66 处深色硬编码改为全局主题变量(bg-primary/surface/surface-elevated/text-*/border-subtle/color-brand(-gradient)) - pwuniapp/pages/activity/my-ticket.vue(我的门票):同样接入主题;条码/二维码区域保持黑白(可扫描,不做主题化) - 两页 onShow 刷新 currentThemeKey,切换主题回到页面即时生效 【2. 后台模板 demo 清理】 - 删除模板路由模块:form / list / profile / result / visualization(原本 hideInMenu 不可见) - 删除对应 views 目录、api(form/list/profile/visualization/dashboard)、dashboard/monitor - 删除 src/mock 与全部 views/**/mock.ts,并移除 main.ts 的 `import './mock'` - 可见工作台移除:content-chart(调用不存在的 /api/content-data)、popular-content(写死假活动数据);分类占比卡片改为整行 - 同步清理 zh-CN/en-US locale 中对应导入与展开 【验证】 - 后台 `pnpm build` 通过,产物显著减小(chart 分块 1026KB→576KB) - 新增 theme-and-admin-cleanup.spec.ts;更新 dashboard-reality.spec.ts - 全量 100 套件 / 685 用例全绿
这个提交包含在:
@@ -1,22 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import type { TableData } from '@arco-design/web-vue/es/table/interface';
|
||||
|
||||
export interface ContentDataRecord {
|
||||
x: string;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export function queryContentData() {
|
||||
return axios.get<ContentDataRecord[]>('/api/content-data');
|
||||
}
|
||||
|
||||
export interface PopularRecord {
|
||||
key: number;
|
||||
clickNumber: string;
|
||||
title: string;
|
||||
increases: number;
|
||||
}
|
||||
|
||||
export function queryPopularList(params: { type: string }) {
|
||||
return axios.get<TableData[]>('/api/popular/list', { params });
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export interface BaseInfoModel {
|
||||
activityName: string;
|
||||
channelType: string;
|
||||
promotionTime: string[];
|
||||
promoteLink: string;
|
||||
}
|
||||
export interface ChannelInfoModel {
|
||||
advertisingSource: string;
|
||||
advertisingMedia: string;
|
||||
keyword: string[];
|
||||
pushNotify: boolean;
|
||||
advertisingContent: string;
|
||||
}
|
||||
|
||||
export type UnitChannelModel = BaseInfoModel & ChannelInfoModel;
|
||||
|
||||
export function submitChannelForm(data: UnitChannelModel) {
|
||||
return axios.post('/api/channel-form/submit', { data });
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import qs from 'query-string';
|
||||
import type { DescData } from '@arco-design/web-vue/es/descriptions/interface';
|
||||
|
||||
export interface PolicyRecord {
|
||||
id: string;
|
||||
number: number;
|
||||
name: string;
|
||||
contentType: 'img' | 'horizontalVideo' | 'verticalVideo';
|
||||
filterType: 'artificial' | 'rules';
|
||||
count: number;
|
||||
status: 'online' | 'offline';
|
||||
createdTime: string;
|
||||
}
|
||||
|
||||
export interface PolicyParams extends Partial<PolicyRecord> {
|
||||
current: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export interface PolicyListRes {
|
||||
list: PolicyRecord[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function queryPolicyList(params: PolicyParams) {
|
||||
return axios.get<PolicyListRes>('/api/list/policy', {
|
||||
params,
|
||||
paramsSerializer: (obj) => {
|
||||
return qs.stringify(obj);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export interface ServiceRecord {
|
||||
id: number;
|
||||
title: string;
|
||||
description: string;
|
||||
name?: string;
|
||||
actionType?: string;
|
||||
icon?: string;
|
||||
data?: DescData[];
|
||||
enable?: boolean;
|
||||
expires?: boolean;
|
||||
}
|
||||
export function queryInspectionList() {
|
||||
return axios.get('/api/list/quality-inspection');
|
||||
}
|
||||
|
||||
export function queryTheServiceList() {
|
||||
return axios.get('/api/list/the-service');
|
||||
}
|
||||
|
||||
export function queryRulesPresetList() {
|
||||
return axios.get('/api/list/rules-preset');
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
import axios from 'axios';
|
||||
|
||||
export interface ProfileBasicRes {
|
||||
status: number;
|
||||
video: {
|
||||
mode: string;
|
||||
acquisition: {
|
||||
resolution: string;
|
||||
frameRate: number;
|
||||
};
|
||||
encoding: {
|
||||
resolution: string;
|
||||
rate: {
|
||||
min: number;
|
||||
max: number;
|
||||
default: number;
|
||||
};
|
||||
frameRate: number;
|
||||
profile: string;
|
||||
};
|
||||
};
|
||||
audio: {
|
||||
mode: string;
|
||||
acquisition: {
|
||||
channels: number;
|
||||
};
|
||||
encoding: {
|
||||
channels: number;
|
||||
rate: number;
|
||||
profile: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export function queryProfileBasic() {
|
||||
return axios.get<ProfileBasicRes>('/api/profile/basic');
|
||||
}
|
||||
|
||||
export type operationLogRes = Array<{
|
||||
key: string;
|
||||
contentNumber: string;
|
||||
updateContent: string;
|
||||
status: number;
|
||||
updateTime: string;
|
||||
}>;
|
||||
|
||||
export function queryOperationLog() {
|
||||
return axios.get<operationLogRes>('/api/operation/log');
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
import axios from 'axios';
|
||||
import { GeneralChart } from '@/types/global';
|
||||
|
||||
export interface ChartDataRecord {
|
||||
x: string;
|
||||
y: number;
|
||||
name: string;
|
||||
}
|
||||
export interface DataChainGrowth {
|
||||
quota: string;
|
||||
}
|
||||
|
||||
export interface DataChainGrowthRes {
|
||||
count: number;
|
||||
growth: number;
|
||||
chartData: {
|
||||
xAxis: string[];
|
||||
data: { name: string; value: number[] };
|
||||
};
|
||||
}
|
||||
export function queryDataChainGrowth(data: DataChainGrowth) {
|
||||
return axios.post<DataChainGrowthRes>('/api/data-chain-growth', data);
|
||||
}
|
||||
|
||||
export interface PopularAuthorRes {
|
||||
list: {
|
||||
ranking: number;
|
||||
author: string;
|
||||
contentCount: number;
|
||||
clickCount: number;
|
||||
}[];
|
||||
}
|
||||
|
||||
export function queryPopularAuthor() {
|
||||
return axios.get<PopularAuthorRes>('/api/popular-author/list');
|
||||
}
|
||||
|
||||
export interface ContentPublishRecord {
|
||||
x: string[];
|
||||
y: number[];
|
||||
name: string;
|
||||
}
|
||||
|
||||
export function queryContentPublish() {
|
||||
return axios.get<ContentPublishRecord[]>('/api/content-publish');
|
||||
}
|
||||
|
||||
export function queryContentPeriodAnalysis() {
|
||||
return axios.post<GeneralChart>('/api/content-period-analysis');
|
||||
}
|
||||
|
||||
export interface PublicOpinionAnalysis {
|
||||
quota: string;
|
||||
}
|
||||
export interface PublicOpinionAnalysisRes {
|
||||
count: number;
|
||||
growth: number;
|
||||
chartData: ChartDataRecord[];
|
||||
}
|
||||
export function queryPublicOpinionAnalysis(data: DataChainGrowth) {
|
||||
return axios.post<PublicOpinionAnalysisRes>(
|
||||
'/api/public-opinion-analysis',
|
||||
data
|
||||
);
|
||||
}
|
||||
export interface DataOverviewRes {
|
||||
xAxis: string[];
|
||||
data: Array<{ name: string; value: number[]; count: number }>;
|
||||
}
|
||||
|
||||
export function queryDataOverview() {
|
||||
return axios.post<DataOverviewRes>('/api/data-overview');
|
||||
}
|
||||
@@ -2,23 +2,6 @@ import localeMessageBox from '@/components/message-box/locale/en-US';
|
||||
import localeLogin from '@/views/login/locale/en-US';
|
||||
|
||||
import localeWorkplace from '@/views/dashboard/workplace/locale/en-US';
|
||||
/** simple */
|
||||
import localeMonitor from '@/views/dashboard/monitor/locale/en-US';
|
||||
|
||||
import localeSearchTable from '@/views/list/search-table/locale/en-US';
|
||||
import localeCardList from '@/views/list/card/locale/en-US';
|
||||
|
||||
import localeStepForm from '@/views/form/step/locale/en-US';
|
||||
import localeGroupForm from '@/views/form/group/locale/en-US';
|
||||
|
||||
import localeBasicProfile from '@/views/profile/basic/locale/en-US';
|
||||
|
||||
import localeDataAnalysis from '@/views/visualization/data-analysis/locale/en-US';
|
||||
import localeMultiDAnalysis from '@/views/visualization/multi-dimension-data-analysis/locale/en-US';
|
||||
|
||||
import localeSuccess from '@/views/result/success/locale/en-US';
|
||||
import localeError from '@/views/result/error/locale/en-US';
|
||||
|
||||
import locale403 from '@/views/exception/403/locale/en-US';
|
||||
import locale404 from '@/views/exception/404/locale/en-US';
|
||||
import locale500 from '@/views/exception/500/locale/en-US';
|
||||
@@ -77,17 +60,6 @@ export default {
|
||||
...localeMessageBox,
|
||||
...localeLogin,
|
||||
...localeWorkplace,
|
||||
/** simple */
|
||||
...localeMonitor,
|
||||
...localeSearchTable,
|
||||
...localeCardList,
|
||||
...localeStepForm,
|
||||
...localeGroupForm,
|
||||
...localeBasicProfile,
|
||||
...localeDataAnalysis,
|
||||
...localeMultiDAnalysis,
|
||||
...localeSuccess,
|
||||
...localeError,
|
||||
...locale403,
|
||||
...locale404,
|
||||
...locale500,
|
||||
|
||||
@@ -2,23 +2,6 @@ import localeMessageBox from '@/components/message-box/locale/zh-CN';
|
||||
import localeLogin from '@/views/login/locale/zh-CN';
|
||||
|
||||
import localeWorkplace from '@/views/dashboard/workplace/locale/zh-CN';
|
||||
/** simple */
|
||||
import localeMonitor from '@/views/dashboard/monitor/locale/zh-CN';
|
||||
|
||||
import localeSearchTable from '@/views/list/search-table/locale/zh-CN';
|
||||
import localeCardList from '@/views/list/card/locale/zh-CN';
|
||||
|
||||
import localeStepForm from '@/views/form/step/locale/zh-CN';
|
||||
import localeGroupForm from '@/views/form/group/locale/zh-CN';
|
||||
|
||||
import localeBasicProfile from '@/views/profile/basic/locale/zh-CN';
|
||||
|
||||
import localeDataAnalysis from '@/views/visualization/data-analysis/locale/zh-CN';
|
||||
import localeMultiDAnalysis from '@/views/visualization/multi-dimension-data-analysis/locale/zh-CN';
|
||||
|
||||
import localeSuccess from '@/views/result/success/locale/zh-CN';
|
||||
import localeError from '@/views/result/error/locale/zh-CN';
|
||||
|
||||
import locale403 from '@/views/exception/403/locale/zh-CN';
|
||||
import locale404 from '@/views/exception/404/locale/zh-CN';
|
||||
import locale500 from '@/views/exception/500/locale/zh-CN';
|
||||
@@ -77,17 +60,6 @@ export default {
|
||||
...localeMessageBox,
|
||||
...localeLogin,
|
||||
...localeWorkplace,
|
||||
/** simple */
|
||||
...localeMonitor,
|
||||
...localeSearchTable,
|
||||
...localeCardList,
|
||||
...localeStepForm,
|
||||
...localeGroupForm,
|
||||
...localeBasicProfile,
|
||||
...localeDataAnalysis,
|
||||
...localeMultiDAnalysis,
|
||||
...localeSuccess,
|
||||
...localeError,
|
||||
...locale403,
|
||||
...locale404,
|
||||
...locale500,
|
||||
|
||||
@@ -6,7 +6,6 @@ import router from './router';
|
||||
import store from './store';
|
||||
import i18n from './locale';
|
||||
import directive from './directive';
|
||||
import './mock';
|
||||
import App from './App.vue';
|
||||
// Styles are imported via arco-plugin. See config/plugin/arcoStyleImport.ts in the directory for details
|
||||
// 样式通过 arco-plugin 插件导入。详见目录文件 config/plugin/arcoStyleImport.ts
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
|
||||
import './user';
|
||||
import './message-box';
|
||||
|
||||
import '@/views/dashboard/workplace/mock';
|
||||
/** simple */
|
||||
import '@/views/dashboard/monitor/mock';
|
||||
|
||||
import '@/views/list/card/mock';
|
||||
import '@/views/list/search-table/mock';
|
||||
|
||||
import '@/views/form/step/mock';
|
||||
|
||||
import '@/views/profile/basic/mock';
|
||||
|
||||
import '@/views/visualization/data-analysis/mock';
|
||||
import '@/views/visualization/multi-dimension-data-analysis/mock';
|
||||
|
||||
import '@/views/user/info/mock';
|
||||
import '@/views/user/setting/mock';
|
||||
/** simple end */
|
||||
|
||||
Mock.setup({
|
||||
timeout: '600-1000',
|
||||
});
|
||||
@@ -1,85 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
|
||||
const haveReadIds: number[] = [];
|
||||
const getMessageList = () => {
|
||||
return [
|
||||
{
|
||||
id: 1,
|
||||
type: 'message',
|
||||
title: '郑曦月',
|
||||
subTitle: '的私信',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/8361eeb82904210b4f55fab888fe8416.png~tplv-uwbnlip3yd-webp.webp',
|
||||
content: '审批请求已发送,请查收',
|
||||
time: '今天 12:30:01',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
type: 'message',
|
||||
title: '宁波',
|
||||
subTitle: '的回复',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
content: '此处 bug 已经修复',
|
||||
time: '今天 12:30:01',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
type: 'message',
|
||||
title: '宁波',
|
||||
subTitle: '的回复',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
content: '此处 bug 已经修复',
|
||||
time: '今天 12:20:01',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
type: 'notice',
|
||||
title: '续费通知',
|
||||
subTitle: '',
|
||||
avatar: '',
|
||||
content: '您的产品使用期限即将截止,如需继续使用产品请前往购…',
|
||||
time: '今天 12:20:01',
|
||||
messageType: 3,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
type: 'notice',
|
||||
title: '规则开通成功',
|
||||
subTitle: '',
|
||||
avatar: '',
|
||||
content: '内容屏蔽规则于 2021-12-01 开通成功并生效',
|
||||
time: '今天 12:20:01',
|
||||
messageType: 1,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
type: 'todo',
|
||||
title: '质检队列变更',
|
||||
subTitle: '',
|
||||
avatar: '',
|
||||
content: '内容质检队列于 2021-12-01 19:50:23 进行变更,请重新…',
|
||||
time: '今天 12:20:01',
|
||||
messageType: 0,
|
||||
},
|
||||
].map((item) => ({
|
||||
...item,
|
||||
status: haveReadIds.indexOf(item.id) === -1 ? 0 : 1,
|
||||
}));
|
||||
};
|
||||
|
||||
setupMock({
|
||||
setup: () => {
|
||||
Mock.mock(new RegExp('/api/message/list'), () => {
|
||||
return successResponseWrap(getMessageList());
|
||||
});
|
||||
|
||||
Mock.mock(new RegExp('/api/message/read'), (params: { body: string }) => {
|
||||
const { ids } = JSON.parse(params.body);
|
||||
haveReadIds.push(...(ids || []));
|
||||
return successResponseWrap(true);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,105 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, {
|
||||
successResponseWrap,
|
||||
failResponseWrap,
|
||||
} from '@/utils/setup-mock';
|
||||
|
||||
import { MockParams } from '@/types/mock';
|
||||
import { isLogin } from '@/utils/auth';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
// Mock.XHR.prototype.withCredentials = true;
|
||||
|
||||
// 用户信息
|
||||
Mock.mock(new RegExp('/api/user/info'), () => {
|
||||
if (isLogin()) {
|
||||
const role = window.localStorage.getItem('userRole') || 'admin';
|
||||
return successResponseWrap({
|
||||
name: 'admin',
|
||||
avatar:
|
||||
'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="50" fill="%23165DFF"/><text x="50" y="62" font-size="36" text-anchor="middle" fill="white" font-family="sans-serif">AD</text></svg>',
|
||||
email: 'wangliqun@email.com',
|
||||
job: 'frontend',
|
||||
jobName: '前端艺术家',
|
||||
organization: 'Frontend',
|
||||
organizationName: '前端',
|
||||
location: 'beijing',
|
||||
locationName: '北京',
|
||||
introduction: '人潇洒,性温存',
|
||||
personalWebsite: 'https://www.arco.design',
|
||||
phone: '150****0000',
|
||||
registrationDate: '2013-05-10 12:10:00',
|
||||
accountId: '15012312300',
|
||||
certification: 1,
|
||||
role,
|
||||
});
|
||||
}
|
||||
return failResponseWrap(null, '未登录', 50008);
|
||||
});
|
||||
|
||||
// 登录
|
||||
Mock.mock(new RegExp('/api/user/login'), (params: MockParams) => {
|
||||
const { username, password } = JSON.parse(params.body);
|
||||
if (!username) {
|
||||
return failResponseWrap(null, '用户名不能为空', 50000);
|
||||
}
|
||||
if (!password) {
|
||||
return failResponseWrap(null, '密码不能为空', 50000);
|
||||
}
|
||||
if (username === 'admin' && password === 'admin') {
|
||||
window.localStorage.setItem('userRole', 'admin');
|
||||
return successResponseWrap({
|
||||
token: '12345',
|
||||
});
|
||||
}
|
||||
if (username === 'user' && password === 'user') {
|
||||
window.localStorage.setItem('userRole', 'user');
|
||||
return successResponseWrap({
|
||||
token: '54321',
|
||||
});
|
||||
}
|
||||
return failResponseWrap(null, '账号或者密码错误', 50000);
|
||||
});
|
||||
|
||||
// 登出
|
||||
Mock.mock(new RegExp('/api/user/logout'), () => {
|
||||
return successResponseWrap(null);
|
||||
});
|
||||
|
||||
// 用户的服务端菜单
|
||||
Mock.mock(new RegExp('/api/user/menu'), () => {
|
||||
const menuList = [
|
||||
{
|
||||
path: '/dashboard',
|
||||
name: 'dashboard',
|
||||
meta: {
|
||||
locale: 'menu.server.dashboard',
|
||||
requiresAuth: true,
|
||||
icon: 'icon-dashboard',
|
||||
order: 1,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'workplace',
|
||||
name: 'Workplace',
|
||||
meta: {
|
||||
locale: 'menu.server.workplace',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'https://arco.design',
|
||||
name: 'arcoWebsite',
|
||||
meta: {
|
||||
locale: 'menu.arcoWebsite',
|
||||
requiresAuth: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
return successResponseWrap(menuList);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,39 +0,0 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const FORM: AppRouteRecordRaw = {
|
||||
path: '/form',
|
||||
name: 'form',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.form',
|
||||
icon: 'icon-settings',
|
||||
requiresAuth: true,
|
||||
order: 3,
|
||||
hideInMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'step',
|
||||
name: 'Step',
|
||||
component: () => import('@/views/form/step/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.form.step',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'group',
|
||||
name: 'Group',
|
||||
component: () => import('@/views/form/group/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.form.group',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default FORM;
|
||||
@@ -1,39 +0,0 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const LIST: AppRouteRecordRaw = {
|
||||
path: '/list',
|
||||
name: 'list',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.list',
|
||||
requiresAuth: true,
|
||||
icon: 'icon-list',
|
||||
order: 2,
|
||||
hideInMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'search-table', // The midline path complies with SEO specifications
|
||||
name: 'SearchTable',
|
||||
component: () => import('@/views/list/search-table/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.list.searchTable',
|
||||
requiresAuth: true,
|
||||
roles: ['*'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'card',
|
||||
name: 'Card',
|
||||
component: () => import('@/views/list/card/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.list.cardList',
|
||||
requiresAuth: true,
|
||||
roles: ['*'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default LIST;
|
||||
@@ -1,29 +0,0 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const PROFILE: AppRouteRecordRaw = {
|
||||
path: '/profile',
|
||||
name: 'profile',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.profile',
|
||||
requiresAuth: true,
|
||||
icon: 'icon-file',
|
||||
order: 4,
|
||||
hideInMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'basic',
|
||||
name: 'Basic',
|
||||
component: () => import('@/views/profile/basic/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.profile.basic',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default PROFILE;
|
||||
@@ -1,39 +0,0 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const RESULT: AppRouteRecordRaw = {
|
||||
path: '/result',
|
||||
name: 'result',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.result',
|
||||
icon: 'icon-check-circle',
|
||||
requiresAuth: true,
|
||||
order: 5,
|
||||
hideInMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'success',
|
||||
name: 'Success',
|
||||
component: () => import('@/views/result/success/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.result.success',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'error',
|
||||
name: 'Error',
|
||||
component: () => import('@/views/result/error/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.result.error',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default RESULT;
|
||||
@@ -1,40 +0,0 @@
|
||||
import { DEFAULT_LAYOUT } from '../base';
|
||||
import { AppRouteRecordRaw } from '../types';
|
||||
|
||||
const VISUALIZATION: AppRouteRecordRaw = {
|
||||
path: '/visualization',
|
||||
name: 'visualization',
|
||||
component: DEFAULT_LAYOUT,
|
||||
meta: {
|
||||
locale: 'menu.visualization',
|
||||
requiresAuth: true,
|
||||
icon: 'icon-apps',
|
||||
order: 1,
|
||||
hideInMenu: true,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'data-analysis',
|
||||
name: 'DataAnalysis',
|
||||
component: () => import('@/views/visualization/data-analysis/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.visualization.dataAnalysis',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'multi-dimension-data-analysis',
|
||||
name: 'MultiDimensionDataAnalysis',
|
||||
component: () =>
|
||||
import('@/views/visualization/multi-dimension-data-analysis/index.vue'),
|
||||
meta: {
|
||||
locale: 'menu.visualization.multiDimensionDataAnalysis',
|
||||
requiresAuth: true,
|
||||
roles: ['admin'],
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default VISUALIZATION;
|
||||
@@ -1,5 +0,0 @@
|
||||
export interface MockParams {
|
||||
url: string;
|
||||
type: string;
|
||||
body: string;
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
<template>
|
||||
<div :class="['chat-item', itemData.isCollect ? 'chat-item-collected' : '']">
|
||||
<a-space :size="4" direction="vertical" fill>
|
||||
<a-typography-text type="warning">
|
||||
{{ itemData.username }}
|
||||
</a-typography-text>
|
||||
<a-typography-text>{{ itemData.content }}</a-typography-text>
|
||||
<div class="chat-item-footer">
|
||||
<div class="chat-item-time">
|
||||
<a-typography-text type="secondary">
|
||||
{{ itemData.time }}
|
||||
</a-typography-text>
|
||||
</div>
|
||||
<div class="chat-item-actions">
|
||||
<div class="chat-item-actions-item">
|
||||
<icon-command />
|
||||
</div>
|
||||
<div class="chat-item-actions-item chat-item-actions-collect">
|
||||
<icon-star />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PropType } from 'vue';
|
||||
import { ChatRecord } from '@/api/message';
|
||||
|
||||
defineProps({
|
||||
itemData: {
|
||||
type: Object as PropType<ChatRecord>,
|
||||
default() {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.chat-item {
|
||||
padding: 8px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
border-radius: 2px;
|
||||
|
||||
&-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
&-actions {
|
||||
display: flex;
|
||||
opacity: 0;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 4px;
|
||||
color: var(--color-text-3);
|
||||
font-size: 14px;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: rgb(var(--gray-3));
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-collected {
|
||||
.chat-item-actions-collect {
|
||||
color: rgb(var(--gold-6));
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgb(var(--gray-2));
|
||||
|
||||
.chat-item-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,76 +0,0 @@
|
||||
<template>
|
||||
<div class="chat-list">
|
||||
<ChatItem v-for="item in renderList" :key="item.id" :item-data="item" />
|
||||
<a-result v-if="!renderList.length" status="404" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { PropType } from 'vue';
|
||||
import { ChatRecord } from '@/api/message';
|
||||
import ChatItem from './chat-item.vue';
|
||||
|
||||
defineProps({
|
||||
renderList: {
|
||||
type: Array as PropType<ChatRecord[]>,
|
||||
default() {
|
||||
return [];
|
||||
},
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.chat-item {
|
||||
padding: 8px;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
border-radius: 2px;
|
||||
|
||||
&-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
&-actions {
|
||||
display: flex;
|
||||
opacity: 0;
|
||||
|
||||
&-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-right: 4px;
|
||||
color: var(--color-text-3);
|
||||
font-size: 14px;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-color: rgb(var(--gray-3));
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-collected {
|
||||
.message-item-actions-collect {
|
||||
color: rgb(var(--gold-6));
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: rgb(var(--gray-2));
|
||||
|
||||
.message-item-actions {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,79 +0,0 @@
|
||||
<template>
|
||||
<a-card
|
||||
class="general-card chat-panel"
|
||||
:title="$t('monitor.title.chatPanel')"
|
||||
:bordered="false"
|
||||
:header-style="{ paddingBottom: '0' }"
|
||||
:body-style="{
|
||||
height: '100%',
|
||||
paddingTop: '16px',
|
||||
display: 'flex',
|
||||
flexFlow: 'column',
|
||||
}"
|
||||
>
|
||||
<a-space :size="8">
|
||||
<a-select style="width: 86px" default-value="all">
|
||||
<a-option value="all">
|
||||
{{ $t('monitor.chat.options.all') }}
|
||||
</a-option>
|
||||
</a-select>
|
||||
<a-input-search
|
||||
:placeholder="$t('monitor.chat.placeholder.searchCategory')"
|
||||
/>
|
||||
<a-button type="text">
|
||||
<icon-download />
|
||||
</a-button>
|
||||
</a-space>
|
||||
<div class="chat-panel-content">
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<ChatList :render-list="chatData" />
|
||||
</a-spin>
|
||||
</div>
|
||||
<div class="chat-panel-footer">
|
||||
<a-space :size="8">
|
||||
<a-Input>
|
||||
<template #suffix>
|
||||
<icon-face-smile-fill />
|
||||
</template>
|
||||
</a-Input>
|
||||
<a-button type="primary">{{ $t('monitor.chat.update') }}</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { queryChatList, ChatRecord } from '@/api/message';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import ChatList from './chat-list.vue';
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const chatData = ref<ChatRecord[]>([]);
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const { data } = await queryChatList();
|
||||
chatData.value = data;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.chat-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
// padding: 20px;
|
||||
background-color: var(--color-bg-2);
|
||||
|
||||
&-content {
|
||||
flex: 1;
|
||||
margin: 20px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,133 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data="data"
|
||||
row-key="id"
|
||||
:row-selection="{
|
||||
type: 'checkbox',
|
||||
showCheckedAll: true,
|
||||
}"
|
||||
:border="false"
|
||||
:pagination="false"
|
||||
/>
|
||||
<a-typography-text type="secondary" class="data-statistic-list-tip">
|
||||
{{ $t('monitor.list.tip.rotations') }} {{ data.length }}
|
||||
{{ $t('monitor.list.tip.rest') }}
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, h, compile } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import type {
|
||||
TableColumnData,
|
||||
TableData,
|
||||
} from '@arco-design/web-vue/es/table/interface.d';
|
||||
|
||||
interface PreviewRecord {
|
||||
cover: string;
|
||||
name: string;
|
||||
duration: string;
|
||||
id: string;
|
||||
status: number;
|
||||
}
|
||||
const { t } = useI18n();
|
||||
const data: PreviewRecord[] = [
|
||||
{
|
||||
cover:
|
||||
'http://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/c788fc704d32cf3b1136c7d45afc2669.png~tplv-uwbnlip3yd-webp.webp',
|
||||
name: '视频直播',
|
||||
duration: '00:05:19',
|
||||
id: '54e23ade',
|
||||
status: -1,
|
||||
},
|
||||
];
|
||||
const renderTag = (status: number) => {
|
||||
if (status === -1) {
|
||||
return `<a-tag color="red" class='data-statistic-list-cover-tag'>
|
||||
${t('monitor.list.tag.auditFailed')}
|
||||
</a-tag>`;
|
||||
}
|
||||
return '';
|
||||
};
|
||||
// Using the Render function is more flexible than using templates.
|
||||
// But, cannot bind context and local scopes are also lost
|
||||
|
||||
const columns = computed(() => {
|
||||
return [
|
||||
{
|
||||
title: t('monitor.list.title.order'),
|
||||
render({
|
||||
rowIndex,
|
||||
}: {
|
||||
record: TableData;
|
||||
column: TableColumnData;
|
||||
rowIndex: number;
|
||||
}) {
|
||||
const tmp = `<span>${rowIndex + 1}</span>`;
|
||||
return h(compile(tmp));
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('monitor.list.title.cover'),
|
||||
render({
|
||||
record,
|
||||
}: {
|
||||
record: TableData;
|
||||
column: TableColumnData;
|
||||
rowIndex: number;
|
||||
}) {
|
||||
const tmp = `<div class='data-statistic-list-cover-wrapper'>
|
||||
<img src=${record.cover} />
|
||||
${renderTag(record.status)}
|
||||
</div>`;
|
||||
return h(compile(tmp));
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('monitor.list.title.name'),
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
dataIndex: 'duration',
|
||||
title: t('monitor.list.title.duration'),
|
||||
},
|
||||
{
|
||||
dataIndex: 'id',
|
||||
title: t('monitor.list.title.id'),
|
||||
},
|
||||
];
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
// Warning: Here is the global style
|
||||
.data-statistic {
|
||||
&-list {
|
||||
&-cover {
|
||||
&-wrapper {
|
||||
position: relative;
|
||||
height: 68px;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
&-tag {
|
||||
position: absolute;
|
||||
top: 6px;
|
||||
left: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
&-tip {
|
||||
display: block;
|
||||
margin-top: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,56 +0,0 @@
|
||||
<template>
|
||||
<a-card :bordered="false" :body-style="{ padding: '20px' }">
|
||||
<a-tabs default-active-tab="liveMethod">
|
||||
<a-tab-pane
|
||||
key="liveMethod"
|
||||
:title="$t('monitor.tab.title.liveMethod')"
|
||||
/>
|
||||
<a-tab-pane
|
||||
key="onlinePopulation"
|
||||
:title="$t('monitor.tab.title.onlinePopulation')"
|
||||
/>
|
||||
</a-tabs>
|
||||
<div class="data-statistic-content">
|
||||
<a-radio-group :default-value="3" type="button">
|
||||
<a-radio :value="1">{{ $t('monitor.liveMethod.normal') }}</a-radio>
|
||||
<a-radio :value="2">{{ $t('monitor.liveMethod.flowControl') }}</a-radio>
|
||||
<a-radio :value="3">{{ $t('monitor.liveMethod.video') }}</a-radio>
|
||||
<a-radio :value="4">{{ $t('monitor.liveMethod.web') }}</a-radio>
|
||||
</a-radio-group>
|
||||
|
||||
<div class="data-statistic-list-wrapper">
|
||||
<div class="data-statistic-list-header">
|
||||
<a-button type="text">{{ $t('monitor.editCarousel') }}</a-button>
|
||||
<a-button disabled>{{ $t('monitor.startCarousel') }}</a-button>
|
||||
</div>
|
||||
<div class="data-statistic-list-content">
|
||||
<DataStatisticList />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import DataStatisticList from './data-statistic-list.vue';
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.data-statistic {
|
||||
&-content {
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
&-list {
|
||||
&-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
&-content {
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,32 +0,0 @@
|
||||
<template>
|
||||
<a-card class="general-card" :title="$t('monitor.title.quickOperation')">
|
||||
<a-space direction="vertical" fill :size="10">
|
||||
<a-button long>
|
||||
{{ $t('monitor.quickOperation.changeClarity') }}
|
||||
<template #icon>
|
||||
<IconTags />
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button long>
|
||||
{{ $t('monitor.quickOperation.switchStream') }}
|
||||
<template #icon>
|
||||
<IconSwap />
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button long>
|
||||
{{ $t('monitor.quickOperation.removeClarity') }}
|
||||
<template #icon>
|
||||
<IconStop />
|
||||
</template>
|
||||
</a-button>
|
||||
<a-button long>
|
||||
{{ $t('monitor.quickOperation.pushFlowGasket') }}
|
||||
<template #icon>
|
||||
<IconArrowRight />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup></script>
|
||||
@@ -1,34 +0,0 @@
|
||||
<template>
|
||||
<a-card class="general-card" :title="$t('monitor.title.studioInfo')">
|
||||
<a-form :model="{}" layout="vertical">
|
||||
<a-form-item :label="$t('monitor.studioInfo.label.studioTitle')" required>
|
||||
<a-input
|
||||
:placeholder="`admin${$t(
|
||||
'monitor.studioInfo.placeholder.studioTitle'
|
||||
)}`"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="$t('monitor.studioInfo.label.onlineNotification')"
|
||||
required
|
||||
>
|
||||
<a-textarea />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="$t('monitor.studioInfo.label.studioCategory')"
|
||||
required
|
||||
>
|
||||
<a-input-search />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
:label="$t('monitor.studioInfo.label.studioCategory')"
|
||||
required
|
||||
>
|
||||
<a-input-search />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<a-button type="primary">{{ $t('monitor.studioInfo.btn.fresh') }}</a-button>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup></script>
|
||||
@@ -1,84 +0,0 @@
|
||||
<template>
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="$t('monitor.studioStatus.title.studioStatus')"
|
||||
>
|
||||
<template #extra>
|
||||
<a-tag color="green">{{ $t('monitor.studioStatus.smooth') }}</a-tag>
|
||||
</template>
|
||||
<a-descriptions layout="horizontal" :data="dataStatus" :column="2">
|
||||
<template #label="{ label }">
|
||||
<span
|
||||
v-if="['mainstream', 'hotStandby', 'coldStandby'].includes(label)"
|
||||
>
|
||||
<a-typography-text style="padding-right: 8px">
|
||||
{{ $t(`monitor.studioStatus.${label}`) }}
|
||||
</a-typography-text>
|
||||
{{ $t('monitor.studioStatus.bitRate') }}
|
||||
</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</template>
|
||||
</a-descriptions>
|
||||
<a-typography-title style="margin-bottom: 16px" :heading="6">
|
||||
{{ $t('monitor.studioStatus.title.pictureInfo') }}
|
||||
</a-typography-title>
|
||||
<a-descriptions layout="horizontal" :data="dataPicture" :column="2" />
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
const { t } = useI18n();
|
||||
const dataStatus = computed(() => [
|
||||
{
|
||||
label: 'mainstream',
|
||||
value: '6 Mbps',
|
||||
},
|
||||
{
|
||||
label: t('monitor.studioStatus.frameRate'),
|
||||
value: '60',
|
||||
},
|
||||
{
|
||||
label: 'hotStandby',
|
||||
value: '6 Mbps',
|
||||
},
|
||||
{
|
||||
label: t('monitor.studioStatus.frameRate'),
|
||||
value: '60',
|
||||
},
|
||||
{
|
||||
label: 'coldStandby',
|
||||
value: '6 Mbps',
|
||||
},
|
||||
{
|
||||
label: t('monitor.studioStatus.frameRate'),
|
||||
value: '60',
|
||||
},
|
||||
]);
|
||||
const dataPicture = computed(() => [
|
||||
{
|
||||
label: t('monitor.studioStatus.line'),
|
||||
value: '热备',
|
||||
},
|
||||
{
|
||||
label: 'CDN',
|
||||
value: 'KS',
|
||||
},
|
||||
{
|
||||
label: t('monitor.studioStatus.play'),
|
||||
value: 'FLV',
|
||||
},
|
||||
{
|
||||
label: t('monitor.studioStatus.pictureQuality'),
|
||||
value: '原画',
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
:deep(.arco-descriptions-item-label) {
|
||||
padding-right: 6px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,51 +0,0 @@
|
||||
<template>
|
||||
<a-card class="general-card" :title="$t('monitor.title.studioPreview')">
|
||||
<template #extra>
|
||||
<icon-more />
|
||||
</template>
|
||||
<div class="studio-wrapper">
|
||||
<img
|
||||
src="http://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/c788fc704d32cf3b1136c7d45afc2669.png~tplv-uwbnlip3yd-webp.webp"
|
||||
class="studio-preview"
|
||||
/>
|
||||
<div class="studio-bar">
|
||||
<div v-if="userInfo">
|
||||
<a-space :size="12">
|
||||
<a-avatar :size="24">
|
||||
<img :src="userInfo.avatar" />
|
||||
</a-avatar>
|
||||
<a-typography-text>
|
||||
{{ userInfo.name }} {{ $t('monitor.studioPreview.studio') }}
|
||||
</a-typography-text>
|
||||
</a-space>
|
||||
</div>
|
||||
<a-typography-text type="secondary">
|
||||
36,000 {{ $t('monitor.studioPreview.watching') }}
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useUserStore } from '@/store';
|
||||
|
||||
const userInfo = useUserStore();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.studio {
|
||||
&-preview {
|
||||
display: block;
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,87 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.dashboard', 'menu.dashboard.monitor']" />
|
||||
<div class="layout">
|
||||
<div class="layout-left-side">
|
||||
<ChatPanel />
|
||||
</div>
|
||||
<div class="layout-content">
|
||||
<a-space :size="16" direction="vertical" fill>
|
||||
<Studio />
|
||||
<DataStatistic />
|
||||
</a-space>
|
||||
</div>
|
||||
<div class="layout-right-side">
|
||||
<a-space :size="16" direction="vertical" fill>
|
||||
<StudioStatus />
|
||||
<QuickOperation />
|
||||
<StudioInformation />
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ChatPanel from './components/chat-panel.vue';
|
||||
import Studio from './components/studio.vue';
|
||||
import DataStatistic from './components/data-statistic.vue';
|
||||
import StudioStatus from './components/studio-status.vue';
|
||||
import QuickOperation from './components/quick-operation.vue';
|
||||
import StudioInformation from './components/studio-information.vue';
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Monitor',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
|
||||
.layout {
|
||||
display: flex;
|
||||
|
||||
&-left-side {
|
||||
flex-basis: 300px;
|
||||
}
|
||||
|
||||
&-content {
|
||||
flex: 1;
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
&-right-side {
|
||||
flex-basis: 280px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less" scoped>
|
||||
// responsive
|
||||
@media (max-width: @screen-lg) {
|
||||
.layout {
|
||||
flex-wrap: wrap;
|
||||
&-left-side {
|
||||
flex: 1;
|
||||
flex-basis: 100%;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
&-content {
|
||||
flex: none;
|
||||
flex-basis: 100%;
|
||||
padding: 0;
|
||||
order: -1;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
&-right-side {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,48 +0,0 @@
|
||||
export default {
|
||||
'menu.dashboard.monitor': 'Real-time Monitor',
|
||||
'monitor.title.chatPanel': 'Chat Window',
|
||||
'monitor.title.quickOperation': 'Quick Operation',
|
||||
'monitor.title.studioInfo': 'Studio Information',
|
||||
'monitor.title.studioPreview': 'Studio Preview',
|
||||
'monitor.chat.options.all': 'All',
|
||||
'monitor.chat.placeholder.searchCategory': 'Search Category',
|
||||
'monitor.chat.update': 'Update',
|
||||
'monitor.list.title.order': 'Order',
|
||||
'monitor.list.title.cover': 'Cover',
|
||||
'monitor.list.title.name': 'Name',
|
||||
'monitor.list.title.duration': 'Duration',
|
||||
'monitor.list.title.id': 'ID',
|
||||
'monitor.list.tip.rotations': 'Rotations ',
|
||||
'monitor.list.tip.rest': ', The program list is not visible to viewers',
|
||||
'monitor.list.tag.auditFailed': 'Audit Failed',
|
||||
'monitor.tab.title.liveMethod': 'Live Method',
|
||||
'monitor.tab.title.onlinePopulation': 'Online Population',
|
||||
'monitor.liveMethod.normal': 'Normal Live',
|
||||
'monitor.liveMethod.flowControl': 'Flow Control Live',
|
||||
'monitor.liveMethod.video': 'Video Live',
|
||||
'monitor.liveMethod.web': 'Web Live',
|
||||
'monitor.editCarousel': 'Edit',
|
||||
'monitor.startCarousel': 'Start',
|
||||
'monitor.quickOperation.changeClarity': 'Change the Clarity',
|
||||
'monitor.quickOperation.switchStream': 'Switch Stream',
|
||||
'monitor.quickOperation.removeClarity': 'Remove the Clarity',
|
||||
'monitor.quickOperation.pushFlowGasket': 'Push Flow Gasket',
|
||||
'monitor.studioInfo.label.studioTitle': 'Studio Title',
|
||||
'monitor.studioInfo.label.onlineNotification': 'Online Notification',
|
||||
'monitor.studioInfo.label.studioCategory': 'Studio Category',
|
||||
'monitor.studioInfo.placeholder.studioTitle': "'s Studio",
|
||||
'monitor.studioInfo.btn.fresh': 'Fresh',
|
||||
'monitor.studioStatus.title.studioStatus': 'Studio Status',
|
||||
'monitor.studioStatus.title.pictureInfo': 'Picture Information',
|
||||
'monitor.studioStatus.smooth': 'Smooth',
|
||||
'monitor.studioStatus.frameRate': 'Frame',
|
||||
'monitor.studioStatus.bitRate': 'Bit',
|
||||
'monitor.studioStatus.mainstream': 'Main',
|
||||
'monitor.studioStatus.hotStandby': 'Hot',
|
||||
'monitor.studioStatus.coldStandby': 'Cold',
|
||||
'monitor.studioStatus.line': 'Line',
|
||||
'monitor.studioStatus.play': 'Format',
|
||||
'monitor.studioStatus.pictureQuality': 'Quality',
|
||||
'monitor.studioPreview.studio': 'Studio',
|
||||
'monitor.studioPreview.watching': 'watching',
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
export default {
|
||||
'menu.dashboard.monitor': '实时监控',
|
||||
'monitor.title.chatPanel': '聊天窗口',
|
||||
'monitor.title.quickOperation': '快捷操作',
|
||||
'monitor.title.studioInfo': '直播信息',
|
||||
'monitor.title.studioPreview': '直播预览',
|
||||
'monitor.chat.options.all': '全部',
|
||||
'monitor.chat.placeholder.searchCategory': '搜索类目',
|
||||
'monitor.chat.update': '更新',
|
||||
'monitor.list.title.order': '序号',
|
||||
'monitor.list.title.cover': '封面',
|
||||
'monitor.list.title.name': '名称',
|
||||
'monitor.list.title.duration': '视频时长',
|
||||
'monitor.list.title.id': '视频Id',
|
||||
'monitor.list.tip.rotations': '轮播次数',
|
||||
'monitor.list.tip.rest': ',节目单观众不可见',
|
||||
'monitor.list.tag.auditFailed': '审核未通过',
|
||||
'monitor.tab.title.liveMethod': '直播方式',
|
||||
'monitor.tab.title.onlinePopulation': '在线人数',
|
||||
'monitor.liveMethod.normal': '普通直播',
|
||||
'monitor.liveMethod.flowControl': '控流直播',
|
||||
'monitor.liveMethod.video': '视频直播',
|
||||
'monitor.liveMethod.web': '网页开播',
|
||||
'monitor.editCarousel': '编辑轮播',
|
||||
'monitor.startCarousel': '开始轮播',
|
||||
'monitor.quickOperation.changeClarity': '切换清晰度',
|
||||
'monitor.quickOperation.switchStream': '主备流切换',
|
||||
'monitor.quickOperation.removeClarity': '摘除清晰度',
|
||||
'monitor.quickOperation.pushFlowGasket': '推流垫片',
|
||||
'monitor.studioInfo.label.studioTitle': '直播标题',
|
||||
'monitor.studioInfo.label.onlineNotification': '上线通知',
|
||||
'monitor.studioInfo.label.studioCategory': '直播类目',
|
||||
'monitor.studioInfo.placeholder.studioTitle': '的直播间',
|
||||
'monitor.studioInfo.btn.fresh': '更新',
|
||||
'monitor.studioStatus.title.studioStatus': '直播状态',
|
||||
'monitor.studioStatus.title.pictureInfo': '画面信息',
|
||||
'monitor.studioStatus.smooth': '流畅',
|
||||
'monitor.studioStatus.frameRate': '帧率',
|
||||
'monitor.studioStatus.bitRate': '码率',
|
||||
'monitor.studioStatus.mainstream': '主流',
|
||||
'monitor.studioStatus.hotStandby': '热备',
|
||||
'monitor.studioStatus.coldStandby': '冷备',
|
||||
'monitor.studioStatus.line': '线路',
|
||||
'monitor.studioStatus.play': '播放格式',
|
||||
'monitor.studioStatus.pictureQuality': '画质',
|
||||
'monitor.studioPreview.studio': '直播间',
|
||||
'monitor.studioPreview.watching': '在看',
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
|
||||
import setupMock, {
|
||||
successResponseWrap,
|
||||
// failResponseWrap,
|
||||
} from '@/utils/setup-mock';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(new RegExp('/api/chat/list'), () => {
|
||||
// return failResponseWrap(null, '重新登陆', 50008);
|
||||
const data = Mock.mock({
|
||||
'data|4-6': [
|
||||
{
|
||||
'id|+1': 1,
|
||||
'username': '用户7352772',
|
||||
'content': '马上就开始了,好激动!',
|
||||
'time': '13:09:12',
|
||||
'isCollect|2': true,
|
||||
},
|
||||
],
|
||||
});
|
||||
return successResponseWrap(data.data);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,224 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card
|
||||
class="general-card"
|
||||
:header-style="{ paddingBottom: 0 }"
|
||||
:body-style="{
|
||||
paddingTop: '20px',
|
||||
}"
|
||||
:title="$t('workplace.contentData')"
|
||||
>
|
||||
<template #extra>
|
||||
<a-link>{{ $t('workplace.viewMore') }}</a-link>
|
||||
</template>
|
||||
<a-alert v-if="loadFailed" type="error" style="margin-bottom: 12px">
|
||||
近 7 日成交走势加载失败,图表暂不可用;请刷新页面或检查服务端接口。
|
||||
</a-alert>
|
||||
<Chart v-else height="289px" :option="chartOption" />
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { graphic } from 'echarts';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryContentData, ContentDataRecord } from '@/api/dashboard';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
import { ToolTipFormatterParams } from '@/types/echarts';
|
||||
import { AnyObject } from '@/types/global';
|
||||
|
||||
function graphicFactory(side: AnyObject) {
|
||||
return {
|
||||
type: 'text',
|
||||
bottom: '8',
|
||||
...side,
|
||||
style: {
|
||||
text: '',
|
||||
textAlign: 'center',
|
||||
fill: '#4E5969',
|
||||
fontSize: 12,
|
||||
},
|
||||
};
|
||||
}
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const loadFailed = ref(false);
|
||||
const xAxis = ref<string[]>([]);
|
||||
const chartsData = ref<number[]>([]);
|
||||
const graphicElements = ref([
|
||||
graphicFactory({ left: '2.6%' }),
|
||||
graphicFactory({ right: 0 }),
|
||||
]);
|
||||
const { chartOption } = useChartOption(() => {
|
||||
return {
|
||||
grid: {
|
||||
left: '2.6%',
|
||||
right: '0',
|
||||
top: '10',
|
||||
bottom: '30',
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
offset: 2,
|
||||
data: xAxis.value,
|
||||
boundaryGap: false,
|
||||
axisLabel: {
|
||||
color: '#4E5969',
|
||||
formatter(value: number, idx: number) {
|
||||
if (idx === 0) return '';
|
||||
if (idx === xAxis.value.length - 1) return '';
|
||||
return `${value}`;
|
||||
},
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
interval: (idx: number) => {
|
||||
if (idx === 0) return false;
|
||||
if (idx === xAxis.value.length - 1) return false;
|
||||
return true;
|
||||
},
|
||||
lineStyle: {
|
||||
color: '#E5E8EF',
|
||||
},
|
||||
},
|
||||
axisPointer: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#23ADFF',
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
formatter(value: any, idx: number) {
|
||||
if (idx === 0) return value;
|
||||
return `${value}k`;
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
type: 'dashed',
|
||||
color: '#E5E8EF',
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter(params) {
|
||||
const [firstElement] = params as ToolTipFormatterParams[];
|
||||
return `<div>
|
||||
<p class="tooltip-title">${firstElement.axisValueLabel}</p>
|
||||
<div class="content-panel"><span>总内容量</span><span class="tooltip-value">${(
|
||||
Number(firstElement.value) * 10000
|
||||
).toLocaleString()}</span></div>
|
||||
</div>`;
|
||||
},
|
||||
className: 'echarts-tooltip-diy',
|
||||
},
|
||||
graphic: {
|
||||
elements: graphicElements.value,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: chartsData.value,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
// symbol: 'circle',
|
||||
symbolSize: 12,
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
},
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3,
|
||||
color: new graphic.LinearGradient(0, 0, 1, 0, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgba(30, 231, 255, 1)',
|
||||
},
|
||||
{
|
||||
offset: 0.5,
|
||||
color: 'rgba(36, 154, 255, 1)',
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgba(111, 66, 251, 1)',
|
||||
},
|
||||
]),
|
||||
},
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
color: new graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{
|
||||
offset: 0,
|
||||
color: 'rgba(17, 126, 255, 0.16)',
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: 'rgba(17, 128, 255, 0)',
|
||||
},
|
||||
]),
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
const fetchData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res: any = await axios.get('/api/dashboard/stats');
|
||||
const trend =
|
||||
res && res.data && Array.isArray(res.data.recentGmvTrend)
|
||||
? res.data.recentGmvTrend
|
||||
: [];
|
||||
if (trend.length === 0) {
|
||||
// 不再以硬编码假走势兜底
|
||||
loadFailed.value = true;
|
||||
xAxis.value = [];
|
||||
chartsData.value = [];
|
||||
Message.error('近 7 日成交走势暂无可展示数据,请刷新重试');
|
||||
return;
|
||||
}
|
||||
loadFailed.value = false;
|
||||
xAxis.value = [];
|
||||
chartsData.value = [];
|
||||
trend.forEach((el: any, idx: number) => {
|
||||
xAxis.value.push(el.date);
|
||||
chartsData.value.push(el.gmv);
|
||||
if (idx === 0) {
|
||||
graphicElements.value[0].style.text = el.date;
|
||||
}
|
||||
if (idx === trend.length - 1) {
|
||||
graphicElements.value[1].style.text = el.date;
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
loadFailed.value = true;
|
||||
xAxis.value = [];
|
||||
chartsData.value = [];
|
||||
Message.error('近 7 日成交走势加载失败,请刷新重试');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,174 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card
|
||||
class="general-card"
|
||||
:header-style="{ paddingBottom: '0' }"
|
||||
:body-style="{ padding: '17px 20px 21px 20px' }"
|
||||
>
|
||||
<template #title>
|
||||
热门同城组局与履约看板
|
||||
</template>
|
||||
<template #extra>
|
||||
<router-link to="/activity/list">
|
||||
<a-link>进入组局监管</a-link>
|
||||
</router-link>
|
||||
</template>
|
||||
<a-space direction="vertical" :size="10" fill>
|
||||
<a-radio-group
|
||||
v-model:model-value="categoryFilter"
|
||||
type="button"
|
||||
size="small"
|
||||
>
|
||||
<a-radio value="all">全产品类</a-radio>
|
||||
<a-radio value="同城陪吃">同城陪吃</a-radio>
|
||||
<a-radio value="同城陪喝">同城陪喝</a-radio>
|
||||
<a-radio value="KTV陪唱">KTV陪唱</a-radio>
|
||||
<a-radio value="线上电竞">线上电竞</a-radio>
|
||||
</a-radio-group>
|
||||
<a-table
|
||||
:data="filteredList"
|
||||
:pagination="false"
|
||||
:bordered="false"
|
||||
:scroll="{ x: '100%', y: '264px' }"
|
||||
size="small"
|
||||
>
|
||||
<template #columns>
|
||||
<a-table-column title="组局活动" data-index="title">
|
||||
<template #cell="{ record }">
|
||||
<div>
|
||||
<a-typography-text bold style="font-size: 13px">{{ record.title }}</a-typography-text>
|
||||
<div style="font-size: 12px; color: var(--color-text-3)">{{ record.location }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column title="品类" data-index="category" :width="100">
|
||||
<template #cell="{ record }">
|
||||
<a-tag :color="getCategoryColor(record.category)" size="small">{{ record.category }}</a-tag>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column title="人均预算" data-index="fee" :width="95">
|
||||
<template #cell="{ record }">
|
||||
<span style="color: #ff5722; font-weight: 600">¥{{ record.fee }}</span>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column title="报名人数" data-index="joined" :width="95">
|
||||
<template #cell="{ record }">
|
||||
<span>{{ record.joined }} / {{ record.max }}人</span>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column title="状态" data-index="status" :width="95">
|
||||
<template #cell="{ record }">
|
||||
<a-tag :color="getStatusColor(record.status)" size="small">
|
||||
{{ record.status }}
|
||||
</a-tag>
|
||||
</template>
|
||||
</a-table-column>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-space>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
|
||||
const loading = ref(false);
|
||||
const categoryFilter = ref('all');
|
||||
|
||||
const rawList = ref([
|
||||
{
|
||||
id: 'act_101',
|
||||
title: '三里屯聚宝源铜锅涮肉AA局 · 8人热烈局',
|
||||
location: '朝阳区三里屯太古里北区',
|
||||
category: '同城陪吃',
|
||||
fee: 158,
|
||||
joined: 4,
|
||||
max: 4,
|
||||
status: '现场核销中',
|
||||
},
|
||||
{
|
||||
id: 'act_102',
|
||||
title: '工体纯K沉浸式麦霸欢唱 · 寻找甜美副唱',
|
||||
location: '工体西路8号纯KTV 888豪华包',
|
||||
category: 'KTV陪唱',
|
||||
fee: 288,
|
||||
joined: 3,
|
||||
max: 3,
|
||||
status: '履约中',
|
||||
},
|
||||
{
|
||||
id: 'act_103',
|
||||
title: '望京合生麒麟社微醺清吧精酿品鉴',
|
||||
location: '望京街道合生麒麟社地库B1跳海酒馆',
|
||||
category: '同城陪喝',
|
||||
fee: 198,
|
||||
joined: 2,
|
||||
max: 4,
|
||||
status: '招募中',
|
||||
},
|
||||
{
|
||||
id: 'act_104',
|
||||
title: '王者荣耀巅峰赛百星车队5排开黑',
|
||||
location: '线上语音频道房间 #9021',
|
||||
category: '线上电竞',
|
||||
fee: 88,
|
||||
joined: 5,
|
||||
max: 5,
|
||||
status: '已结束',
|
||||
},
|
||||
{
|
||||
id: 'act_105',
|
||||
title: '国贸大厦云端高端西餐双人体验局',
|
||||
location: '朝阳区国贸商城三期80层餐厅',
|
||||
category: '同城陪吃',
|
||||
fee: 480,
|
||||
joined: 2,
|
||||
max: 2,
|
||||
status: '现场核销中',
|
||||
},
|
||||
]);
|
||||
|
||||
const filteredList = computed(() => {
|
||||
if (categoryFilter.value === 'all') {
|
||||
return rawList.value;
|
||||
}
|
||||
return rawList.value.filter((item) => item.category === categoryFilter.value);
|
||||
});
|
||||
|
||||
const getCategoryColor = (cat: string) => {
|
||||
switch (cat) {
|
||||
case '同城陪吃':
|
||||
return 'blue';
|
||||
case '同城陪喝':
|
||||
return 'orange';
|
||||
case 'KTV陪唱':
|
||||
return 'purple';
|
||||
case '线上电竞':
|
||||
return 'green';
|
||||
default:
|
||||
return 'arcoblue';
|
||||
}
|
||||
};
|
||||
|
||||
const getStatusColor = (status: string) => {
|
||||
switch (status) {
|
||||
case '现场核销中':
|
||||
return 'orangered';
|
||||
case '履约中':
|
||||
return 'cyan';
|
||||
case '招募中':
|
||||
return 'blue';
|
||||
case '已结束':
|
||||
return 'gray';
|
||||
default:
|
||||
return 'arcoblue';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.general-card {
|
||||
min-height: 395px;
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,6 @@
|
||||
<Banner v-model:perspective="activePerspective" />
|
||||
<ActionHub />
|
||||
<DataPanel :perspective="activePerspective" />
|
||||
<ContentChart v-show="activePerspective === 'all' || activePerspective === 'finance'" />
|
||||
</div>
|
||||
|
||||
<a-grid
|
||||
@@ -15,10 +14,7 @@
|
||||
:row-gap="16"
|
||||
style="margin-top: 16px"
|
||||
>
|
||||
<a-grid-item :span="{ xs: 24, sm: 24, md: 24, lg: 13, xl: 13, xxl: 13 }">
|
||||
<PopularContent />
|
||||
</a-grid-item>
|
||||
<a-grid-item :span="{ xs: 24, sm: 24, md: 24, lg: 11, xl: 11, xxl: 11 }">
|
||||
<a-grid-item :span="{ xs: 24, sm: 24, md: 24, lg: 24, xl: 24, xxl: 24 }">
|
||||
<CategoriesPercent />
|
||||
</a-grid-item>
|
||||
</a-grid>
|
||||
@@ -110,8 +106,6 @@
|
||||
import Banner from './components/banner.vue';
|
||||
import ActionHub from './components/action-hub.vue';
|
||||
import DataPanel from './components/data-panel.vue';
|
||||
import ContentChart from './components/content-chart.vue';
|
||||
import PopularContent from './components/popular-content.vue';
|
||||
import CategoriesPercent from './components/categories-percent.vue';
|
||||
import QuickVerifier from './components/quick-verifier.vue';
|
||||
import QuickTodoList from './components/quick-todo-list.vue';
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import qs from 'query-string';
|
||||
import dayjs from 'dayjs';
|
||||
import { GetParams } from '@/types/global';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
|
||||
const textList = [
|
||||
{
|
||||
key: 1,
|
||||
clickNumber: '346.3w+',
|
||||
title: '经济日报:财政政策要精准提升…',
|
||||
increases: 35,
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
clickNumber: '324.2w+',
|
||||
title: '双12遇冷,消费者厌倦了电商平…',
|
||||
increases: 22,
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
clickNumber: '318.9w+',
|
||||
title: '致敬坚守战“疫”一线的社区工作…',
|
||||
increases: 9,
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
clickNumber: '257.9w+',
|
||||
title: '普高还是职高?家长们陷入选择…',
|
||||
increases: 17,
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
clickNumber: '124.2w+',
|
||||
title: '人民快评:没想到“浓眉大眼”的…',
|
||||
increases: 37,
|
||||
},
|
||||
];
|
||||
const imageList = [
|
||||
{
|
||||
key: 1,
|
||||
clickNumber: '15.3w+',
|
||||
title: '杨涛接替陆慷出任外交部美大司…',
|
||||
increases: 15,
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
clickNumber: '12.2w+',
|
||||
title: '图集:龙卷风袭击美国多州房屋…',
|
||||
increases: 26,
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
clickNumber: '18.9w+',
|
||||
title: '52岁大姐贴钱照顾自闭症儿童八…',
|
||||
increases: 9,
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
clickNumber: '7.9w+',
|
||||
title: '杭州一家三口公园宿营取暖中毒',
|
||||
increases: 0,
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
clickNumber: '5.2w+',
|
||||
title: '派出所副所长威胁市民?警方调…',
|
||||
increases: 4,
|
||||
},
|
||||
];
|
||||
const videoList = [
|
||||
{
|
||||
key: 1,
|
||||
clickNumber: '367.6w+',
|
||||
title: '这是今日10点的南京',
|
||||
increases: 5,
|
||||
},
|
||||
{
|
||||
key: 2,
|
||||
clickNumber: '352.2w+',
|
||||
title: '立陶宛不断挑衅致经济受损民众…',
|
||||
increases: 17,
|
||||
},
|
||||
{
|
||||
key: 3,
|
||||
clickNumber: '348.9w+',
|
||||
title: '韩国艺人刘在石确诊新冠',
|
||||
increases: 30,
|
||||
},
|
||||
{
|
||||
key: 4,
|
||||
clickNumber: '346.3w+',
|
||||
title: '关于北京冬奥会,文在寅表态',
|
||||
increases: 12,
|
||||
},
|
||||
{
|
||||
key: 5,
|
||||
clickNumber: '271.2w+',
|
||||
title: '95后现役军人荣立一等功',
|
||||
increases: 2,
|
||||
},
|
||||
];
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(new RegExp('/api/content-data'), () => {
|
||||
const presetData = [58, 81, 53, 90, 64, 88, 49, 79];
|
||||
const getLineData = () => {
|
||||
const count = 8;
|
||||
return new Array(count).fill(0).map((el, idx) => ({
|
||||
x: dayjs()
|
||||
.day(idx - 2)
|
||||
.format('YYYY-MM-DD'),
|
||||
y: presetData[idx],
|
||||
}));
|
||||
};
|
||||
return successResponseWrap([...getLineData()]);
|
||||
});
|
||||
Mock.mock(new RegExp('/api/popular/list'), (params: GetParams) => {
|
||||
const { type = 'text' } = qs.parseUrl(params.url).query;
|
||||
if (type === 'image') {
|
||||
return successResponseWrap([...videoList]);
|
||||
}
|
||||
if (type === 'video') {
|
||||
return successResponseWrap([...imageList]);
|
||||
}
|
||||
return successResponseWrap([...textList]);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,293 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.form', 'menu.form.group']" />
|
||||
<a-form ref="formRef" layout="vertical" :model="formData">
|
||||
<a-space direction="vertical" :size="16">
|
||||
<a-card class="general-card">
|
||||
<template #title>
|
||||
{{ $t('groupForm.title.video') }}
|
||||
</template>
|
||||
<a-row :gutter="80">
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.mode')"
|
||||
field="video.mode"
|
||||
>
|
||||
<a-select :placeholder="$t('groupForm.placeholder.video.mode')">
|
||||
<a-option value="custom">自定义</a-option>
|
||||
<a-option value="mode1">模式1</a-option>
|
||||
<a-option value="mode2">模式2</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.acquisition.resolution')"
|
||||
field="video.acquisition.resolution"
|
||||
>
|
||||
<a-select
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.acquisition.resolution')
|
||||
"
|
||||
>
|
||||
<a-option value="resolution1">分辨率1</a-option>
|
||||
<a-option value="resolution2">分辨率2</a-option>
|
||||
<a-option value="resolution3">分辨率3</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.acquisition.frameRate')"
|
||||
field="video.acquisition.frameRate"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.acquisition.frameRate')
|
||||
"
|
||||
>
|
||||
<template #append> fps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="80">
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.encoding.resolution')"
|
||||
field="video.encoding.resolution"
|
||||
>
|
||||
<a-select
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.encoding.resolution')
|
||||
"
|
||||
>
|
||||
<a-option value="resolution1">分辨率1</a-option>
|
||||
<a-option value="resolution2">分辨率2</a-option>
|
||||
<a-option value="resolution3">分辨率3</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.encoding.rate.min')"
|
||||
field="video.encoding.rate.min"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.encoding.rate.min')
|
||||
"
|
||||
add-after="bps"
|
||||
>
|
||||
<template #append> bps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.encoding.rate.max')"
|
||||
field="video.encoding.rate.max"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.encoding.rate.max')
|
||||
"
|
||||
>
|
||||
<template #append> bps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="80">
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.encoding.rate.default')"
|
||||
field="video.encoding.rate.default"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.encoding.rate.default')
|
||||
"
|
||||
>
|
||||
<template #append> bps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.encoding.frameRate')"
|
||||
field="video.encoding.frameRate"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.encoding.frameRate')
|
||||
"
|
||||
>
|
||||
<template #append> fps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.video.encoding.profile')"
|
||||
field="video.encoding.profile"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.video.encoding.profile')
|
||||
"
|
||||
>
|
||||
<template #append> bps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<a-card class="general-card">
|
||||
<template #title>
|
||||
{{ $t('groupForm.title.audio') }}
|
||||
</template>
|
||||
<a-row :gutter="80">
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.audio.mode')"
|
||||
field="audio.mode"
|
||||
>
|
||||
<a-select :placeholder="$t('groupForm.placeholder.audio.mode')">
|
||||
<a-option value="custom">自定义</a-option>
|
||||
<a-option value="mode1">模式1</a-option>
|
||||
<a-option value="mode2">模式2</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.audio.acquisition.channels')"
|
||||
field="audio.acquisition.channels"
|
||||
>
|
||||
<a-select
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.audio.acquisition.channels')
|
||||
"
|
||||
>
|
||||
<a-option value="1">1</a-option>
|
||||
<a-option value="2">2</a-option>
|
||||
<a-option value="3">3</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.audio.encoding.channels')"
|
||||
field="audio.encoding.channels"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.audio.encoding.channels')
|
||||
"
|
||||
>
|
||||
<template #append> bps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="80">
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.audio.encoding.rate')"
|
||||
field="audio.encoding.rate"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="$t('groupForm.placeholder.audio.encoding.rate')"
|
||||
>
|
||||
<template #append> bps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.audio.encoding.profile')"
|
||||
field="audio.encoding.profile"
|
||||
>
|
||||
<a-input
|
||||
:placeholder="
|
||||
$t('groupForm.placeholder.audio.encoding.profile')
|
||||
"
|
||||
>
|
||||
<template #append> fps </template>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-card>
|
||||
<a-card class="general-card" :bordered="false">
|
||||
<template #title>
|
||||
{{ $t('groupForm.title.description') }}
|
||||
</template>
|
||||
<a-form-item
|
||||
:label="$t('groupForm.form.label.parameterDescription')"
|
||||
field="audio.approvers"
|
||||
>
|
||||
<a-textarea
|
||||
:placeholder="$t('groupForm.placeholder.description')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-card>
|
||||
</a-space>
|
||||
<div class="actions">
|
||||
<a-space>
|
||||
<a-button>
|
||||
{{ $t('groupForm.reset') }}
|
||||
</a-button>
|
||||
<a-button type="primary" :loading="loading" @click="onSubmitClick">
|
||||
{{ $t('groupForm.submit') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||
import useLoading from '@/hooks/loading';
|
||||
|
||||
const formData = ref({});
|
||||
const formRef = ref<FormInstance>();
|
||||
const { loading, setLoading } = useLoading();
|
||||
const onSubmitClick = async () => {
|
||||
const res = await formRef.value?.validate();
|
||||
if (!res) {
|
||||
setLoading(true);
|
||||
}
|
||||
setTimeout(() => {
|
||||
setLoading(false);
|
||||
}, 1000);
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Group',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 40px 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.actions {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 60px;
|
||||
padding: 14px 20px 14px 0;
|
||||
background: var(--color-bg-2);
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
@@ -1,41 +0,0 @@
|
||||
export default {
|
||||
'menu.form.group': 'Group Form',
|
||||
'groupForm.title.video': 'Video Parameters',
|
||||
'groupForm.title.audio': 'Audio Parameters',
|
||||
'groupForm.title.description': 'Enter Description',
|
||||
'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.channels': 'Encoding Channels',
|
||||
'groupForm.placeholder.audio.encoding.channels': 'Enter Range [150, 1800]',
|
||||
'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 [1, 30]',
|
||||
'groupForm.form.label.parameterDescription': 'Parameter Description',
|
||||
// https://vue-i18n.intlify.dev/guide/essentials/syntax.html#list-interpolation
|
||||
'groupForm.placeholder.description': `Please fill in the parameter description with a maximum of 200 words`,
|
||||
'groupForm.submit': 'Submit',
|
||||
'groupForm.reset': 'Reset',
|
||||
'groupForm.submitSuccess': 'Submit Success',
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
export default {
|
||||
'menu.form.group': '分组表单',
|
||||
'groupForm.title.video': '视频参数',
|
||||
'groupForm.title.audio': '音频参数',
|
||||
'groupForm.title.description': '填写说明',
|
||||
'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.channels': '编码声道数',
|
||||
'groupForm.placeholder.audio.encoding.channels': '输入范围[150, 1800]',
|
||||
'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': '输入范围[1, 30]',
|
||||
'groupForm.form.label.parameterDescription': '参数说明',
|
||||
// https://vue-i18n.intlify.dev/guide/essentials/syntax.html#list-interpolation
|
||||
'groupForm.placeholder.description': `请填写参数说明,最多不超多200字。`,
|
||||
'groupForm.submit': '提交',
|
||||
'groupForm.reset': '重置',
|
||||
'groupForm.submitSuccess': '提交成功',
|
||||
};
|
||||
@@ -1,137 +0,0 @@
|
||||
<template>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
class="form"
|
||||
:label-col-props="{ span: 6 }"
|
||||
:wrapper-col-props="{ span: 18 }"
|
||||
>
|
||||
<a-form-item
|
||||
field="activityName"
|
||||
:label="$t('stepForm.form.label.activityName')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.activityName.required'),
|
||||
},
|
||||
{
|
||||
match: /^[a-zA-Z0-9\u4e00-\u9fa5]{1,20}$/,
|
||||
message: $t('stepForm.form.error.activityName.pattern'),
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.activityName"
|
||||
:placeholder="$t('stepForm.placeholder.activityName')"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="channelType"
|
||||
:label="$t('stepForm.form.label.channelType')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.channelType.required'),
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-select
|
||||
v-model="formData.channelType"
|
||||
:placeholder="$t('stepForm.placeholder.channelType')"
|
||||
>
|
||||
<a-option>APP通用渠道</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="promotionTime"
|
||||
:label="$t('stepForm.form.label.promotionTime')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.promotionTime.required'),
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-range-picker v-model="formData.promotionTime" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="promoteLink"
|
||||
:label="$t('stepForm.form.label.promoteLink')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.promoteLink.required'),
|
||||
},
|
||||
{
|
||||
type: 'url',
|
||||
message: $t('stepForm.form.error.promoteLink.pattern'),
|
||||
},
|
||||
]"
|
||||
row-class="keep-margin"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.promoteLink"
|
||||
:placeholder="$t('stepForm.placeholder.promoteLink')"
|
||||
/>
|
||||
<template #help>
|
||||
<span>{{ $t('stepForm.form.tip.promoteLink') }}</span>
|
||||
</template>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<a-button type="primary" @click="onNextClick">
|
||||
{{ $t('stepForm.button.next') }}
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||
import { BaseInfoModel } from '@/api/form';
|
||||
|
||||
const emits = defineEmits(['changeStep']);
|
||||
const formRef = ref<FormInstance>();
|
||||
const formData = ref<BaseInfoModel>({
|
||||
activityName: '',
|
||||
channelType: '',
|
||||
promotionTime: [],
|
||||
promoteLink: 'https://arco.design',
|
||||
});
|
||||
|
||||
const onNextClick = async () => {
|
||||
const res = await formRef.value?.validate();
|
||||
if (!res) {
|
||||
emits('changeStep', 'forward', { ...formData.value });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 20px;
|
||||
.keep-margin {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 64px 0;
|
||||
background-color: var(--color-bg-2);
|
||||
}
|
||||
|
||||
.steps {
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
.form {
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
.form-content {
|
||||
padding: 8px 50px 0 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,151 +0,0 @@
|
||||
<template>
|
||||
<a-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
class="form"
|
||||
:label-col-props="{ span: 6 }"
|
||||
:wrapper-col-props="{ span: 18 }"
|
||||
>
|
||||
<a-form-item
|
||||
field="advertisingSource"
|
||||
:label="$t('stepForm.form.label.advertisingSource')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.advertisingSource.required'),
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.advertisingSource"
|
||||
:placeholder="$t('stepForm.placeholder.advertisingSource')"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="advertisingMedia"
|
||||
:label="$t('stepForm.form.label.advertisingMedia')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.advertisingMedia.required'),
|
||||
},
|
||||
]"
|
||||
>
|
||||
<a-input
|
||||
v-model="formData.advertisingMedia"
|
||||
:placeholder="$t('stepForm.placeholder.advertisingMedia')"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="keyword"
|
||||
:label="$t('stepForm.form.label.keyword')"
|
||||
:rules="[
|
||||
{ required: true, message: $t('stepForm.form.error.keyword.required') },
|
||||
]"
|
||||
>
|
||||
<a-select
|
||||
v-model="formData.keyword"
|
||||
:placeholder="$t('stepForm.placeholder.keyword')"
|
||||
multiple
|
||||
>
|
||||
<a-option>今日头条</a-option>
|
||||
<a-option>火山</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="pushNotify"
|
||||
:label="$t('stepForm.form.label.pushNotify')"
|
||||
:rules="[{ required: true }]"
|
||||
>
|
||||
<a-switch v-model="formData.pushNotify" />
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
field="advertisingContent"
|
||||
:label="$t('stepForm.form.label.advertisingContent')"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: $t('stepForm.form.error.advertisingContent.required'),
|
||||
},
|
||||
{
|
||||
maxLength: 200,
|
||||
message: $t('stepForm.form.error.advertisingContent.maxLength'),
|
||||
},
|
||||
]"
|
||||
row-class="keep-margin"
|
||||
>
|
||||
<a-textarea
|
||||
v-model="formData.advertisingContent"
|
||||
:placeholder="$t('stepForm.placeholder.advertisingContent')"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item>
|
||||
<!-- <a-button type="primary" @click="onNextClick">
|
||||
{{ $t('stepForm.button.next') }}
|
||||
</a-button> -->
|
||||
<a-space>
|
||||
<a-button type="secondary" @click="goPrev">
|
||||
{{ $t('stepForm.button.prev') }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click="onNextClick">
|
||||
{{ $t('stepForm.button.next') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { FormInstance } from '@arco-design/web-vue/es/form';
|
||||
import { ChannelInfoModel } from '@/api/form';
|
||||
|
||||
const emits = defineEmits(['changeStep']);
|
||||
|
||||
const formRef = ref<FormInstance>();
|
||||
const formData = ref<ChannelInfoModel>({
|
||||
advertisingSource: '',
|
||||
advertisingMedia: '',
|
||||
keyword: [],
|
||||
pushNotify: true,
|
||||
advertisingContent: '',
|
||||
});
|
||||
|
||||
const onNextClick = async () => {
|
||||
const res = await formRef.value?.validate();
|
||||
if (!res) {
|
||||
emits('changeStep', 'submit', { ...formData.value });
|
||||
}
|
||||
};
|
||||
const goPrev = () => {
|
||||
emits('changeStep', 'backward');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
.keep-margin {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 64px 0;
|
||||
background-color: var(--color-bg-2);
|
||||
}
|
||||
|
||||
.steps {
|
||||
margin-bottom: 36px;
|
||||
}
|
||||
|
||||
.form {
|
||||
width: 540px;
|
||||
}
|
||||
|
||||
.form-content {
|
||||
padding: 8px 50px 0 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,49 +0,0 @@
|
||||
<template>
|
||||
<div class="success-wrap">
|
||||
<a-result
|
||||
status="success"
|
||||
:title="$t('stepForm.success.title')"
|
||||
:subtitle="$t('stepForm.success.subTitle')"
|
||||
/>
|
||||
<a-space :size="16">
|
||||
<a-button key="view" type="primary">
|
||||
{{ $t('stepForm.button.view') }}
|
||||
</a-button>
|
||||
<a-button key="again" type="secondary" @click="oneMore">
|
||||
{{ $t('stepForm.button.again') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
<div class="details-wrapper">
|
||||
<a-typography-title :heading="6" style="margin-top: 0">
|
||||
{{ $t('stepForm.form.description.title') }}
|
||||
</a-typography-title>
|
||||
<a-typography-paragraph style="margin-bottom: 0">
|
||||
{{ $t('stepForm.form.description.text') }}
|
||||
<a-link href="link">{{ $t('stepForm.button.view') }}</a-link>
|
||||
</a-typography-paragraph>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const emits = defineEmits(['changeStep']);
|
||||
const oneMore = () => {
|
||||
emits('changeStep', 1);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.success-wrap {
|
||||
text-align: center;
|
||||
}
|
||||
:deep(.arco-result) {
|
||||
padding-top: 0;
|
||||
}
|
||||
.details-wrapper {
|
||||
width: 895px;
|
||||
margin-top: 54px;
|
||||
padding: 20px;
|
||||
text-align: left;
|
||||
background-color: var(--color-fill-2);
|
||||
}
|
||||
</style>
|
||||
@@ -1,118 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.form', 'menu.form.step']" />
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card class="general-card">
|
||||
<template #title>
|
||||
{{ $t('stepForm.step.title') }}
|
||||
</template>
|
||||
<div class="wrapper">
|
||||
<a-steps
|
||||
v-model:current="step"
|
||||
style="width: 580px"
|
||||
line-less
|
||||
class="steps"
|
||||
>
|
||||
<a-step :description="$t('stepForm.step.subTitle.baseInfo')">
|
||||
{{ $t('stepForm.step.title.baseInfo') }}
|
||||
</a-step>
|
||||
<a-step :description="$t('stepForm.step.subTitle.channel')">
|
||||
{{ $t('stepForm.step.title.channel') }}
|
||||
</a-step>
|
||||
<a-step :description="$t('stepForm.step.subTitle.finish')">
|
||||
{{ $t('stepForm.step.title.finish') }}
|
||||
</a-step>
|
||||
</a-steps>
|
||||
<keep-alive>
|
||||
<BaseInfo v-if="step === 1" @change-step="changeStep" />
|
||||
<ChannelInfo v-else-if="step === 2" @change-step="changeStep" />
|
||||
<Success v-else-if="step === 3" @change-step="changeStep" />
|
||||
</keep-alive>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import {
|
||||
submitChannelForm,
|
||||
BaseInfoModel,
|
||||
ChannelInfoModel,
|
||||
UnitChannelModel,
|
||||
} from '@/api/form';
|
||||
import BaseInfo from './components/base-info.vue';
|
||||
import ChannelInfo from './components/channel-info.vue';
|
||||
import Success from './components/success.vue';
|
||||
|
||||
const { loading, setLoading } = useLoading(false);
|
||||
const step = ref(1);
|
||||
const submitModel = ref<UnitChannelModel>({} as UnitChannelModel);
|
||||
const submitForm = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
await submitChannelForm(submitModel.value); // The mock api default success
|
||||
step.value = 3;
|
||||
submitModel.value = {} as UnitChannelModel; // init
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const changeStep = (
|
||||
direction: string | number,
|
||||
model: BaseInfoModel | ChannelInfoModel
|
||||
) => {
|
||||
if (typeof direction === 'number') {
|
||||
step.value = direction;
|
||||
return;
|
||||
}
|
||||
|
||||
if (direction === 'forward' || direction === 'submit') {
|
||||
submitModel.value = {
|
||||
...submitModel.value,
|
||||
...model,
|
||||
};
|
||||
if (direction === 'submit') {
|
||||
submitForm();
|
||||
return;
|
||||
}
|
||||
step.value += 1;
|
||||
} else if (direction === 'backward') {
|
||||
step.value -= 1;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Step',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 64px 0;
|
||||
background-color: var(--color-bg-2);
|
||||
:deep(.arco-form) {
|
||||
.arco-form-item {
|
||||
&:last-child {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.steps {
|
||||
margin-bottom: 76px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,66 +0,0 @@
|
||||
export default {
|
||||
'menu.form.step': 'Step Form',
|
||||
'stepForm.step.title': 'Create Channel Forms',
|
||||
'stepForm.step.title.baseInfo': 'Select Basic Information',
|
||||
'stepForm.step.subTitle.baseInfo': 'Channel creation activities',
|
||||
'stepForm.step.title.channel': 'Channel Information',
|
||||
'stepForm.step.subTitle.channel': 'Select upstream of domain',
|
||||
'stepForm.step.title.finish': 'Finish',
|
||||
'stepForm.step.subTitle.finish': 'Submit success',
|
||||
'stepForm.success.title': 'Success',
|
||||
'stepForm.success.subTitle': 'The form is submitted successfully!',
|
||||
'stepForm.button.next': 'Next',
|
||||
'stepForm.button.prev': 'Prev',
|
||||
'stepForm.button.submit': 'Submit',
|
||||
'stepForm.button.again': 'Again',
|
||||
'stepForm.button.view': 'Detail',
|
||||
'stepForm.label.type.web': 'web domain',
|
||||
'stepForm.label.type.api': 'api domain',
|
||||
// form -1
|
||||
'stepForm.form.label.activityName': 'Activity Name',
|
||||
'stepForm.placeholder.activityName':
|
||||
'Enter a maximum of 20 Chinese characters, letters, or digits',
|
||||
'stepForm.form.error.activityName.pattern':
|
||||
'Enter a maximum of 20 Chinese characters, letters, or digits',
|
||||
'stepForm.form.error.activityName.required': 'Please enter the activity name',
|
||||
'stepForm.form.label.channelType': 'Channel Type',
|
||||
'stepForm.placeholder.channelType': 'Select a channel type',
|
||||
'stepForm.form.error.channelType.required': 'Please select a channel type',
|
||||
'stepForm.form.label.promotionTime': 'Promotion Time',
|
||||
'stepForm.form.error.promotionTime.required':
|
||||
'Please select the promotion time',
|
||||
'stepForm.form.label.promoteLink': 'Promote Link',
|
||||
'stepForm.form.error.promoteLink.required': 'Please enter the promotion link',
|
||||
'stepForm.form.error.promoteLink.pattern':
|
||||
'For example, the download address of Android or iOS or the intermediate URL must start with http:// or https://',
|
||||
'stepForm.form.tip.promoteLink':
|
||||
'For example, the download address of Android or iOS or the intermediate URL must start with http:// or https://',
|
||||
'stepForm.placeholder.promoteLink': 'Please enter the promotion page Link',
|
||||
|
||||
// form -1 end
|
||||
// form -2
|
||||
'stepForm.form.label.advertisingSource': 'Advertising Source',
|
||||
'stepForm.placeholder.advertisingSource':
|
||||
'Introduction source address: Sohu, Sina',
|
||||
'stepForm.form.error.advertisingSource.required':
|
||||
'Please enter the advertising source',
|
||||
'stepForm.form.label.advertisingMedia': 'Advertising Media',
|
||||
'stepForm.placeholder.advertisingMedia': 'Marketing media: CPC, Banner, EDM',
|
||||
'stepForm.form.error.advertisingMedia.required':
|
||||
'Please enter the advertising media',
|
||||
'stepForm.form.label.keyword': 'keyword',
|
||||
'stepForm.placeholder.keyword': 'Please select keyword',
|
||||
'stepForm.form.error.keyword.required': 'Please select keyword',
|
||||
'stepForm.form.label.pushNotify': 'Push Notify',
|
||||
'stepForm.form.label.advertisingContent': 'Advertising Content',
|
||||
'stepForm.placeholder.advertisingContent':
|
||||
'Please enter the description of advertisement content, the maximum is 200 words',
|
||||
'stepForm.form.error.advertisingContent.required':
|
||||
'Please enter the description of advertisement content',
|
||||
'stepForm.form.error.advertisingContent.maxLength':
|
||||
'the maximum is 200 words',
|
||||
// form -2 end
|
||||
'stepForm.form.description.title': 'Channel Form Description',
|
||||
'stepForm.form.description.text':
|
||||
'Advertiser channel promotion supports tracking of users who download apps by placing ads on third-party advertisers, such as toutiao channel, and tracking users who activate apps by downloading apps through channels.',
|
||||
};
|
||||
@@ -1,52 +0,0 @@
|
||||
export default {
|
||||
'menu.form.step': '分步表单',
|
||||
'stepForm.step.title': '创建渠道表单',
|
||||
'stepForm.step.title.baseInfo': '选择基本信息',
|
||||
'stepForm.step.subTitle.baseInfo': '创建渠道活动',
|
||||
'stepForm.step.title.channel': '输入渠道信息',
|
||||
'stepForm.step.subTitle.channel': '输入详细的渠道信息',
|
||||
'stepForm.step.title.finish': '完成创建',
|
||||
'stepForm.step.subTitle.finish': '创建成功',
|
||||
'stepForm.success.title': '提交成功',
|
||||
'stepForm.success.subTitle': '表单提交成功!',
|
||||
'stepForm.button.next': '下一步',
|
||||
'stepForm.button.prev': '上一步',
|
||||
'stepForm.button.submit': '提交',
|
||||
'stepForm.button.again': '再次创建',
|
||||
'stepForm.button.view': '查看详情',
|
||||
'stepForm.form.label.activityName': '活动名称',
|
||||
'stepForm.placeholder.activityName': '输入汉字、字母或数字,最多20字符',
|
||||
'stepForm.form.error.activityName.required': '请输入活动名称',
|
||||
'stepForm.form.error.activityName.pattern':
|
||||
'输入汉字、字母或数字,最多20字符',
|
||||
'stepForm.form.label.channelType': '渠道类型',
|
||||
'stepForm.placeholder.channelType': '请选择渠道类型',
|
||||
'stepForm.form.error.channelType.required': '请选择渠道类型',
|
||||
'stepForm.form.label.promotionTime': '推广时间',
|
||||
'stepForm.form.error.promotionTime.required': '请选择推广时间',
|
||||
'stepForm.form.label.promoteLink': '推广地址',
|
||||
'stepForm.form.error.promoteLink.required': '请输入推广地址',
|
||||
'stepForm.form.error.promoteLink.pattern':
|
||||
'如 Android 或 iOS 的下载地址、中间跳转URL,网址必须以 http:// 或 https:// 开头',
|
||||
'stepForm.form.tip.promoteLink':
|
||||
'如 Android 或 iOS 的下载地址、中间跳转URL,网址必须以 http:// 或 https:// 开头',
|
||||
'stepForm.placeholder.promoteLink': '请输入推广页面地址',
|
||||
'stepForm.form.label.advertisingSource': '广告来源',
|
||||
'stepForm.placeholder.advertisingSource': '引荐来源地址:sohu、sina',
|
||||
'stepForm.form.error.advertisingSource.required': '请输入广告来源',
|
||||
'stepForm.form.label.advertisingMedia': '广告媒介',
|
||||
'stepForm.placeholder.advertisingMedia': '营销媒介:cpc、banner、edm',
|
||||
'stepForm.form.error.advertisingMedia.required': '请输入广告媒介',
|
||||
'stepForm.form.label.keyword': '关键词',
|
||||
'stepForm.placeholder.keyword': '请选择关键词',
|
||||
'stepForm.form.error.keyword.required': '请选择关键词',
|
||||
'stepForm.form.label.pushNotify': '推送提醒',
|
||||
'stepForm.form.label.advertisingContent': '广告内容',
|
||||
'stepForm.placeholder.advertisingContent':
|
||||
'请输入广告内容介绍,最多不超过200字。',
|
||||
'stepForm.form.error.advertisingContent.required': '请输入广告内容',
|
||||
'stepForm.form.error.advertisingContent.maxLength': '最多不超过200字',
|
||||
'stepForm.form.description.title': '渠道表单说明',
|
||||
'stepForm.form.description.text':
|
||||
'广告商渠道推广支持追踪在第三方广告商投放广告下载App用户的场景,例如在今日头条渠道投放下载App广告,追踪通过在渠道下载激活App的用户。',
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
// submit
|
||||
Mock.mock(new RegExp('/api/channel-form/submit'), () => {
|
||||
return successResponseWrap('ok');
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,204 +0,0 @@
|
||||
<template>
|
||||
<div class="card-wrap">
|
||||
<a-card v-if="loading" :bordered="false" hoverable>
|
||||
<slot name="skeleton"></slot>
|
||||
</a-card>
|
||||
<a-card v-else :bordered="false" hoverable>
|
||||
<a-space align="start">
|
||||
<a-avatar
|
||||
v-if="icon"
|
||||
:size="24"
|
||||
style="margin-right: 8px; background-color: #626aea"
|
||||
>
|
||||
<icon-filter />
|
||||
</a-avatar>
|
||||
<a-card-meta>
|
||||
<template #title>
|
||||
<a-typography-text style="margin-right: 10px">
|
||||
{{ title }}
|
||||
</a-typography-text>
|
||||
<template v-if="showTag">
|
||||
<a-tag
|
||||
v-if="open && isExpires === false"
|
||||
size="small"
|
||||
color="green"
|
||||
>
|
||||
<template #icon>
|
||||
<icon-check-circle-fill />
|
||||
</template>
|
||||
<span>{{ tagText }}</span>
|
||||
</a-tag>
|
||||
<a-tag v-else-if="isExpires" size="small" color="red">
|
||||
<template #icon>
|
||||
<icon-check-circle-fill />
|
||||
</template>
|
||||
<span>{{ expiresTagText }}</span>
|
||||
</a-tag>
|
||||
</template>
|
||||
</template>
|
||||
<template #description>
|
||||
{{ description }}
|
||||
<slot></slot>
|
||||
</template>
|
||||
</a-card-meta>
|
||||
</a-space>
|
||||
<template #actions>
|
||||
<a-switch v-if="actionType === 'switch'" v-model="open" />
|
||||
<a-space v-else-if="actionType === 'button'">
|
||||
<template v-if="isExpires">
|
||||
<a-button type="outline" @click="renew">
|
||||
{{ expiresText }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a-button v-if="open" @click="handleToggle">
|
||||
{{ closeTxt }}
|
||||
</a-button>
|
||||
<a-button v-else-if="!open" type="outline" @click="handleToggle">
|
||||
{{ openTxt }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-space>
|
||||
<div v-else>
|
||||
<a-space>
|
||||
<a-button @click="toggle(false)">
|
||||
{{ closeTxt }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click="toggle(true)">
|
||||
{{ openTxt }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { useToggle } from '@vueuse/core';
|
||||
|
||||
const props = defineProps({
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
description: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
actionType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
defaultValue: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
openTxt: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
closeTxt: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
expiresText: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
showTag: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
tagText: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
expires: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
expiresTagText: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const [open, toggle] = useToggle(props.defaultValue);
|
||||
const handleToggle = () => {
|
||||
toggle();
|
||||
};
|
||||
const isExpires = ref(props.expires);
|
||||
const renew = () => {
|
||||
isExpires.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.card-wrap {
|
||||
height: 100%;
|
||||
transition: all 0.3s;
|
||||
border: 1px solid var(--color-neutral-3);
|
||||
border-radius: 4px;
|
||||
&:hover {
|
||||
transform: translateY(-4px);
|
||||
// box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
:deep(.arco-card) {
|
||||
height: 100%;
|
||||
border-radius: 4px;
|
||||
.arco-card-body {
|
||||
height: 100%;
|
||||
.arco-space {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.arco-space-item {
|
||||
height: 100%;
|
||||
&:last-child {
|
||||
flex: 1;
|
||||
}
|
||||
.arco-card-meta {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
.arco-card-meta-content {
|
||||
flex: 1;
|
||||
.arco-card-meta-description {
|
||||
margin-top: 8px;
|
||||
color: rgb(var(--gray-6));
|
||||
line-height: 20px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.arco-card-meta-footer {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
:deep(.arco-card-meta-title) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
// To prevent the shaking
|
||||
line-height: 28px;
|
||||
}
|
||||
:deep(.arco-skeleton-line) {
|
||||
&:last-child {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,115 +0,0 @@
|
||||
<template>
|
||||
<div class="list-wrap">
|
||||
<a-typography-title class="block-title" :heading="6">
|
||||
{{ $t('cardList.tab.title.content') }}
|
||||
</a-typography-title>
|
||||
<a-row class="list-row" :gutter="24">
|
||||
<a-col
|
||||
:xs="12"
|
||||
:sm="12"
|
||||
:md="12"
|
||||
:lg="6"
|
||||
:xl="6"
|
||||
:xxl="6"
|
||||
class="list-col"
|
||||
>
|
||||
<div class="card-wrap empty-wrap">
|
||||
<a-card :bordered="false" hoverable>
|
||||
<a-result :status="null" :title="$t('cardList.content.action')">
|
||||
<template #icon>
|
||||
<icon-plus style="font-size: 20px" />
|
||||
</template>
|
||||
</a-result>
|
||||
</a-card>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col
|
||||
v-for="item in renderData"
|
||||
:key="item.id"
|
||||
class="list-col"
|
||||
:xs="12"
|
||||
:sm="12"
|
||||
:md="12"
|
||||
:lg="6"
|
||||
:xl="6"
|
||||
:xxl="6"
|
||||
>
|
||||
<CardWrap
|
||||
:loading="loading"
|
||||
:title="item.title"
|
||||
:description="item.description"
|
||||
:default-value="item.enable"
|
||||
:action-type="item.actionType"
|
||||
:icon="item.icon"
|
||||
:open-txt="$t('cardList.content.inspection')"
|
||||
:close-txt="$t('cardList.content.delete')"
|
||||
:show-tag="false"
|
||||
>
|
||||
<a-descriptions
|
||||
style="margin-top: 16px"
|
||||
:data="item.data"
|
||||
layout="inline-horizontal"
|
||||
:column="2"
|
||||
/>
|
||||
<template #skeleton>
|
||||
<a-skeleton :animation="true">
|
||||
<a-skeleton-line
|
||||
:widths="['50%', '50%', '100%', '40%']"
|
||||
:rows="4"
|
||||
/>
|
||||
<a-skeleton-line :widths="['40%']" :rows="1" />
|
||||
</a-skeleton>
|
||||
</template>
|
||||
</CardWrap>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { queryInspectionList, ServiceRecord } from '@/api/list';
|
||||
import useRequest from '@/hooks/request';
|
||||
import CardWrap from './card-wrap.vue';
|
||||
|
||||
const defaultValue: ServiceRecord[] = new Array(3).fill({});
|
||||
const { loading, response: renderData } = useRequest<ServiceRecord[]>(
|
||||
queryInspectionList,
|
||||
defaultValue
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.card-wrap {
|
||||
height: 100%;
|
||||
transition: all 0.3s;
|
||||
border: 1px solid var(--color-neutral-3);
|
||||
&:hover {
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
:deep(.arco-card-meta-description) {
|
||||
color: rgb(var(--gray-6));
|
||||
.arco-descriptions-item-label-inline {
|
||||
font-weight: normal;
|
||||
font-size: 12px;
|
||||
color: rgb(var(--gray-6));
|
||||
}
|
||||
.arco-descriptions-item-value-inline {
|
||||
color: rgb(var(--gray-8));
|
||||
}
|
||||
}
|
||||
}
|
||||
.empty-wrap {
|
||||
height: 200px;
|
||||
border-radius: 4px;
|
||||
:deep(.arco-card) {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
.arco-result-title {
|
||||
color: rgb(var(--gray-6));
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,51 +0,0 @@
|
||||
<template>
|
||||
<div class="list-wrap">
|
||||
<a-typography-title class="block-title" :heading="6">
|
||||
{{ $t('cardList.tab.title.preset') }}
|
||||
</a-typography-title>
|
||||
<a-row class="list-row" :gutter="24">
|
||||
<a-col
|
||||
v-for="item in renderData"
|
||||
:key="item.id"
|
||||
:xs="12"
|
||||
:sm="12"
|
||||
:md="12"
|
||||
:lg="6"
|
||||
:xl="6"
|
||||
:xxl="6"
|
||||
class="list-col"
|
||||
style="min-height: 140px"
|
||||
>
|
||||
<CardWrap
|
||||
:loading="loading"
|
||||
:title="item.title"
|
||||
:description="item.description"
|
||||
:default-value="item.enable"
|
||||
:action-type="item.actionType"
|
||||
:tag-text="$t('cardList.preset.tag')"
|
||||
>
|
||||
<template #skeleton>
|
||||
<a-skeleton :animation="true">
|
||||
<a-skeleton-line :widths="['100%', '40%']" :rows="2" />
|
||||
<a-skeleton-line :widths="['40%']" :rows="1" />
|
||||
</a-skeleton>
|
||||
</template>
|
||||
</CardWrap>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { queryRulesPresetList, ServiceRecord } from '@/api/list';
|
||||
import useRequest from '@/hooks/request';
|
||||
import CardWrap from './card-wrap.vue';
|
||||
|
||||
const defaultValue: ServiceRecord[] = new Array(6).fill({});
|
||||
const { loading, response: renderData } = useRequest<ServiceRecord[]>(
|
||||
queryRulesPresetList,
|
||||
defaultValue
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,57 +0,0 @@
|
||||
<template>
|
||||
<div class="list-wrap">
|
||||
<a-typography-title class="block-title" :heading="6">
|
||||
{{ $t('cardList.tab.title.service') }}
|
||||
</a-typography-title>
|
||||
<a-row class="list-row" :gutter="24">
|
||||
<a-col
|
||||
v-for="item in renderData"
|
||||
:key="item.id"
|
||||
:xs="12"
|
||||
:sm="12"
|
||||
:md="12"
|
||||
:lg="6"
|
||||
:xl="6"
|
||||
:xxl="6"
|
||||
class="list-col"
|
||||
style="min-height: 162px"
|
||||
>
|
||||
<CardWrap
|
||||
:loading="loading"
|
||||
:title="item.title"
|
||||
:description="item.description"
|
||||
:default-value="item.enable"
|
||||
:action-type="item.actionType"
|
||||
:expires="item.expires"
|
||||
:open-txt="$t('cardList.service.open')"
|
||||
:close-txt="$t('cardList.service.cancel')"
|
||||
:expires-text="$t('cardList.service.renew')"
|
||||
:tag-text="$t('cardList.service.tag')"
|
||||
:expires-tag-text="$t('cardList.service.expiresTag')"
|
||||
:icon="item.icon"
|
||||
>
|
||||
<template #skeleton>
|
||||
<a-skeleton :animation="true">
|
||||
<a-skeleton-line :widths="['100%', '40%', '100%']" :rows="3" />
|
||||
<a-skeleton-line :widths="['40%']" :rows="1" />
|
||||
</a-skeleton>
|
||||
</template>
|
||||
</CardWrap>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { queryTheServiceList, ServiceRecord } from '@/api/list';
|
||||
import useRequest from '@/hooks/request';
|
||||
import CardWrap from './card-wrap.vue';
|
||||
|
||||
const defaultValue: ServiceRecord[] = new Array(4).fill({});
|
||||
const { loading, response: renderData } = useRequest<ServiceRecord[]>(
|
||||
queryTheServiceList,
|
||||
defaultValue
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,92 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.list', 'menu.list.cardList']" />
|
||||
<a-row :gutter="20" align="stretch">
|
||||
<a-col :span="24">
|
||||
<a-card class="general-card" :title="$t('menu.list.cardList')">
|
||||
<a-row justify="space-between">
|
||||
<a-col :span="24">
|
||||
<a-tabs :default-active-tab="1" type="rounded">
|
||||
<a-tab-pane key="1" :title="$t('cardList.tab.title.all')">
|
||||
<QualityInspection />
|
||||
<TheService />
|
||||
<RulesPreset />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" :title="$t('cardList.tab.title.content')">
|
||||
<QualityInspection />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" :title="$t('cardList.tab.title.service')">
|
||||
<TheService />
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="4" :title="$t('cardList.tab.title.preset')">
|
||||
<RulesPreset />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-col>
|
||||
<a-input-search
|
||||
:placeholder="$t('cardList.searchInput.placeholder')"
|
||||
style="width: 240px; position: absolute; top: 60px; right: 20px"
|
||||
/>
|
||||
</a-row>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import QualityInspection from './components/quality-inspection.vue';
|
||||
import TheService from './components/the-service.vue';
|
||||
import RulesPreset from './components/rules-preset.vue';
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Card',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
:deep(.arco-list-content) {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
:deep(.arco-card-meta-title) {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
:deep(.arco-list-col) {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
:deep(.arco-list-item) {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
:deep(.block-title) {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
:deep(.list-wrap) {
|
||||
// min-height: 140px;
|
||||
.list-row {
|
||||
align-items: stretch;
|
||||
.list-col {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
:deep(.arco-space) {
|
||||
width: 100%;
|
||||
.arco-space-item {
|
||||
&:last-child {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,19 +0,0 @@
|
||||
export default {
|
||||
'menu.list.cardList': 'Card List',
|
||||
'cardList.tab.title.all': 'All',
|
||||
'cardList.tab.title.content': 'Quality Inspection',
|
||||
'cardList.tab.title.service': 'The service',
|
||||
'cardList.tab.title.preset': 'Rules Preset',
|
||||
'cardList.searchInput.placeholder': 'Search',
|
||||
'cardList.enable': 'Enable',
|
||||
'cardList.disable': 'Disable',
|
||||
'cardList.content.delete': 'Delete',
|
||||
'cardList.content.inspection': 'Inspection',
|
||||
'cardList.content.action': 'Click Create Qc Content queue',
|
||||
'cardList.service.open': 'Open',
|
||||
'cardList.service.cancel': 'Cancel',
|
||||
'cardList.service.renew': 'Contract of service',
|
||||
'cardList.service.tag': 'Opened',
|
||||
'cardList.service.expiresTag': 'Expired',
|
||||
'cardList.preset.tag': 'Enable',
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
export default {
|
||||
'menu.list.cardList': '卡片列表',
|
||||
'cardList.tab.title.all': '全部',
|
||||
'cardList.tab.title.content': '内容质检',
|
||||
'cardList.tab.title.service': '开通服务',
|
||||
'cardList.tab.title.preset': '规则预置',
|
||||
'cardList.searchInput.placeholder': '搜索',
|
||||
// 'cardList.statistic.enable': '已启用',
|
||||
// 'cardList.statistic.disable': '未启用',
|
||||
'cardList.content.delete': '删除',
|
||||
'cardList.content.inspection': '质检',
|
||||
'cardList.content.action': '点击创建质检内容队列',
|
||||
'cardList.service.open': '开通服务',
|
||||
'cardList.service.cancel': '取消服务',
|
||||
'cardList.service.renew': '续约服务',
|
||||
'cardList.service.tag': '已开通',
|
||||
'cardList.service.expiresTag': '已过期',
|
||||
'cardList.preset.tag': '已启用',
|
||||
};
|
||||
@@ -1,186 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
import { ServiceRecord } from '@/api/list';
|
||||
|
||||
const qualityInspectionList: ServiceRecord[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'quality',
|
||||
title: '视频类-历史导入',
|
||||
description: '2021-10-12 00:00:00',
|
||||
data: [
|
||||
{
|
||||
label: '待质检数',
|
||||
value: '120',
|
||||
},
|
||||
{
|
||||
label: '积压时长',
|
||||
value: '60s',
|
||||
},
|
||||
{
|
||||
label: '待抽检数',
|
||||
value: '0',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'quality',
|
||||
title: '图文类-图片版权',
|
||||
description: '2021-12-11 18:30:00',
|
||||
data: [
|
||||
{
|
||||
label: '待质检数',
|
||||
value: '120',
|
||||
},
|
||||
{
|
||||
label: '积压时长',
|
||||
value: '60s',
|
||||
},
|
||||
{
|
||||
label: '待抽检数',
|
||||
value: '0',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'quality',
|
||||
title: '图文类-高清图片',
|
||||
description: '2021-10-15 08:10:00',
|
||||
data: [
|
||||
{
|
||||
label: '待质检数',
|
||||
value: '120',
|
||||
},
|
||||
{
|
||||
label: '积压时长',
|
||||
value: '60s',
|
||||
},
|
||||
{
|
||||
label: '待抽检数',
|
||||
value: '0',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
const theServiceList: ServiceRecord[] = [
|
||||
{
|
||||
id: 1,
|
||||
icon: 'code',
|
||||
title: '漏斗分析',
|
||||
description:
|
||||
'用户行为分析之漏斗分析模型是企业实现精细化运营、进行用户行为分析的重要数据分析模型。',
|
||||
enable: true,
|
||||
actionType: 'button',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
icon: 'edit',
|
||||
title: '用户分布',
|
||||
description:
|
||||
'快速诊断用户人群,地域细分情况,了解数据分布的集中度,以及主要的数据分布的区间段是什么。',
|
||||
enable: true,
|
||||
actionType: 'button',
|
||||
expires: true,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
icon: 'user',
|
||||
title: '资源分发',
|
||||
description:
|
||||
'移动端动态化资源分发解决方案。提供稳定大流量服务支持、灵活定制的分发圈选规则,通过离线化预加载。',
|
||||
enable: false,
|
||||
actionType: 'button',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
icon: 'user',
|
||||
title: '用户画像分析',
|
||||
description:
|
||||
'用户画像就是将典型用户信息标签化,根据用户特征、业务场景和用户行为等信息,构建一个标签化的用户模型。',
|
||||
enable: true,
|
||||
actionType: 'button',
|
||||
},
|
||||
];
|
||||
const rulesPresetList: ServiceRecord[] = [
|
||||
{
|
||||
id: 1,
|
||||
title: '内容屏蔽规则',
|
||||
description:
|
||||
'用户在执行特定的内容分发任务时,可使用内容屏蔽规则根据特定标签,过滤内容集合。',
|
||||
enable: true,
|
||||
actionType: 'switch',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '内容置顶规则',
|
||||
description:
|
||||
'该规则支持用户在执行特定内容分发任务时,对固定的几条内容置顶。',
|
||||
enable: true,
|
||||
actionType: 'switch',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '内容加权规则',
|
||||
description: '选定内容加权规则后可自定义从不同内容集合获取内容的概率。',
|
||||
enable: false,
|
||||
actionType: 'switch',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '内容分发规则',
|
||||
description: '内容分发时,对某些内容需要固定在C端展示的位置。',
|
||||
enable: true,
|
||||
actionType: 'switch',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
title: '违禁内容识别',
|
||||
description: '精准识别赌博、刀枪、毒品、造假、贩假等违规物品和违规行为。',
|
||||
enable: false,
|
||||
actionType: 'switch',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
title: '多语言文字符号识别',
|
||||
description:
|
||||
'精准识别英语、维语、藏语、蒙古语、朝鲜语等多种语言以及emoji表情形态的语义识别。',
|
||||
enable: false,
|
||||
actionType: 'switch',
|
||||
},
|
||||
];
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
// Quality Inspection
|
||||
Mock.mock(new RegExp('/api/list/quality-inspection'), () => {
|
||||
return successResponseWrap(
|
||||
qualityInspectionList.map((_, index) => ({
|
||||
...qualityInspectionList[index % qualityInspectionList.length],
|
||||
id: Mock.Random.guid(),
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
// the service
|
||||
Mock.mock(new RegExp('/api/list/the-service'), () => {
|
||||
return successResponseWrap(
|
||||
theServiceList.map((_, index) => ({
|
||||
...theServiceList[index % theServiceList.length],
|
||||
id: Mock.Random.guid(),
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
// rules preset
|
||||
Mock.mock(new RegExp('/api/list/rules-preset'), () => {
|
||||
return successResponseWrap(
|
||||
rulesPresetList.map((_, index) => ({
|
||||
...rulesPresetList[index % rulesPresetList.length],
|
||||
id: Mock.Random.guid(),
|
||||
}))
|
||||
);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,514 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.list', 'menu.list.searchTable']" />
|
||||
<a-card class="general-card" :title="$t('menu.list.searchTable')">
|
||||
<a-row>
|
||||
<a-col :flex="1">
|
||||
<a-form
|
||||
:model="formModel"
|
||||
:label-col-props="{ span: 6 }"
|
||||
:wrapper-col-props="{ span: 18 }"
|
||||
label-align="left"
|
||||
>
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
field="number"
|
||||
:label="$t('searchTable.form.number')"
|
||||
>
|
||||
<a-input
|
||||
v-model="formModel.number"
|
||||
:placeholder="$t('searchTable.form.number.placeholder')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item field="name" :label="$t('searchTable.form.name')">
|
||||
<a-input
|
||||
v-model="formModel.name"
|
||||
:placeholder="$t('searchTable.form.name.placeholder')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
field="contentType"
|
||||
:label="$t('searchTable.form.contentType')"
|
||||
>
|
||||
<a-select
|
||||
v-model="formModel.contentType"
|
||||
:options="contentTypeOptions"
|
||||
:placeholder="$t('searchTable.form.selectDefault')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
field="filterType"
|
||||
:label="$t('searchTable.form.filterType')"
|
||||
>
|
||||
<a-select
|
||||
v-model="formModel.filterType"
|
||||
:options="filterTypeOptions"
|
||||
:placeholder="$t('searchTable.form.selectDefault')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
field="createdTime"
|
||||
:label="$t('searchTable.form.createdTime')"
|
||||
>
|
||||
<a-range-picker
|
||||
v-model="formModel.createdTime"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item
|
||||
field="status"
|
||||
:label="$t('searchTable.form.status')"
|
||||
>
|
||||
<a-select
|
||||
v-model="formModel.status"
|
||||
:options="statusOptions"
|
||||
:placeholder="$t('searchTable.form.selectDefault')"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-col>
|
||||
<a-divider style="height: 84px" direction="vertical" />
|
||||
<a-col :flex="'86px'" style="text-align: right">
|
||||
<a-space direction="vertical" :size="18">
|
||||
<a-button type="primary" @click="search">
|
||||
<template #icon>
|
||||
<icon-search />
|
||||
</template>
|
||||
{{ $t('searchTable.form.search') }}
|
||||
</a-button>
|
||||
<a-button @click="reset">
|
||||
<template #icon>
|
||||
<icon-refresh />
|
||||
</template>
|
||||
{{ $t('searchTable.form.reset') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider style="margin-top: 0" />
|
||||
<a-row style="margin-bottom: 16px">
|
||||
<a-col :span="12">
|
||||
<a-space>
|
||||
<a-button type="primary">
|
||||
<template #icon>
|
||||
<icon-plus />
|
||||
</template>
|
||||
{{ $t('searchTable.operation.create') }}
|
||||
</a-button>
|
||||
<a-upload action="/">
|
||||
<template #upload-button>
|
||||
<a-button>
|
||||
{{ $t('searchTable.operation.import') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-upload>
|
||||
</a-space>
|
||||
</a-col>
|
||||
<a-col
|
||||
:span="12"
|
||||
style="display: flex; align-items: center; justify-content: end"
|
||||
>
|
||||
<a-button>
|
||||
<template #icon>
|
||||
<icon-download />
|
||||
</template>
|
||||
{{ $t('searchTable.operation.download') }}
|
||||
</a-button>
|
||||
<a-tooltip :content="$t('searchTable.actions.refresh')">
|
||||
<div class="action-icon" @click="search"
|
||||
><icon-refresh size="18"
|
||||
/></div>
|
||||
</a-tooltip>
|
||||
<a-dropdown @select="handleSelectDensity">
|
||||
<a-tooltip :content="$t('searchTable.actions.density')">
|
||||
<div class="action-icon"><icon-line-height size="18" /></div>
|
||||
</a-tooltip>
|
||||
<template #content>
|
||||
<a-doption
|
||||
v-for="item in densityList"
|
||||
:key="item.value"
|
||||
:value="item.value"
|
||||
:class="{ active: item.value === size }"
|
||||
>
|
||||
<span>{{ item.name }}</span>
|
||||
</a-doption>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<a-tooltip :content="$t('searchTable.actions.columnSetting')">
|
||||
<a-popover
|
||||
trigger="click"
|
||||
position="bl"
|
||||
@popup-visible-change="popupVisibleChange"
|
||||
>
|
||||
<div class="action-icon"><icon-settings size="18" /></div>
|
||||
<template #content>
|
||||
<div id="tableSetting">
|
||||
<div
|
||||
v-for="(item, index) in showColumns"
|
||||
:key="item.dataIndex"
|
||||
class="setting"
|
||||
>
|
||||
<div style="margin-right: 4px; cursor: move">
|
||||
<icon-drag-arrow />
|
||||
</div>
|
||||
<div>
|
||||
<a-checkbox
|
||||
v-model="item.checked"
|
||||
@change="
|
||||
handleChange($event, item as TableColumnData, index)
|
||||
"
|
||||
>
|
||||
</a-checkbox>
|
||||
</div>
|
||||
<div class="title">
|
||||
{{ item.title === '#' ? '序列号' : item.title }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-popover>
|
||||
</a-tooltip>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-table
|
||||
row-key="id"
|
||||
:loading="loading"
|
||||
:pagination="pagination"
|
||||
:columns="(cloneColumns as TableColumnData[])"
|
||||
:data="renderData"
|
||||
:bordered="false"
|
||||
:size="size"
|
||||
@page-change="onPageChange"
|
||||
>
|
||||
<template #index="{ rowIndex }">
|
||||
{{ rowIndex + 1 + (pagination.current - 1) * pagination.pageSize }}
|
||||
</template>
|
||||
<template #contentType="{ record }">
|
||||
<a-space>
|
||||
<a-avatar
|
||||
v-if="record.contentType === 'img'"
|
||||
:size="16"
|
||||
shape="square"
|
||||
>
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/581b17753093199839f2e327e726b157.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
</a-avatar>
|
||||
<a-avatar
|
||||
v-else-if="record.contentType === 'horizontalVideo'"
|
||||
:size="16"
|
||||
shape="square"
|
||||
>
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/77721e365eb2ab786c889682cbc721c1.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
</a-avatar>
|
||||
<a-avatar v-else :size="16" shape="square">
|
||||
<img
|
||||
alt="avatar"
|
||||
src="//p3-armor.byteimg.com/tos-cn-i-49unhts6dw/ea8b09190046da0ea7e070d83c5d1731.svg~tplv-49unhts6dw-image.image"
|
||||
/>
|
||||
</a-avatar>
|
||||
{{ $t(`searchTable.form.contentType.${record.contentType}`) }}
|
||||
</a-space>
|
||||
</template>
|
||||
<template #filterType="{ record }">
|
||||
{{ $t(`searchTable.form.filterType.${record.filterType}`) }}
|
||||
</template>
|
||||
<template #status="{ record }">
|
||||
<span v-if="record.status === 'offline'" class="circle"></span>
|
||||
<span v-else class="circle pass"></span>
|
||||
{{ $t(`searchTable.form.status.${record.status}`) }}
|
||||
</template>
|
||||
<template #operations>
|
||||
<a-button v-permission="['admin']" type="text" size="small">
|
||||
{{ $t('searchTable.columns.operations.view') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, reactive, watch, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryPolicyList, PolicyRecord, PolicyParams } from '@/api/list';
|
||||
import { Pagination } from '@/types/global';
|
||||
import type { SelectOptionData } from '@arco-design/web-vue/es/select/interface';
|
||||
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import Sortable from 'sortablejs';
|
||||
|
||||
type SizeProps = 'mini' | 'small' | 'medium' | 'large';
|
||||
type Column = TableColumnData & { checked?: true };
|
||||
|
||||
const generateFormModel = () => {
|
||||
return {
|
||||
number: '',
|
||||
name: '',
|
||||
contentType: '',
|
||||
filterType: '',
|
||||
createdTime: [],
|
||||
status: '',
|
||||
};
|
||||
};
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const { t } = useI18n();
|
||||
const renderData = ref<PolicyRecord[]>([]);
|
||||
const formModel = ref(generateFormModel());
|
||||
const cloneColumns = ref<Column[]>([]);
|
||||
const showColumns = ref<Column[]>([]);
|
||||
|
||||
const size = ref<SizeProps>('medium');
|
||||
|
||||
const basePagination: Pagination = {
|
||||
current: 1,
|
||||
pageSize: 20,
|
||||
};
|
||||
const pagination = reactive({
|
||||
...basePagination,
|
||||
});
|
||||
const densityList = computed(() => [
|
||||
{
|
||||
name: t('searchTable.size.mini'),
|
||||
value: 'mini',
|
||||
},
|
||||
{
|
||||
name: t('searchTable.size.small'),
|
||||
value: 'small',
|
||||
},
|
||||
{
|
||||
name: t('searchTable.size.medium'),
|
||||
value: 'medium',
|
||||
},
|
||||
{
|
||||
name: t('searchTable.size.large'),
|
||||
value: 'large',
|
||||
},
|
||||
]);
|
||||
const columns = computed<TableColumnData[]>(() => [
|
||||
{
|
||||
title: t('searchTable.columns.index'),
|
||||
dataIndex: 'index',
|
||||
slotName: 'index',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.number'),
|
||||
dataIndex: 'number',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.name'),
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.contentType'),
|
||||
dataIndex: 'contentType',
|
||||
slotName: 'contentType',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.filterType'),
|
||||
dataIndex: 'filterType',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.count'),
|
||||
dataIndex: 'count',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.createdTime'),
|
||||
dataIndex: 'createdTime',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.status'),
|
||||
dataIndex: 'status',
|
||||
slotName: 'status',
|
||||
},
|
||||
{
|
||||
title: t('searchTable.columns.operations'),
|
||||
dataIndex: 'operations',
|
||||
slotName: 'operations',
|
||||
},
|
||||
]);
|
||||
const contentTypeOptions = computed<SelectOptionData[]>(() => [
|
||||
{
|
||||
label: t('searchTable.form.contentType.img'),
|
||||
value: 'img',
|
||||
},
|
||||
{
|
||||
label: t('searchTable.form.contentType.horizontalVideo'),
|
||||
value: 'horizontalVideo',
|
||||
},
|
||||
{
|
||||
label: t('searchTable.form.contentType.verticalVideo'),
|
||||
value: 'verticalVideo',
|
||||
},
|
||||
]);
|
||||
const filterTypeOptions = computed<SelectOptionData[]>(() => [
|
||||
{
|
||||
label: t('searchTable.form.filterType.artificial'),
|
||||
value: 'artificial',
|
||||
},
|
||||
{
|
||||
label: t('searchTable.form.filterType.rules'),
|
||||
value: 'rules',
|
||||
},
|
||||
]);
|
||||
const statusOptions = computed<SelectOptionData[]>(() => [
|
||||
{
|
||||
label: t('searchTable.form.status.online'),
|
||||
value: 'online',
|
||||
},
|
||||
{
|
||||
label: t('searchTable.form.status.offline'),
|
||||
value: 'offline',
|
||||
},
|
||||
]);
|
||||
const fetchData = async (
|
||||
params: PolicyParams = { current: 1, pageSize: 20 }
|
||||
) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { data } = await queryPolicyList(params);
|
||||
renderData.value = data.list;
|
||||
pagination.current = params.current;
|
||||
pagination.total = data.total;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
const search = () => {
|
||||
fetchData({
|
||||
...basePagination,
|
||||
...formModel.value,
|
||||
} as unknown as PolicyParams);
|
||||
};
|
||||
const onPageChange = (current: number) => {
|
||||
fetchData({ ...basePagination, current });
|
||||
};
|
||||
|
||||
fetchData();
|
||||
const reset = () => {
|
||||
formModel.value = generateFormModel();
|
||||
};
|
||||
|
||||
const handleSelectDensity = (
|
||||
val: string | number | Record<string, any> | undefined,
|
||||
e: Event
|
||||
) => {
|
||||
size.value = val as SizeProps;
|
||||
};
|
||||
|
||||
const handleChange = (
|
||||
checked: boolean | (string | boolean | number)[],
|
||||
column: Column,
|
||||
index: number
|
||||
) => {
|
||||
if (!checked) {
|
||||
cloneColumns.value = showColumns.value.filter(
|
||||
(item) => item.dataIndex !== column.dataIndex
|
||||
);
|
||||
} else {
|
||||
cloneColumns.value.splice(index, 0, column);
|
||||
}
|
||||
};
|
||||
|
||||
const exchangeArray = <T extends Array<any>>(
|
||||
array: T,
|
||||
beforeIdx: number,
|
||||
newIdx: number,
|
||||
isDeep = false
|
||||
): T => {
|
||||
const newArray = isDeep ? cloneDeep(array) : array;
|
||||
if (beforeIdx > -1 && newIdx > -1) {
|
||||
// 先替换后面的,然后拿到替换的结果替换前面的
|
||||
newArray.splice(
|
||||
beforeIdx,
|
||||
1,
|
||||
newArray.splice(newIdx, 1, newArray[beforeIdx]).pop()
|
||||
);
|
||||
}
|
||||
return newArray;
|
||||
};
|
||||
|
||||
const popupVisibleChange = (val: boolean) => {
|
||||
if (val) {
|
||||
nextTick(() => {
|
||||
const el = document.getElementById('tableSetting') as HTMLElement;
|
||||
const sortable = new Sortable(el, {
|
||||
onEnd(e: any) {
|
||||
const { oldIndex, newIndex } = e;
|
||||
exchangeArray(cloneColumns.value, oldIndex, newIndex);
|
||||
exchangeArray(showColumns.value, oldIndex, newIndex);
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
() => columns.value,
|
||||
(val) => {
|
||||
cloneColumns.value = cloneDeep(val);
|
||||
cloneColumns.value.forEach((item, index) => {
|
||||
item.checked = true;
|
||||
});
|
||||
showColumns.value = cloneDeep(cloneColumns.value);
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'SearchTable',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
:deep(.arco-table-th) {
|
||||
&:last-child {
|
||||
.arco-table-th-item-title {
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.action-icon {
|
||||
margin-left: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.active {
|
||||
color: #0960bd;
|
||||
background-color: #e3f4fc;
|
||||
}
|
||||
.setting {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 200px;
|
||||
.title {
|
||||
margin-left: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,44 +0,0 @@
|
||||
export default {
|
||||
'menu.list.searchTable': 'Search Table',
|
||||
'searchTable.form.number': 'Set Number',
|
||||
'searchTable.form.number.placeholder': 'Please enter Set Number',
|
||||
'searchTable.form.name': 'Set Name',
|
||||
'searchTable.form.name.placeholder': 'Please enter Set Name',
|
||||
'searchTable.form.contentType': 'Content Type',
|
||||
'searchTable.form.contentType.img': 'image-text',
|
||||
'searchTable.form.contentType.horizontalVideo': 'Horizontal short video',
|
||||
'searchTable.form.contentType.verticalVideo': 'Vertical short video',
|
||||
'searchTable.form.filterType': 'Filter Type',
|
||||
'searchTable.form.filterType.artificial': 'artificial',
|
||||
'searchTable.form.filterType.rules': 'Rules',
|
||||
'searchTable.form.createdTime': 'Create Date',
|
||||
'searchTable.form.status': 'Status',
|
||||
'searchTable.form.status.online': 'Online',
|
||||
'searchTable.form.status.offline': 'Offline',
|
||||
'searchTable.form.search': 'Search',
|
||||
'searchTable.form.reset': 'Reset',
|
||||
'searchTable.form.selectDefault': 'All',
|
||||
'searchTable.operation.create': 'Create',
|
||||
'searchTable.operation.import': 'Import',
|
||||
'searchTable.operation.download': 'Download',
|
||||
// columns
|
||||
'searchTable.columns.index': '#',
|
||||
'searchTable.columns.number': 'Set Number',
|
||||
'searchTable.columns.name': 'Set Name',
|
||||
'searchTable.columns.contentType': 'Content Type',
|
||||
'searchTable.columns.filterType': 'Filter Type',
|
||||
'searchTable.columns.count': 'Count',
|
||||
'searchTable.columns.createdTime': 'CreatedTime',
|
||||
'searchTable.columns.status': 'Status',
|
||||
'searchTable.columns.operations': 'Operations',
|
||||
'searchTable.columns.operations.view': 'View',
|
||||
// size
|
||||
'searchTable.size.mini': 'mini',
|
||||
'searchTable.size.small': 'small',
|
||||
'searchTable.size.medium': 'middle',
|
||||
'searchTable.size.large': 'large',
|
||||
// actions
|
||||
'searchTable.actions.refresh': 'refresh',
|
||||
'searchTable.actions.density': 'density',
|
||||
'searchTable.actions.columnSetting': 'columnSetting',
|
||||
};
|
||||
@@ -1,45 +0,0 @@
|
||||
export default {
|
||||
'menu.list.searchTable': '查询表格',
|
||||
'searchTable.form.number': '集合编号',
|
||||
'searchTable.form.number.placeholder': '请输入集合编号',
|
||||
'searchTable.form.name': '集合名称',
|
||||
'searchTable.form.name.placeholder': '请输入集合名称',
|
||||
'searchTable.form.contentType': '内容体裁',
|
||||
'searchTable.form.contentType.img': '图文',
|
||||
'searchTable.form.contentType.horizontalVideo': '横版短视频',
|
||||
'searchTable.form.contentType.verticalVideo': '竖版小视频',
|
||||
'searchTable.form.filterType': '筛选方式',
|
||||
'searchTable.form.filterType.artificial': '人工筛选',
|
||||
'searchTable.form.filterType.rules': '规则筛选',
|
||||
'searchTable.form.createdTime': '创建时间',
|
||||
'searchTable.form.status': '状态',
|
||||
'searchTable.form.status.online': '已上线',
|
||||
'searchTable.form.status.offline': '已下线',
|
||||
'searchTable.form.search': '查询',
|
||||
'searchTable.form.reset': '重置',
|
||||
'searchTable.form.selectDefault': '全部',
|
||||
'searchTable.operation.create': '新建',
|
||||
'searchTable.operation.import': '批量导入',
|
||||
'searchTable.operation.download': '下载',
|
||||
// columns
|
||||
'searchTable.columns.index': '#',
|
||||
'searchTable.columns.number': '集合编号',
|
||||
'searchTable.columns.name': '集合名称',
|
||||
'searchTable.columns.contentType': '内容体裁',
|
||||
'searchTable.columns.filterType': '筛选方式',
|
||||
'searchTable.columns.count': '内容量',
|
||||
'searchTable.columns.createdTime': '创建时间',
|
||||
'searchTable.columns.status': '状态',
|
||||
'searchTable.columns.operations': '操作',
|
||||
'searchTable.columns.operations.view': '查看',
|
||||
|
||||
// size
|
||||
'searchTable.size.mini': '迷你',
|
||||
'searchTable.size.small': '偏小',
|
||||
'searchTable.size.medium': '中等',
|
||||
'searchTable.size.large': '偏大',
|
||||
// actions
|
||||
'searchTable.actions.refresh': '刷新',
|
||||
'searchTable.actions.density': '密度',
|
||||
'searchTable.actions.columnSetting': '列设置',
|
||||
};
|
||||
@@ -1,35 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import qs from 'query-string';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
import { GetParams } from '@/types/global';
|
||||
|
||||
const { Random } = Mock;
|
||||
|
||||
const data = Mock.mock({
|
||||
'list|55': [
|
||||
{
|
||||
'id|8': /[A-Z][a-z][-][0-9]/,
|
||||
'number|2-3': /[0-9]/,
|
||||
'name|4-8': /[A-Z]/,
|
||||
'contentType|1': ['img', 'horizontalVideo', 'verticalVideo'],
|
||||
'count|2-3': /[0-9]/,
|
||||
'status|1': ['online', 'offline'],
|
||||
'filterType|1': ['artificial', 'rules'],
|
||||
'createdTime': Random.datetime(),
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(new RegExp('/api/list/policy'), (params: GetParams) => {
|
||||
const { current = 1, pageSize = 10 } = qs.parseUrl(params.url).query;
|
||||
const p = current as number;
|
||||
const ps = pageSize as number;
|
||||
return successResponseWrap({
|
||||
list: data.list.slice((p - 1) * ps, p * ps),
|
||||
total: 55,
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<a-card class="general-card">
|
||||
<template #title>
|
||||
{{ $t('basicProfile.title.operationLog') }}
|
||||
</template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-table :data="renderData">
|
||||
<template #columns>
|
||||
<a-table-column
|
||||
:title="$t('basicProfile.column.contentNumber')"
|
||||
data-index="contentNumber"
|
||||
/>
|
||||
<a-table-column
|
||||
:title="$t('basicProfile.column.updateContent')"
|
||||
data-index="updateContent"
|
||||
/>
|
||||
<a-table-column
|
||||
:title="$t('basicProfile.column.status')"
|
||||
data-index="status"
|
||||
>
|
||||
<template #cell="{ record }">
|
||||
<p v-if="record.status === 0">
|
||||
<span class="circle"></span>
|
||||
<span>{{ $t('basicProfile.cell.auditing') }}</span>
|
||||
</p>
|
||||
<p v-if="record.status === 1">
|
||||
<span class="circle pass"></span>
|
||||
<span>{{ $t('basicProfile.cell.pass') }}</span>
|
||||
</p>
|
||||
</template>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
:title="$t('basicProfile.column.updateTime')"
|
||||
data-index="updateTime"
|
||||
/>
|
||||
<a-table-column :title="$t('basicProfile.column.operation')">
|
||||
<template #cell>
|
||||
<a-button type="text">{{
|
||||
$t('basicProfile.cell.view')
|
||||
}}</a-button>
|
||||
</template>
|
||||
</a-table-column>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-spin>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { queryOperationLog, operationLogRes } from '@/api/profile';
|
||||
import useLoading from '@/hooks/loading';
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const renderData = ref<operationLogRes>([]);
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
const { data } = await queryOperationLog();
|
||||
renderData.value = data;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
:deep(.arco-table-th) {
|
||||
&:last-child {
|
||||
.arco-table-th-item-title {
|
||||
margin-left: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,148 +0,0 @@
|
||||
<template>
|
||||
<div class="item-container">
|
||||
<a-space :size="16" direction="vertical" fill>
|
||||
<a-descriptions
|
||||
v-for="(item, idx) in blockDataList"
|
||||
:key="idx"
|
||||
:label-style="{
|
||||
textAlign: 'right',
|
||||
width: '200px',
|
||||
paddingRight: '10px',
|
||||
color: 'rgb(var(--gray-8))',
|
||||
}"
|
||||
:value-style="{ width: '400px' }"
|
||||
:title="item.title"
|
||||
:data="item.data"
|
||||
>
|
||||
<template #value="{ value }">
|
||||
<a-skeleton v-if="loading" :animation="true">
|
||||
<a-skeleton-line :widths="['200px']" :rows="1" />
|
||||
</a-skeleton>
|
||||
<span v-else>{{ value }}</span>
|
||||
</template>
|
||||
</a-descriptions>
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, PropType } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { ProfileBasicRes } from '@/api/profile';
|
||||
|
||||
type BlockList = {
|
||||
title: string;
|
||||
data: {
|
||||
label: string;
|
||||
value: string;
|
||||
}[];
|
||||
}[];
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
renderData: {
|
||||
type: Object as PropType<ProfileBasicRes>,
|
||||
required: true,
|
||||
},
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const { t } = useI18n();
|
||||
const blockDataList = computed<BlockList>(() => {
|
||||
const { renderData } = props;
|
||||
const result = [];
|
||||
result.push({
|
||||
title:
|
||||
props.type === 'pre'
|
||||
? t('basicProfile.title.preVideo')
|
||||
: t('basicProfile.title.video'),
|
||||
data: [
|
||||
{
|
||||
label: t('basicProfile.label.video.mode'),
|
||||
value: renderData?.video?.mode || '-',
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.acquisition.resolution'),
|
||||
value: renderData?.video?.acquisition.resolution || '-',
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.acquisition.frameRate'),
|
||||
value: `${renderData?.video?.acquisition.frameRate || '-'} fps`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.encoding.resolution'),
|
||||
value: renderData?.video?.encoding.resolution || '-',
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.encoding.rate.min'),
|
||||
value: `${renderData?.video?.encoding.rate.min || '-'} bps`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.encoding.rate.max'),
|
||||
value: `${renderData?.video?.encoding.rate.max || '-'} bps`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.encoding.rate.default'),
|
||||
value: `${renderData?.video?.encoding.rate.default || '-'} bps`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.encoding.frameRate'),
|
||||
value: `${renderData?.video?.encoding.frameRate || '-'} fpx`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.video.encoding.profile'),
|
||||
value: renderData?.video?.encoding.profile || '-',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
result.push({
|
||||
title:
|
||||
props.type === 'pre'
|
||||
? t('basicProfile.title.preAudio')
|
||||
: t('basicProfile.title.audio'),
|
||||
data: [
|
||||
{
|
||||
label: t('basicProfile.label.audio.mode'),
|
||||
value: renderData?.audio?.mode || '-',
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.audio.acquisition.channels'),
|
||||
value: `${renderData?.audio?.acquisition.channels || '-'} ${t(
|
||||
'basicProfile.unit.audio.channels'
|
||||
)}`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.audio.encoding.channels'),
|
||||
value: `${renderData?.audio?.encoding.channels || '-'} ${t(
|
||||
'basicProfile.unit.audio.channels'
|
||||
)}`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.audio.encoding.rate'),
|
||||
value: `${renderData?.audio?.encoding.rate || '-'} kbps`,
|
||||
},
|
||||
{
|
||||
label: t('basicProfile.label.audio.encoding.profile'),
|
||||
value: renderData?.audio?.encoding.profile || '-',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
return result;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.item-container {
|
||||
padding-top: 20px;
|
||||
:deep(.arco-descriptions-item-label) {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,83 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.profile', 'menu.profile.basic']" />
|
||||
<a-space direction="vertical" :size="16" fill>
|
||||
<a-card class="general-card" :title="$t('basicProfile.title.form')">
|
||||
<template #extra>
|
||||
<a-space>
|
||||
<a-button>{{ $t('basicProfile.cancel') }}</a-button>
|
||||
<a-button type="primary">
|
||||
{{ $t('basicProfile.goBack') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
<a-steps v-model:current="step" line-less class="steps">
|
||||
<a-step>{{ $t('basicProfile.steps.commit') }}</a-step>
|
||||
<a-step>{{ $t('basicProfile.steps.approval') }}</a-step>
|
||||
<a-step>{{ $t('basicProfile.steps.finish') }}</a-step>
|
||||
</a-steps>
|
||||
</a-card>
|
||||
<a-card class="general-card">
|
||||
<ProfileItem :loading="loading" :render-data="currentData" />
|
||||
</a-card>
|
||||
<a-card class="general-card">
|
||||
<ProfileItem :loading="preLoading" type="pre" :render-data="preData" />
|
||||
</a-card>
|
||||
<OperationLog />
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryProfileBasic, ProfileBasicRes } from '@/api/profile';
|
||||
import ProfileItem from './components/profile-item.vue';
|
||||
import OperationLog from './components/operation-log.vue';
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const { loading: preLoading, setLoading: preSetLoading } = useLoading(true);
|
||||
const currentData = ref<ProfileBasicRes>({} as ProfileBasicRes);
|
||||
const preData = ref<ProfileBasicRes>({} as ProfileBasicRes);
|
||||
const step = ref(1);
|
||||
const fetchCurrentData = async () => {
|
||||
try {
|
||||
const { data } = await queryProfileBasic();
|
||||
currentData.value = data;
|
||||
step.value = 2;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
const fetchPreData = async () => {
|
||||
try {
|
||||
const { data } = await queryProfileBasic();
|
||||
preData.value = data;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
preSetLoading(false);
|
||||
}
|
||||
};
|
||||
fetchCurrentData();
|
||||
fetchPreData();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Basic',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
|
||||
.steps {
|
||||
max-width: 548px;
|
||||
margin: 0 auto 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,39 +0,0 @@
|
||||
export default {
|
||||
'menu.profile.basic': 'Basic Profile',
|
||||
'basicProfile.title.form': 'Parameter Approval Process Table',
|
||||
'basicProfile.steps.commit': 'Commit',
|
||||
'basicProfile.steps.approval': 'Approval',
|
||||
'basicProfile.steps.finish': 'Finish',
|
||||
'basicProfile.title.currentParams': 'Current Parameters',
|
||||
'basicProfile.title.originParams': 'Original Parameters',
|
||||
'basicProfile.title.video': 'Video Parameters',
|
||||
'basicProfile.title.audio': 'Audio Parameters',
|
||||
'basicProfile.title.preVideo': 'Original video parameters',
|
||||
'basicProfile.title.preAudio': 'Original audio parameters',
|
||||
'basicProfile.label.video.mode': 'Match Mode',
|
||||
'basicProfile.label.video.acquisition.resolution': 'Acquisition Resolution',
|
||||
'basicProfile.label.video.acquisition.frameRate': 'Acquisition Frame Rate',
|
||||
'basicProfile.label.video.encoding.resolution': 'Encoding Resolution',
|
||||
'basicProfile.label.video.encoding.rate.min': 'Encoding Min Rate',
|
||||
'basicProfile.label.video.encoding.rate.max': 'Encoding Max Rate',
|
||||
'basicProfile.label.video.encoding.rate.default': 'Encoding Default Rate',
|
||||
'basicProfile.label.video.encoding.frameRate': 'Encoding Frame Rate',
|
||||
'basicProfile.label.video.encoding.profile': 'Encoding Profile',
|
||||
'basicProfile.label.audio.mode': 'Match Mode',
|
||||
'basicProfile.label.audio.acquisition.channels': 'Acquisition Channels',
|
||||
'basicProfile.label.audio.encoding.channels': 'Encoding Channels',
|
||||
'basicProfile.label.audio.encoding.rate': 'Encoding Rate',
|
||||
'basicProfile.label.audio.encoding.profile': 'Encoding Profile',
|
||||
'basicProfile.unit.audio.channels': 'channels',
|
||||
'basicProfile.goBack': 'GoBack',
|
||||
'basicProfile.cancel': 'Cancel Process',
|
||||
'basicProfile.title.operationLog': 'Operation Log',
|
||||
'basicProfile.column.contentNumber': 'Content Number',
|
||||
'basicProfile.column.updateContent': 'Update Content',
|
||||
'basicProfile.column.status': 'Status',
|
||||
'basicProfile.column.updateTime': 'Update Time',
|
||||
'basicProfile.column.operation': 'Operation',
|
||||
'basicProfile.cell.pass': 'Pass',
|
||||
'basicProfile.cell.auditing': 'Auditing',
|
||||
'basicProfile.cell.view': 'View',
|
||||
};
|
||||
@@ -1,39 +0,0 @@
|
||||
export default {
|
||||
'menu.profile.basic': '基础详情页',
|
||||
'basicProfile.title.form': '参数审批流程表',
|
||||
'basicProfile.steps.commit': '提交修改',
|
||||
'basicProfile.steps.approval': '审批中',
|
||||
'basicProfile.steps.finish': '修改完成',
|
||||
'basicProfile.title.currentParams': '修改后参数',
|
||||
'basicProfile.title.originParams': '原参数',
|
||||
'basicProfile.title.video': '现视频参数',
|
||||
'basicProfile.title.preVideo': '原视频参数',
|
||||
'basicProfile.title.audio': '现音频参数',
|
||||
'basicProfile.title.preAudio': '原音频参数',
|
||||
'basicProfile.label.video.mode': '匹配模式',
|
||||
'basicProfile.label.video.acquisition.resolution': '采集分辨率',
|
||||
'basicProfile.label.video.acquisition.frameRate': '采集帧率',
|
||||
'basicProfile.label.video.encoding.resolution': '编码分辨率',
|
||||
'basicProfile.label.video.encoding.rate.min': '编码码率最小值',
|
||||
'basicProfile.label.video.encoding.rate.max': '编码码率最大值',
|
||||
'basicProfile.label.video.encoding.rate.default': '编码码率默认值',
|
||||
'basicProfile.label.video.encoding.frameRate': '编码帧率',
|
||||
'basicProfile.label.video.encoding.profile': '编码profile',
|
||||
'basicProfile.label.audio.mode': '匹配模式',
|
||||
'basicProfile.label.audio.acquisition.channels': '采集声道数',
|
||||
'basicProfile.label.audio.encoding.channels': '编码声道数',
|
||||
'basicProfile.label.audio.encoding.rate': '编码码率',
|
||||
'basicProfile.label.audio.encoding.profile': '编码 profile',
|
||||
'basicProfile.unit.audio.channels': '声道',
|
||||
'basicProfile.goBack': '返回',
|
||||
'basicProfile.cancel': '取消流程',
|
||||
'basicProfile.title.operationLog': '参数调整记录',
|
||||
'basicProfile.column.contentNumber': '内容编号',
|
||||
'basicProfile.column.updateContent': '调整内容',
|
||||
'basicProfile.column.status': '当前状态',
|
||||
'basicProfile.column.updateTime': '修改时间',
|
||||
'basicProfile.column.operation': '操作',
|
||||
'basicProfile.cell.pass': '已通过',
|
||||
'basicProfile.cell.auditing': '审核中',
|
||||
'basicProfile.cell.view': '查看',
|
||||
};
|
||||
@@ -1,58 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(new RegExp('/api/profile/basic'), () => {
|
||||
return successResponseWrap({
|
||||
status: 2,
|
||||
video: {
|
||||
mode: '自定义',
|
||||
acquisition: {
|
||||
resolution: '720*1280',
|
||||
frameRate: 15,
|
||||
},
|
||||
encoding: {
|
||||
resolution: '720*1280',
|
||||
rate: {
|
||||
min: 300,
|
||||
max: 800,
|
||||
default: 1500,
|
||||
},
|
||||
frameRate: 15,
|
||||
profile: 'high',
|
||||
},
|
||||
},
|
||||
audio: {
|
||||
mode: '自定义',
|
||||
acquisition: {
|
||||
channels: 8,
|
||||
},
|
||||
encoding: {
|
||||
channels: 8,
|
||||
rate: 128,
|
||||
profile: 'ACC-LC',
|
||||
},
|
||||
},
|
||||
});
|
||||
});
|
||||
Mock.mock(new RegExp('/api/operation/log'), () => {
|
||||
return successResponseWrap([
|
||||
{
|
||||
key: '1',
|
||||
contentNumber: '视频类001003',
|
||||
updateContent: '视频参数变更',
|
||||
status: 0,
|
||||
updateTime: '2021-02-28 10:30:50',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
contentNumber: '视频类058212',
|
||||
updateContent: '视频参数变更;音频参数变更',
|
||||
status: 1,
|
||||
updateTime: '2020-05-13 08:00:00',
|
||||
},
|
||||
]);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,77 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.result', 'menu.result.error']" />
|
||||
<div class="wrapper">
|
||||
<a-result
|
||||
class="result"
|
||||
status="error"
|
||||
:title="$t('error.result.title')"
|
||||
:subtitle="$t('error.result.subTitle')"
|
||||
>
|
||||
<template #extra>
|
||||
<a-space class="operation-wrap" :size="16">
|
||||
<a-button key="again" type="secondary">
|
||||
{{ $t('error.result.goBack') }}
|
||||
</a-button>
|
||||
<a-button key="back" type="primary">
|
||||
{{ $t('error.result.retry') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-result>
|
||||
|
||||
<div class="details-wrapper">
|
||||
<a-typography-title :heading="6" style="margin-top: 0">
|
||||
{{ $t('error.detailTitle') }}
|
||||
</a-typography-title>
|
||||
<a-typography-paragraph style="margin-bottom: 0">
|
||||
<ol>
|
||||
<li>
|
||||
{{ $t('error.detailLine.record') }}
|
||||
<a-link>
|
||||
<IconLink />
|
||||
{{ $t('error.detailLine.record.link') }}
|
||||
</a-link>
|
||||
</li>
|
||||
<li>{{ $t('error.detailLine.auth') }}</li>
|
||||
</ol>
|
||||
</a-typography-paragraph>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup></script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Error',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
.wrapper {
|
||||
padding: 24px 150px;
|
||||
background-color: var(--color-bg-2);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.result {
|
||||
margin: 150px 0 36px 0;
|
||||
}
|
||||
|
||||
.operation-wrap {
|
||||
margin-bottom: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.details-wrapper {
|
||||
width: 100%;
|
||||
margin-bottom: 150px;
|
||||
padding: 20px;
|
||||
background-color: rgb(var(--gray-1));
|
||||
}
|
||||
</style>
|
||||
@@ -1,13 +0,0 @@
|
||||
export default {
|
||||
'menu.result.error': 'Error',
|
||||
'error.result.title': 'Submit Error',
|
||||
'error.result.subTitle': 'Submit form error',
|
||||
'error.result.goBack': 'Go Back',
|
||||
'error.result.retry': 'return for correction',
|
||||
'error.detailTitle': 'Details of Error',
|
||||
'error.detailLine.record':
|
||||
'The current domain name has not been registered, please check the registration process: ',
|
||||
'error.detailLine.record.link': 'Registration Process',
|
||||
'error.detailLine.auth':
|
||||
'Your user group does not have the authority to perform this operation;',
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
export default {
|
||||
'menu.result.error': '失败页',
|
||||
'error.result.title': '提交失败',
|
||||
'error.result.subTitle': '表单提交失败,请重试。',
|
||||
'error.result.goBack': '回到首页',
|
||||
'error.result.retry': '返回修改',
|
||||
'error.detailTitle': '错误详情',
|
||||
'error.detailLine.record': '当前域名未备案,备案流程请查看:',
|
||||
'error.detailLine.record.link': '备案流程',
|
||||
'error.detailLine.auth': '你的用户组不具有进行此操作的权限;',
|
||||
};
|
||||
@@ -1,99 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb :items="['menu.result', 'menu.result.success']" />
|
||||
<div class="wrapper">
|
||||
<a-result
|
||||
class="result"
|
||||
status="success"
|
||||
:title="$t('success.result.title')"
|
||||
:subtitle="$t('success.result.subTitle')"
|
||||
>
|
||||
<template #extra>
|
||||
<a-space class="operation-wrap" :size="16">
|
||||
<a-button key="again" type="secondary">
|
||||
{{ $t('success.result.printResult') }}
|
||||
</a-button>
|
||||
<a-button key="back" type="primary">
|
||||
{{ $t('success.result.projectList') }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-result>
|
||||
|
||||
<div class="steps-wrapper">
|
||||
<a-typography-paragraph bold>{{
|
||||
$t('success.result.progress')
|
||||
}}</a-typography-paragraph>
|
||||
<a-steps type="dot" :current="2">
|
||||
<a-step
|
||||
:title="$t('success.submitApplication')"
|
||||
description="2020/10/10 14:00:39"
|
||||
/>
|
||||
<a-step
|
||||
:title="$t('success.leaderReview')"
|
||||
:description="$t('success.processing')"
|
||||
/>
|
||||
<a-step
|
||||
:title="$t('success.purchaseCertificate')"
|
||||
:description="$t('success.waiting')"
|
||||
/>
|
||||
<a-step
|
||||
:title="$t('success.safetyTest')"
|
||||
:description="$t('success.waiting')"
|
||||
/>
|
||||
<a-step
|
||||
:title="$t('success.launched')"
|
||||
:description="$t('success.waiting')"
|
||||
/>
|
||||
</a-steps>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup></script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'Success',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
.wrapper {
|
||||
padding: 24px 150px;
|
||||
background-color: var(--color-bg-2);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.result {
|
||||
margin: 150px 0 0 0;
|
||||
}
|
||||
|
||||
.operation-wrap {
|
||||
margin-bottom: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.steps-wrapper {
|
||||
width: 100%;
|
||||
min-width: fit-content;
|
||||
margin-bottom: 150px;
|
||||
padding: 20px;
|
||||
background-color: rgb(var(--gray-1));
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.mobile {
|
||||
.wrapper {
|
||||
padding: 24px 10px;
|
||||
.steps-wrapper {
|
||||
transform: scale(0.8);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,15 +0,0 @@
|
||||
export default {
|
||||
'menu.result.success': 'Success',
|
||||
'success.result.title': 'Submit Success',
|
||||
'success.result.subTitle': 'Submit form success!',
|
||||
'success.result.printResult': 'Print result',
|
||||
'success.result.projectList': 'Project List',
|
||||
'success.result.progress': 'Progress',
|
||||
'success.submitApplication': 'Submit Application',
|
||||
'success.leaderReview': 'Leader Review',
|
||||
'success.purchaseCertificate': 'Purchase Certificate',
|
||||
'success.safetyTest': 'Safety Test',
|
||||
'success.launched': 'Officially launched',
|
||||
'success.waiting': 'Waiting',
|
||||
'success.processing': 'Processing',
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
export default {
|
||||
'menu.result.success': '成功页',
|
||||
'success.result.title': '提交成功',
|
||||
'success.result.subTitle': '表单提交成功!',
|
||||
'success.result.printResult': '打印结果',
|
||||
'success.result.projectList': '返回项目列表',
|
||||
'success.result.progress': '当前进度',
|
||||
'success.submitApplication': '提交申请',
|
||||
'success.leaderReview': '直属领导审核',
|
||||
'success.purchaseCertificate': '购买证书',
|
||||
'success.safetyTest': '安全测试',
|
||||
'success.launched': '正式上线',
|
||||
'success.waiting': '未开始',
|
||||
'success.processing': '进行中',
|
||||
};
|
||||
@@ -1,162 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
// 最新项目
|
||||
Mock.mock(new RegExp('/api/user/my-project/list'), () => {
|
||||
const contributors = [
|
||||
{
|
||||
name: '秦臻宇',
|
||||
email: 'qingzhenyu@arco.design',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp',
|
||||
},
|
||||
{
|
||||
name: '于涛',
|
||||
email: 'yuebao@arco.design',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp',
|
||||
},
|
||||
{
|
||||
name: '宁波',
|
||||
email: 'ningbo@arco.design',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
},
|
||||
{
|
||||
name: '郑曦月',
|
||||
email: 'zhengxiyue@arco.design',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/8361eeb82904210b4f55fab888fe8416.png~tplv-uwbnlip3yd-webp.webp',
|
||||
},
|
||||
{
|
||||
name: '宁波',
|
||||
email: 'ningbo@arco.design',
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
},
|
||||
];
|
||||
const units = [
|
||||
{
|
||||
name: '企业级产品设计系统',
|
||||
description: 'Arco Design System',
|
||||
},
|
||||
{
|
||||
name: '火山引擎智能应用',
|
||||
description: 'The Volcano Engine',
|
||||
},
|
||||
{
|
||||
name: 'OCR文本识别',
|
||||
description: 'OCR text recognition',
|
||||
},
|
||||
{
|
||||
name: '内容资源管理',
|
||||
description: 'Content resource management ',
|
||||
},
|
||||
{
|
||||
name: '今日头条内容管理',
|
||||
description: 'Toutiao content management',
|
||||
},
|
||||
{
|
||||
name: '智能机器人',
|
||||
description: 'Intelligent Robot Project',
|
||||
},
|
||||
];
|
||||
return successResponseWrap(
|
||||
new Array(6).fill(null).map((_item, index) => ({
|
||||
id: index,
|
||||
name: units[index].name,
|
||||
description: units[index].description,
|
||||
peopleNumber: Mock.Random.natural(10, 1000),
|
||||
contributors,
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
// 最新动态
|
||||
Mock.mock(new RegExp('/api/user/latest-activity'), () => {
|
||||
return successResponseWrap(
|
||||
new Array(7).fill(null).map((_item, index) => ({
|
||||
id: index,
|
||||
title: '发布了项目 Arco Design System',
|
||||
description: '企业级产品设计系统',
|
||||
avatar:
|
||||
'//lf1-xgcdn-tos.pstatp.com/obj/vcloud/vadmin/start.8e0e4855ee346a46ccff8ff3e24db27b.png',
|
||||
}))
|
||||
);
|
||||
});
|
||||
|
||||
// 访问量
|
||||
Mock.mock(new RegExp('/api/user/visits'), () => {
|
||||
return successResponseWrap([
|
||||
{
|
||||
name: '主页访问量',
|
||||
visits: 5670,
|
||||
growth: 206.32,
|
||||
},
|
||||
{
|
||||
name: '项目访问量',
|
||||
visits: 5670,
|
||||
growth: 206.32,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
// 项目和团队列表
|
||||
Mock.mock(new RegExp('/api/user/project-and-team/list'), () => {
|
||||
return successResponseWrap([
|
||||
{
|
||||
id: 1,
|
||||
content: '他创建的项目',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
content: '他参与的项目',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
content: '他创建的团队',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
content: '他加入的团队',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
// 团队列表
|
||||
Mock.mock(new RegExp('/api/user/my-team/list'), () => {
|
||||
return successResponseWrap([
|
||||
{
|
||||
id: 1,
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp',
|
||||
name: '火山引擎智能应用团队',
|
||||
peopleNumber: Mock.Random.natural(10, 100),
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
name: '企业级产品设计团队',
|
||||
peopleNumber: Mock.Random.natural(5000, 6000),
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/3ee5f13fb09879ecb5185e440cef6eb9.png~tplv-uwbnlip3yd-webp.webp',
|
||||
name: '前端/UE小分队',
|
||||
peopleNumber: Mock.Random.natural(10, 5000),
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
avatar:
|
||||
'//p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/8361eeb82904210b4f55fab888fe8416.png~tplv-uwbnlip3yd-webp.webp',
|
||||
name: '内容识别插件小分队',
|
||||
peopleNumber: Mock.Random.natural(10, 100),
|
||||
},
|
||||
]);
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,42 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(new RegExp('/api/user/save-info'), () => {
|
||||
return successResponseWrap('ok');
|
||||
});
|
||||
Mock.mock(new RegExp('/api/user/certification'), () => {
|
||||
return successResponseWrap({
|
||||
enterpriseInfo: {
|
||||
accountType: '企业账号',
|
||||
status: 0,
|
||||
time: '2018-10-22 14:53:12',
|
||||
legalPerson: '李**',
|
||||
certificateType: '中国身份证',
|
||||
authenticationNumber: '130************123',
|
||||
enterpriseName: '低调有实力的企业',
|
||||
enterpriseCertificateType: '企业营业执照',
|
||||
organizationCode: '7*******9',
|
||||
},
|
||||
record: [
|
||||
{
|
||||
certificationType: 1,
|
||||
certificationContent: '企业实名认证,法人姓名:李**',
|
||||
status: 0,
|
||||
time: '2021-02-28 10:30:50',
|
||||
},
|
||||
{
|
||||
certificationType: 1,
|
||||
certificationContent: '企业实名认证,法人姓名:李**',
|
||||
status: 1,
|
||||
time: '2020-05-13 08:00:00',
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
Mock.mock(new RegExp('/api/user/upload'), () => {
|
||||
return successResponseWrap('ok');
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,291 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card :bordered="false" :style="cardStyle">
|
||||
<div class="content-wrap">
|
||||
<div class="content">
|
||||
<a-statistic
|
||||
:title="title"
|
||||
:value="renderData.count"
|
||||
:value-from="0"
|
||||
animation
|
||||
show-group-separator
|
||||
/>
|
||||
<div class="desc">
|
||||
<a-typography-text type="secondary" class="label">
|
||||
{{ $t('dataAnalysis.card.yesterday') }}
|
||||
</a-typography-text>
|
||||
<a-typography-text type="danger">
|
||||
{{ renderData.growth }}
|
||||
<icon-arrow-rise />
|
||||
</a-typography-text>
|
||||
</div>
|
||||
</div>
|
||||
<div class="chart">
|
||||
<Chart v-if="!loading" :option="chartOption" />
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, PropType, CSSProperties } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import {
|
||||
queryPublicOpinionAnalysis,
|
||||
PublicOpinionAnalysis,
|
||||
PublicOpinionAnalysisRes,
|
||||
} from '@/api/visualization';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const barChartOptionsFactory = () => {
|
||||
const data = ref<any>([]);
|
||||
const { chartOption } = useChartOption(() => {
|
||||
return {
|
||||
grid: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 10,
|
||||
bottom: 0,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
show: false,
|
||||
},
|
||||
yAxis: {
|
||||
show: false,
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
},
|
||||
series: {
|
||||
name: 'total',
|
||||
data,
|
||||
type: 'bar',
|
||||
barWidth: 7,
|
||||
itemStyle: {
|
||||
borderRadius: 2,
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
return {
|
||||
data,
|
||||
chartOption,
|
||||
};
|
||||
};
|
||||
|
||||
const lineChartOptionsFactory = () => {
|
||||
const data = ref<number[][]>([[], []]);
|
||||
const { chartOption } = useChartOption(() => {
|
||||
return {
|
||||
grid: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 10,
|
||||
bottom: 0,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
show: false,
|
||||
},
|
||||
yAxis: {
|
||||
show: false,
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '2001',
|
||||
data: data.value[0],
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
color: '#165DFF',
|
||||
width: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '2002',
|
||||
data: data.value[1],
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
color: '#6AA1FF',
|
||||
width: 3,
|
||||
type: 'dashed',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
return {
|
||||
data,
|
||||
chartOption,
|
||||
};
|
||||
};
|
||||
|
||||
const pieChartOptionsFactory = () => {
|
||||
const data = ref<any>([]);
|
||||
const { chartOption } = useChartOption(() => {
|
||||
return {
|
||||
grid: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
top: 'center',
|
||||
right: '0',
|
||||
orient: 'vertical',
|
||||
icon: 'circle',
|
||||
itemWidth: 6,
|
||||
itemHeight: 6,
|
||||
textStyle: {
|
||||
color: '#4E5969',
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '总计',
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'],
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
data,
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
return {
|
||||
data,
|
||||
chartOption,
|
||||
};
|
||||
};
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
quota: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
chartType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
cardStyle: {
|
||||
type: Object as PropType<CSSProperties>,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const { chartOption: lineChartOption, data: lineData } =
|
||||
lineChartOptionsFactory();
|
||||
const { chartOption: barChartOption, data: barData } =
|
||||
barChartOptionsFactory();
|
||||
const { chartOption: pieChartOption, data: pieData } =
|
||||
pieChartOptionsFactory();
|
||||
const renderData = ref<PublicOpinionAnalysisRes>({
|
||||
count: 0,
|
||||
growth: 0,
|
||||
chartData: [],
|
||||
});
|
||||
const chartOption = ref({});
|
||||
const fetchData = async (params: PublicOpinionAnalysis) => {
|
||||
try {
|
||||
const { data } = await queryPublicOpinionAnalysis(params);
|
||||
renderData.value = data;
|
||||
const { chartData } = data;
|
||||
if (props.chartType === 'bar') {
|
||||
chartData.forEach((el, idx) => {
|
||||
barData.value.push({
|
||||
value: el.y,
|
||||
itemStyle: {
|
||||
color: idx % 2 ? '#2CAB40' : '#86DF6C',
|
||||
},
|
||||
});
|
||||
});
|
||||
chartOption.value = barChartOption.value;
|
||||
} else if (props.chartType === 'line') {
|
||||
chartData.forEach((el) => {
|
||||
if (el.name === '2021') {
|
||||
lineData.value[0].push(el.y);
|
||||
} else {
|
||||
lineData.value[1].push(el.y);
|
||||
}
|
||||
});
|
||||
chartOption.value = lineChartOption.value;
|
||||
} else {
|
||||
chartData.forEach((el) => {
|
||||
pieData.value.push(el);
|
||||
});
|
||||
chartOption.value = pieChartOption.value;
|
||||
}
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData({ quota: props.quota });
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
:deep(.arco-card) {
|
||||
border-radius: 4px;
|
||||
}
|
||||
:deep(.arco-card-body) {
|
||||
width: 100%;
|
||||
height: 134px;
|
||||
padding: 0;
|
||||
}
|
||||
.content-wrap {
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
:deep(.content) {
|
||||
float: left;
|
||||
width: 108px;
|
||||
height: 102px;
|
||||
}
|
||||
:deep(.arco-statistic) {
|
||||
.arco-statistic-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.arco-statistic-content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.chart {
|
||||
float: right;
|
||||
width: calc(100% - 108px);
|
||||
height: 90px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.label {
|
||||
padding-right: 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,216 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card class="general-card" :header-style="{ paddingBottom: '16px' }">
|
||||
<template #title>
|
||||
{{ $t('dataAnalysis.contentPeriodAnalysis') }}
|
||||
</template>
|
||||
<Chart style="width: 100%; height: 370px" :option="chartOption" />
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryContentPeriodAnalysis } from '@/api/visualization';
|
||||
import { ToolTipFormatterParams } from '@/types/echarts';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const tooltipItemsHtmlString = (items: ToolTipFormatterParams[]) => {
|
||||
return items
|
||||
.map(
|
||||
(el) => `<div class="content-panel">
|
||||
<p>
|
||||
<span style="background-color: ${el.color}" class="tooltip-item-icon"></span>
|
||||
<span>${el.seriesName}</span>
|
||||
</p>
|
||||
<span class="tooltip-value">
|
||||
${el.value}%
|
||||
</span>
|
||||
</div>`
|
||||
)
|
||||
.join('');
|
||||
};
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const xAxis = ref<string[]>([]);
|
||||
const textChartsData = ref<number[]>([]);
|
||||
const imgChartsData = ref<number[]>([]);
|
||||
const videoChartsData = ref<number[]>([]);
|
||||
const { chartOption } = useChartOption((isDark) => {
|
||||
return {
|
||||
grid: {
|
||||
left: '40',
|
||||
right: 0,
|
||||
top: '20',
|
||||
bottom: '100',
|
||||
},
|
||||
legend: {
|
||||
bottom: 0,
|
||||
icon: 'circle',
|
||||
textStyle: {
|
||||
color: '#4E5969',
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xAxis.value,
|
||||
boundaryGap: false,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#3f3f3f' : '#A9AEB8',
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
alignWithLabel: true,
|
||||
lineStyle: {
|
||||
color: '#86909C',
|
||||
},
|
||||
interval(idx: number) {
|
||||
if (idx === 0) return false;
|
||||
if (idx === xAxis.value.length - 1) return false;
|
||||
return true;
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#86909C',
|
||||
formatter(value: number, idx: number) {
|
||||
if (idx === 0) return '';
|
||||
if (idx === xAxis.value.length - 1) return '';
|
||||
return `${value}`;
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: '#86909C',
|
||||
formatter: '{value}%',
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#3F3F3F' : '#E5E6EB',
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
formatter(params) {
|
||||
const [firstElement] = params as ToolTipFormatterParams[];
|
||||
return `<div>
|
||||
<p class="tooltip-title">${firstElement.axisValueLabel}</p>
|
||||
${tooltipItemsHtmlString(params as ToolTipFormatterParams[])}
|
||||
</div>`;
|
||||
},
|
||||
className: 'echarts-tooltip-diy',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '纯文本',
|
||||
data: textChartsData.value,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
color: isDark ? '#3D72F6' : '#246EFF',
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
borderColor: '#E0E3FF',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '图文类',
|
||||
data: imgChartsData.value,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
color: isDark ? '#A079DC' : '#00B2FF',
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
borderColor: '#E2F2FF',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '视频类',
|
||||
data: videoChartsData.value,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
showSymbol: false,
|
||||
color: isDark ? '#6CAAF5' : '#81E2FF',
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
itemStyle: {
|
||||
borderWidth: 2,
|
||||
borderColor: '#D9F6FF',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
dataZoom: [
|
||||
{
|
||||
bottom: 40,
|
||||
type: 'slider',
|
||||
left: 40,
|
||||
right: 14,
|
||||
height: 14,
|
||||
borderColor: 'transparent',
|
||||
handleIcon:
|
||||
'image://http://p3-armor.byteimg.com/tos-cn-i-49unhts6dw/1ee5a8c6142b2bcf47d2a9f084096447.svg~tplv-49unhts6dw-image.image',
|
||||
handleSize: '20',
|
||||
handleStyle: {
|
||||
shadowColor: 'rgba(0, 0, 0, 0.2)',
|
||||
shadowBlur: 4,
|
||||
},
|
||||
brushSelect: false,
|
||||
backgroundColor: isDark ? '#313132' : '#F2F3F5',
|
||||
},
|
||||
{
|
||||
type: 'inside',
|
||||
start: 0,
|
||||
end: 100,
|
||||
zoomOnMouseWheel: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
const fetchData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { data: chartData } = await queryContentPeriodAnalysis();
|
||||
xAxis.value = chartData.xAxis;
|
||||
chartData.data.forEach((el) => {
|
||||
if (el.name === '纯文本') {
|
||||
textChartsData.value = el.value;
|
||||
} else if (el.name === '图文类') {
|
||||
imgChartsData.value = el.value;
|
||||
}
|
||||
videoChartsData.value = el.value;
|
||||
});
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.chart-box {
|
||||
width: 100%;
|
||||
height: 230px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,162 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card class="general-card" :header-style="{ paddingBottom: '14px' }">
|
||||
<template #title>
|
||||
{{ $t('dataAnalysis.contentPublishRatio') }}
|
||||
</template>
|
||||
<template #extra>
|
||||
<a-link>{{ $t('workplace.viewMore') }}</a-link>
|
||||
</template>
|
||||
<Chart style="width: 100%; height: 347px" :option="chartOption" />
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ToolTipFormatterParams } from '@/types/echarts';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import {
|
||||
queryContentPublish,
|
||||
ContentPublishRecord,
|
||||
} from '@/api/visualization';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const tooltipItemsHtmlString = (items: ToolTipFormatterParams[]) => {
|
||||
return items
|
||||
.map(
|
||||
(el) => `<div class="content-panel">
|
||||
<p>
|
||||
<span style="background-color: ${
|
||||
el.color
|
||||
}" class="tooltip-item-icon"></span>
|
||||
<span>
|
||||
${el.seriesName}
|
||||
</span>
|
||||
</p>
|
||||
<span class="tooltip-value">
|
||||
${Number(el.value).toLocaleString()}
|
||||
</span>
|
||||
</div>`
|
||||
)
|
||||
.join('');
|
||||
};
|
||||
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const xAxis = ref<string[]>([]);
|
||||
const textChartsData = ref<number[]>([]);
|
||||
const imgChartsData = ref<number[]>([]);
|
||||
const videoChartsData = ref<number[]>([]);
|
||||
const { chartOption } = useChartOption((isDark) => {
|
||||
return {
|
||||
grid: {
|
||||
left: '4%',
|
||||
right: 0,
|
||||
top: '20',
|
||||
bottom: '60',
|
||||
},
|
||||
legend: {
|
||||
bottom: 0,
|
||||
icon: 'circle',
|
||||
textStyle: {
|
||||
color: '#4E5969',
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: xAxis.value,
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#3f3f3f' : '#A9AEB8',
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
alignWithLabel: true,
|
||||
lineStyle: {
|
||||
color: '#86909C',
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
color: '#86909C',
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: '#86909C',
|
||||
formatter(value: number, idx: number) {
|
||||
if (idx === 0) return `${value}`;
|
||||
return `${value / 1000}k`;
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#3F3F3F' : '#E5E6EB',
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
formatter(params) {
|
||||
const [firstElement] = params as ToolTipFormatterParams[];
|
||||
return `<div>
|
||||
<p class="tooltip-title">${firstElement.axisValueLabel}</p>
|
||||
${tooltipItemsHtmlString(params as ToolTipFormatterParams[])}
|
||||
</div>`;
|
||||
},
|
||||
className: 'echarts-tooltip-diy',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '纯文本',
|
||||
data: textChartsData.value,
|
||||
stack: 'one',
|
||||
type: 'bar',
|
||||
barWidth: 16,
|
||||
color: isDark ? '#4A7FF7' : '#246EFF',
|
||||
},
|
||||
{
|
||||
name: '图文类',
|
||||
data: imgChartsData.value,
|
||||
stack: 'one',
|
||||
type: 'bar',
|
||||
color: isDark ? '#085FEF' : '#00B2FF',
|
||||
},
|
||||
{
|
||||
name: '视频类',
|
||||
data: videoChartsData.value,
|
||||
stack: 'one',
|
||||
type: 'bar',
|
||||
color: isDark ? '#01349F' : '#81E2FF',
|
||||
itemStyle: {
|
||||
borderRadius: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
const fetchData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { data: chartData } = await queryContentPublish();
|
||||
xAxis.value = chartData[0].x;
|
||||
chartData.forEach((el: ContentPublishRecord) => {
|
||||
if (el.name === '纯文本') {
|
||||
textChartsData.value = el.y;
|
||||
} else if (el.name === '图文类') {
|
||||
imgChartsData.value = el.y;
|
||||
}
|
||||
videoChartsData.value = el.y;
|
||||
});
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,75 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card class="general-card" :header-style="{ paddingBottom: '14px' }">
|
||||
<template #title>
|
||||
{{ $t('dataAnalysis.popularAuthor') }}
|
||||
</template>
|
||||
<template #extra>
|
||||
<a-link>{{ $t('workplace.viewMore') }}</a-link>
|
||||
</template>
|
||||
<a-table
|
||||
:data="tableData.list"
|
||||
:pagination="false"
|
||||
:bordered="false"
|
||||
style="margin-bottom: 20px"
|
||||
:scroll="{ x: '100%', y: '350px' }"
|
||||
>
|
||||
<template #columns>
|
||||
<a-table-column
|
||||
:title="$t('dataAnalysis.popularAuthor.column.ranking')"
|
||||
data-index="ranking"
|
||||
>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
:title="$t('dataAnalysis.popularAuthor.column.author')"
|
||||
data-index="author"
|
||||
>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
:title="$t('dataAnalysis.popularAuthor.column.content')"
|
||||
data-index="contentCount"
|
||||
:sortable="{
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
}"
|
||||
>
|
||||
</a-table-column>
|
||||
<a-table-column
|
||||
:title="$t('dataAnalysis.popularAuthor.column.click')"
|
||||
data-index="clickCount"
|
||||
:sortable="{
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
}"
|
||||
>
|
||||
</a-table-column>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryPopularAuthor, PopularAuthorRes } from '@/api/visualization';
|
||||
|
||||
const { loading, setLoading } = useLoading();
|
||||
const tableData = ref<PopularAuthorRes>({ list: [] });
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
setLoading(true);
|
||||
const { data } = await queryPopularAuthor();
|
||||
tableData.value = data;
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.general-card {
|
||||
max-height: 425px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,65 +0,0 @@
|
||||
<template>
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="$t('dataAnalysis.title.publicOpinion')"
|
||||
:header-style="{ paddingBottom: '12px' }"
|
||||
>
|
||||
<a-grid :cols="24" :col-gap="12" :row-gap="12">
|
||||
<a-grid-item :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 6, xxl: 6 }">
|
||||
<ChainItem
|
||||
:title="$t('dataAnalysis.card.title.allVisitors')"
|
||||
quota="visitors"
|
||||
chart-type="line"
|
||||
:card-style="{
|
||||
background: isDark
|
||||
? 'linear-gradient(180deg, #284991 0%, #122B62 100%)'
|
||||
: 'linear-gradient(180deg, #f2f9fe 0%, #e6f4fe 100%)',
|
||||
}"
|
||||
/>
|
||||
</a-grid-item>
|
||||
<a-grid-item :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 6, xxl: 6 }">
|
||||
<ChainItem
|
||||
:title="$t('dataAnalysis.card.title.contentPublished')"
|
||||
quota="published"
|
||||
chart-type="bar"
|
||||
:card-style="{
|
||||
background: isDark
|
||||
? ' linear-gradient(180deg, #3D492E 0%, #263827 100%)'
|
||||
: 'linear-gradient(180deg, #F5FEF2 0%, #E6FEEE 100%)',
|
||||
}"
|
||||
/>
|
||||
</a-grid-item>
|
||||
<a-grid-item :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 6, xxl: 6 }">
|
||||
<ChainItem
|
||||
:title="$t('dataAnalysis.card.title.totalComment')"
|
||||
quota="comment"
|
||||
chart-type="line"
|
||||
:card-style="{
|
||||
background: isDark
|
||||
? 'linear-gradient(180deg, #294B94 0%, #0F275C 100%)'
|
||||
: 'linear-gradient(180deg, #f2f9fe 0%, #e6f4fe 100%)',
|
||||
}"
|
||||
/>
|
||||
</a-grid-item>
|
||||
<a-grid-item :span="{ xs: 12, sm: 12, md: 12, lg: 12, xl: 6, xxl: 6 }">
|
||||
<ChainItem
|
||||
:title="$t('dataAnalysis.card.title.totalShare')"
|
||||
quota="share"
|
||||
chart-type="pie"
|
||||
:card-style="{
|
||||
background: isDark
|
||||
? 'linear-gradient(180deg, #312565 0%, #201936 100%)'
|
||||
: 'linear-gradient(180deg, #F7F7FF 0%, #ECECFF 100%)',
|
||||
}"
|
||||
/>
|
||||
</a-grid-item>
|
||||
</a-grid>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useThemes from '@/hooks/themes';
|
||||
import ChainItem from './chain-item.vue';
|
||||
|
||||
const { isDark } = useThemes();
|
||||
</script>
|
||||
@@ -1,65 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb
|
||||
:items="['menu.visualization', 'menu.visualization.dataAnalysis']"
|
||||
/>
|
||||
<a-space direction="vertical" :size="12" fill>
|
||||
<a-space direction="vertical" :size="16" fill>
|
||||
<div class="space-unit">
|
||||
<PublicOpinion />
|
||||
</div>
|
||||
<div>
|
||||
<a-grid :cols="24" :col-gap="16" :row-gap="16">
|
||||
<a-grid-item
|
||||
:span="{ xs: 24, sm: 24, md: 24, lg: 24, xl: 16, xxl: 16 }"
|
||||
>
|
||||
<ContentPublishRatio />
|
||||
</a-grid-item>
|
||||
<a-grid-item
|
||||
:span="{ xs: 24, sm: 24, md: 24, lg: 24, xl: 8, xxl: 8 }"
|
||||
>
|
||||
<PopularAuthor />
|
||||
</a-grid-item>
|
||||
</a-grid>
|
||||
</div>
|
||||
<div>
|
||||
<ContentPeriodAnalysis />
|
||||
</div>
|
||||
</a-space>
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import PublicOpinion from './components/public-opinion.vue';
|
||||
import ContentPeriodAnalysis from './components/content-period-analysis.vue';
|
||||
import ContentPublishRatio from './components/content-publish-ratio.vue';
|
||||
import PopularAuthor from './components/popular-author.vue';
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'DataAnalysis',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.space-unit {
|
||||
background-color: var(--color-bg-2);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.title-fix {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 14;
|
||||
}
|
||||
:deep(.section-title) {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,16 +0,0 @@
|
||||
export default {
|
||||
'menu.visualization.dataAnalysis': 'Analysis',
|
||||
'dataAnalysis.title.publicOpinion': 'Public Opinion Analysis',
|
||||
'dataAnalysis.card.title.allVisitors': 'All Visitors',
|
||||
'dataAnalysis.card.title.contentPublished': 'Content Published',
|
||||
'dataAnalysis.card.title.totalComment': 'Total Comment',
|
||||
'dataAnalysis.card.title.totalShare': 'Total Share',
|
||||
'dataAnalysis.card.yesterday': 'Yesterday',
|
||||
'dataAnalysis.contentPublishRatio': 'Content Publishing Ratio',
|
||||
'dataAnalysis.popularAuthor': 'Popular Author',
|
||||
'dataAnalysis.popularAuthor.column.ranking': 'ranking',
|
||||
'dataAnalysis.popularAuthor.column.author': 'author',
|
||||
'dataAnalysis.popularAuthor.column.content': 'Content Number',
|
||||
'dataAnalysis.popularAuthor.column.click': 'Click Number',
|
||||
'dataAnalysis.contentPeriodAnalysis': 'Content Period Analysis',
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
export default {
|
||||
'menu.visualization.dataAnalysis': '分析页',
|
||||
'dataAnalysis.title.publicOpinion': '舆情分析',
|
||||
'dataAnalysis.card.title.allVisitors': '访问总人次',
|
||||
'dataAnalysis.card.title.contentPublished': '内容发布量',
|
||||
'dataAnalysis.card.title.totalComment': '评论总量',
|
||||
'dataAnalysis.card.title.totalShare': '分享总量',
|
||||
'dataAnalysis.card.yesterday': '较昨日',
|
||||
'dataAnalysis.contentPublishRatio': '内容发布比例',
|
||||
'dataAnalysis.popularAuthor': '热门作者榜单',
|
||||
'dataAnalysis.popularAuthor.column.ranking': '排名',
|
||||
'dataAnalysis.popularAuthor.column.author': '作者',
|
||||
'dataAnalysis.popularAuthor.column.content': '内容量',
|
||||
'dataAnalysis.popularAuthor.column.click': '点击量',
|
||||
'dataAnalysis.contentPeriodAnalysis': '内容时段分析',
|
||||
};
|
||||
@@ -1,108 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
import { PostData } from '@/types/global';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(
|
||||
new RegExp('/api/public-opinion-analysis'),
|
||||
(params: PostData) => {
|
||||
const { quota = 'visitors' } = JSON.parse(params.body);
|
||||
if (['visitors', 'comment'].includes(quota)) {
|
||||
const year = new Date().getFullYear();
|
||||
const getLineData = (name: number) => {
|
||||
return new Array(12).fill(0).map((_item, index) => ({
|
||||
x: `${index + 1}月`,
|
||||
y: Mock.Random.natural(0, 100),
|
||||
name: String(name),
|
||||
}));
|
||||
};
|
||||
return successResponseWrap({
|
||||
count: 5670,
|
||||
growth: 206.32,
|
||||
chartData: [...getLineData(year), ...getLineData(year - 1)],
|
||||
});
|
||||
}
|
||||
if (['published'].includes(quota)) {
|
||||
const year = new Date().getFullYear();
|
||||
const getLineData = (name: number) => {
|
||||
return new Array(12).fill(0).map((_item, index) => ({
|
||||
x: `${index + 1}日`,
|
||||
y: Mock.Random.natural(20, 100),
|
||||
name: String(name),
|
||||
}));
|
||||
};
|
||||
return successResponseWrap({
|
||||
count: 5670,
|
||||
growth: 206.32,
|
||||
chartData: [...getLineData(year)],
|
||||
});
|
||||
}
|
||||
return successResponseWrap({
|
||||
count: 5670,
|
||||
growth: 206.32,
|
||||
chartData: [
|
||||
// itemStyle for demo
|
||||
{ name: '文本类', value: 25, itemStyle: { color: '#8D4EDA' } },
|
||||
{ name: '图文类', value: 35, itemStyle: { color: '#165DFF' } },
|
||||
{ name: '视频类', value: 40, itemStyle: { color: '#00B2FF' } },
|
||||
],
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Mock.mock(new RegExp('/api/content-period-analysis'), () => {
|
||||
const getLineData = (name: string) => {
|
||||
return {
|
||||
name,
|
||||
value: new Array(12).fill(0).map(() => Mock.Random.natural(30, 90)),
|
||||
};
|
||||
};
|
||||
return successResponseWrap({
|
||||
xAxis: new Array(12).fill(0).map((_item, index) => `${index * 2}:00`),
|
||||
data: [
|
||||
getLineData('纯文本'),
|
||||
getLineData('图文类'),
|
||||
getLineData('视频类'),
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
Mock.mock(new RegExp('/api/content-publish'), () => {
|
||||
const generateLineData = (name: string) => {
|
||||
const result = {
|
||||
name,
|
||||
x: [] as string[],
|
||||
y: [] as number[],
|
||||
};
|
||||
new Array(12).fill(0).forEach((_item, index) => {
|
||||
result.x.push(`${index * 2}:00`);
|
||||
result.y.push(Mock.Random.natural(1000, 3000));
|
||||
});
|
||||
return result;
|
||||
};
|
||||
return successResponseWrap([
|
||||
generateLineData('纯文本'),
|
||||
generateLineData('图文类'),
|
||||
generateLineData('视频类'),
|
||||
]);
|
||||
});
|
||||
|
||||
Mock.mock(new RegExp('/api/popular-author/list'), () => {
|
||||
const generateData = () => {
|
||||
const list = new Array(7).fill(0).map((_item, index) => ({
|
||||
ranking: index + 1,
|
||||
author: Mock.mock('@ctitle(5)'),
|
||||
contentCount: Mock.mock(/[0-9]{4}/),
|
||||
clickCount: Mock.mock(/[0-9]{4}/),
|
||||
}));
|
||||
return {
|
||||
list,
|
||||
};
|
||||
};
|
||||
return successResponseWrap({
|
||||
...generateData(),
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -1,152 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="title"
|
||||
:header-style="{ paddingBottom: '12px' }"
|
||||
>
|
||||
<div class="content">
|
||||
<a-statistic
|
||||
:value="count"
|
||||
:show-group-separator="true"
|
||||
:value-from="0"
|
||||
animation
|
||||
/>
|
||||
<a-typography-text
|
||||
class="percent-text"
|
||||
:type="isUp ? 'danger' : 'success'"
|
||||
>
|
||||
{{ growth }}%
|
||||
<icon-arrow-rise v-if="isUp" />
|
||||
<icon-arrow-fall v-else />
|
||||
</a-typography-text>
|
||||
</div>
|
||||
<div class="chart">
|
||||
<Chart :option="chartOption" />
|
||||
</div>
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { queryDataChainGrowth, DataChainGrowth } from '@/api/visualization';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
quota: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
chartType: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const count = ref(0);
|
||||
const growth = ref(100);
|
||||
const isUp = computed(() => growth.value > 50);
|
||||
const chartData = ref<any>([]);
|
||||
const { chartOption } = useChartOption(() => {
|
||||
return {
|
||||
grid: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
show: false,
|
||||
},
|
||||
yAxis: {
|
||||
show: false,
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
formatter: '{c}',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: chartData.value,
|
||||
...(props.chartType === 'bar'
|
||||
? {
|
||||
type: 'bar',
|
||||
barWidth: 7,
|
||||
barGap: '0',
|
||||
}
|
||||
: {
|
||||
type: 'line',
|
||||
showSymbol: false,
|
||||
smooth: true,
|
||||
lineStyle: {
|
||||
color: '#4080FF',
|
||||
},
|
||||
}),
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
const fetchData = async (params: DataChainGrowth) => {
|
||||
try {
|
||||
const { data } = await queryDataChainGrowth(params);
|
||||
const { chartData: resChartData } = data;
|
||||
count.value = data.count;
|
||||
growth.value = data.growth;
|
||||
resChartData.data.value.forEach((el, idx) => {
|
||||
if (props.chartType === 'bar') {
|
||||
chartData.value.push({
|
||||
value: el,
|
||||
itemStyle: {
|
||||
color: idx % 2 ? '#468DFF' : '#86DF6C',
|
||||
},
|
||||
});
|
||||
} else {
|
||||
chartData.value.push(el);
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData({ quota: props.quota });
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.general-card {
|
||||
min-height: 204px;
|
||||
}
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.percent-text {
|
||||
margin-left: 16px;
|
||||
}
|
||||
.chart {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.unit {
|
||||
padding-left: 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.label {
|
||||
padding-right: 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,230 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="$t('multiDAnalysis.card.title.contentPublishingSource')"
|
||||
>
|
||||
<Chart style="width: 100%; height: 300px" :option="chartOption" />
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useLoading from '@/hooks/loading';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const { chartOption } = useChartOption((isDark) => {
|
||||
const graphicElementStyle = {
|
||||
textAlign: 'center',
|
||||
fill: isDark ? 'rgba(255,255,255,0.7)' : '#4E5969',
|
||||
fontSize: 14,
|
||||
lineWidth: 10,
|
||||
fontWeight: 'bold',
|
||||
};
|
||||
return {
|
||||
legend: {
|
||||
left: 'center',
|
||||
data: ['UGC原创', '国外网站', '转载文章', '行业报告', '其他'],
|
||||
bottom: 0,
|
||||
icon: 'circle',
|
||||
itemWidth: 8,
|
||||
textStyle: {
|
||||
color: isDark ? 'rgba(255,255,255,0.7)' : '#4E5969',
|
||||
},
|
||||
itemStyle: {
|
||||
borderWidth: 0,
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'item',
|
||||
},
|
||||
graphic: {
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
left: '9.6%',
|
||||
top: 'center',
|
||||
style: {
|
||||
text: '纯文本',
|
||||
...graphicElementStyle,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
left: 'center',
|
||||
top: 'center',
|
||||
style: {
|
||||
text: '图文类',
|
||||
...graphicElementStyle,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
left: '86.6%',
|
||||
top: 'center',
|
||||
style: {
|
||||
text: '视频类',
|
||||
...graphicElementStyle,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'],
|
||||
center: ['11%', '50%'],
|
||||
label: {
|
||||
formatter: '{d}% ',
|
||||
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969',
|
||||
},
|
||||
itemStyle: {
|
||||
borderColor: isDark ? '#000' : '#fff',
|
||||
borderWidth: 1,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: [148564],
|
||||
name: 'UGC原创',
|
||||
itemStyle: {
|
||||
color: '#249EFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [334271],
|
||||
name: '国外网站',
|
||||
itemStyle: {
|
||||
color: '#846BCE',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '转载文章',
|
||||
itemStyle: {
|
||||
color: '#21CCFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '行业报告',
|
||||
itemStyle: {
|
||||
color: '#0E42D2',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '其他',
|
||||
itemStyle: {
|
||||
color: '#86DF6C',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'],
|
||||
center: ['50%', '50%'],
|
||||
label: {
|
||||
formatter: '{d}% ',
|
||||
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969',
|
||||
},
|
||||
itemStyle: {
|
||||
borderColor: isDark ? '#000' : '#fff',
|
||||
borderWidth: 1,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: [148564],
|
||||
name: 'UGC原创',
|
||||
itemStyle: {
|
||||
color: '#249EFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [334271],
|
||||
name: '国外网站',
|
||||
itemStyle: {
|
||||
color: '#846BCE',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '转载文章',
|
||||
itemStyle: {
|
||||
color: '#21CCFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '行业报告',
|
||||
itemStyle: {
|
||||
color: '#0E42D2',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '其他',
|
||||
itemStyle: {
|
||||
color: '#86DF6C',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
type: 'pie',
|
||||
radius: ['50%', '70%'],
|
||||
center: ['88%', '50%'],
|
||||
label: {
|
||||
formatter: '{d}% ',
|
||||
color: isDark ? 'rgba(255, 255, 255, 0.7)' : '#4E5969',
|
||||
},
|
||||
itemStyle: {
|
||||
borderColor: isDark ? '#000' : '#fff',
|
||||
borderWidth: 1,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: [148564],
|
||||
name: 'UGC原创',
|
||||
itemStyle: {
|
||||
color: '#249EFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [334271],
|
||||
name: '国外网站',
|
||||
itemStyle: {
|
||||
color: '#846BCE',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '转载文章',
|
||||
itemStyle: {
|
||||
color: '#21CCFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '行业报告',
|
||||
itemStyle: {
|
||||
color: '#0E42D2',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [445694],
|
||||
name: '其他',
|
||||
itemStyle: {
|
||||
color: '#86DF6C',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
const { loading } = useLoading(false);
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,103 +0,0 @@
|
||||
<template>
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="$t('multiDAnalysis.card.title.contentTypeDistribution')"
|
||||
:header-style="{ paddingBottom: 0 }"
|
||||
>
|
||||
<Chart style="height: 222px" :option="chartOption" />
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const { chartOption } = useChartOption((isDark) => {
|
||||
return {
|
||||
grid: {
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 0,
|
||||
bottom: 20,
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
top: 'center',
|
||||
right: '0',
|
||||
orient: 'vertical',
|
||||
icon: 'circle',
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
itemGap: 20,
|
||||
textStyle: {
|
||||
color: isDark ? '#ffffff' : '#4E5969',
|
||||
},
|
||||
},
|
||||
radar: {
|
||||
center: ['40%', '50%'],
|
||||
radius: 80,
|
||||
indicator: [
|
||||
{ name: '国际', max: 6500 },
|
||||
{ name: '财经', max: 22000 },
|
||||
{ name: '科技', max: 30000 },
|
||||
{ name: '其他', max: 38000 },
|
||||
{ name: '体育', max: 52000 },
|
||||
{ name: '娱乐', max: 25000 },
|
||||
],
|
||||
axisName: {
|
||||
color: isDark ? '#ffffff' : '#1D2129',
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#484849' : '#E5E6EB',
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#484849' : '#E5E6EB',
|
||||
},
|
||||
},
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
type: 'radar',
|
||||
areaStyle: {
|
||||
opacity: 0.2,
|
||||
},
|
||||
data: [
|
||||
{
|
||||
value: [4850, 19000, 19000, 29500, 35200, 20000],
|
||||
name: '纯文本',
|
||||
symbol: 'none',
|
||||
itemStyle: {
|
||||
color: isDark ? '#6CAAF5' : '#249EFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [2250, 17000, 21000, 23500, 42950, 22000],
|
||||
name: '图文类',
|
||||
symbol: 'none',
|
||||
itemStyle: {
|
||||
color: isDark ? '#A079DC' : '#313CA9',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: [5850, 11000, 26000, 27500, 46950, 18000],
|
||||
name: '视频类',
|
||||
symbol: 'none',
|
||||
itemStyle: {
|
||||
color: isDark ? '#3D72F6' : '#21CCFF',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,38 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="6">
|
||||
<ChainItem
|
||||
:title="$t('multiDAnalysis.card.title.retentionTrends')"
|
||||
quota="retentionTrends"
|
||||
chart-type="line"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<ChainItem
|
||||
:title="$t('multiDAnalysis.card.title.userRetention')"
|
||||
quota="userRetention"
|
||||
chart-type="bar"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<ChainItem
|
||||
:title="$t('multiDAnalysis.card.title.contentConsumptionTrends')"
|
||||
quota="contentConsumptionTrends"
|
||||
chart-type="line"
|
||||
/>
|
||||
</a-col>
|
||||
<a-col :span="6">
|
||||
<ChainItem
|
||||
:title="$t('multiDAnalysis.card.title.contentConsumption')"
|
||||
quota="contentConsumption"
|
||||
chart-type="bar"
|
||||
/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ChainItem from './chain-item.vue';
|
||||
</script>
|
||||
@@ -1,310 +0,0 @@
|
||||
<template>
|
||||
<a-spin :loading="loading" style="width: 100%">
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="$t('multiDAnalysis.card.title.dataOverview')"
|
||||
>
|
||||
<a-row justify="space-between">
|
||||
<a-col v-for="(item, idx) in renderData" :key="idx" :span="6">
|
||||
<a-statistic
|
||||
:title="item.title"
|
||||
:value="item.value"
|
||||
show-group-separator
|
||||
:value-from="0"
|
||||
animation
|
||||
>
|
||||
<template #prefix>
|
||||
<span
|
||||
class="statistic-prefix"
|
||||
:style="{ background: item.prefix.background }"
|
||||
>
|
||||
<component
|
||||
:is="item.prefix.icon"
|
||||
:style="{ color: item.prefix.iconColor }"
|
||||
/>
|
||||
</span>
|
||||
</template>
|
||||
</a-statistic>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<Chart style="height: 328px; margin-top: 20px" :option="chartOption" />
|
||||
</a-card>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { LineSeriesOption } from 'echarts';
|
||||
import { queryDataOverview } from '@/api/visualization';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import { ToolTipFormatterParams } from '@/types/echarts';
|
||||
import useThemes from '@/hooks/themes';
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const tooltipItemsHtmlString = (items: ToolTipFormatterParams[]) => {
|
||||
return items
|
||||
.map(
|
||||
(el) => `<div class="content-panel">
|
||||
<p>
|
||||
<span style="background-color: ${
|
||||
el.color
|
||||
}" class="tooltip-item-icon"></span><span>${el.seriesName}</span>
|
||||
</p>
|
||||
<span class="tooltip-value">${el.value.toLocaleString()}</span>
|
||||
</div>`
|
||||
)
|
||||
.reverse()
|
||||
.join('');
|
||||
};
|
||||
|
||||
const generateSeries = (
|
||||
name: string,
|
||||
lineColor: string,
|
||||
itemBorderColor: string,
|
||||
data: number[]
|
||||
): LineSeriesOption => {
|
||||
return {
|
||||
name,
|
||||
data,
|
||||
stack: 'Total',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
symbol: 'circle',
|
||||
symbolSize: 10,
|
||||
itemStyle: {
|
||||
color: lineColor,
|
||||
},
|
||||
emphasis: {
|
||||
focus: 'series',
|
||||
itemStyle: {
|
||||
color: lineColor,
|
||||
borderWidth: 2,
|
||||
borderColor: itemBorderColor,
|
||||
},
|
||||
},
|
||||
lineStyle: {
|
||||
width: 2,
|
||||
color: lineColor,
|
||||
},
|
||||
showSymbol: false,
|
||||
areaStyle: {
|
||||
opacity: 0.1,
|
||||
color: lineColor,
|
||||
},
|
||||
};
|
||||
};
|
||||
const { t } = useI18n();
|
||||
const { loading, setLoading } = useLoading(true);
|
||||
const { isDark } = useThemes();
|
||||
const renderData = computed(() => [
|
||||
{
|
||||
title: t('multiDAnalysis.dataOverview.contentProduction'),
|
||||
value: 1902,
|
||||
prefix: {
|
||||
icon: 'icon-edit',
|
||||
background: isDark.value ? '#593E2F' : '#FFE4BA',
|
||||
iconColor: isDark.value ? '#F29A43' : '#F77234',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('multiDAnalysis.dataOverview.contentClick'),
|
||||
value: 2445,
|
||||
prefix: {
|
||||
icon: 'icon-thumb-up',
|
||||
background: isDark.value ? '#3D5A62' : '#E8FFFB',
|
||||
iconColor: isDark.value ? '#6ED1CE' : '#33D1C9',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('multiDAnalysis.dataOverview.contentExposure'),
|
||||
value: 3034,
|
||||
prefix: {
|
||||
icon: 'icon-heart',
|
||||
background: isDark.value ? '#354276' : '#E8F3FF',
|
||||
iconColor: isDark.value ? '#4A7FF7' : '#165DFF',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: t('multiDAnalysis.dataOverview.activeUsers'),
|
||||
value: 1275,
|
||||
prefix: {
|
||||
icon: 'icon-user',
|
||||
background: isDark.value ? '#3F385E' : '#F5E8FF',
|
||||
iconColor: isDark.value ? '#8558D3' : '#722ED1',
|
||||
},
|
||||
},
|
||||
]);
|
||||
const xAxis = ref<string[]>([]);
|
||||
const contentProductionData = ref<number[]>([]);
|
||||
const contentClickData = ref<number[]>([]);
|
||||
const contentExposureData = ref<number[]>([]);
|
||||
const activeUsersData = ref<number[]>([]);
|
||||
const { chartOption } = useChartOption((dark) => {
|
||||
return {
|
||||
grid: {
|
||||
left: '2.6%',
|
||||
right: '4',
|
||||
top: '40',
|
||||
bottom: '40',
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
offset: 2,
|
||||
data: xAxis.value,
|
||||
boundaryGap: false,
|
||||
axisLabel: {
|
||||
color: '#4E5969',
|
||||
formatter(value: number, idx: number) {
|
||||
if (idx === 0) return '';
|
||||
if (idx === xAxis.value.length - 1) return '';
|
||||
return `${value}`;
|
||||
},
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisPointer: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#23ADFF',
|
||||
width: 2,
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
formatter(value: number, idx: number) {
|
||||
if (idx === 0) return String(value);
|
||||
return `${value / 1000}k`;
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: dark ? '#2E2E30' : '#F2F3F5',
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
formatter(params) {
|
||||
const [firstElement] = params as ToolTipFormatterParams[];
|
||||
return `<div>
|
||||
<p class="tooltip-title">${firstElement.axisValueLabel}</p>
|
||||
${tooltipItemsHtmlString(params as ToolTipFormatterParams[])}
|
||||
</div>`;
|
||||
},
|
||||
className: 'echarts-tooltip-diy',
|
||||
},
|
||||
graphic: {
|
||||
elements: [
|
||||
{
|
||||
type: 'text',
|
||||
left: '2.6%',
|
||||
bottom: '18',
|
||||
style: {
|
||||
text: '12.10',
|
||||
textAlign: 'center',
|
||||
fill: '#4E5969',
|
||||
fontSize: 12,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
right: '0',
|
||||
bottom: '18',
|
||||
style: {
|
||||
text: '12.17',
|
||||
textAlign: 'center',
|
||||
fill: '#4E5969',
|
||||
fontSize: 12,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
series: [
|
||||
generateSeries(
|
||||
'内容生产量',
|
||||
'#722ED1',
|
||||
'#F5E8FF',
|
||||
contentProductionData.value
|
||||
),
|
||||
generateSeries(
|
||||
'内容点击量',
|
||||
'#F77234',
|
||||
'#FFE4BA',
|
||||
contentClickData.value
|
||||
),
|
||||
generateSeries(
|
||||
'内容曝光量',
|
||||
'#33D1C9',
|
||||
'#E8FFFB',
|
||||
contentExposureData.value
|
||||
),
|
||||
generateSeries(
|
||||
'活跃用户数',
|
||||
'#3469FF',
|
||||
'#E8F3FF',
|
||||
activeUsersData.value
|
||||
),
|
||||
],
|
||||
};
|
||||
});
|
||||
const fetchData = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const { data } = await queryDataOverview();
|
||||
xAxis.value = data.xAxis;
|
||||
data.data.forEach((el) => {
|
||||
if (el.name === '内容生产量') {
|
||||
contentProductionData.value = el.value;
|
||||
} else if (el.name === '内容点击量') {
|
||||
contentClickData.value = el.value;
|
||||
} else if (el.name === '内容曝光量') {
|
||||
contentExposureData.value = el.value;
|
||||
}
|
||||
activeUsersData.value = el.value;
|
||||
});
|
||||
} catch (err) {
|
||||
// you can report use errorHandler or other
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
fetchData();
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
:deep(.arco-statistic) {
|
||||
.arco-statistic-title {
|
||||
color: rgb(var(--gray-10));
|
||||
font-weight: bold;
|
||||
}
|
||||
.arco-statistic-value {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.statistic-prefix {
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 8px;
|
||||
color: var(--color-white);
|
||||
font-size: 16px;
|
||||
line-height: 32px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border-radius: 6px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,76 +0,0 @@
|
||||
<template>
|
||||
<a-card
|
||||
class="general-card"
|
||||
:title="$t('multiDAnalysis.card.title.userActions')"
|
||||
>
|
||||
<Chart height="122px" :option="chartOption" />
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import useChartOption from '@/hooks/chart-option';
|
||||
|
||||
const { chartOption } = useChartOption((isDark) => {
|
||||
return {
|
||||
grid: {
|
||||
left: 44,
|
||||
right: 20,
|
||||
top: 0,
|
||||
bottom: 20,
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
show: true,
|
||||
formatter(value: number, idx: number) {
|
||||
if (idx === 0) return String(value);
|
||||
return `${Number(value) / 1000}k`;
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#484849' : '#E5E8EF',
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: ['点赞量', '评论量', '分享量'],
|
||||
axisLabel: {
|
||||
show: true,
|
||||
color: '#4E5969',
|
||||
},
|
||||
axisTick: {
|
||||
show: true,
|
||||
length: 2,
|
||||
lineStyle: {
|
||||
color: '#A9AEB8',
|
||||
},
|
||||
alignWithLabel: true,
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: isDark ? '#484849' : '#A9AEB8',
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: [1033, 1244, 1520],
|
||||
type: 'bar',
|
||||
barWidth: 7,
|
||||
itemStyle: {
|
||||
color: '#4086FF',
|
||||
borderRadius: 4,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less"></style>
|
||||
@@ -1,55 +0,0 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<Breadcrumb
|
||||
:items="[
|
||||
'menu.visualization',
|
||||
'menu.visualization.multiDimensionDataAnalysis',
|
||||
]"
|
||||
/>
|
||||
<a-space direction="vertical" :size="16" fill>
|
||||
<a-grid :cols="24" :col-gap="16" :row-gap="16">
|
||||
<a-grid-item
|
||||
:span="{ xs: 24, sm: 24, md: 24, lg: 18, xl: 18, xxl: 18 }"
|
||||
>
|
||||
<DataOverview />
|
||||
</a-grid-item>
|
||||
<a-grid-item :span="{ xs: 24, sm: 24, md: 24, lg: 6, xl: 6, xxl: 6 }">
|
||||
<UserActions style="margin-bottom: 16px" />
|
||||
<ContentTypeDistribution />
|
||||
</a-grid-item>
|
||||
</a-grid>
|
||||
<DataChainGrowth />
|
||||
<ContentPublishingSource />
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import DataOverview from './components/data-overview.vue';
|
||||
import DataChainGrowth from './components/data-chain-growth.vue';
|
||||
import UserActions from './components/user-actions.vue';
|
||||
import ContentTypeDistribution from './components/content-type-distribution.vue';
|
||||
import ContentPublishingSource from './components/content-publishing-source.vue';
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'MultiDimensionDataAnalysis',
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.container {
|
||||
padding: 0 20px 20px 20px;
|
||||
}
|
||||
|
||||
:deep(.section-title) {
|
||||
margin-top: 0;
|
||||
margin-bottom: 16px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
:deep(.chart-wrap) {
|
||||
height: 264px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,18 +0,0 @@
|
||||
export default {
|
||||
'menu.visualization.multiDimensionDataAnalysis': 'Multi-D Analysis',
|
||||
'multiDAnalysis.card.title.dataOverview': 'Overview',
|
||||
'multiDAnalysis.dataOverview.contentProduction': 'Content Production',
|
||||
'multiDAnalysis.dataOverview.contentClick': 'Content Click',
|
||||
'multiDAnalysis.dataOverview.contentExposure': 'Content Exposure',
|
||||
'multiDAnalysis.dataOverview.activeUsers': 'Active Users',
|
||||
'multiDAnalysis.card.title.userActions': 'User Actions',
|
||||
'multiDAnalysis.card.title.contentTypeDistribution':
|
||||
'Content Type Distribution',
|
||||
'multiDAnalysis.card.title.retentionTrends': 'Retention Trends',
|
||||
'multiDAnalysis.card.title.userRetention': 'User Retention',
|
||||
'multiDAnalysis.card.title.contentConsumptionTrends':
|
||||
'Content Consumption Trends',
|
||||
'multiDAnalysis.card.title.contentConsumption': 'Content Consumption',
|
||||
'multiDAnalysis.card.title.contentPublishingSource':
|
||||
'Content Publishing Source',
|
||||
};
|
||||
@@ -1,15 +0,0 @@
|
||||
export default {
|
||||
'menu.visualization.multiDimensionDataAnalysis': '多维数据分析',
|
||||
'multiDAnalysis.card.title.dataOverview': '数据总览',
|
||||
'multiDAnalysis.dataOverview.contentProduction': '内容生产量',
|
||||
'multiDAnalysis.dataOverview.contentClick': '内容点击量',
|
||||
'multiDAnalysis.dataOverview.contentExposure': '内容曝光量',
|
||||
'multiDAnalysis.dataOverview.activeUsers': '活跃用户数',
|
||||
'multiDAnalysis.card.title.userActions': '今日转评赞统计',
|
||||
'multiDAnalysis.card.title.contentTypeDistribution': '内容题材分布',
|
||||
'multiDAnalysis.card.title.retentionTrends': '用户留存趋势',
|
||||
'multiDAnalysis.card.title.userRetention': '用户留存量',
|
||||
'multiDAnalysis.card.title.contentConsumptionTrends': '内容消费趋势',
|
||||
'multiDAnalysis.card.title.contentConsumption': '内容消费量',
|
||||
'multiDAnalysis.card.title.contentPublishingSource': '内容发布来源',
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
import Mock from 'mockjs';
|
||||
import setupMock, { successResponseWrap } from '@/utils/setup-mock';
|
||||
import { PostData } from '@/types/global';
|
||||
|
||||
setupMock({
|
||||
setup() {
|
||||
Mock.mock(new RegExp('/api/data-chain-growth'), (params: PostData) => {
|
||||
const { quota } = JSON.parse(params.body);
|
||||
const getLineData = () => {
|
||||
return {
|
||||
xAxis: new Array(12).fill(0).map((_item, index) => `${index + 1}日`),
|
||||
data: {
|
||||
name: quota,
|
||||
value: new Array(12)
|
||||
.fill(0)
|
||||
.map(() => Mock.Random.natural(1000, 3000)),
|
||||
},
|
||||
};
|
||||
};
|
||||
return successResponseWrap({
|
||||
count: Mock.Random.natural(1000, 3000),
|
||||
growth: Mock.Random.float(20, 100, 2, 2),
|
||||
chartData: getLineData(),
|
||||
});
|
||||
});
|
||||
// v2
|
||||
Mock.mock(new RegExp('/api/data-overview'), () => {
|
||||
const generateLineData = (name: string) => {
|
||||
return {
|
||||
name,
|
||||
count: Mock.Random.natural(20, 2000),
|
||||
value: new Array(8).fill(0).map(() => Mock.Random.natural(800, 4000)),
|
||||
};
|
||||
};
|
||||
const xAxis = new Array(8).fill(0).map((_item, index) => {
|
||||
return `12.1${index}`;
|
||||
});
|
||||
return successResponseWrap({
|
||||
xAxis,
|
||||
data: [
|
||||
generateLineData('内容生产量'),
|
||||
generateLineData('内容点击量'),
|
||||
generateLineData('内容曝光量'),
|
||||
generateLineData('活跃用户数'),
|
||||
],
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户