feat: websources视图
This commit is contained in:
@@ -80,3 +80,15 @@ export const deleteProject = (id: string) => {
|
|||||||
method: 'delete'
|
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-list flex">
|
||||||
<div class="url-item flex flex-col" v-for="item in urlList" :key="item">
|
<div class="url-item flex flex-col" v-for="item in urlList" :key="item">
|
||||||
<div class="url-title" v-ellipsis="3" @click="handleClickUrl(item)">
|
<div class="url-title" v-ellipsis="3" @click="handleClickUrl(item)">
|
||||||
{{ item }}
|
{{ item.title }}
|
||||||
<img src="@/assets/images/link-outer.png" class="link-outer" />
|
<img src="@/assets/images/link-outer.png" class="link-outer" />
|
||||||
</div>
|
</div>
|
||||||
<div class="url-link" v-ellipsis="3">{{ item }}</div>
|
<div class="url-link" v-ellipsis="3">{{ item.url }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -94,18 +94,20 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, onUnmounted, watch } from 'vue'
|
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 { deleteSketchFlowCanvas } from '@/api/flow-canvas'
|
||||||
import { useProjectStore } from '@/stores'
|
import { useProjectStore } from '@/stores'
|
||||||
const projectStore = useProjectStore()
|
|
||||||
import MyEvent from '@/utils/myEvent'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { VueMarkdown } from '@crazydos/vue-markdown'
|
import { VueMarkdown } from '@crazydos/vue-markdown'
|
||||||
import type { CustomAttrs } from '@crazydos/vue-markdown'
|
import type { CustomAttrs } from '@crazydos/vue-markdown'
|
||||||
import rehypeRaw from 'rehype-raw'
|
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 { t } = useI18n()
|
||||||
const emits = defineEmits(['deleteSketch'])
|
const emits = defineEmits(['deleteSketch'])
|
||||||
@@ -158,14 +160,10 @@
|
|||||||
reportType.value = 'report'
|
reportType.value = 'report'
|
||||||
sessionId.value = id
|
sessionId.value = id
|
||||||
}
|
}
|
||||||
const setUrls = (list: string[]) => {
|
const setUrls = async (list: string[]) => {
|
||||||
reportType.value = 'urls'
|
reportType.value = 'urls'
|
||||||
urlList.value = list
|
const res = await fetchUrlTitle(list)
|
||||||
// urlList.value = [
|
urlList.value = res
|
||||||
// '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'
|
|
||||||
// ]
|
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => sessionId.value,
|
() => sessionId.value,
|
||||||
@@ -241,8 +239,8 @@
|
|||||||
showLoading.value = true
|
showLoading.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleClickUrl = (item: string) => {
|
const handleClickUrl = (item: { url: string, title: string }) => {
|
||||||
window.open(item, '_blank')
|
window.open(item.url, '_blank')
|
||||||
}
|
}
|
||||||
|
|
||||||
// watch(
|
// watch(
|
||||||
|
|||||||
Reference in New Issue
Block a user