优化:把网站设置、参数配置、域名管理放到概览页面

This commit is contained in:
2024-09-04 00:25:55 +08:00
parent aa85c133e3
commit 4b2c4bd9e6
9 changed files with 176 additions and 89 deletions
+24 -24
View File
@@ -1,51 +1,51 @@
<!-- 搜索表单 -->
<template>
<a-space style="flex-wrap: wrap">
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
<!-- <template #icon>-->
<!-- <PlusOutlined />-->
<!-- </template>-->
<!-- <span>添加</span>-->
<!-- </a-button>-->
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-pages`)">-->
<!-- <span>页面管理</span>-->
<!-- </a-button>-->
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-field/0`)">-->
<!-- <span>参数配置</span>-->
<!-- </a-button>-->
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-ad`)">-->
<!-- <span>广告管理</span>-->
<!-- </a-button>-->
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-group`)">-->
<!-- <span>卡片管理</span>-->
<!-- </a-button>-->
<!-- <a-button class="ele-btn-icon" @click="navigator(`/website/domain`)">-->
<!-- <span>域名管理</span>-->
<!-- </a-button>-->
<a-space style="flex-wrap: wrap" v-if="website">
<a-button class="ele-btn-icon" @click="edit">
<span>网站设置</span>
</a-button>
<a-button
class="ele-btn-icon"
@click="push(`/website/field/${website.websiteId}`)"
>
<span>参数配置</span>
</a-button>
<a-button
class="ele-btn-icon"
@click="push(`/website/domain/${website?.websiteId}`)"
>
<span>域名管理</span>
</a-button>
</a-space>
</template>
<script lang="ts" setup>
import { PlusOutlined } from '@ant-design/icons-vue';
import { watch } from 'vue';
import { Website } from '@/api/cms/website/model';
import { push } from '@/utils/common';
const props = withDefaults(
defineProps<{
// 选中的角色
selection?: [];
website?: Website;
count?: 0;
}>(),
{}
);
const emit = defineEmits<{
(e: 'add'): void;
(e: 'add', data: Website): void;
}>();
const add = () => {
emit('add');
};
const edit = () => {
emit('add', props.website);
};
watch(
() => props.selection,
() => {}
+23 -28
View File
@@ -7,6 +7,7 @@
row-key="websiteId"
:columns="columns"
:datasource="datasource"
:parse-data="parseData"
:customRow="customRow"
:need-page="false"
tool-class="ele-toolbar-form"
@@ -16,6 +17,7 @@
<search
@search="reload"
:selection="selection"
:website="website"
@add="openEdit"
@remove="removeBatch"
@batchMove="openMove"
@@ -26,19 +28,6 @@
<a-image :src="record.websiteLogo" :width="50" />
</template>
<template v-if="column.key === 'domain'">
<!-- <a-button-->
<!-- type="link"-->
<!-- v-if="record.domain"-->
<!-- @click="-->
<!-- openSpmUrl(-->
<!-- `https://${record.domain}`,-->
<!-- record,-->
<!-- record.websiteId-->
<!-- )-->
<!-- "-->
<!-- >-->
<!-- {{ record.domain }}-->
<!-- </a-button>-->
<a-button
type="link"
@click="
@@ -76,9 +65,6 @@
</template>
<template v-if="column.key === 'action'">
<a-space>
<a @click="openUrl(`/website/domain/${record.websiteId}`)"
>域名管理</a
>
<a-divider type="vertical" />
<a @click="openEdit(record)">编辑</a>
</a-space>
@@ -112,8 +98,8 @@
updateWebsite
} from '@/api/cms/website';
import type { Website, WebsiteParam } from '@/api/cms/website/model';
import { openPreview, openSpmUrl, openUrl } from '@/utils/common';
import { getSiteDomain } from '@/utils/domain';
import { openSpmUrl } from '@/utils/common';
import { PageResult } from '@/api';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -128,7 +114,8 @@
const showMove = ref(false);
// 加载状态
const loading = ref(true);
const domain = getSiteDomain();
// 当前网站项目
const website = ref<Website>();
// 表格数据源
const datasource: DatasourceFunction = ({
@@ -152,7 +139,7 @@
// 表格列配置
const columns = ref<ColumnItem[]>([
{
title: 'ID',
title: '租户ID',
dataIndex: 'tenantId',
key: 'tenantId',
width: 80
@@ -201,17 +188,25 @@
sorter: true,
ellipsis: true,
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
},
{
title: '操作',
key: 'action',
width: 180,
fixed: 'right',
align: 'center',
hideInSetting: true
}
// {
// title: '操作',
// key: 'action',
// width: 180,
// fixed: 'right',
// align: 'center',
// hideInSetting: true
// }
]);
// 整理数据
const parseData = (data: PageResult<Website>) => {
if (data?.count > 0) {
website.value = data.list[0];
}
return data;
};
/* 搜索 */
const reload = (where?: WebsiteParam) => {
selection.value = [];