feat: websources视图
This commit is contained in:
@@ -80,3 +80,15 @@ export const deleteProject = (id: string) => {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量获取url对应的标题
|
||||
* @param { string[] } data 批量获取url对应的标题参数
|
||||
*/
|
||||
export const fetchUrlTitle = (data: string[]) => {
|
||||
return request({
|
||||
url: '/api/ai-design/fetch-url-content',
|
||||
method: 'post',
|
||||
data: { urls: data }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
<div class="url-list flex">
|
||||
<div class="url-item flex flex-col" v-for="item in urlList" :key="item">
|
||||
<div class="url-title" v-ellipsis="3" @click="handleClickUrl(item)">
|
||||
{{ item }}
|
||||
{{ item.title }}
|
||||
<img src="@/assets/images/link-outer.png" class="link-outer" />
|
||||
</div>
|
||||
<div class="url-link" v-ellipsis="3">{{ item }}</div>
|
||||
<div class="url-link" v-ellipsis="3">{{ item.url }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -94,18 +94,20 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, onMounted, onUnmounted, watch } from 'vue'
|
||||
import Menu from './Menu.vue'
|
||||
import LoadingImg from '@/assets/images/sketch-loading.gif'
|
||||
import reportNull from '@/assets/images/reportNull.png'
|
||||
import myEvent from '@/utils/myEvent'
|
||||
import { deleteSketchFlowCanvas } from '@/api/flow-canvas'
|
||||
import { useProjectStore } from '@/stores'
|
||||
const projectStore = useProjectStore()
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { VueMarkdown } from '@crazydos/vue-markdown'
|
||||
import type { CustomAttrs } from '@crazydos/vue-markdown'
|
||||
import rehypeRaw from 'rehype-raw'
|
||||
import Menu from './Menu.vue'
|
||||
import LoadingImg from '@/assets/images/sketch-loading.gif'
|
||||
import reportNull from '@/assets/images/reportNull.png'
|
||||
import myEvent from '@/utils/myEvent'
|
||||
import { fetchUrlTitle } from '@/api/agent'
|
||||
|
||||
const projectStore = useProjectStore()
|
||||
import MyEvent from '@/utils/myEvent'
|
||||
|
||||
const { t } = useI18n()
|
||||
const emits = defineEmits(['deleteSketch'])
|
||||
@@ -158,14 +160,10 @@
|
||||
reportType.value = 'report'
|
||||
sessionId.value = id
|
||||
}
|
||||
const setUrls = (list: string[]) => {
|
||||
const setUrls = async (list: string[]) => {
|
||||
reportType.value = 'urls'
|
||||
urlList.value = list
|
||||
// urlList.value = [
|
||||
// 'https://furnitureindustrynews.substack.com/p/what-2026-really-looks-like-for-furniture',
|
||||
// 'https://furnitureindustrynews.substack.com/p/what-2026-really-looks-like-for-furniture',
|
||||
// 'https://furnitureindustrynews.substack.com/p/what-2026-really-looks-like-for-furniture'
|
||||
// ]
|
||||
const res = await fetchUrlTitle(list)
|
||||
urlList.value = res
|
||||
}
|
||||
watch(
|
||||
() => sessionId.value,
|
||||
@@ -241,8 +239,8 @@
|
||||
showLoading.value = true
|
||||
}
|
||||
|
||||
const handleClickUrl = (item: string) => {
|
||||
window.open(item, '_blank')
|
||||
const handleClickUrl = (item: { url: string, title: string }) => {
|
||||
window.open(item.url, '_blank')
|
||||
}
|
||||
|
||||
// watch(
|
||||
|
||||
Reference in New Issue
Block a user