Skip to content

Commit d687e88

Browse files
committed
fix(card): adaptive
1 parent 03032ac commit d687e88

File tree

5 files changed

+75
-203
lines changed

5 files changed

+75
-203
lines changed

frontend/src/views/chat/ChatCreator.vue

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,30 @@ defineExpose({
142142
</el-icon>
143143
</template>
144144
<div v-if="datasourceListWithSearch.length" class="card-content">
145-
<Card
146-
v-for="ele in datasourceListWithSearch"
147-
:id="ele.id"
148-
:key="ele.id"
149-
:name="ele.name"
150-
:type="ele.type"
151-
:type-name="ele.type_name"
152-
:num="ele.num"
153-
:is-selected="ele.id === innerDs"
154-
:description="ele.description"
155-
@select-ds="selectDsInDialog(ele)"
156-
></Card>
145+
<el-row :gutter="16" class="w-full">
146+
<el-col
147+
v-for="ele in datasourceListWithSearch"
148+
:key="ele.id"
149+
:xs="24"
150+
:sm="12"
151+
:md="12"
152+
:lg="8"
153+
:xl="6"
154+
class="mb-16"
155+
>
156+
<Card
157+
:id="ele.id"
158+
:key="ele.id"
159+
:name="ele.name"
160+
:type="ele.type"
161+
:type-name="ele.type_name"
162+
:num="ele.num"
163+
:is-selected="ele.id === innerDs"
164+
:description="ele.description"
165+
@select-ds="selectDsInDialog(ele)"
166+
></Card>
167+
</el-col>
168+
</el-row>
157169
</div>
158170
<template v-if="!keywords && !datasourceListWithSearch.length && !searchLoading">
159171
<EmptyBackground
@@ -196,11 +208,21 @@ defineExpose({
196208

197209
<style lang="less">
198210
.datasource-drawer-chat {
211+
.ed-drawer__body {
212+
padding: 16px 0 16px 0;
213+
}
199214
.card-content {
200-
display: flex;
201-
flex-wrap: wrap;
202-
max-height: 100%;
215+
max-height: calc(100% - 40px);
203216
overflow-y: auto;
217+
padding: 0 8px 0 24px;
218+
219+
.w-full {
220+
width: 100%;
221+
}
222+
223+
.mb-16 {
224+
margin-bottom: 16px;
225+
}
204226
}
205227
206228
.datasource-yet {

frontend/src/views/chat/ChatSelectDs.vue

Lines changed: 0 additions & 170 deletions
This file was deleted.

frontend/src/views/ds/ChatCard.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@ const SelectDs = () => {
6060

6161
<style lang="less" scoped>
6262
.card {
63-
width: 370px;
63+
width: 100%;
6464
border: 1px solid #dee0e3;
6565
padding: 16px;
6666
border-radius: 12px;
6767
cursor: pointer;
68-
margin: 0 16px 16px 0;
6968
7069
&:hover {
7170
box-shadow: 0px 6px 24px 0px #1f232914;

frontend/src/views/system/permission/Card.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,11 @@ const setUser = () => {
7676

7777
<style lang="less" scoped>
7878
.card {
79-
width: 371px;
79+
width: 100%;
8080
height: 176px;
8181
border: 1px solid #dee0e3;
8282
padding: 16px;
8383
border-radius: 12px;
84-
margin: 0 16px 16px 0;
8584
&:hover {
8685
box-shadow: 0px 6px 24px 0px #1f232914;
8786
}

frontend/src/views/system/permission/index.vue

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ const columnRules = {
516516
</script>
517517

518518
<template>
519-
<div v-loading="searchLoading" class="permission">
519+
<div v-loading="searchLoading" class="permission no-padding">
520520
<div class="tool-left">
521521
<span class="page-title">{{ $t('workspace.permission_configuration') }}</span>
522522
<div>
@@ -549,17 +549,29 @@ const columnRules = {
549549
/>
550550

551551
<div v-else class="card-content">
552-
<Card
553-
v-for="ele in ruleListWithSearch"
554-
:id="ele.id"
555-
:key="ele.id"
556-
:name="ele.name"
557-
:type="ele.users.length"
558-
:num="ele.permissions.length"
559-
@edit="handleEditRule(ele)"
560-
@del="deleteHandler(ele)"
561-
@set-user="setUser(ele)"
562-
></Card>
552+
<el-row :gutter="16" class="w-full">
553+
<el-col
554+
v-for="ele in ruleListWithSearch"
555+
:key="ele.id"
556+
:xs="24"
557+
:sm="12"
558+
:md="12"
559+
:lg="8"
560+
:xl="6"
561+
class="mb-16"
562+
>
563+
<Card
564+
:id="ele.id"
565+
:key="ele.id"
566+
:name="ele.name"
567+
:type="ele.users.length"
568+
:num="ele.permissions.length"
569+
@edit="handleEditRule(ele)"
570+
@del="deleteHandler(ele)"
571+
@set-user="setUser(ele)"
572+
></Card>
573+
</el-col>
574+
</el-row>
563575
</div>
564576
<template v-if="!keywords && !ruleListWithSearch.length && !searchLoading">
565577
<EmptyBackground
@@ -857,6 +869,8 @@ const columnRules = {
857869
.permission {
858870
height: 100%;
859871
width: 100%;
872+
padding: 16px 0 16px 0;
873+
860874
.ed-empty_200 {
861875
padding-top: 200px;
862876
padding-bottom: 0;
@@ -867,6 +881,7 @@ const columnRules = {
867881
align-items: center;
868882
justify-content: space-between;
869883
margin-bottom: 16px;
884+
padding: 0 24px 0 24px;
870885
871886
.page-title {
872887
font-weight: 500;
@@ -876,10 +891,17 @@ const columnRules = {
876891
}
877892
878893
.card-content {
879-
display: flex;
880-
flex-wrap: wrap;
881894
max-height: calc(100% - 40px);
882895
overflow-y: auto;
896+
padding: 0 8px 0 24px;
897+
898+
.w-full {
899+
width: 100%;
900+
}
901+
902+
.mb-16 {
903+
margin-bottom: 16px;
904+
}
883905
}
884906
}
885907
</style>

0 commit comments

Comments
 (0)