|
@@ -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中对应的数据
|