Skip to content

Commit 980aedd

Browse files
authored
Merge pull request #415 from fastapiadmin/dev
refactor: 调整多处页面布局与组件引用
2 parents 4620162 + 715853f commit 980aedd

8 files changed

Lines changed: 89 additions & 62 deletions

File tree

‎frontend/web/src/components/others/fa-pagination/index.vue‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,10 @@ function handleCurrentChange(val: number) {
100100
}
101101
</script>
102102

103-
<style lang="scss" scoped></style>
103+
<style lang="scss" scoped>
104+
.pagination {
105+
display: flex;
106+
justify-content: center;
107+
padding: 12px 0;
108+
}
109+
</style>

‎frontend/web/src/views/dashboard/home/index.vue‎

Lines changed: 67 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,10 @@
9797
<!-- CardList 概览统计(含在线用户/UV/PV/访问量等) -->
9898
<CardList />
9999

100-
<!-- 日程日历 + 我的收藏 -->
100+
<!-- 关于项目 + 我的收藏 -->
101101
<ElRow :gutter="16">
102102
<ElCol :xs="24" :span="12" class="flex flex-col">
103-
<ElCard shadow="hover" class="workplace-surface workplace-ops-card flex flex-col h-full">
104-
<template #header>
105-
<div class="workplace-section-card__head">
106-
<div>
107-
<span class="workplace-panel-title">日程日历</span>
108-
<p class="workplace-section-sub workplace-section-sub--inline">
109-
点击日期添加或编辑(本地演示)
110-
</p>
111-
</div>
112-
</div>
113-
</template>
114-
<div class="workplace-ops-card__body">
115-
<FaCalendar />
116-
</div>
117-
</ElCard>
103+
<AboutProject />
118104
</ElCol>
119105
<ElCol :xs="24" :span="12" class="flex flex-col">
120106
<ElCard shadow="hover" class="flex flex-col h-full">
@@ -152,51 +138,60 @@
152138
</div>
153139
</div>
154140
</template>
155-
<div v-if="quickLinks.length > 0">
156-
<ElTooltip
141+
<ElRow v-if="quickLinks.length > 0" :gutter="12">
142+
<ElCol
157143
v-for="(item, index) in quickLinks"
158144
:key="item.id || `${item.href}-${index}`"
159-
placement="top"
160-
:show-after="400"
161-
:content="item.title"
145+
:xs="24"
146+
:sm="12"
147+
:md="8"
148+
:lg="8"
149+
:xl="8"
150+
class="mb-3"
162151
>
163-
<div
164-
class="workplace-quick-row workplace-quick-row--compact workplace-quick-row--chip"
165-
role="button"
166-
tabindex="0"
167-
@click="handleQuickLinkClick(item)"
168-
@keydown.enter.prevent="handleQuickLinkClick(item)"
169-
@keydown.space.prevent="handleQuickLinkClick(item)"
152+
<ElTooltip
153+
placement="top"
154+
:show-after="400"
155+
:content="item.title"
170156
>
171-
<span
172-
class="workplace-quick-row__accent"
173-
:style="{ backgroundColor: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
174-
/>
175157
<div
176-
class="workplace-quick-row__icon"
177-
:style="{ color: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
158+
class="workplace-quick-row workplace-quick-row--compact workplace-quick-row--chip"
159+
role="button"
160+
tabindex="0"
161+
@click="handleQuickLinkClick(item)"
162+
@keydown.enter.prevent="handleQuickLinkClick(item)"
163+
@keydown.space.prevent="handleQuickLinkClick(item)"
178164
>
179-
<FaMenuRouteIcon :icon="item.icon || 'menu'" />
180-
</div>
181-
<div class="workplace-quick-row__text">
182-
<span class="workplace-quick-row__title">{{ item.title }}</span>
183-
</div>
184-
<div class="workplace-quick-row__actions">
185-
<button
186-
type="button"
187-
class="workplace-quick-row__remove"
188-
:disabled="!item.id && !item.href"
189-
:title="item.id || item.href ? '移除收藏' : '无法移除(缺少路径)'"
190-
:aria-label="`移除收藏 ${item.title}`"
191-
@click.stop="handleDeleteLink(item)"
165+
<span
166+
class="workplace-quick-row__accent"
167+
:style="{ backgroundColor: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
168+
/>
169+
<div
170+
class="workplace-quick-row__icon"
171+
:style="{ color: getQuickLinkColor(getQuickLinkStableIndex(item)) }"
192172
>
193-
<ElIcon><Close /></ElIcon>
194-
</button>
173+
<FaMenuRouteIcon :icon="item.icon || 'menu'" />
174+
</div>
175+
<div class="workplace-quick-row__text">
176+
<span class="workplace-quick-row__title">{{ item.title }}</span>
177+
</div>
178+
<div class="workplace-quick-row__actions">
179+
<button
180+
type="button"
181+
class="workplace-quick-row__remove"
182+
:disabled="!item.id && !item.href"
183+
:title="item.id || item.href ? '移除收藏' : '无法移除(缺少路径)'"
184+
:aria-label="`移除收藏 ${item.title}`"
185+
@click.stop="handleDeleteLink(item)"
186+
>
187+
<ElIcon><Close /></ElIcon>
188+
</button>
189+
</div>
195190
</div>
196-
</div>
197-
</ElTooltip>
198-
</div>
199-
<ElEmpty v-else :image-size="48">
191+
</ElTooltip>
192+
</ElCol>
193+
</ElRow>
194+
<ElEmpty v-else :image-size="100">
200195
<template #description>
201196
<p class="workplace-quick-empty__title">暂无收藏</p>
202197
<p class="workplace-quick-empty__hint">
@@ -210,8 +205,25 @@
210205
</ElCol>
211206
</ElRow>
212207

213-
<!-- 最新动态 + 关于项目 -->
208+
<!-- 日程日历 + 最新动态 -->
214209
<ElRow :gutter="16">
210+
<ElCol :span="12" class="flex flex-col">
211+
<ElCard shadow="hover" class="workplace-surface workplace-ops-card flex flex-col h-full">
212+
<template #header>
213+
<div class="workplace-section-card__head">
214+
<div>
215+
<span class="workplace-panel-title">日程日历</span>
216+
<p class="workplace-section-sub workplace-section-sub--inline">
217+
点击日期添加或编辑(本地演示)
218+
</p>
219+
</div>
220+
</div>
221+
</template>
222+
<div class="workplace-ops-card__body">
223+
<FaCalendar />
224+
</div>
225+
</ElCard>
226+
</ElCol>
215227
<ElCol :span="12" class="flex flex-col">
216228
<ElCard shadow="hover" class="h-full flex flex-col">
217229
<template #header>
@@ -228,7 +240,7 @@
228240
</ElLink>
229241
</div>
230242
</template>
231-
<ElScrollbar height="300px">
243+
<ElScrollbar class="h-full">
232244
<ElTimeline class="p-2">
233245
<ElTimelineItem
234246
v-for="(item, index) in vesionList"
@@ -263,9 +275,6 @@
263275
</ElScrollbar>
264276
</ElCard>
265277
</ElCol>
266-
<ElCol :span="12" class="flex flex-col">
267-
<AboutProject />
268-
</ElCol>
269278
</ElRow>
270279
</div>
271280
</template>

‎frontend/web/src/views/module_ai/memory/index.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
:items="memoryDialogFormItems"
126126
:rules="rules"
127127
label-suffix=":"
128-
:label-width="'auto'"
128+
:label-width="'70px'"
129129
label-position="right"
130130
:span="24"
131131
:gutter="16"

‎frontend/web/src/views/module_generator/gencode/components/FaImportDbTableDialog.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</ElButton>
3838
</ElFormItem>
3939
</ElForm>
40-
<ElRow>
40+
<div>
4141
<ElTable
4242
ref="tableRef"
4343
:data="data"
@@ -79,7 +79,7 @@
7979
:total="total"
8080
@pagination="emit('fetch')"
8181
/>
82-
</ElRow>
82+
</div>
8383
<template #footer>
8484
<div class="dialog-footer">
8585
<ElButton type="primary" :loading="confirmLoading" @click="emit('confirm')">确 定</ElButton>

‎frontend/web/src/views/module_system/role/index.vue‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ import type { FormItem } from "@/components/forms/fa-form/index.vue";
165165
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
166166
import FaForm from "@/components/forms/fa-form/index.vue";
167167
import { ElTag, ElMessage } from "element-plus";
168+
import FaPermissonDrawer from "./components/FaPermissonDrawer.vue";
168169
169170
defineOptions({
170171
name: "Role",

‎frontend/web/src/views/module_system/user/index.vue‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ import type { FormItem } from "@/components/forms/fa-form/index.vue";
238238
import type { IContentConfig, IObject } from "@/components/modal/types";
239239
import FaSearchBar from "@/components/forms/fa-search-bar/index.vue";
240240
import FaForm from "@/components/forms/fa-form/index.vue";
241+
import FaDeptTree from "./components/FaDeptTree.vue";
241242
import { ElTag, ElMessage, ElMessageBox } from "element-plus";
242243
243244
const { hasAuth } = useAuth();

‎frontend/web/src/views/module_task/workflow/components/FaWorkflowDesignDrawer.vue‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ import WorkflowDefinitionAPI, {
206206
type WorkflowForm,
207207
} from "@/api/module_task/workflow/definition";
208208
import WorkflowNodeTypeAPI from "@/api/module_task/workflow/node-type";
209+
import FaNodeConfigPanel from "./FaNodeConfigPanel.vue";
210+
import FaEdgeConfigPanel from "./FaEdgeConfigPanel.vue";
209211
210212
defineOptions({
211213
name: "WorkflowCreateDrawer",
@@ -965,9 +967,16 @@ function deleteEdge(edgeId: string, getEdges: () => Edge[], setEdges: (edges: Ed
965967
.canvas-container {
966968
flex: 1;
967969
min-height: 400px;
970+
width: 100%;
971+
height: 100%;
968972
overflow: hidden;
969973
}
970974
975+
.canvas-container :deep(.vue-flow) {
976+
width: 100%;
977+
height: 100%;
978+
}
979+
971980
:deep(.vue-flow__controls) {
972981
display: flex;
973982
flex-direction: column;

‎frontend/web/src/views/module_task/workflow/definition/index.vue‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ import type { SearchFormItem } from "@/components/forms/fa-search-bar/index.vue"
124124
import FaTable from "@/components/tables/fa-table/index.vue";
125125
import FaTableHeader from "@/components/tables/fa-table-header/index.vue";
126126
import FaTableHeaderLeft from "@/components/tables/fa-table-header-left/index.vue";
127+
import FaWorkflowDesignDrawer from "../components/FaWorkflowDesignDrawer.vue";
127128
import { useTable } from "@/hooks/core/useTable";
128129
import type { ColumnOption } from "@/types/component";
129130
import { ArrowDown } from "@element-plus/icons-vue";

0 commit comments

Comments
 (0)