feat: 样式调整

This commit is contained in:
rd
2025-09-05 17:45:12 +08:00
parent 64e21e5b91
commit 4d3410f58b
31 changed files with 221 additions and 259 deletions

View File

@ -1,6 +1,6 @@
## template-admin-ts
基于 Arco Design Pro 的中后台管理模板
基于 Ant Design Vue 的中后台管理模板
- vite 4.x
- vue 3.x
@ -10,7 +10,7 @@
- axios
- dayjs
- lodash
- arco-design
- ant-design-vue
- less
- eslint + prettier
@ -183,7 +183,7 @@ export { default as Comp } from './comp/index.vue';
</template>
```
### `ui` 框架 [`ArcoVue`](https://arco.design/vue/docs/start)
### `ui` 框架 [`Ant Design Vue`](https://antdv.com/)
- 自动导入组件,无需再次导入
- 图标库已配置,同组件使用

View File

@ -1,8 +1,8 @@
<template>
<a-config-provider :locale="zhCN" size="small" :theme="redTheme">
<ConfigProvider :locale="zhCN" :theme="redTheme">
<router-view v-if="$route.path === '/login' || ['ExploreList', 'ExploreDetail'].includes($route.name)" />
<LayoutBasic v-else />
</a-config-provider>
</ConfigProvider>
</template>
<script setup>
@ -12,7 +12,8 @@ import { useChatStore } from '@/stores/modules/chat';
import { initApp } from '@/utils/user';
import { useSidebarStore } from '@/stores/modules/side-bar';
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn'; // 已移除
import { ConfigProvider } from 'ant-design-vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
const userStore = useUserStore();
const route = useRoute();

View File

@ -297,14 +297,14 @@ export default {
align={column.align}
ellipsis
title={() => (
<div class="flex items-center">
<>
<span class="cts mr-4px">{column.title}</span>
{column.tooltip && (
<Tooltip title={column.tooltip} placement="top">
<IconQuestionCircle class="tooltip-icon color-#737478" size={16} />
</Tooltip>
)}
</div>
</>
)}
customRender={({ record }) => {
if (column.dataIndex === 'status') {

View File

@ -145,14 +145,14 @@ export default {
align={column.align}
ellipsis
title={() => (
<div class="flex items-center">
<>
<span class="cts mr-4px">{column.title}</span>
{column.tooltip && (
<Tooltip title={column.tooltip} placement="top">
<IconQuestionCircle class="tooltip-icon color-#737478" size={16} />
</Tooltip>
)}
</div>
</>
)}
customRender={({ record }) => {
if (column.dataIndex === 'status') {

View File

@ -11,8 +11,8 @@ import NoData from '@/components/no-data/index.vue';
import SvgIcon from '@/components/svg-icon/index.vue';
import '@/api/index';
import '@arco-design/web-vue/dist/arco.css'; // 已移除 Arco 样式
import './core';
import '@arco-design/web-vue/dist/arco.css'; // 已移除 Arco 样式
import 'normalize.css';
import 'uno.css';

View File

@ -26,12 +26,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template v-if="column.dataIndex === 'customer_opinion'" #customRender="{ record }">

View File

@ -219,7 +219,7 @@ export const INITIAL_QUERY = {
title: '',
created_at: [],
audit_started_at: [],
audit_platform: '',
audit_platform: undefined,
sort_column: undefined,
sort_order: undefined,
};

View File

@ -121,16 +121,13 @@ export default {
<Upload
ref={uploadRef}
action="/"
draggable
class="w-fit"
custom-request={(option) => uploadImage(option, action)}
customRequest={(option) => uploadImage(option, action)}
accept=".jpg,.jpeg,.png,.gif,.webp"
show-file-list={false}
showUploadList={false}
multiple
>
{{
'upload-button': () => <UploadBtn />,
}}
<UploadBtn />
</Upload>
);
};

View File

@ -1,7 +1,6 @@
<script lang="jsx">
import axios from 'axios';
import { Button, Form, FormItem, Input, message } from 'ant-design-vue';
import { Upload } from 'ant-design-vue';
import { Button, Form, FormItem, Input, message, Upload } from 'ant-design-vue';
// import CommonSelect from '@/components/common-select';
// import { VueDraggable } from 'vue-draggable-plus';
import TextOverTips from '@/components/text-over-tips';
@ -202,25 +201,18 @@ export default {
<Upload
ref={uploadRef}
action="/"
draggable
custom-request={uploadVideo}
customRequest={uploadVideo}
accept=".mp4,.mov,.avi,.flv,.wmv"
show-file-list={false}
showUploadList={false}
>
{{
'upload-button': () => {
if (formData.value.videoInfo.uploadStatus === ENUM_UPLOAD_STATUS.DEFAULT) {
return (
{formData.value.videoInfo.uploadStatus === ENUM_UPLOAD_STATUS.DEFAULT ? (
<div class="upload-box">
<icon-plus size="14" class="mb-16px color-#3C4043" />
<span class="cts !color-#211F24">上传视频</span>
</div>
);
} else {
return <Button type="text">替换视频</Button>;
}
},
}}
) : (
<Button type="text">替换视频</Button>
)}
</Upload>
);
};

View File

@ -74,34 +74,34 @@ export default {
reset();
};
const renderColumn = () => {
return TABLE_COLUMNS.map((column) => (
<TableColumn
key={column.dataIndex}
data-index={column.dataIndex}
fixed={column.fixed}
width={column.width}
min-width={column.minWidth}
sortable={column.sortable}
align={column.align}
ellipsis
tooltip
v-slots={{
title: () => (
<div class="flex items-center">
<span class="cts mr-4px">{column.title}</span>
{column.tooltip && (
<Tooltip title={column.tooltip} placement="top">
<IconQuestionCircle class="tooltip-icon color-#737478" size={16} />
</Tooltip>
)}
</div>
),
cell: ({ record }) => renderCell(record),
}}
/>
));
};
// const renderColumn = () => {
// return TABLE_COLUMNS.map((column) => (
// <TableColumn
// key={column.dataIndex}
// data-index={column.dataIndex}
// fixed={column.fixed}
// width={column.width}
// min-width={column.minWidth}
// sortable={column.sortable}
// align={column.align}
// ellipsis
// tooltip
// v-slots={{
// title: () => (
// <>
// <span class="cts mr-4px">{column.title}</span>
// {column.tooltip && (
// <Tooltip title={column.tooltip} placement="top">
// <IconQuestionCircle class="tooltip-icon color-#737478" size={16} />
// </Tooltip>
// )}
// </>
// ),
// cell: ({ record }) => renderCell(record),
// }}
// />
// ));
// };
const onShare = () => {
shareModalRef.value?.open(selectedRowKeys.value);
@ -187,14 +187,14 @@ export default {
align={column.align}
ellipsis
title={() => (
<div class="flex items-center">
<>
<span class="cts mr-4px bold color-#211F24">{column.title}</span>
{column.tooltip && (
<Tooltip title={column.tooltip} placement="top">
<IconQuestionCircle class="tooltip-icon color-#737478" size={16} />
</Tooltip>
)}
</div>
</>
)}
customRender={({ record }) => {
if (column.dataIndex === 'audit_status') {

View File

@ -7,6 +7,7 @@ import { slsWithCatch } from '@/utils/stroage.ts';
import TextOverTips from '@/components/text-over-tips';
import icon1 from '@/assets/img/media-account/icon-feedback-fail.png';
import icon2 from '@/assets/img/media-account/icon-download.png';
const { TextArea } = Input;
@ -232,24 +233,20 @@ export default {
<div class="flex flex-col w-full">
<Upload
action="/"
draggable
multiple
customRequest={handleUpload}
class="w-full"
accept=".xlsx,.xls,.docx,.doc,.mp4,.mov,.avi,.flv,.wmv,.m4v"
show-file-list={false}
showUploadList={false}
>
{{
'upload-button': () => (
<div class="upload-box">
<icon-plus size="14" class="mb-16px" />
<span class="text mb-4px">点击或拖拽文件到此处上传</span>
<span class="tip">支持文档文本+, 视频批量上传</span>
</div>
),
}}
</Upload>
<div class="flex items-center cursor-pointer mt-8px" onClick={handleDownloadTemplate}>
<icon-download size="14" class="mr-4px !color-#6D4CFE" />
<img src={icon2} width="16" height="16" class="mr-4px" />
<span class="cts color-#6D4CFE">下载示例文档</span>
</div>
</div>

View File

@ -28,4 +28,8 @@
border: 1px dashed var(--Border-1, #d7d7d9);
background: var(--BG-200, #f2f3f5);
}
.ant-upload {
cursor: pointer;
width: 100%;
}
}

View File

@ -25,12 +25,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template v-if="column.dataIndex === 'create_at'" #customRender="{ record }">

View File

@ -26,12 +26,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template v-if="column.dataIndex === 'name'" #customRender="{ record }">
<div class="flex items-center">

View File

@ -60,13 +60,11 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<img v-if="column.dataIndex === 'ai_evaluate'" width="16" height="16" :src="icon5" class="mr-4px" />
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template v-if="column.dataIndex === 'platform'" #customRender="{ record }">
@ -216,8 +214,6 @@ const tableColumns = computed(() => {
return _result;
});
const handleDetail = (record) => {
router.push(`/media-account/detail/${record.id}?type=${dateType.value}`);
};
@ -230,7 +226,7 @@ const handleTableChange = (pagination, filters, sorter) => {
};
const handleSelect = (record, selected, selectedRows, nativeEvent) => {
selectedItems.value = selectedRows.map(row => row.id);
selectedItems.value = selectedRows.map((row) => row.id);
emit('selectionChange', selectedRows);
};

View File

@ -18,7 +18,7 @@ export const TABLE_COLUMNS = [
{
title: '笔记标题',
dataIndex: 'title',
width: 240,
width: 280,
fixed: 'left',
},
{
@ -30,42 +30,42 @@ export const TABLE_COLUMNS = [
{
title: '曝光量',
dataIndex: 'exposure_number',
width: 180,
width: 160,
tooltip: '内容被展示给用户的总次数,不代表用户实际观看。',
align: 'right',
},
{
title: '观看量',
dataIndex: 'view_number',
width: 180,
width: 160,
tooltip: '用户点击内容并实际观看的次数,是内容实际触达的重要指标。',
align: 'right',
},
{
title: '点赞量',
dataIndex: 'like_number',
width: 180,
width: 160,
tooltip: '单篇笔记获得的点赞总数,反映用户喜好程度。',
align: 'right',
},
{
title: '收藏量',
dataIndex: 'collect_number',
width: 180,
width: 160,
tooltip: '用户将内容保存到收藏夹的次数,代表内容被认可为“值得保留”。',
align: 'right',
},
{
title: '评论数',
dataIndex: 'comment_number',
width: 180,
width: 160,
tooltip: '内容下方用户留言的总数,体现用户参与度与讨论热度。',
align: 'right',
},
{
title: '分享量',
dataIndex: 'share_number',
width: 180,
width: 160,
tooltip: '内容被转发或分享至其他平台或私信的次数,代表外扩传播意愿。',
align: 'right',
},

View File

@ -66,12 +66,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template #customRender="{ record }">
<template v-if="column.dataIndex === 'published_at'">
@ -80,6 +78,9 @@
<template v-else-if="column.dataIndex === 'exposure_number'">
{{ formatNumberShow({ value: record.view_number * 10, showExactValue: true }) }}
</template>
<template v-else-if="column.dataIndex === 'title'">
<TextoverTips :context="record.title" />
</template>
<template v-else>
{{ formatTableField(column, record, true) }}
</template>
@ -110,6 +111,7 @@ import { TABLE_COLUMNS, INITIAL_QUERY, INITIAL_PAGE_INFO } from './constants';
import { useRoute } from 'vue-router';
import { formatTableField, exactFormatTime, formatNumberShow } from '@/utils/tools';
import { getMediaAccountBoardWorks } from '@/api/all/propertyMarketing';
import TextoverTips from '@/components/text-over-tips/index.vue';
const route = useRoute();
const id = route.params.id;

View File

@ -117,7 +117,7 @@ export default defineComponent({
return renderUpdateBtn();
} else if ([EnumErrorStatus.REQUEST, EnumErrorStatus.FREEZE].includes(error_status)) {
return (
<Tooltip title={statusInfo.value?.disabledBtnTooltip}>
<Tooltip title={statusInfo.value.disabledBtnTooltip}>
<Button type="primary" ghost size="small" disabled>
</Button>

View File

@ -4,7 +4,19 @@
-->
<script lang="jsx">
import { ref, computed } from 'vue';
import { Button, Modal, Form, FormItem, RadioGroup, Radio, Input, message, Tooltip, Upload, Switch } from 'ant-design-vue';
import {
Button,
Modal,
Form,
FormItem,
RadioGroup,
Radio,
Input,
message,
Tooltip,
Upload,
Switch,
} from 'ant-design-vue';
const { TextArea } = Input;
import AuthorizedAccountModal from '../authorized-account-modal';
// import ImportPromptModal from '../import-prompt-modal';
@ -275,6 +287,7 @@ export default {
model={form.value}
rules={rules}
layout="horizontal"
labelAlign="right"
labelCol={{ span: 4 }}
wrapperCol={{ span: 20 }}
>
@ -293,19 +306,14 @@ export default {
<Upload
ref={uploadRef}
action="/"
draggable
custom-request={handleUpload}
customRequest={handleUpload}
accept=".xlsx,.xls"
show-file-list={false}
showUploadList={false}
>
{{
'upload-button': () => (
<div class="upload-box">
<span class="text mb-4px">点击或拖拽文件到此处上传</span>
<span class="tip">支持 xls, xlsx格式</span>
</div>
),
}}
</Upload>
) : (
<div class="flex items-center">

View File

@ -36,15 +36,8 @@
}
}
}
.arco-upload-drag {
height: 120px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.arco-icon {
margin-bottom: 16px;
}
.ant-upload {
width: 100%;
}
.upload-box {
display: flex;
@ -77,13 +70,13 @@
}
}
}
.upload-dragger {
border: 1px dashed #d9d9d9;
padding: 24px 0;
text-align: center;
background: #fafafa;
cursor: pointer;
}
// .upload-dragger {
// border: 1px dashed #d9d9d9;
// padding: 24px 0;
// text-align: center;
// background: #fafafa;
// cursor: pointer;
// }
.upload-error {
color: #f53f3f;
margin-left: 8px;

View File

@ -67,12 +67,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template #customRender="{ record }">

View File

@ -22,13 +22,9 @@
allowClear
@change="handleSearch"
>
<Option
v-for="(item, index) in PLATFORM_LIST"
:key="index"
:value="item.value"
:label="item.label"
>{{ item.label }}</Option
>
<Option v-for="(item, index) in PLATFORM_LIST" :key="index" :value="item.value" :label="item.label">{{
item.label
}}</Option>
</Select>
<Select
v-model:value="query.operator_id"
@ -71,12 +67,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template #customRender="{ record }">
@ -147,8 +141,7 @@ const props = defineProps({
},
});
const { dataSource, selectedRowKeys, selectedRows, handleSelect, handleSelectAll } =
useTableSelectionWithPagination({
const { dataSource, selectedRowKeys, selectedRows, handleSelect, handleSelectAll } = useTableSelectionWithPagination({
onSelectChange: () => {
updateFormQuery();
},

View File

@ -70,12 +70,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template #customRender="{ record }">
<template v-if="column.dataIndex === 'platform'">
@ -143,8 +141,7 @@ const props = defineProps({
},
});
const { dataSource, selectedRowKeys, selectedRows, handleSelect, handleSelectAll } =
useTableSelectionWithPagination({
const { dataSource, selectedRowKeys, selectedRows, handleSelect, handleSelectAll } = useTableSelectionWithPagination({
onSelectChange: () => {
updateFormQuery();
},

View File

@ -43,11 +43,13 @@
class="account-table w-100%"
bordered
:showSorterTooltip="false"
@change="(pagination, filters, sorter) => {
@change="
(pagination, filters, sorter) => {
if (sorter && sorter.columnKey) {
handleSorterChange(sorter.columnKey, sorter.order === 'ascend' ? 'asc' : 'desc');
}
}"
}
"
>
<Table.Column
v-for="column in tableColumns"
@ -61,13 +63,11 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<img v-if="column.dataIndex === 'ai_evaluate'" width="16" height="16" :src="icon5" class="mr-4px" />
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template v-if="column.dataIndex === 'platform'" #customRender="{ record }">
@ -75,9 +75,7 @@
</template>
<template v-else-if="column.dataIndex === 'status'" #customRender="{ record }">
<div class="status-tag" :class="`status-tag-${record.status}`">
<span class="cts status-tag-text">{{
STATUS_LIST.find((item) => item.value === record.status)?.label
}}</span>
<span class="cts status-tag-text">{{ STATUS_LIST.find((item) => item.value === record.status)?.label }}</span>
</div>
</template>
<template v-else-if="column.dataIndex === 'ai_evaluate'" #customRender="{ record }">

View File

@ -58,13 +58,11 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<img v-if="column.dataIndex === 'ai_evaluate'" width="16" height="16" :src="icon5" class="mr-4px" />
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template #customRender="{ record }">
<template v-if="column.dataIndex === 'platform'">

View File

@ -42,13 +42,11 @@
accept=".xlsx,.xls,.docx,.doc"
:showUploadList="false"
>
<template #default>
<div class="upload-box">
<icon-plus size="14" class="mb-16px" />
<span class="text mb-4px">点击或拖拽文件到此处上传</span>
<span class="tip">支持 xls, xlsx格式</span>
</div>
</template>
</Upload>
</template>
<template v-else>
@ -154,7 +152,19 @@
</template>
<script setup>
import { Modal, Form, FormItem, Button, Input, RadioGroup, Radio, Tooltip, message, Switch, Upload } from 'ant-design-vue';
import {
Modal,
Form,
FormItem,
Button,
Input,
RadioGroup,
Radio,
Tooltip,
message,
Switch,
Upload,
} from 'ant-design-vue';
import { ref, defineEmits } from 'vue';
import AuthorizedAccountModal from '../authorized-account-modal';

View File

@ -70,12 +70,10 @@
:ellipsis="true"
>
<template #title>
<div class="flex items-center">
<span class="cts mr-4px">{{ column.title }}</span>
<Tooltip v-if="column.tooltip" :title="column.tooltip" placement="top">
<icon-question-circle class="tooltip-icon color-#737478" size="16" />
</Tooltip>
</div>
</template>
<template #customRender="{ record }">

View File

@ -209,7 +209,7 @@ export const INITIAL_QUERY = {
title: '',
created_at: [],
audit_started_at: [],
audit_platform: '',
audit_platform: undefined,
sort_column: undefined,
sort_order: undefined,
};

View File

@ -122,16 +122,13 @@ export default {
<Upload
ref={uploadRef}
action="/"
draggable
class="w-fit"
custom-request={(option) => uploadImage(option, action)}
customRequest={(option) => uploadImage(option, action)}
accept=".jpg,.jpeg,.png,.gif,.webp"
show-file-list={false}
showUploadList={false}
multiple
>
{{
'upload-button': () => <UploadBtn />,
}}
<UploadBtn />
</Upload>
);
};

View File

@ -202,25 +202,18 @@ export default {
<Upload
ref={uploadRef}
action="/"
draggable
custom-request={uploadVideo}
customRequest={uploadVideo}
accept=".mp4,.mov,.avi,.flv,.wmv"
show-file-list={false}
showUploadList={false}
>
{{
'upload-button': () => {
if (formData.value.videoInfo.uploadStatus === ENUM_UPLOAD_STATUS.DEFAULT) {
return (
{formData.value.videoInfo.uploadStatus === ENUM_UPLOAD_STATUS.DEFAULT ? (
<div class="upload-box">
<icon-plus size="14" class="mb-16px color-#3C4043" />
<span class="cts !color-#211F24">上传视频</span>
</div>
);
} else {
return <Button type="text">替换视频</Button>;
}
},
}}
) : (
<Button type="text">替换视频</Button>
)}
</Upload>
);
};

View File

@ -12,6 +12,7 @@ import { slsWithCatch } from '@/utils/stroage.ts';
import TextOverTips from '@/components/text-over-tips';
import icon1 from '@/assets/img/media-account/icon-feedback-fail.png';
import icon2 from '@/assets/img/media-account/icon-download.png';
// 状态枚举
const TASK_STATUS = {
@ -201,24 +202,19 @@ export default {
<div class="flex flex-col w-full">
<Upload
action="/"
draggable
multiple
customRequest={handleUpload}
accept=".xlsx,.xls,.docx,.doc,.mp4,.mov,.avi,.flv,.wmv,.m4v"
show-file-list={false}
showUploadList={false}
>
{{
'upload-button': () => (
<div class="upload-box">
<icon-plus size="14" class="mb-16px" />
<span class="text mb-4px">点击或拖拽文件到此处上传</span>
<span class="tip">支持文档文本+, 视频批量上传</span>
</div>
),
}}
</Upload>
<div class="flex items-center cursor-pointer mt-8px" onClick={handleDownloadTemplate}>
<icon-download size="14" class="mr-4px !color-#6D4CFE" />
<img src={icon1} width="16" height="16" class="mr-4px" />
<span class="cts color-#6D4CFE">下载示例文档</span>
</div>
</div>