Xiao_123 2 giorni fa
parent
commit
678d65ef21

+ 86 - 0
src/views/menduner/system/talentMap/maintenance/gather/components/data.js

@@ -0,0 +1,86 @@
+export default {
+	'名片': [
+		{
+			"name_zh": "名片1",
+			"checked": true,
+			"pic_url": "http://192.168.3.143:9000/dataops-bucket/talent_photos/talent_photo_20250717_175905_40a0f010.png"
+		},
+		{
+			"name_zh": '名片2',
+			"checked": true,
+			"pic_url": 'http://192.168.3.143:9000/dataops-bucket/talent_photos/talent_photo_20250717_175905_aa0e6a04.png'
+		}
+	],
+	'简历': [
+		{
+			"name_zh": "简历1",
+			"checked": true,
+			"pic_url": "http://192.168.3.143:9000/dataops-bucket/resume_files/resume_20250717_102750_4b95eb0b.pdf"
+		},
+		{
+			"name_zh": '简历2',
+			"checked": true,
+			"pic_url": 'http://192.168.3.143:9000/dataops-bucket/resume_files/resume_20250717_102750_43860e0e.pdf'
+		}
+	],
+	'新任命': [
+		{
+			"name_zh": "新任命1",
+			"hotel_zh": '万豪',
+			"title_zh": '总经理',
+			"checked": true,
+			"pic_url": 'http://192.168.3.143:9000/dataops-bucket/talent_photos/talent_photo_20250717_175905_aa0e6a04.png',
+			"originText": `![](https://mmecoa.qpic.cn/mmecoa_jpg/4eGU2iarqNCR0qLEYTU2NhIsuZ4SJTnUMHTQ4fE6EiaIy7webgxUCyoTddAttjb0lAaDBkyGzupgYTwKkcCVQjVQ/640?wx_fmt=jpeg)
+				
+			**盘海文 先生**
+				
+			北海涠洲岛悦苑酒店
+				
+			工程总监
+				
+			北海涠洲岛悦苑酒店正式宣布盘海文先生的加入,全面统筹酒店工程板块的开业筹备、设备运维及全周期管理工作。拥有 37年工程领域资历、26年酒店工程专业经验的他,职业脚印横跨北海香格里拉、温州香格里拉、桂林香格里拉等标杆项目,曾深度参与丽江洲际及英迪格酒店、温德姆酒店等多品牌工程体系搭建,在机电系统集成、绿色工程设计、大型项目筹备等领域形成系统化专业积淀。
+				
+			
+			"以工程匠心守护自然与建筑的和谐共生。"盘海文先生将携手团队以 "三化标准" 落实工程目标:设备管理智能化(建立全周期运维数字档案)、应急响应标准化(制定海岛台风季专项预案)、生态保护融入化(将零废弃社区理念嵌入工程细节)。这一兼具专业性与生态意识的工程管理思路,正为北海涠洲岛悦苑酒店的开业运营筑牢硬件根基,也为海岛酒店的工程管理树立新范式。`,
+		},
+		{
+			"name_zh": '新任命2',
+			"hotel_zh": '洲际',
+			"title_zh": '副经理',
+			"checked": true,
+			"originText": `![](https://mmecoa.qpic.cn/mmecoa_jpg/4eGU2iarqNCR0qLEYTU2NhIsuZ4SJTnUM2PpwKG5502CAIH0icCbYFW4FAOrkQiahueiaicXCA0FNIjiag6n0QjL2H3Q/640?wx_fmt=jpeg)
+				**王亚铭 先生**
+				**Mr.Vincent Wang**
+				武汉世茂希尔顿酒店
+				餐饮总监
+				武汉世茂希尔顿酒店荣幸地宣布王亚铭先生于2025年4月23日加入武汉世茂希尔顿酒店、出任餐饮总监一职。
+				王亚铭先生2007年在迪拜福朋喜来登开启他的职业生涯,之后在多个国际酒店集团的不同品牌任职,包括万豪、洲际、雅高、朗廷等。加入武汉世茂希尔顿酒店前,王亚铭先生在海宁华邑酒店全权负责餐饮部整体运行和经营。我们相信王亚铭先生的加入必将带领酒店餐饮团队实现服务升级、业绩突破,为宾客创造更高品质的用餐体验。
+				请与我们一起欢迎王亚铭先生开启他的新征程,祝愿他与武汉世茂希尔顿酒店共同成长!`,
+			"pic_url": 'http://192.168.3.143:9000/dataops-bucket/talent_photos/talent_photo_20250717_175905_aa0e6a04.png'
+		}
+	],
+	'杂项': [
+		{
+			"name_zh": "杂项1",
+			"checked": true,
+			"pic_url": "http://192.168.3.143:9000/dataops-bucket/talent_photos/talent_photo_20250717_175905_40a0f010.png"
+		},
+		{
+			"name_zh": '杂项2',
+			"checked": true,
+			"pic_url": 'http://192.168.3.143:9000/dataops-bucket/talent_photos/talent_photo_20250717_175905_aa0e6a04.png'
+		}
+	],
+	'招聘': [
+		{
+			"name_zh": "招聘1",
+			"checked": true,
+			"userId": 1
+		},
+		{
+			"name_zh": '招聘2',
+			"checked": true,
+			"userId": 1
+		}
+	]
+}

+ 113 - 91
src/views/menduner/system/talentMap/maintenance/gather/components/store.vue

@@ -3,61 +3,53 @@
     <div class="analysisInfoBox">
       <div class="analysisFile !w-50%">
           <!-- 门墩儿人才库 -->
-          <template v-if="source === 'menduner'">
+          <template v-if="source === '招聘'">
             <el-card shadow="never">
-              <!-- <Info :id="id" :user-id="userId" />
-              <expExtend :user-id="userId" defaultShowAll class="m-t-20px" /> -->
+              <Info id="1793583467288223745" :user-id="userId" />
+              <expExtend :user-id="userId" defaultShowAll class="m-t-20px" />
             </el-card>
           </template>
           <!-- 简历解析 -->
-          <template v-if="source === 'file'">
-            <IFrame :src="''" />
+          <template v-if="source === '简历'">
+            <IFrame :src="fileUrl" />
           </template>
           <!-- 名片解析 -->
-          <template v-if="source === 'card'">
+          <template v-if="['名片', '杂项'].includes(source)">
             <div class="image">
-              <el-image class="!w-100%" :src="''" />
+              <el-image class="!w-100%" :src="imgUrl" />
             </div>
           </template>
           <!-- 网页解析 -->
-          <template v-if="source === 'web'">
-            <div></div>
+          <template v-if="source === '新任命'">
+            <iframe
+              id="MyIframe"
+              class="!w-100% !h-[calc(100vh-90px)]"
+              src=""
+              frameborder="0"
+            ></iframe>
           </template>
       </div>
       <div class="flex-1">
 				<el-tabs type="border-card">
 					<el-tab-pane label="已解析人才列表">
 						<div class="tagBox mb-10px" v-if="tagList?.length">
-						<!-- <el-tag 
-							type="primary" 
-							round
-							size="large"
-							v-for="(val, index) in tagList"
-							:key="val.id"
-							class="mr-10px cursor-pointer mb-10px"
-							@click="handleTagClick(index)"
-						>
-							<div class="flex items-center">
-								<el-checkbox v-model="val.cehcked" />
-								<span class="ml-5px">{{ val.name }}</span>
-							</div>
-						</el-tag> -->
-						<el-checkbox-group v-model="selectTags">
-							<el-checkbox
-								v-for="(val, index) in tagList"
-								:key="val.id"
-								:label="val.name"
-								:value="val.value"
-								border
-								@click="handleTagClick(index)"
-							/>
-						</el-checkbox-group>
-					</div>
-					<FormPage
-						ref="FormPageRef"
-						formType="create"
-						:itemData="itemData"
-          />
+              <el-tag 
+                :type="index === tagCurrentIndex ? 'primary' : 'info'" 
+                size="large"
+                effect="plain"
+                v-for="(val, index) in tagList"
+                :key="val.name_zh + index"
+                class="mr-10px cursor-pointer"
+                @click="handleTagClick(val, index)"
+              >
+                <div class="flex items-center">
+                  <el-checkbox v-model="val.checked" />
+                  <span class="ml-5px">{{ val.name_zh }}</span>
+                  <Icon icon="ep:view" class="ml-5px" /> 
+                </div>
+              </el-tag>
+            </div>
+            <FormPage	ref="FormPageRef"	formType="create"	:itemData="itemData" />
 					</el-tab-pane>
 				</el-tabs>
       </div>
@@ -75,76 +67,106 @@ defineOptions({ name: 'Store' })
 import { ElLoading } from 'element-plus'
 // import { generateUUID } from '@/utils'
 import FormPage from '@/views/menduner/system/talentMap/components/FormPage.vue'
+import Info from '@/views/menduner/system/person/details/components/info.vue'
+import expExtend from '@/views/menduner/system/person/details/components/expExtend.vue'
+import TestData from './data.js'
+import { cloneDeep } from 'lodash-es'
+import { marked } from 'marked'
+import data from './data.js'
+
+// 配置 marked
+// marked.setOptions({
+//   breaks: true,       // 允许换行符
+//   gfm: true,          // 支持 GitHub Flavored Markdown
+//   sanitize: false   // 不转义 HTML(如果需要渲染 HTML 标签)
+// })
 
 const dialogVisible = ref(false)
-const showFormPage = ref(false)
 const FormPageRef = ref(null)
 const itemData = ref({})
 const tagList = ref([])
 const tagCurrentIndex = ref(0)
 const source = ref('')
-const selectTags = ref([])
+const originData = ref([])
 
-const originData = ref([
-  {
-    "brand_group": "万豪",
-    "career_path": [
-      {
-        "date": "2025-06-24",
-        "hotel_en": "Shenzhen Marriott Hotel Nanshan",
-        "hotel_zh": "深圳中洲万豪酒店",
-        "image_path": "",
-        "source": "webpage_extraction",
-        "title_en": "Director of Human Resources",
-        "title_zh": "人力资源总监"
-      }
-    ],
-    "hotel_en": "Shenzhen Marriott Hotel Nanshan",
-    "hotel_zh": "深圳中洲万豪酒店",
-    "name_en": "Sandra Zhou",
-		id: 1,
-    "name_zh": "周银萍",
-    "pic_url": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/UOfXdu2ZbTdomIosTR7sMXCbtjMXRHTSkwudn71WJOrkOzA7IYQyYvjRpPQ80cvyawKNSibxiafjCuamsVJlUo1A/640?wx_fmt=jpeg",
-    "title_en": "Director of Human Resources",
-    "title_zh": "人力资源总监"
-  },
-  {
-    "brand_group": "万豪",
-    "career_path": [
-      {
-        "date": "2025-06-24",
-        "hotel_en": "Shenzhen Marriott Hotel Nanshan",
-        "hotel_zh": "深圳中洲万豪酒店",
-        "image_path": "",
-        "source": "webpage_extraction",
-        "title_en": "Director of Human Resources",
-        "title_zh": "人力资源总监"
+const imgUrl = ref(null)
+const fileUrl = ref(null)
+const userId = ref(null)
+
+// markdown回显
+const showPage = (html) => {
+   // 将 data-src 转化为 src
+  html = html.replace(/data-src/g, 'src')
+    .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/g, '')
+    .replace(/https/g, 'http')
+  
+  nextTick(() => {
+    const iframe = document.getElementById('MyIframe')
+    if (!iframe) return
+    const doc = iframe.contentDocument || iframe.document
+    // 设置 iframe 中请求不发送 referrer,以绕过图片防盗链
+    const htmlArr = html.split('</head>')
+    const html_src_add = htmlArr[0] + '<meta name="referrer" content="never"></head>' + htmlArr[1]
+    doc.open()
+    doc.write(html_src_add)
+    doc.close()
+
+    // 设置图片宽高
+    let iwindow = iframe.contentWindow;
+    iframe.addEventListener('load',function () {
+      let idoc = iwindow.document;
+      let img = idoc.getElementsByTagName('img')[0];
+      if (img) {
+        if (img.width >= img.height) {
+          img.width = iframe.clientWidth / 2
+          let top = (iframe.clientHeight - img.height) / 2
+          img.style.marginTop = top + "px"
+        } else {
+          img.height = iframe.clientHeight / 2
+          let left = (iframe.clientWidth - img.width) / 2
+          img.style.marginLeft = left + "px"
+        }
       }
-    ],
-    "hotel_en": "Shenzhen Marriott Hotel Nanshan",
-    "hotel_zh": "广州希尔顿酒店",
-    "name_en": "Sandra Zhou",
-    "name_zh": "盘海龙",
-		id: 2,
-    "pic_url": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/UOfXdu2ZbTdomIosTR7sMXCbtjMXRHTSkwudn71WJOrkOzA7IYQyYvjRpPQ80cvyawKNSibxiafjCuamsVJlUo1A/640?wx_fmt=jpeg",
-    "title_en": "Director of Human Resources",
-    "title_zh": "工程总监"
+    })
+  })
+}
+
+const dealData = async (type, data) => {
+  if (['名片', '杂项'].includes(type)) {
+    imgUrl.value = data.pic_url
+  }
+  if (type === '简历') fileUrl.value = data.pic_url
+  if (type === '招聘') userId.value = data.userId
+  if (type === '新任命') {
+    await nextTick()
+    showPage(marked(data.originText))
   }
-])
+}
+
+// 重置
+const resetData = () => {
+  imgUrl.value = null
+  fileUrl.value = null
+  itemData.value = {}
+  tagList.value = []
+}
 
 // 打开弹窗
-const open = async (list) => {
-	// if (!list || !list.length) return
-	tagList.value = originData.value.map(e => ({ name: e.name_zh, value: e.id }))
+const open = async (type) => {
+  resetData()
+  source.value = type
+  originData.value = TestData[type]
+  tagList.value = cloneDeep(originData.value)
 	itemData.value = originData.value[0]
+  dealData(type, originData.value[0]) // 赋值左侧原始文件
   dialogVisible.value = true
 }
 defineExpose({ open }) // 提供 open 方法,用于打开弹窗
 
-const handleTagClick = (index) => {
+const handleTagClick = (val, index) => {
 	tagCurrentIndex.value = index
-	itemData.value = originData.value[index]
-	showFormPage.value = true
+	itemData.value = val
+  dealData(source.value, val)
 }
 
 // 监听表单变化,同步更新originData中对应的数据

+ 4 - 2
src/views/menduner/system/talentMap/maintenance/gather/components/webAnalysis.vue

@@ -65,8 +65,8 @@ const { t } = useI18n() // 国际化
 
 const queryParams = reactive({
 	// 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: ''
+	// urls: 'https://mp.weixin.qq.com/s/vQLWlSB6DzqSewtBLkk_kQ'
+  urls: ''
 })
 const queryFormRef = ref()
 const contents = ref([])
@@ -108,6 +108,8 @@ const wechatHtmlToMarkdown = (html, filename = '新任命.md') => {
     content.querySelectorAll(selector).forEach(el => el.remove())
   })
 
+  // return turndownService.turndown(content.innerHTML)
+
   // 转换为Markdown
   const result = turndownService.turndown(content.innerHTML)
 

+ 4 - 4
src/views/menduner/system/talentMap/maintenance/gather/index.vue

@@ -243,10 +243,10 @@ const handleWebAnalysis = (list) => {
 
 // 入库
 const StorePageRef = ref(null)
-const handleStore = async (row) => {
-  // StorePageRef.value.open(row)
-  const data = await talentGatherApi.getTaskDetail(row.task_name)
-  console.log(data, '任务详情')
+const handleStore = async ({ task_type, task_name }) => {
+  StorePageRef.value.open(task_type)
+  // const data = await talentGatherApi.getTaskDetail(row.task_name)
+  // console.log(data, '任务详情')
 }
 
 // 任务解析