-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: code to implement some of the functions
- Loading branch information
Showing
9 changed files
with
88 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
<script setup lang="ts"> | ||
import { IconDelete } from '@arco-design/web-vue/es/icon' | ||
import { useRecordStore } from '@/stores' | ||
const recordStore = useRecordStore() | ||
const { deleteRecord } = recordStore | ||
const { currentRecord } = storeToRefs(recordStore) | ||
</script> | ||
|
||
<template> | ||
<a-tooltip content="清空对话"> | ||
<IconDelete /> | ||
<IconDelete @click="deleteRecord(currentRecord?.id)" /> | ||
</a-tooltip> | ||
</template> | ||
|
||
<style scoped lang="scss"></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<script setup lang="ts"> | ||
import { IconPlusCircle } from '@arco-design/web-vue/es/icon' | ||
import { useRecordStore } from '@/stores' | ||
const { createNewRecord } = useRecordStore() | ||
</script> | ||
|
||
<template> | ||
<a-tooltip content="新建对话"> | ||
<IconPlusCircle @click="createNewRecord" /> | ||
</a-tooltip> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
import { IconRefresh } from '@arco-design/web-vue/es/icon' | ||
import { useRecordStore } from '@/stores' | ||
const recordStore = useRecordStore() | ||
const { updateRecord } = recordStore | ||
const { currentRecord } = storeToRefs(recordStore) | ||
const handleClick = () => { | ||
if (!currentRecord.value) return | ||
const newRecord = { ...currentRecord.value } | ||
newRecord.data?.pop() | ||
currentRecord.value = newRecord | ||
updateRecord(newRecord) | ||
} | ||
</script> | ||
|
||
<template> | ||
<a-tooltip content="重新回答"> | ||
<IconRefresh @click="handleClick" /> | ||
</a-tooltip> | ||
</template> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters