|
@@ -1,70 +1,53 @@
|
|
|
<template>
|
|
|
- <!-- <div v-if="!markdown_data || !Object.keys(markdown_data)?.length"> -->
|
|
|
- <ContentWrap>
|
|
|
- <el-form
|
|
|
- class="-mb-15px"
|
|
|
- :model="queryParams"
|
|
|
- ref="queryFormRef"
|
|
|
- :inline="true"
|
|
|
- label-width="110px"
|
|
|
- >
|
|
|
- <el-form-item label="微信公众号链接" prop="urls" class="!w-100%">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.urls"
|
|
|
- class="!w-75%"
|
|
|
- type="textarea"
|
|
|
- :rows="2"
|
|
|
- placeholder="请输入需要解析的微信公众号链接"
|
|
|
- />
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="ml-10px"
|
|
|
- plain
|
|
|
- @click="handleAnalysis"
|
|
|
- >解析</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </ContentWrap>
|
|
|
-
|
|
|
- <el-row v-if="contents.length" :gutter="20">
|
|
|
- <el-col v-for="(content, index) in contents" :key="index" :span="24">
|
|
|
- <el-card class="!h-600px" v-loading="!content.data">
|
|
|
- <template #header>
|
|
|
- <div class="flex items-center justify-between">
|
|
|
- <el-text class="flex-1" truncated>{{ content.url }}</el-text>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- plain
|
|
|
- class="mt-10px"
|
|
|
- @click="handleSubmit(content, index)"
|
|
|
- >信息提取</el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <iframe
|
|
|
- :id="content.id"
|
|
|
- class="!w-100% !h-[calc(100vh-90px)]"
|
|
|
- src=""
|
|
|
- frameborder="0"
|
|
|
- ></iframe>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <!-- </div> -->
|
|
|
- <!-- <div v-else class="!h-100%">
|
|
|
- <div class="text-right">
|
|
|
- <el-button type="primary" plain @click="handleReturn">返回查看解析内容</el-button>
|
|
|
- </div>
|
|
|
- <el-card class="!h-100% mt-10px">
|
|
|
- <div class="!w-192px !h-250px m-auto">
|
|
|
- <el-image referrerpolicy="no-referrer" :src="markdown_data.pic_url" class="!w-192px !h-250px" />
|
|
|
- </div>
|
|
|
- <pre>{{ markdown_data.name_zh }}</pre>
|
|
|
- <pre>{{ markdown_data.name_en }}</pre>
|
|
|
- <pre>{{ markdown_data.hotel_zh }}</pre>
|
|
|
- <pre>{{ markdown_data.title_zh }}</pre>
|
|
|
- <pre>{{ markdown_data.detailIntroduction }}</pre>
|
|
|
- </el-card>
|
|
|
- </div> -->
|
|
|
+ <ContentWrap>
|
|
|
+ <el-form
|
|
|
+ class="-mb-15px"
|
|
|
+ :model="queryParams"
|
|
|
+ ref="queryFormRef"
|
|
|
+ :inline="true"
|
|
|
+ label-width="110px"
|
|
|
+ >
|
|
|
+ <el-form-item label="微信公众号链接" prop="urls" class="!w-100%">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.urls"
|
|
|
+ class="!w-75%"
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ placeholder="请输入需要解析的微信公众号链接"
|
|
|
+ />
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="ml-10px"
|
|
|
+ plain
|
|
|
+ @click="handleAnalysis"
|
|
|
+ >解析</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </ContentWrap>
|
|
|
+
|
|
|
+ <el-row v-if="contents.length" :gutter="20">
|
|
|
+ <el-col v-for="(content, index) in contents" :key="index" :span="24">
|
|
|
+ <el-card class="!h-600px" v-loading="!content.data">
|
|
|
+ <template #header>
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <el-text class="flex-1" truncated>{{ content.url }}</el-text>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ class="mt-10px"
|
|
|
+ @click="handleSubmit(content, index)"
|
|
|
+ >信息提取</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <iframe
|
|
|
+ :id="content.id"
|
|
|
+ class="!w-100% !h-[calc(100vh-90px)]"
|
|
|
+ src=""
|
|
|
+ frameborder="0"
|
|
|
+ ></iframe>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -77,19 +60,11 @@ import { generateUUID } from '@/utils'
|
|
|
import { ElLoading } from 'element-plus'
|
|
|
|
|
|
const emit = defineEmits(['analysis', 'reset'])
|
|
|
-// const props = defineProps({
|
|
|
-// markDownData: Object
|
|
|
-// })
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
-// const markdown_data = ref({})
|
|
|
-// watch(() => props.markDownData, val => {
|
|
|
-// markdown_data.value = val
|
|
|
-// }, { deep: true })
|
|
|
-
|
|
|
const queryParams = reactive({
|
|
|
- // urls: 'https://mp.weixin.qq.com/s/JZ5qxaj9vXsEsswxxD1djA'
|
|
|
+ // urls: 'https://mp.weixin.qq.com/s/JZ5qxaj9vXsEsswxxD1djA' // https://mp.weixin.qq.com/s/R1aJpn9z-Jf0dk9ttoYYeg
|
|
|
// urls: 'https://mp.weixin.qq.com/s/vQLWlSB6DzqSewtBLkk_kQ'
|
|
|
urls: ''
|
|
|
})
|
|
@@ -121,7 +96,7 @@ const wechatHtmlToMarkdown = (html) => {
|
|
|
const doc = parser.parseFromString(html, 'text/html')
|
|
|
|
|
|
// 提取正文内容 - 微信公众号文章通常在id="js_content"的div中
|
|
|
- const content = doc.querySelector('#js_content') || doc.body
|
|
|
+ const content = doc.querySelector('#img_content') || doc.body
|
|
|
|
|
|
// 移除不需要的元素
|
|
|
const elementsToRemove = [
|
|
@@ -278,10 +253,7 @@ const handleAnalysis = async () => {
|
|
|
}
|
|
|
|
|
|
// 信息提取
|
|
|
-// const extractIndex = ref(0)
|
|
|
const handleSubmit = async (content, index) => {
|
|
|
- // extractIndex.value = index
|
|
|
- // if (loading.value) return message.warning('正在解析中,请稍后再试')
|
|
|
if (!content.markdown_text) return
|
|
|
|
|
|
const loading = ElLoading.service({
|
|
@@ -304,12 +276,6 @@ const handleSubmit = async (content, index) => {
|
|
|
loading.close()
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// 返回查看解析内容
|
|
|
-// const handleReturn = () => {
|
|
|
-// markdown_data.value = {}
|
|
|
-// showPage(contents.value[extractIndex.value])
|
|
|
-// }
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|