Skip to content

Commit 06216b1

Browse files
feat: paragraph
1 parent 980a27b commit 06216b1

File tree

1 file changed

+46
-11
lines changed

1 file changed

+46
-11
lines changed

ui/src/views/paragraph/component/ParagraphCard.vue

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212
:modelValue="data.content"
1313
class="maxkb-md"
1414
/>
15-
<el-card shadow="always" style="--el-card-padding: 8px 12px; --el-card-border-radius: 8px">
15+
<el-card
16+
class="paragraph-box-operation mt-8 mr-8"
17+
shadow="always"
18+
style="--el-card-padding: 8px 12px; --el-card-border-radius: 8px"
19+
>
1620
<el-switch
1721
:loading="changeStateloading"
1822
v-model="data.is_active"
@@ -21,11 +25,20 @@
2125
/>
2226

2327
<el-divider direction="vertical" />
24-
<el-button link>
25-
<el-icon :size="16" :title="$t('views.applicationWorkflow.control.zoomOut')"
26-
><ZoomOut
27-
/></el-icon>
28-
</el-button>
28+
<span class="mr-8">
29+
<el-button link @click="editParagraph(data)">
30+
<el-icon :size="16" :title="$t('views.applicationWorkflow.control.zoomOut')">
31+
<EditPen />
32+
</el-icon>
33+
</el-button>
34+
</span>
35+
<span class="mr-8">
36+
<el-button link>
37+
<el-icon :size="16" :title="$t('views.applicationWorkflow.control.zoomOut')">
38+
<el-icon><CirclePlus /></el-icon>
39+
</el-icon>
40+
</el-button>
41+
</span>
2942
<el-dropdown trigger="click">
3043
<el-button text>
3144
<el-icon><MoreFilled /></el-icon>
@@ -47,6 +60,9 @@
4760
</template>
4861
</el-dropdown>
4962
</el-card>
63+
<ParagraphDialog ref="ParagraphDialogRef" :title="title" @refresh="refresh" />
64+
<SelectDocumentDialog ref="SelectDocumentDialogRef" @refresh="refreshMigrateParagraph" />
65+
<GenerateRelatedDialog ref="GenerateRelatedDialogRef" @refresh="refresh" />
5066
</el-card>
5167
</template>
5268
<script setup lang="ts">
@@ -55,6 +71,8 @@ import { useRoute } from 'vue-router'
5571
import { t } from '@/locales'
5672
import useStore from '@/stores'
5773
import GenerateRelatedDialog from '@/components/generate-related-dialog/index.vue'
74+
import ParagraphDialog from '@/views/paragraph/component/ParagraphDialog.vue'
75+
import SelectDocumentDialog from '@/views/paragraph/component/SelectDocumentDialog.vue'
5876
import { MsgSuccess, MsgConfirm } from '@/utils/message'
5977
const { paragraph } = useStore()
6078
@@ -66,7 +84,6 @@ const props = defineProps<{
6684
data: any
6785
}>()
6886
69-
const SelectDocumentDialogRef = ref()
7087
const changeStateloading = ref(false)
7188
const show = ref(false)
7289
// card上面存在dropdown菜单
@@ -103,10 +120,10 @@ function openGenerateDialog(row: any) {
103120
}
104121
}
105122
function openSelectDocumentDialog(row?: any) {
106-
// if (row) {
107-
// multipleSelection.value = [row.id]
108-
// }
109-
// SelectDocumentDialogRef.value.open(multipleSelection.value)
123+
// if (row) {
124+
// multipleSelection.value = [row.id]
125+
// }
126+
// SelectDocumentDialogRef.value.open(multipleSelection.value)
110127
}
111128
112129
function deleteParagraph(row: any) {
@@ -127,15 +144,33 @@ function deleteParagraph(row: any) {
127144
})
128145
.catch(() => {})
129146
}
147+
const SelectDocumentDialogRef = ref()
148+
const ParagraphDialogRef = ref()
149+
const title = ref('')
150+
function editParagraph(row: any) {
151+
title.value = t('views.paragraph.paragraphDetail')
152+
ParagraphDialogRef.value.open(row)
153+
}
154+
155+
function refresh() {}
156+
157+
function refreshMigrateParagraph() {}
130158
</script>
131159
<style lang="scss" scoped>
132160
.paragraph-box {
133161
background: var(--app-layout-bg-color);
134162
border: 1px solid #ffffff;
135163
box-shadow: none !important;
164+
position: relative;
136165
&:hover {
137166
background: rgba(31, 35, 41, 0.1);
138167
border: 1px solid #dee0e3;
139168
}
169+
.paragraph-box-operation {
170+
position: absolute;
171+
right: 0;
172+
top: 0;
173+
border: 1px solid #dee0e3;
174+
}
140175
}
141176
</style>

0 commit comments

Comments
 (0)